/* ==========================================================================
   ZENIFIX NEWS BOARD & MODAL STYLES (다국어 폰트 시스템 포함)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 다국어 폰트 시스템 (Font Variables)
-------------------------------------------------------------------------- */
.news-section, #newsReadModal {
    --news-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --news-lh: 1.5;
    --news-ls: normal;
}
body.lang-ko .news-section, body.lang-ko #newsReadModal { --news-font: 'Pretendard Variable', Pretendard, sans-serif; }
body.lang-ja .news-section, body.lang-ja #newsReadModal { --news-font: 'Noto Sans JP', sans-serif; }
body.lang-cn .news-section, body.lang-zh .news-section,
body.lang-cn #newsReadModal, body.lang-zh #newsReadModal { --news-font: 'Noto Sans SC', sans-serif; }
body.lang-th .news-section, body.lang-th #newsReadModal { --news-font: 'Prompt', sans-serif; --news-lh: 1.75; --news-ls: 0.02em; }
body.lang-vn .news-section, body.lang-vi .news-section,
body.lang-vn #newsReadModal, body.lang-vi #newsReadModal { --news-font: 'Be Vietnam Pro', sans-serif; --news-lh: 1.75; --news-ls: 0.02em; }
body.lang-hi .news-section, body.lang-hi #newsReadModal { --news-font: 'Hind', sans-serif; --news-lh: 1.75; }

/* --------------------------------------------------------------------------
   2. 뉴스 섹션 (News Section & Grid)
-------------------------------------------------------------------------- */
.news-section {
    margin: 60px 0 40px;
    font-family: var(--news-font) !important;
}
.news-section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark, #302720);
    margin-bottom: 24px;
    text-transform: uppercase;
    font-family: inherit;
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
}

/* --------------------------------------------------------------------------
   3. 뉴스 카드 (News Card Item)
-------------------------------------------------------------------------- */
.news-card {
    background: #fff;
    border: 1px solid var(--line, #e8e1d8);
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(40,32,24,.08);
}
.news-thumb {
    width: 100%;
    aspect-ratio: 1 / 1; 
    background: #f8f9fa;
    overflow: hidden;
}
.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.news-card:hover .news-thumb img {
    transform: scale(1.03);
}
.news-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.news-date {
    font-size: 12px;
    color: #76b82a;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
    font-family: inherit;
}
.news-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark, #302720);
    line-height: var(--news-lh);
    letter-spacing: var(--news-ls);
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: inherit;
}

/* --------------------------------------------------------------------------
   4. ★ 뉴스 팝업 (매거진 에디토리얼 레이아웃 적용)
-------------------------------------------------------------------------- */
.news-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 25, 20, 0.65);
    z-index: 10020;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: var(--news-font) !important;
}
.news-modal-overlay.show { display: flex; opacity: 1; }

.news-modal-box {
    background: #fff;
    width: 90%;
    max-width: 880px; /* PC에서는 창을 넓게 써서 좌우 분할 */
    border-radius: 28px;
    padding: 45px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    position: relative;
    text-align: left;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 85vh; 
    
    /* CSS Grid를 활용한 완벽한 2단 분할 */
    display: grid;
    grid-template-columns: 340px 1fr; /* 좌측 이미지 구역 340px 고정, 우측 텍스트 구역 */
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
        "img date"
        "img title"
        "img content";
    gap: 0 40px;
}
.news-modal-overlay.show .news-modal-box { transform: translateY(0); }

.news-modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #f0ede9;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.news-modal-close:hover {
    background: var(--dark, #302720);
    color: #fff;
    transform: rotate(90deg);
}

.news-read-img {
    grid-area: img;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    object-fit: cover;
    margin: 0;
    align-self: start; /* 이미지 위쪽 맞춤 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.news-read-date {
    grid-area: date;
    color: #ffb836;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: inherit;
    margin-top: 5px;
}

.news-read-title {
    grid-area: title;
    font-size: 24px;
    font-weight: 800;
    color: var(--dark, #302720);
    margin: 0 0 20px 0;
    line-height: 1.35;
    font-family: inherit;
    word-break: keep-all;
}

.news-read-content {
    grid-area: content;
    font-size: 15px;
    line-height: var(--news-lh);
    letter-spacing: var(--news-ls);
    color: #4a423a;
    overflow-y: auto;
    font-family: inherit;
    min-height: 0; /* 우측 텍스트 공간만 스크롤 활성화 */
    margin-right: -15px; 
    padding-right: 15px; 
}

