@charset "UTF-8";

/* ==========================================================================
   1. Variables & Reset
   ========================================================================== */
:root {
    --bg-dark: #0A0F16; 
    --bg-panel: #111827;
    --bg-panel-hover: #1f2937;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #4b5563;
    --primary: #007bff;
    --primary-hover: #0056b3;
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a, button {
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ==========================================================================
   2. Base Layout
   ========================================================================== */
.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.main-wrapper { flex: 1; padding: 40px 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }


/* ==========================================================================
   3. Header & Navigation
   ========================================================================== */
.header { 
    position: sticky; 
    top: 0; 
    z-index: 50; 
    background-color: var(--bg-dark); 
    border-bottom: 1px solid var(--border-color); 
    transition: background-color 0.3s ease, box-shadow 0.3s ease; 
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

/* Logo */
.logo-wrap { display: flex; align-items: center; gap: 16px; }
.logo-text { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; display: flex; align-items: center; }
.logo-box { border: 2px solid var(--primary); padding: 2px 6px; margin-left: 4px; font-weight: 600; }
.header-logo-img { max-height: 32px; width: auto; display: block; }

/* Desktop Navigation */
.desktop-nav { display: none; gap: 28px; }
.desktop-nav .nav-link { font-size: 18px; font-weight: 600; color: #d1d5db; transition: color 0.3s ease; }
.desktop-nav .nav-link:hover, .desktop-nav .nav-link.active { color: #fff; }
@media (min-width: 1024px) { 
    .desktop-nav { display: flex; } 
    #mobile-menu-btn { display: none; } 
}

/* Header Utils (Search, Lang) */
.header-utils { display: flex; align-items: center; gap: 16px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-input { display: none; position: absolute; right: 32px; background: var(--bg-panel); border: 1px solid var(--border-color); color: #fff; padding: 6px 12px; border-radius: 4px; font-size: 13px; outline: none; width: 180px; }
.search-input.show { display: block; animation: fadeInRight 0.2s ease; }
.header-icon { color: #fff; transition: color 0.3s ease; }
.search-btn:hover { color: #fff; }
.lang-btn { display: none; font-size: 12px; color: var(--primary); font-weight: 600; }
@media (min-width: 768px) { .lang-btn { display: block; } }

/* Header Scrolled State (화면 스크롤 시 화이트 테마 전환) */
.header.header--scrolled { background-color: #ffffff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); border-bottom: 1px solid #e5e7eb; }
.header.header--scrolled .desktop-nav .nav-link { color: #4b5563; }
.header.header--scrolled .desktop-nav .nav-link:hover, .header.header--scrolled .desktop-nav .nav-link.active { color: var(--primary); }
.header.header--scrolled .header-icon { color: #111827; }
.header.header--scrolled .search-btn { color: #4b5563; }
.header.header--scrolled .lang-btn { color: #111827; }

/* Mobile Navigation */
.mobile-nav {
    display: none; 
    flex-direction: column;
    background-color: var(--bg-dark); 
    border-bottom: 1px solid var(--border-color);
    position: absolute;
    top: 70px; 
    left: 0;
    width: 100%;
    padding: 10px 24px 24px;
    z-index: 40;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
.mobile-nav.show { display: flex; animation: slideDown 0.3s ease; }
.mobile-nav .nav-link { padding: 14px 0; font-size: 16px; font-weight: 600; color: #d1d5db; border-bottom: 1px solid rgba(255, 255, 255, 0.05); transition: color 0.2s; }
.mobile-nav .nav-link:hover, .mobile-nav .nav-link.active { color: #fff; }
.mobile-nav .nav-link:last-child { border-bottom: none; }
@media (min-width: 1024px) { .mobile-nav { display: none !important; } }


/* ==========================================================================
   4. Home Layout & Content
   ========================================================================== */
.home-layout { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 1024px) { .home-layout { grid-template-columns: 1fr 1fr; gap: 60px; } }
.section-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 24px; }

/* Hero Article */
.hero-article { position: relative; width: 100%; aspect-ratio: 16/9; margin-bottom: 40px; cursor: pointer; overflow: hidden; border-bottom: 3px solid var(--primary); }
.hero-article img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s; }
.hero-article:hover img { transform: scale(1.05); }
.hero-content { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 15, 22, 1) 0%, rgba(10, 15, 22, 0.4) 50%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 32px; }
.hero-title { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 12px; line-height: 1.2; letter-spacing: -1px; word-break: keep-all; }
.hero-desc { font-size: 15px; color: #d1d5db; margin-bottom: 24px; max-width: 80%; word-break: keep-all; }
.btn-blue { background-color: var(--primary); color: #fff; padding: 10px 24px; border-radius: 2px; font-weight: 700; font-size: 13px; width: fit-content; transition: background 0.2s; }
.btn-blue:hover { background-color: var(--primary-hover); }

/* In-Depth Grid */
.in-depth-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (min-width: 640px) { .in-depth-grid { grid-template-columns: repeat(3, 1fr); } }
.card-sm { display: flex; flex-direction: column; cursor: pointer; }
.card-img-wrap { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; margin-bottom: 12px; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.card-sm:hover .card-img-wrap img { transform: scale(1.05); }
.card-badge { position: absolute; top: 0; left: 0; background: var(--primary); color: #fff; font-size: 11px; font-weight: bold; padding: 4px 8px; }
.card-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; line-height: 1.4; transition: color 0.2s; word-break: keep-all;}
.card-sm:hover .card-title { color: var(--primary); }
.card-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.read-more-text { color: var(--primary); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 4px; margin-top: auto; }
.video-wrap::after { content: '▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.7); color: white; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; padding-left: 2px; pointer-events: none; border: 2px solid rgba(255, 255, 255, 0.8); transition: all 0.3s; }
.card-sm:hover .video-wrap::after { background: var(--primary); border-color: var(--primary); }

/* Latest Grid & Past Issues */
.latest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 48px; }
@media (min-width: 768px) { .latest-grid { grid-template-columns: repeat(4, 1fr); } }
.latest-grid .card-desc { display: none}
.past-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }
.past-list-item { display: flex; gap: 16px; padding: 16px; background: var(--bg-panel); border-radius: 8px; cursor: pointer; transition: background 0.2s; border: 1px solid transparent; }
.past-list-item:hover { background: var(--bg-panel-hover); border-color: var(--border-color); }
.past-list-img { width: 120px; aspect-ratio: 16/9; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.past-list-info { display: flex; flex-direction: column; justify-content: center; }
.past-list-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; word-break: keep-all; transition: color 0.2s; }
.past-list-item:hover .past-list-title { color: var(--primary); }
.past-list-desc { font-size: 13px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


/* ==========================================================================
   5. General Views (List, Detail, Intro)
   ========================================================================== */
.page-view { animation: fadeIn 0.3s ease; }
.page-header { margin-bottom: 40px; border-bottom: 1px solid var(--border-color); padding-bottom: 24px; }
.page-title { font-size: 32px; font-weight: 800; color: #fff; }

/* List View (리스트 페이지 반응형 적용) */
.list-container { display: flex; flex-direction: column; gap: 24px; max-width: 900px; }

/* 1) 모바일 기본 레이아웃 (제안해주신 코드 적용) */
.list-card { display: flex; flex-direction: column; gap: 16px; cursor: pointer; }
.list-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; flex-shrink: 0; border-radius: 6px; }

.list-info h3 { font-size: 20px; color: #fff; margin-bottom: 8px; word-break: keep-all; }
.list-info p { font-size: 15px; color: var(--text-muted); word-break: keep-all; }

/* 2) PC 및 태블릿 레이아웃 (640px 이상일 때 좌우 배치로 변경) */
@media (min-width: 640px) {
    .list-card { flex-direction: row; gap: 24px; }
    .list-img { width: 240px; }
}

/* Detail View */
.detail-container { max-width: 800px; margin: 0 auto; }
.detail-title { font-size: 36px; font-weight: 800; color: #fff; margin: 16px 0; line-height: 1.3; word-break: keep-all; }
.detail-meta { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.detail-content { font-size: 17px; color: #d1d5db; line-height: 1.8; word-break: keep-all; }

/* Intro/Tabs Layout */
.intro-layout { display: flex; flex-direction: column; gap: 40px; margin-top: 20px; }
@media (min-width: 768px) { .intro-layout { flex-direction: row; } }
.tab-sidebar { width: 100%; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
@media (min-width: 768px) { .tab-sidebar { width: 240px; } }
.tab-btn { text-align: left; padding: 14px 20px; border-radius: 8px; color: var(--text-muted); font-size: 14px; font-weight: 600; transition: all 0.2s; background: transparent; }
.tab-btn:hover { background: var(--bg-panel-hover); color: #fff; }
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-content-area { flex: 1; background: var(--bg-panel); padding: 40px; border-radius: 12px; min-height: 500px; border: 1px solid var(--border-color); }
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }
.tab-title { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
.tab-text { font-size: 15px; color: #d1d5db; line-height: 1.8; margin-bottom: 24px; word-break: keep-all; }
.tab-box { background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); padding: 24px; border-radius: 8px; margin-bottom: 16px; }


/* ==========================================================================
   6. Subscribe & Footer
   ========================================================================== */
.subscribe-section { border-top: 1px solid var(--border-color); padding-top: 32px; }
.subscribe-flex { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 640px) { .subscribe-flex { flex-direction: row; align-items: center; justify-content: space-between; } }
.sub-info h4 { font-size: 18px; color: #fff; font-weight: 700; margin-bottom: 4px; }
.sub-info p { font-size: 13px; color: var(--text-muted); }
.sub-form { display: flex; gap: 8px; flex: 1; max-width: 400px; }
.sub-input { flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--text-dark); color: #fff; padding: 8px 0; font-size: 14px; outline: none; }
.sub-input:focus { border-color: var(--primary); }

.footer { background-color: var(--bg-dark); border-top: 1px solid var(--border-color); padding: 40px 0 20px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 40px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } }
.footer-logo { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 16px; display: inline-flex; align-items: center; }
.footer-logo-box { border: 1px solid var(--primary); padding: 0 4px; margin-left: 2px; }
.footer-address { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.footer-col h5 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col li { font-size: 13px; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.footer-col li:hover { color: #fff; }
.social-links { display: flex; gap: 12px; color: var(--primary); }
.social-links svg { width: 18px; height: 18px; cursor: pointer; transition: 0.2s; }
.social-links svg:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 12px; color: var(--text-dark); }
.lang-select { background: transparent; color: var(--text-muted); border: none; outline: none; font-size: 12px; }

/* ==========================================================================
   7. Article View Layout & Sidebar Overrides (view.html 전용)
   ========================================================================== */
   
/* 7-1. View Page Base Layout */
/* view.html에서 body 기본 폰트 사이즈를 강제 지정하여 html { font-size: 62.5% } 영향을 방어합니다. */
.view-main-content, .view-sidebar { font-size: 16px; } 

.view-layout-wrapper { display: flex; flex-wrap: wrap; gap: 40px; margin: 0 auto; align-items: flex-start; max-width: 1200px; padding: 0 24px; }
.view-main-content { flex: 1; min-width: 0; }

.aside.view-sidebar { width: 100%; flex-shrink: 0; }
@media (min-width: 1024px) { 
    .aside.view-sidebar { width: 320px; } 
}

/* 7-2. Article Detail Elements */
.btn-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-muted); margin-bottom: 24px; transition: 0.2s; }
.btn-back:hover { color: #fff; }
.detail-badge-primary { display: inline-block; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; margin-bottom: 12px; border-radius: 2px; }
.detail-title { font-size: 32px; font-weight: 800; color: #fff; line-height: 1.3; word-break: keep-all; margin-bottom: 24px; }

.detail-meta-wrap { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid #334155; padding-bottom: 16px; margin-bottom: 24px; }
.detail-author-info { display: flex; align-items: center; gap: 12px; }
.detail-author-avatar { width: 40px; height: 40px; border-radius: 50%; background: #374151; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; }
.detail-author-name { font-size: 14px; color: #fff; font-weight: 600; margin-bottom: 2px; }
.detail-date { font-size: 13px; color: var(--text-muted); }

.detail-actions { display: flex; gap: 12px; }
.btn-action { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-panel); border: 1px solid var(--border-color); color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-action:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.detail-text p { font-size: 17px; color: #d1d5db; line-height: 1.8; word-break: keep-all; margin-bottom: 24px; }
.report-box { position: relative; background: rgba(0, 123, 255, 0.05); border: 1px solid rgba(0, 123, 255, 0.2); border-radius: 8px; padding: 24px; display: flex; gap: 16px; align-items: flex-start; margin-top: 40px; }
.report-icon { color: var(--primary); flex-shrink: 0; }
.report-text { font-size: 15px; color: #d1d5db; line-height: 1.6; }
.text-highlight { color: var(--primary); font-weight: bold; }


/* 7-3. External Sidebar CSS Dark Theme Overrides */
/* 외부 CSS(side_section.css, ad_text.css)를 현재 다크테마에 맞게 강제 덮어쓰기 합니다. */
.view-sidebar { color: #f3f4f6; }

/* 공통 헤딩 오버라이드 */
.view-sidebar [class*=section_] h3, .view-sidebar [class*=ad_text] h4 {
    color: #fff !important;
    border-bottom: 2px solid #1f2937 !important;
    border-top: none !important;
    border-right: none !important;
    border-left: none !important;
    padding: 0 0 10px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    background: transparent !important;
    margin-bottom: 16px !important;
}

/* 테두리(선) 다크테마 맞춤 */
.view-sidebar [class*=section_] li, .view-sidebar [class*=ad_text] li {
    border-top-color: #1f2937 !important;
    border-bottom-color: #1f2937 !important;
    list-style: none;
}

/* 텍스트 색상 및 호버 */
.view-sidebar .tit, .view-sidebar strong.tit {
    color: #d1d5db !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    transition: color 0.2s ease;
}
.view-sidebar a:hover .tit, .view-sidebar a:hover strong.tit, .view-sidebar a:hover {
    color: var(--primary) !important;
    text-decoration: none !important;
}
.view-sidebar .lede, .view-sidebar .press, .view-sidebar .date, .view-sidebar .hit {
    color: #9ca3af !important;
    font-size: 13px !important;
    margin-top: 6px !important;
}

/* 썸네일 가상선 및 백그라운드 보정 */
.view-sidebar .thumb:after, .view-sidebar .thumb_wrap:after {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
.view-sidebar .thumb, .view-sidebar .thumb_wrap {
    background-color: #1f2937 !important;
    border-radius: 6px !important;
}
.view-sidebar .thumb img, .view-sidebar .thumb_wrap img {
    border-radius: 6px !important;
}

/* [ad_text_pic_r_C] 보정 */
.view-sidebar .ad_text_pic_r_C .rank_num {
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    width: 22px !important;
    height: 22px !important;
    line-height: 22px !important;
    font-size: 12px !important;
    border-radius: 4px 0 6px 0;
}

/* [section_05] 보정 (순위 번호와 레이아웃 충돌 해결) */
.view-sidebar .section_05 .rank_num {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    color: var(--primary) !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    width: 24px !important;
    line-height: 1 !important;
    text-align: left !important;
}
.view-sidebar .section_05 li a { padding-left: 28px !important; }
.view-sidebar .section_05 .thumb {
    margin-left: 0 !important;
    margin-right: 12px !important;
    border-radius: 6px !important;
    width: 80px !important;
    height: 60px !important;
}
.view-sidebar .section_05 .info {
    padding-left: 0 !important;
    display: flex !important;
    align-items: center !important;
}
.view-sidebar .section_05 .tit { margin-top: 0 !important; }

/* [section_10] (추천영상) 보정 */
.view-sidebar .section_10 .thumb_wrap::after {
    content: '▶' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 14px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-left: 3px !important;
    border: 2px solid rgba(255,255,255,0.8) !important;
}

/* [ad_text_r_F] 보정 (텍스트 리스트) */
.view-sidebar .ad_text_r_F ul { padding: 0 !important; margin: 0 !important; }
.view-sidebar .ad_text_r_F li { border: none !important; padding: 6px 0 !important; }
.view-sidebar .ad_text_r_F li a {
    font-size: 14px !important;
    line-height: 1.6 !important;
    padding-left: 12px !important;
    position: relative;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    color: #fff !important;
}
.view-sidebar .ad_text_r_F li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

/* [section_06] 보정 */
.view-sidebar .section_06 .thumb {
    border-radius: 6px !important;
    margin-bottom: 10px !important;
}