/* =========================================
   1. Reset & Base
========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #fff;
    word-break: keep-all;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; background-color: #f0f0f0; } /* 이미지 없을 때 회색 배경 */

/* =========================================
   2. Layout
========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.page-wrapper {
    display: flex;
    gap: 40px;
    padding: 40px 0;
    align-items: flex-start;
}
.main-content {
    flex: 1;
    min-width: 0; 
}

/* =========================================
   3. Header
========================================= */
.site-header {border-bottom: 1px solid #222;}
.header-top { padding: 20px 0; display: flex; justify-content: space-between; align-items: center; }

.site-logo a { font-size: 32px; font-weight: bold; color: #004790; letter-spacing: -1px; display: block; }
.site-logo img { height: 65px; background-color: transparent; } 

.header-search form { display: flex; border: 1px solid #ccc; border-radius: 20px; overflow: hidden; }
.header-search input { border: none; padding: 8px 15px; outline: none; font-size: 14px; width: 200px; }
.header-search button { border: none; background: #004790; color: #fff; padding: 0 15px; cursor: pointer; font-size: 14px; }

.gnb {
    background-color: #1b507b; /* 기존 회색에서 깔끔한 화이트로 변경 */
    /* border-bottom: 1px solid #eaeaea; */
    border-top: none;
}
.gnb-list { 
    display: flex; 
    justify-content: center; /* 메뉴를 가운데로 모아 안정감 부여 */
    flex-wrap: wrap; 
    gap: 15px; /* 메뉴 간격 확보 */
}
.gnb-list li { 
    position: relative; 
}
.gnb-list li a {
    display: block;
    padding: 15px 15px;
    font-weight: 600;
    font-size: 16px;
    color: #ffffff; /* 텍스트 색상을 약간 부드럽게 처리 */
    transition: color 0.3s ease;
    position: relative;
}

/* 밑줄 애니메이션 효과 (Micro-interaction) */
.gnb-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%; /* 글자 너비에 맞게 밑줄 길이 조절 */
    height: 3px;
    background-color: #ffffff;
    transition: transform 0.3s ease-in-out;
    border-radius: 3px 3px 0 0;
}

/* 호버 및 활성화 상태 */
.gnb-list li a:hover, 
.gnb-list li.active a {
    color: #b9ffe6; /* 선택 시 더 뚜렷한 색상으로 강조 */
}
.gnb-list li a:hover::after, 
.gnb-list li.active a::after {
    transform: translateX(-50%) scaleX(1); /* 부드럽게 채워지는 선 */
}

/* =========================================
   4. Footer
========================================= */
.site-footer { background-color: #222; color: #ccc; padding: 40px 0; font-size: 14px; margin-top: 40px; }
.footer-logo { margin-bottom: 20px; }
.footer-logo img { height: 35px; background-color: transparent; opacity: 0.8; }

.footer-menu { display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid #444; padding-bottom: 20px; flex-wrap: wrap; }
.footer-menu a { color: #fff; font-weight: bold; transition: color 0.2s; }
.footer-menu a:hover { color: #004790; }

.footer-info { line-height: 1.8; }
.footer-info span { display: inline-block; margin-right: 15px; }
.copyright { margin-top: 15px; color: #888; }

/* =========================================
   5. UI Components (Main & List)
========================================= */
.section-title { font-size: 24px; font-weight: bold; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #333; }
.list-header { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center; }
.list-header .section-title { margin-bottom: 0; border: none; padding: 0; font-size: 28px; color: #004790; }

.news-card { display: flex; gap: 20px; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid #eee; }
.news-card-thumb { width: 240px; flex-shrink: 0; aspect-ratio: 16/9; object-fit: cover; }
.news-card-content { flex: 1; }
.news-card-title { font-size: 20px; font-weight: bold; margin-bottom: 10px; line-height: 1.4; }
.news-card-desc { color: #666; font-size: 15px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { font-size: 13px; color: #999; }

/* Main Specific */
.youtube-section { background: #111; color: #fff; padding: 30px; margin: 40px 0; border-radius: 10px; }
.youtube-section .section-title { border-bottom-color: #444; color: #fff; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.video-item-thumb { aspect-ratio: 16/9; background: #333; margin-bottom: 10px; position: relative; }
.video-item-title { font-size: 15px; font-weight: bold; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.issue-section { display: flex; flex-wrap: wrap; gap: 20px; }
.issue-card { flex: 1 1 calc(50% - 10px); border: 1px solid #ddd; padding: 20px; }

/* Pagination & Search */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 40px; }
.pagination a, .pagination span { display: block; width: 36px; height: 36px; line-height: 36px; text-align: center; border: 1px solid #ccc; background: #fff; text-decoration: none; font-size: 14px; }
.pagination a:hover { background: #f5f5f5; }
.pagination span.current { background: #004790; color: #fff; border-color: #004790; }

.list-search { text-align: center; margin-top: 40px; padding: 20px; background: #f9f9f9; border-radius: 5px; }
.list-search input { padding: 10px; width: 300px; border: 1px solid #ccc; max-width: 100%; }
.list-search button { padding: 10px 20px; background: #333; color: #fff; border: none; cursor: pointer; }

/* =========================================
   6. View Page (Article)
========================================= */
.article-header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #ddd; }
.article-category { font-weight: bold; color: #004790; font-size: 16px; margin-bottom: 10px; display: inline-block; text-decoration: none; }
.article-title { font-size: 32px; font-weight: bold; line-height: 1.4; margin-bottom: 20px; color: #111; }
.article-info { display: flex; justify-content: space-between; align-items: center; color: #666; font-size: 14px; }
.article-util button { background: none; border: 1px solid #ccc; padding: 6px 12px; cursor: pointer; border-radius: 4px; font-size: 13px; margin-left: 5px; background: #fafafa; }
.article-util button:hover { background: #eee; }

.article-body { font-size: 18px; line-height: 1.8; color: #333; margin-bottom: 50px; }
.article-body img { display: block; margin: 30px auto; max-width: 100%; height: auto; border-radius: 4px; background: #f4f4f4; }
.article-body p { margin-bottom: 20px; }
.article-footer-ad { margin: 40px 0; text-align: center; padding: 30px; background: #f8f9fa; border: 1px solid #eee; color: #888; }

/* =========================================
   7. Sidebar Setup
========================================= */
.view-sidebar { width: 320px; flex-shrink: 0; }
.side-widget { margin-bottom: 40px; }
.side-widget-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 2px solid #222; }

.side-news-list li { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.side-news-list .rank { font-size: 20px; font-weight: bold; color: #004790; width: 24px; text-align: center; }
.side-news-thumb { width: 80px; height: 60px; object-fit: cover; }
.side-news-title { font-size: 14px; font-weight: bold; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Ad Widget */
.ad-widget { border: 1px solid #e0e0e0; background-color: #fafafa; padding: 20px; }
.ad-label { font-size: 11px; color: #999; text-align: right; margin-bottom: 5px; font-weight: bold; }
.ad-text-list li { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed #ccc; }
.ad-text-list li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.ad-text-link { display: block; font-size: 14px; color: #333; font-weight: bold; }
.ad-text-link:hover { text-decoration: underline; color: #004790; }
.ad-banner img { width: 100%; height: auto; margin-top: 10px; aspect-ratio: 16/9; object-fit: cover; }

/* =========================================
   8. About Page (소개 및 정책)
========================================= */
.about-header { text-align: center; margin-bottom: 40px; padding: 40px 0; background-color: #f8f9fa; border-radius: 10px; }
.about-header h2 { font-size: 32px; color: #004790; margin-bottom: 10px; }
.about-header p { color: #666; font-size: 16px; }

.tab-nav { display: flex; border-bottom: 2px solid #004790; margin-bottom: 30px; flex-wrap: wrap; }
.tab-btn { flex: 1; min-width: 150px; background: none; border: none; padding: 15px 10px; font-size: 16px; font-weight: bold; color: #555; cursor: pointer; transition: all 0.2s; outline: none; }
.tab-btn:hover { background-color: #f0f5fa; }
.tab-btn.active { color: #fff; background-color: #004790; }

.tab-content { display: none; padding: 20px; line-height: 1.8; font-size: 16px; min-height: 400px; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tab-content h3 { font-size: 24px; margin-bottom: 20px; color: #222; border-left: 4px solid #004790; padding-left: 15px; }
.tab-content p { margin-bottom: 15px; }
.contact-box { background: #f5f5f5; border: 1px solid #ddd; padding: 20px; border-radius: 5px; margin-top: 20px; font-weight: bold; text-align: center; font-size: 18px; color: #004790; word-break: break-all; }

ul.policy-list { margin-left: 20px; margin-bottom: 15px; list-style-type: disc; }
ul.policy-list li { margin-bottom: 8px; }

/* =========================================
   9. Responsive (Mobile)
========================================= */
@media (max-width: 768px) {
    /* Layout */
    .page-wrapper {flex-direction: column;padding: 20px; display: block;}
    
    /* Header (Mobile) */
    .header-top { flex-direction: column; gap: 15px; }
    .site-logo img { height: 45px; } 
    .header-search input { width: 100%; } /* 검색창 모바일 너비 확보 */
.gnb-list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        padding: 0;
        
        /* 모바일 스크롤바 숨김 처리 (더 깔끔한 UI) */
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }
    .gnb-list::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    .gnb-list li a {
        white-space: nowrap;
        padding: 14px 10px;
        font-size: 15px;
    }
    
    /* UI & Lists */
    .list-header { margin-bottom:0;}
    .news-card { flex-direction: column; gap: 10px; }
    .news-card-thumb { width: 100%; height: auto; }
    .issue-card { flex: 1 1 100%; }
    
    /* View Page & Sidebar */
    .view-sidebar { width: 100%; }
    .article-title { font-size: 26px; }
    .article-info { flex-direction: column; align-items: flex-start; gap: 15px; }
    .article-body { font-size: 16px; }
    
    /* About Page (Mobile) */
    .about-header { padding: 30px 15px; }
    .about-header h2 { font-size: 26px; }
    .tab-nav { flex-direction: row; border-bottom: none; }
    .tab-btn { flex: 1 1 33.33%; min-width: auto; font-size: 14px; padding: 12px 5px; border: 1px solid #ddd; margin-bottom: -1px; }
    .tab-btn.active { border-color: #004790; }
    
    /* Footer (Mobile) */
    .footer-menu { gap: 10px; }
    .footer-info span {display: block;/* margin-bottom: 5px; */}
    .footer-logo img { margin: auto;}
}

/* =========================================
   10. Main Page Updates (Rolling, Grid, Extras)
========================================= */

/* 상단 롤링 배너 */
.hero-rolling-section { margin-bottom: 40px; }
.rolling-container { width: 100%; overflow: hidden; position: relative; border-radius: 8px; background: #000; aspect-ratio: 2/1; max-height: 400px; }
.rolling-wrapper { 
    display: flex; 
    width: 100%; 
    height: 100%; 
    transition: transform 0.5s ease-in-out; 
}
.rolling-slide { 
    width: 100%; 
    flex-shrink: 0; 
    position: relative; 
}
.rolling-slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: opacity 0.3s; }
.rolling-slide:hover img { opacity: 1; }
.rolling-text { position: absolute; bottom: 0; left: 0; width: 100%; padding: 40px 30px 30px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: #fff; }
.rolling-text .badge { display: inline-block; padding: 4px 10px; font-size: 13px; font-weight: bold; border-radius: 3px; margin-bottom: 10px; }
.rolling-text h2 { font-size: 28px; font-weight: bold; line-height: 1.3; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); margin-bottom: 15px; }
.rolling-text p { font-size: 15px;
    color: fff;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;}
/* 메뉴별 9개 최신 기사 그리드 */
.category-news-section { margin-bottom: 50px; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.category-item { background: #fff; border: 1px solid #eaeaea; padding: 15px; border-radius: 6px; }
.category-item .cat-label a { color: #004790; font-size: 16px; font-weight: bold; margin-bottom: 10px; display: inline-block; }
.category-item .cat-label a:hover { text-decoration: underline; }
.category-item .cat-thumb { display: block; margin-bottom: 12px; overflow: hidden; border-radius: 4px; aspect-ratio: 16/9; }
.category-item .cat-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.category-item:hover .cat-thumb img { transform: scale(1.05); }
.category-item .cat-title { font-size: 16px; font-weight: bold; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 추가 섹션 1: 포토 뉴스 */
.photo-news-section { margin-bottom: 50px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.photo-item { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 4/3; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-item:hover img { transform: scale(1.05); }
.photo-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.6); padding: 15px; }
.photo-overlay p { color: #fff; font-weight: bold; margin: 0; font-size: 15px; text-align: center; }

/* 추가 섹션 2: 오피니언 */
.opinion-section { margin-bottom: 40px; }
.opinion-list { display: flex; flex-direction: column; gap: 15px; }
.opinion-item { display: flex; align-items: center; gap: 20px; padding: 20px; background: #f8f9fa; border: 1px solid #eee; border-radius: 6px; transition: background 0.2s; }
.opinion-item:hover { background: #f0f5fa; border-color: #dbe4ee; }
.opinion-author img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #ddd; }
.opinion-content h4 { font-size: 18px; font-weight: bold; margin-bottom: 5px; color: #222; }
.opinion-content span { font-size: 14px; color: #666; font-weight: bold; }

/* 모바일 반응형 처리 */
@media (max-width: 768px) {
    .rolling-container { height: 560px; max-height: 460px;}
    .rolling-text {
        padding: 20px;}
    .rolling-text h2 { font-size: 20px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-grid { grid-template-columns: 1fr; }
    .opinion-item { flex-direction: column; text-align: center; gap: 10px; }
}
@media (max-width: 480px) {
    .category-grid { grid-template-columns: 1fr; }
}

    /* 기본 광고 배너 */
    .ad-banner { width: 100%; background-color: #161B2E; /*border: 1px solid #1e293b;*/  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; cursor: pointer; margin: 2rem 0;  }
    @media (min-width: 768px) { .ad-banner {  } }
    .ad-bg { position: absolute; inset: 0; background: linear-gradient(to right, rgba(30,58,138,0.1), transparent, rgba(30,58,138,0.1)); opacity: 0.5; }
    .ad-content { position: relative; z-index: 10; text-align: center; }
    .ad-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.1em; font-weight: bold; display: block; margin-bottom: 0.25rem; }
    .ad-text { color: #94a3b8; font-weight: 500; }
    @media (min-width: 768px) { .ad-text { font-size: 1.125rem; } }
    .ad-badge {position: absolute;top: 3px;right: 3px;font-weight: bold;margin: auto;display: flex;align-items: center;font-size: 10px;background: rgba(0, 0, 0, 0.1);color: #cecdcd;padding: 2px 6px;border-radius: 3px;}

    /* 우측 광고배너 */
    .banner_ad{position:absolute;top:2px; right:2px; width: auto !important; height: 16px; z-index:1;cursor:pointer}