/* =========================================
   News Page Styles
========================================= */

/* =========================================
   1. PAGE TITLE SECTION
========================================= */

/* news 페이지는 component.css의 body:not(.page-home) .header로 자동 처리 */

/* news 페이지 전용 컬러 유틸리티 */
.color-white { color: #FFFFFF; }

.news-main {
    padding-top: 5.25rem; /* 헤더 높이 오프셋 */
    min-height: calc(100vh - 5.25rem);
    display: flex;
    flex-direction: column;
}

/* news 페이지 전체 word-break 설정 */
.page-news {
    word-break: keep-all;
}

.news-title-section {
    padding-top: clamp(3.75rem, 9vw, 8.125rem); /* 60px ~ 130px */
    padding-bottom: 0;
    text-align: center;
}

.news-page-title {
    font-family: 'jalnan gothic ttf', sans-serif;
    font-weight: 400;
    font-size: clamp(1.75rem, 3.75vw, 3.375rem); /* 28px ~ 54px */
    margin: 0;
}

/* =========================================
   2. LNB TAB SECTION
========================================= */
.news-lnb-section {
    padding-top: clamp(1.25rem, 3.5vw, 3.125rem); /* 20px ~ 50px */
    padding-bottom: 0;
}

.news-lnb-wrap {
    display: flex;
    justify-content: center;
}

/* [레거시 보관] 탭 버튼 비주얼 — 최하단 TAB BAR UNIFIED 블록 참고 */
/*
.page-news .lnb-tab-bar .lnb-tab-btn {
    box-sizing: border-box;
    margin: 0;
    padding: 0.5rem 2.5rem;
    line-height: 2rem;
    background-color: #FFFFFF;
    border: 1px solid rgba(51, 52, 70, 0.1);
    border-radius: 3.125rem;
    cursor: pointer;
    box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
    appearance: none;
    -webkit-appearance: none;
}

.page-news .lnb-tab-bar .lnb-tab-btn:hover:not(.active) {
    box-shadow: 0px 0px 3px 0px #D4734A;
}

.page-news .lnb-tab-bar .lnb-tab-btn.active {
    color: #FFFFFF;
    background-color: #D4734A;
    border: 1px solid rgba(51, 52, 70, 0.1);
    box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
}
*/

/* =========================================
   3. CONTENT SECTION
========================================= */
.news-content-section {
    padding-top: 5rem;           /* lnb ~ 콘텐츠 80px */
    padding-bottom: clamp(5rem, 9vw, 8.125rem); /* 80px ~ 130px */
    flex: 1;
}

/* =========================================
   4. NEWS CARD GRID
========================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 1.67vw, 24px); /* 12px ~ 24px fluid */
}

/* =========================================
   5. NEWS CARD
========================================= */
.news-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: transform 0.2s ease;
}

.news-card:hover {
    transform: translateY(-4px);
}

.news-card-img-wrap {
    width: 100%;
    aspect-ratio: 464 / 619;
    background-color: #D9D9D9;
    overflow: hidden;
}

.news-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-img-wrap img {
    transform: scale(1.03);
}

