/* === Reset & Base === */
:root {
    --primary-color: #d32f2f;
    --text-main: #222;
    --text-muted: #666;
    --text-light: #888;
    --border-color: #eaeaea;
    --bg-light: #fcfcfc;
    --bg-white: #ffffff;
    --font-main: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: var(--font-main);
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
}
a {
    text-decoration: none;
    color: inherit;
}
a:hover {
    text-decoration: underline;
}
ul, ol, li {
    list-style: none;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
button, input {
    font-family: inherit;
    border: none;
    background: none;
}
button {
    cursor: pointer;
}
.blind {
    position: absolute;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

/* === Layout === */
.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0;
}
.content-wrapper {
    display: flex;
    gap: 30px;
    padding: 30px 0;
    align-items: flex-start;
}
.main-content {
    flex: 1;
    min-width: 0; /* flex bug fix */
    background-color: var(--bg-white);
}
.aside.view-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* Page Section (MPA 구조에서는 애니메이션만 유지) */
.page-section {
    display: block;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Header === */
.site-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.site-logo {
    font-size: 28px;
    font-weight: 900;
    color: #111;
    letter-spacing: -1.5px;
}

.site-logo img { height: 48px;}

.site-logo span {
    color: var(--primary-color);
}
.header-utils {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}
.global-nav {
    border-top: 1px solid #f0f0f0;
}
.nav-list {
    display: flex;
    justify-content: flex-start;
    gap: 25px;
    height: 50px;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}
.nav-list::-webkit-scrollbar {
    display: none; /* Chrome */
}
.nav-list li a {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    padding: 10px 2px;
    display: block;
    transition: color 0.2s;
}
.nav-list li a:hover, .nav-list li a.active {
    color: var(--primary-color);
    text-decoration: none;
}


.section-container {
    margin-bottom: 40px;
}
.section-title {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #222;
}

/* === 1. Main Page UI === */
.top-news-layout {
    display: flex;
    gap: 25px;
}
.top-news-primary {
    flex: 1;
}
.top-news-primary .thumb {
    width: 100%;
    height: 320px;
    background-color: #f0f0f0;
    overflow: hidden;
    margin-bottom: 15px;
}
.top-news-primary .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.top-news-primary:hover .thumb img {
    transform: scale(1.03);
}
.top-news-primary .title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}
.top-news-primary .desc {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.top-news-secondary {
    width: 280px;
    display: flex;
    flex-direction: column;
}
.secondary-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.secondary-item:first-child { padding-top: 0; }
.secondary-item:last-child { border-bottom: none; padding-bottom: 0; }
.secondary-item .title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.meta-info {
    font-size: 12px;
    color: var(--text-light);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.category-card {
    display: flex;
    gap: 15px;
}
.category-card .thumb {
    width: 130px;
    height: 90px;
    flex-shrink: 0;
    background-color: #eee;
}
.category-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.category-card .info { flex: 1; }
.category-card .category-label {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 5px;
    display: inline-block;
}
.category-card .title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.video-card .thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background-color: #000;
    margin-bottom: 10px;
    overflow: hidden;
}
.video-card .thumb img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0.8; transition: opacity 0.3s;
}
.video-card:hover .thumb img { opacity: 1; transform: scale(1.05); }
.video-card .thumb::after {
    content: '▶'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); color: #fff;
    font-size: 24px; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.video-card .title { font-size: 14px; font-weight: 700; line-height: 1.4; }

/* === 2. List Page UI === */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #222;
}
.list-title { font-size: 24px; font-weight: 800; }
.search-box {
    display: flex;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 20px;
}
.search-box input { outline: none; width: 150px; font-size: 14px; }
.article-list-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}
.article-list-item .thumb {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
}
.article-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-list-item .info { flex: 1; }
.article-list-item .title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}
.article-list-item .desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
}
.pagination button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* === 3. View Page UI === */
.article-view-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.article-view-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -1px;
    margin-bottom: 15px;
}
.article-view-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: var(--text-light);
}

