/**
 * 땅튜브 메인 스타일
 *
 * @package DdangTube
 * @version 1.0.0
 */


/* ========== Font Face ========== */

@font-face {
    font-family: 'Galmuri11';
    src: url('../fonts/Galmuri11.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* ========== Reset & Base ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
    font-size: 16px;
}


/* ========== Headings with Galmuri11 Font ========== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Galmuri11', sans-serif;
}

h1.page-title,
h2.post-title,
.entry-title {
    font-family: 'Galmuri11', sans-serif;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

ul,
ol {
    list-style: none;
}


/* ========== Layout ========== */

.ddangtube-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ddangtube-main {
    display: flex;
    flex: 1;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}


/* 콘텐츠 영역 (사이드바 옆) */

.ddangtube-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* flexbox 오버플로우 방지 */
}

.ddangtube-content {
    flex: 1;
    padding: 2rem;
}

.content-wrapper {
    margin: 0 auto;
}


/* ========== Posts Grid ========== */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-item {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-item:hover {
    transform: translateY(-4px);
}

.post-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 비율 */
    overflow: hidden;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Galmuri11', sans-serif;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid;
}

.post-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-category {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}


/* ========== Pagination ========== */

.pagination {
    margin: 3rem 0;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination .page-numbers {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pagination .current {
    font-weight: 700;
}


/* ========== No Posts ========== */

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
}

.no-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}


/* ========== Utility Classes ========== */

.hidden {
    display: none !important;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ===================
   공통 버튼 (모달 등 전역 사용)
   =================== */
.ddtc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm, 6px);
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

.ddtc-btn--primary {
    background-color: var(--accent-primary, #6366f1);
    color: #fff;
}

.ddtc-btn--primary:hover {
    background-color: var(--accent-primary-hover, #4f46e5);
    color: #fff;
}

/* ===================
   계정 정지 모달
   =================== */
.ddtc-modal--suspended {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ddtc-modal--suspended .ddtc-modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
}

.ddtc-modal--suspended .ddtc-modal__box {
    position: relative;
    background-color: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border-primary, #333);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-width: 400px;
    width: 90%;
    z-index: 1;
    overflow: hidden;
}

.ddtc-modal__head--danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background-color: rgba(239, 68, 68, 0.12);
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
}

.ddtc-modal__head--danger h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #f87171;
    margin: 0;
}

.ddtc-modal__head-icon {
    display: flex;
    color: #f87171;
    flex-shrink: 0;
}

.ddtc-modal--suspended .ddtc-modal__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ddtc-suspended__desc {
    font-size: 0.9rem;
    color: var(--text-secondary, #aaa);
    margin: 0;
    line-height: 1.6;
}

.ddtc-suspended__row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background-color: var(--bg-tertiary, #16161e);
    border-radius: 8px;
    border: 1px solid var(--border-primary, #333);
}

.ddtc-suspended__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #666);
    white-space: nowrap;
    min-width: 60px;
}

.ddtc-suspended__value {
    font-size: 0.8rem;
    color: var(--text-primary, #eee);
    line-height: 1.5;
}

.ddtc-suspended__value--permanent {
    color: #f87171;
    font-weight: 600;
}

.ddtc-suspended__contact {
    font-size: 0.8rem;
    color: var(--text-muted, #666);
    margin: 0;
}

.ddtc-modal--suspended .ddtc-modal__foot {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-primary, #333);
    display: flex;
    justify-content: flex-end;
}

#suspended-modal-close {
    background-color: #383a40;
    color: #fff;
    font-size: 0.775rem;
    font-weight: 500;
    padding: 0.5rem .7rem;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: background 0.2s;
    width: max-content;
}