/* 스크롤바 커스텀 (모달 내부) */
.news-read-content::-webkit-scrollbar { width: 5px; }
.news-read-content::-webkit-scrollbar-thumb {
    background-color: rgba(200, 195, 185, 0.4); 
    border-radius: 10px;
    border-top: 25px solid transparent; 
    border-bottom: 25px solid transparent; 
    background-clip: padding-box;
}
.news-read-content::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------------------
   5. 모바일 반응형 (Responsive)
-------------------------------------------------------------------------- */
@media (max-width: 1050px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .news-modal-box {
        grid-template-columns: 280px 1fr; /* 태블릿 환경 조율 */
        gap: 0 30px;
    }
}

@media (max-width: 720px) {
    .news-section { margin: 40px 0 30px; }
    .news-section-title { font-size: 20px; margin-bottom: 16px; }
    .news-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .news-thumb { aspect-ratio: 1 / 1; }
    .news-info { padding: 12px 10px; }
    .news-date { font-size: 12px; margin-bottom: 4px; }
    .news-title { font-size: 13.5px; -webkit-line-clamp: 2; }

    /* ★ 모바일 모달: 컴팩트 앨범 레이아웃 적용 */
    .news-modal-box {
        max-width: 500px;
        padding: 35px 25px 25px;
        grid-template-columns: 1fr; /* 다시 1열로 세로 배치 */
        grid-template-rows: auto auto auto 1fr;
        grid-template-areas:
            "img"
            "date"
            "title"
            "content";
        gap: 0;
    }

    .news-read-img {
        width: 160px; /* 앨범 커버처럼 작고 귀엽게 고정 */
        margin: 0 auto 24px auto; /* 한가운데 정렬 */
        border-radius: 18px;
    }

    /* 모바일에서는 제목과 날짜도 이미지에 맞춰 한가운데 정렬 */
    .news-read-date { 
        text-align: center; 
        margin-bottom: 8px; 
        margin-top: 0;
    }
    .news-read-title { 
        text-align: center; 
        font-size: 20px; 
    }

    /* 텍스트는 가독성을 위해 기존처럼 좌측 정렬 유지 */
    .news-read-content {
        margin-top: 5px;
        margin-right: -10px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .news-thumb { aspect-ratio: 1 / 1; }
    .news-info { padding: 10px 8px; }
    .news-title { font-size: 12.5px; }
}

/* --- 더보기(Load More) 버튼 세련된 스타일 --- */
.news-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 36px;
    margin-top: 30px;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    background: transparent;
    border: 1px solid #d1cbc3;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.news-more-btn:hover {
    background: var(--dark);
    color: #fff;
    border-color: var(--dark);
    transform: translateY(-2px);
}

/* ==========================================================================
   [추가] 다국어 줄바꿈(Word Break) 자동 최적화
   ========================================================================== */

/* 1. 기본 설정 (한국어/영어 등): 단어가 쪼개지지 않도록 보호하되, 너무 길면 강제 줄바꿈 */
.news-title,
.news-read-title, 
.news-read-content {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 2. 띄어쓰기가 없는 언어 (일본어, 중국어): 영단어는 보호하고 자연스럽게 줄바꿈 */
body.lang-ja .news-title, 
body.lang-ja .news-read-title, 
body.lang-ja .news-read-content,
body.lang-cn .news-title, 
body.lang-cn .news-read-title, 
body.lang-cn .news-read-content,
body.lang-zh .news-title, 
body.lang-zh .news-read-title, 
body.lang-zh .news-read-content {
    word-break: normal; /* 영단어(알파벳)는 쪼개지지 않도록 하나의 덩어리로 보호 */
    overflow-wrap: break-word; /* 긴 영단어가 영역을 뚫고 나갈 우려가 있을 때만 예외적으로 쪼갬 */
    line-break: strict; /* 일본어 금칙처리 (마침표나 쉼표, '」' 등이 줄 맨 앞에 오지 않도록 방지해주는 고급 속성) */
}

/* 3. ★ 태국어 (TH): 브라우저 내장 사전을 이용해 단어가 깨지지 않게 지능형 줄바꿈 */
body.lang-th .news-title, 
body.lang-th .news-read-title, 
body.lang-th .news-read-content {
    word-break: normal; 
    overflow-wrap: break-word;
}