.article-view-body {
    font-size: 17px;
    color: #333;
    letter-spacing: -0.2px;
}
.article-view-body img {
    margin: 30px auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
}
.article-view-body p {
/*    margin-bottom: 20px;*/
}

.article-tools {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}
.tool-btn {
    padding: 8px 15px;
    border: 1px solid #ccc;
    font-size: 13px;
    color: #555;
    background: #f9f9f9;
}
.tool-btn:hover { background: #eee; }

.ad_text_pic_B {
    margin-top: 40px;
    background: #fafafa;
    padding: 20px;
    border: 1px solid #eee;
}
.ad_text_pic_B h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #111;
}
.ad_text_pic_B ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.ad_text_pic_B li a {
    display: flex;
    gap: 10px;
    align-items: center;
}
.ad_text_pic_B .thumb { width: 100px; height: 70px; background: #ddd; flex-shrink: 0; }
.ad_text_pic_B .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad_text_pic_B .tit { font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* === 4. About Page UI === */
.about-header {
    text-align: center;
    margin-bottom: 40px;
}
.about-header img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    margin-bottom: 20px;
}
.about-header h2 { font-size: 28px; font-weight: 800; }

.about-tabs {
    display: flex;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.about-tabs li {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    margin-right: 5px;
    transition: all 0.2s;
}
.about-tabs li.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.about-content-area {
    min-height: 400px;
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}
.about-panel { display: none; animation: fadeIn 0.3s; }
.about-panel.active { display: block; }
.about-panel h3 { font-size: 22px; margin-bottom: 15px; color: #111; }
.about-panel p, .about-panel ul { margin-bottom: 15px; }
.about-panel ul li { margin-bottom: 8px; list-style: disc; margin-left: 20px; }
.about-contact-box {
    background: #f4f6f8;
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    margin-top: 30px;
}

/* === Footer === */
.site-footer {
    background-color: #1a1a1a;
    color: #aaa;
    padding: 50px 0;
    font-size: 14px;
    margin-top: 50px;
}
.footer-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 25px;
    flex-wrap: wrap;
}
.footer-nav a {
    color: #fff;
    font-weight: 600;
}
.footer-info-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}
.footer-company-details {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    line-height: 1.6;
}
.footer-company-details strong {
    color: #ccc;
    font-weight: 500;
}
.footer-contact {
    flex: 1;
    border-left: 1px solid #333;
    padding-left: 40px;
}
.footer-contact h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
}
.copyright {
    margin-top: 30px;
    font-size: 13px;
    color: #666;
    width: 100%;
}

/* === Responsive === */
@media (max-width: 1024px) {
    
    
    .container { padding: 0 20px; }
    .content-wrapper { flex-direction: column; padding: 20px; }
    .main-content { width: 100%; } /* 추가: 모바일에서 가로폭을 100%로 복구 */
    .aside.view-sidebar { width: 100%; }
    .top-news-layout { flex-direction: column; }
    .top-news-secondary { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .secondary-item { border-bottom: none; border-right: 1px solid var(--border-color); padding: 0 15px 0 0; }
    .secondary-item:nth-child(even), .secondary-item:last-child { border-right: none; padding-right: 0; }
    .footer-info-wrap {flex-direction: column;}
}
@media (max-width: 768px) {
    .category-grid, .video-grid { grid-template-columns: 1fr; }
    .top-news-secondary { grid-template-columns: 1fr; }
    .secondary-item { border-right: none; border-bottom: 1px solid var(--border-color); padding: 15px 0; }
    .footer-company-details { grid-template-columns: 1fr; }
    .footer-contact { border-left: none; padding-left: 0; margin-top: 20px; }
    .article-list-item { flex-direction: column; }
    .article-list-item .thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
    .ad_text_pic_B ul { grid-template-columns: 1fr; }
    .about-tabs li { width: 100%; margin-right: 0; text-align: center; border-bottom: 1px solid #ddd; }
    .about-tabs li.active { border-bottom: 1px solid var(--primary-color); }
}



    /* 기본 광고 배너 */
    .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}