/* =========================================
   6. MODAL OVERLAY
========================================= */
.news-modal-overlay {
    --news-modal-max-h: calc(100dvh - 6rem);
    --news-modal-max-w: min(calc(100vw - 2.5rem), 45.1875rem);
    display: none;
    position: fixed;
    inset: 0;
    padding: 3rem 1.25rem;
    box-sizing: border-box;
    background-color: rgba(70, 70, 70, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.news-modal-overlay.is-open {
    display: flex;
}

/* =========================================
   7. MODAL CONTENT
========================================= */
.news-modal {
    position: relative;
    width: fit-content;
    max-width: var(--news-modal-max-w);
    max-height: var(--news-modal-max-h);
    margin: auto;
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.news-modal-img-wrap {
    display: block;
    width: fit-content;
    max-width: var(--news-modal-max-w);
    max-height: var(--news-modal-max-h);
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

.news-modal-img-wrap img {
    display: block;
    width: auto;
    height: auto;
    max-width: var(--news-modal-max-w);
    max-height: var(--news-modal-max-h);
    object-fit: contain;
    object-position: center;
}

/* 이미지 없을 때 placeholder — 현재 미사용 */

/* =========================================
   8. MODAL CLOSE BUTTON
========================================= */
.news-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 2.25rem;   /* 36px */
    height: 2.25rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.news-modal-close:hover {
    background-color: #FFFFFF;
}

.news-modal-close img {
    width: 1.5rem;    /* 24px */
    height: 1.5rem;
    display: block;
}

/* =========================================
   9. EMPTY STATE (완료된 이벤트 등)
========================================= */
.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 0;
}

/* =========================================
   9-1. 완료된 이벤트 딤처리
========================================= */
#tab-panel-ended .news-card-img-wrap {
    position: relative;
}

#tab-panel-ended .news-card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.news-card-ended-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    font-family: 'jalnan gothic ttf', sans-serif;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
}

/* =========================================
   10. RESPONSIVE
========================================= */

/* 1440px 이하부터 자연스럽게 좌우 여백 생성 */
@media screen and (max-width: 1440px) {
    .page-news .inner {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
        box-sizing: border-box;
    }
}

/* 태블릿 (1024px 이하) — 탭바 갭만 조정 (버튼 비주얼은 TAB BAR UNIFIED) */
@media screen and (max-width: 1024px) {
    .page-news .lnb-tab-bar {
        gap: 1.25rem;
    }
}

@media screen and (max-width: 768px) {
    .page-news .inner {
        padding-left: 4rem;          /* 64px */
        padding-right: 4rem;
    }

    .news-page-title {
        font-size: 2.625rem;         /* 42px */
    }

    .news-title-section {
        padding-top: 2.5rem;         /* 40px */
    }

    .news-lnb-section {
        padding-top: 1.25rem;        /* 20px */
    }

    .news-content-section {
        padding-top: 2.5rem;         /* 40px */
        padding-bottom: 2.5rem;      /* 40px */
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .page-news .lnb-tab-bar {
        gap: 0.5rem;
    }

    .news-modal-overlay {
        --news-modal-max-h: calc(100dvh - 4rem);
        --news-modal-max-w: min(calc(100vw - 2rem), 45.1875rem);
        padding: 2rem 1rem;
    }

    .news-modal {
        width: fit-content;
        max-width: var(--news-modal-max-w);
        max-height: var(--news-modal-max-h);
    }

    .news-modal-img-wrap {
        max-width: var(--news-modal-max-w);
        max-height: var(--news-modal-max-h);
    }

    .news-modal-img-wrap img {
        max-width: var(--news-modal-max-w);
        max-height: var(--news-modal-max-h);
    }

    .news-modal-close {
        width: 36px;
        height: 36px;
        top: 8px;
        right: 8px;
    }

    .news-modal-close img {
        width: 36px;
        height: 36px;
    }
}

@media screen and (max-width: 480px) {
    .page-news .inner {
        padding-left: 0.875rem;      /* 14px */
        padding-right: 0.875rem;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

}

@media screen and (max-width: 402px) {
    .page-news .inner {
        padding-left: 1rem;          /* 16px */
        padding-right: 1rem;
    }

    .news-title-section {
        padding-top: 2.5rem;         /* 40px */
    }

    .news-lnb-section {
        padding-top: 1.25rem;        /* 20px */
    }

    .news-content-section {
        padding-top: 1.25rem;        /* 20px */
        padding-bottom: 2.5rem;      /* 40px */
    }

    .news-page-title {
        font-size: 2rem;             /* 32px */
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .news-card-img-wrap {
        aspect-ratio: 464 / 619;
    }

    .page-news .lnb-tab-bar {
        gap: 0.375rem;
    }

    .news-modal-overlay {
        --news-modal-max-h: calc(100dvh - 2.5rem);
        --news-modal-max-w: min(calc(100vw - 1.5rem), 45.1875rem);
        padding: 1.25rem 0.75rem;
    }

    .news-modal {
        width: fit-content;
        max-width: var(--news-modal-max-w);
        max-height: var(--news-modal-max-h);
    }

    .news-modal-img-wrap {
        max-width: var(--news-modal-max-w);
        max-height: var(--news-modal-max-h);
    }

    .news-modal-img-wrap img {
        max-width: var(--news-modal-max-w);
        max-height: var(--news-modal-max-h);
    }

    .news-modal-close {
        width: 24px;
        height: 24px;
        top: 6px;
        right: 6px;
    }

    .news-modal-close img {
        width: 24px;
        height: 24px;
    }
}

/* =========================================
   TAB BAR UNIFIED — Space Figma baseline (Community / news.css)
   · Frame·Space TAB BAR UNIFIED와 동일 비주얼
   · 탭 2개 — 가로: 텍스트+패딩만(fit-content) · 세로: line-height 1.4 고정
========================================= */

.page-news .lnb-tab-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.page-news .lnb-tab-bar .lnb-tab-btn {
    box-sizing: border-box;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: center;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0.5rem 1.25rem;
    letter-spacing: 0;
    font-size: 1.25rem;   /* 20px · ft-20-r PC */
    font-weight: 400;
    line-height: 1.4;
    background-color: #FFFFFF;
    color: #D4734A;
    border: 1px solid rgba(51, 52, 70, 0.1);
    border-radius: 3.125rem;
    cursor: pointer;
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    overflow: hidden;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
}

.page-news .lnb-tab-bar .lnb-tab-btn:hover:not(.active) {
    background-color: #FFFFFF;
    color: #D4734A;
    border: 1px solid rgba(51, 52, 70, 0.1);
    box-shadow: 0 0 3px 0 #D4734A;
}

.page-news .lnb-tab-bar .lnb-tab-btn.active,
.page-news .lnb-tab-bar .lnb-tab-btn.active:hover {
    color: #FFFFFF;
    background-color: #D4734A;
    border: 1px solid rgba(51, 52, 70, 0.1);
    border-radius: 3.125rem;
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.page-news .lnb-tab-bar .lnb-tab-btn:focus,
.page-news .lnb-tab-bar .lnb-tab-btn:focus-visible {
    outline: none;
}

.page-news .lnb-tab-bar .lnb-tab-btn:focus-visible:not(.active) {
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.page-news .lnb-tab-bar .lnb-tab-btn.active:focus,
.page-news .lnb-tab-bar .lnb-tab-btn.active:focus-visible {
    color: #FFFFFF;
    background-color: #D4734A;
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

@media screen and (max-width: 1024px) {
    .page-news .lnb-tab-bar .lnb-tab-btn {
        font-size: 1.125rem;  /* 18px · ft-20-r 1024 */
        padding: 0.5rem 1rem;
        line-height: 1.4;
    }
}

@media screen and (max-width: 768px) {
    .page-news .lnb-tab-bar .lnb-tab-btn {
        font-size: 1rem;      /* 16px · ft-20-r 768 */
        padding: 0.4375rem 0.75rem;
        line-height: 1.4;
    }
}

@media screen and (max-width: 402px) {
    .page-news .lnb-tab-bar .lnb-tab-btn {
        font-size: 0.875rem;      /* 14px · 다른 탭바와 폰트 크기 맞춤 */
        padding: 0.375rem 0.625rem;
        line-height: 1.4;
    }
}