/* === Reset & Base === */
:root {
    --primary-color: #0b3a72; /* 짙은 파란색 계열 */
    --primary-hover: #082a52;
    --text-dark: #222;
    --text-gray: #666;
    --border-color: #e5e5e5;
    --bg-light: #f9f9f9;
    --font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    --content-width: 1280px; /* MSN 스타일을 위해 가로폭 확장 */
    --sidebar-width: 320px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); color: var(--text-dark); line-height: 1.6; background-color: #f4f4f4; }
a { text-decoration: none; color: inherit; cursor: pointer; }
a:hover { color: var(--primary-color); }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* === Utility === */
.ir { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-10 { margin-top: 10px; }
.text-sm { font-size: 14px; }
.text-blue { color: blue; }
.highlight-link { color: var(--primary-color); }
.text-primary { color: var(--primary-color) !important; }

.container { max-width: var(--content-width); margin: 0 auto; padding: 0 15px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* === Header === */
.site-header { background-color: #fff; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }

.logo a { font-size: 28px; font-weight: 900; color: var(--primary-color); letter-spacing: -1px; }
.logo a span { color: #333; }
.logo a img { height: 100%; max-height: 60px }

.search-form { display: flex; background-color: #f0f0f0; border-radius: 20px; overflow: hidden; padding: 2px 15px; width: 400px; }
.search-input { padding: 8px 0; border: none; background: transparent; width: 100%; outline: none; font-size: 15px; }
.search-button { padding: 0 10px; font-weight: bold; color: #555; }

/* === Navigation === */
.main-nav { background-color: #fff; border-top: 1px solid var(--border-color); }
.nav-list { display: flex; max-width: var(--content-width); margin: 0 auto; padding: 0 15px; flex-wrap: nowrap; overflow-x: auto; gap: 20px; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-item a { display: block; padding: 12px 0; color: #555; font-weight: 600; font-size: 15px; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav-item a:hover, .nav-item.active a { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }

/* === Layout === */
.content-wrapper { display: flex; justify-content: space-between; padding: 20px 0; gap: 30px; }
.main-content { flex: 1; min-width: 0; }
.aside-sidebar { width: var(--sidebar-width); flex-shrink: 0; background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* === SPA Views === */
.page-view { display: none; }
.page-view.active { display: block; }
.view-sidebar { display: none; }

/* === MSN Style Main Grid === */
.msn-category-pills { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; }
.msn-pill { padding: 6px 16px; background-color: #fff; border: 1px solid #ddd; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.msn-pill:hover, .msn-pill.active { background-color: #eef3f8; color: var(--primary-color); border-color: var(--primary-color); }

.msn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; grid-auto-flow: dense; }

.msn-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; position: relative; }
.msn-card:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); }
.msn-card-img-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #eee; overflow: hidden; }
.msn-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.msn-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; background: rgba(0,0,0,0.6); border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; padding-left: 4px; }

.msn-card-body { padding: 12px 16px 6px; display: flex; flex-direction: column; flex: 1; }
.msn-publisher { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: bold; color: #555; margin-bottom: 8px; }
.msn-publisher-icon { width: 16px; height: 16px; border-radius: 50%; background: #ccc; display: inline-block; }

/* Icon Colors */
.icon-primary { background: var(--primary-color); }
.icon-red { background: #e74c3c; }
.icon-green { background: #2ecc71; }

.msn-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; color: #222; display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden; }
.msn-title-large { font-size: 20px; }
.msn-summary { font-size: 14px; color: #666; margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.msn-summary4 { font-size: 14px; color: #666; margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.msn-card-footer { margin-top: auto; display: flex; justify-content: flex-end; align-items: center; border-top: 1px solid #f0f0f0; padding-top: 8px; font-size: 12px; color: #888; }

/* Card Variations */
.msn-card.span-2-col { grid-column: span 2; }
.msn-card.span-2-row { grid-row: span 2; }
.msn-card-img-wrap2 { aspect-ratio: 1/1; }
.msn-card-img-wrap2 img { height: 100%;}

.msn-card.text-only .msn-card-img-wrap { display: none; }
.msn-card.text-only .msn-title { font-size: 21px; }

.msn-card.span-2-col .msn-title { font-size: 30px; }

/* Widget / Ad Card */
.msn-ad-card { background: #fdfdfd; border: 1px solid #eaeaea; text-align: center; justify-content: center; align-items: center; }
.msn-ad-label { position:absolute; top:8px; right:8px; background:rgba(0,0,0,0.5); color:#fff; font-size:10px; padding:2px 6px; border-radius:4px; z-index: 10; }
.msn-ad-link { display: block; width: 100%; height: 100%; }
.msn-ad-img { width: 100%; height: 100%; object-fit: cover; }

/* Weather Card */
.msn-weather-card { background: linear-gradient(to bottom, #4a90e2, #2c3e50); color: #fff; }
.msn-weather-body { justify-content: center; align-items: center; text-align: center; }
.msn-weather-title { font-size: 18px; margin-bottom: 10px; }
.msn-weather-temp { font-size: 42px; font-weight: bold; margin-bottom: 10px; }
.msn-weather-footer { display: flex; justify-content: space-between; width: 100%; margin-top: 20px; font-size: 14px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 10px; }

/* === Components === */
.section-title { font-size: 20px; font-weight: bold; border-bottom: 2px solid #222; padding-bottom: 10px; margin-bottom: 20px; }

/* === List View === */
.news-list-container { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.news-list-card { display: flex; gap: 20px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.news-list-card:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.news-list-img { flex-shrink: 0; width: 220px; height: 140px; border-radius: 8px; overflow: hidden; background: #eee; }
.news-list-img img { width: 100%; height: 100%; object-fit: cover; }
.news-list-content { display: flex; flex-direction: column; justify-content: center; }
.news-list-title { font-size: 20px; font-weight: bold; margin-bottom: 10px; line-height: 1.4; }
.news-list-summary { font-size: 15px; color: var(--text-gray); margin-bottom: 10px; }
.news-list-meta { font-size: 13px; color: #999; }
.news-more-wrap { text-align: center; padding: 20px 0 0 0; }
.news-more-btn { padding: 10px 30px; background: #fff; border: 1px solid #ddd; border-radius: 20px; font-weight: bold; }

/* === Sidebar Widgets === */
.widget { margin-bottom: 30px; }
.widget-title { font-size: 16px; font-weight: bold; border-left: 4px solid var(--primary-color); padding-left: 10px; margin-bottom: 15px; }
.list-news li { border-bottom: 1px dashed var(--border-color); padding: 10px 0; }
.list-news li:last-child { border-bottom: none; }
.list-news a { font-size: 15px; display: block; line-height: 1.4;     display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;}
.list-news-numbered { list-style-type: decimal; padding-left: 20px; }

.ad-banner { background-color: #f1f1f1; padding: 40px 20px; text-align: center; color: #888; border: 1px solid #ddd; margin-bottom: 20px; }
.text-ad-list li { margin-bottom: 8px; }
.text-ad-list a { display: block; padding: 10px; background-color: var(--bg-light); font-size: 14px; font-weight: bold; color: #333; }
.text-ad-list a:hover { text-decoration: underline; }

/* === View Page (Article) === */
.article-container { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.article-header { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.article-category { color: var(--primary-color); font-weight: bold; margin-bottom: 10px; display: block; font-size: 14px; }
.article-title { font-size: 32px; line-height: 1.3; margin-bottom: 15px; }
.article-info { font-size: 14px; color: var(--text-gray); display: flex; justify-content: space-between; }

.article-body { font-size: 17px; line-height: 1.8; color: #333; margin-bottom: 40px; }
.article-body img {max-width: 100%; height: auto; border-radius: 8px; margin: auto; margin-bottom: 20px; display: block; }
.article-body p { margin-bottom: 15px; }

.article-hero-wrap { text-align: center; margin-bottom: 20px; }
.article-hero-img { width: 100%; border-radius: 8px; display: inline-block; }
.article-caption { text-align: center; font-size: 12px; color: #888; margin-bottom: 30px; }
.article-chart-wrap { text-align: center; margin: 30px 0; }
.article-chart-img { width: 80%; max-width: 600px; border-radius: 8px; display: inline-block; }

.article-share-wrap { padding: 20px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); text-align: center; margin-bottom: 30px; }
.article-share-label { margin-right: 15px; font-weight: bold; }
.article-share-btn { padding: 8px 15px; border: 1px solid #ddd; background: #f9f9f9; border-radius: 20px; margin-right: 5px; }
.article-share-btn:last-child { margin-right: 0; }

.ad-horizontal-banner { text-align: center; margin: 20px 0; }
.ad-horizontal-banner img { max-width: 100%; display: inline-block; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* === About Page === */
.about-container { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.about-tabs { display: flex; border-bottom: 2px solid var(--primary-color); margin-bottom: 30px; flex-wrap: wrap; }
.tab-btn { padding: 15px 25px; font-size: 16px; font-weight: bold; color: var(--text-gray); background: #f5f5f5; border: 1px solid var(--border-color); border-bottom: none; margin-right: 5px; border-radius: 5px 5px 0 0; }
.tab-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

.tab-content { display: none; line-height: 1.8; font-size: 15px; padding: 20px; background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 0 5px 5px 5px; }
.tab-content.active { display: block; }
.tab-content h3 { font-size: 20px; margin-bottom: 15px; color: var(--primary-color); }
.policy-box { background: #fff; padding: 20px; border: 1px solid #ddd; margin-top: 15px; border-radius: 8px; }
.policy-list { list-style-type: disc; margin-left: 20px; }

/* === Footer === */
.site-footer { background-color: #fff; border-top: 1px solid var(--border-color); padding: 40px 0; margin-top: 50px; font-size: 14px; color: var(--text-gray); }
.footer-links { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; font-weight: bold; }
.footer-info { display: flex; flex-wrap: wrap; gap: 15px; line-height: 1.6; }
.footer-info span { position: relative; }
.footer-info span:not(:last-child)::after { content: '|'; margin-left: 15px; color: #ccc; }
.footer-bottom { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eaeaea; display: flex; justify-content: space-between; }
.footer-logo { font-size: 24px; font-weight: 900; color: #333; margin-bottom: 10px; }
.footer-logo img { height: 34px; }

/* === Responsive === */
@media (max-width: 1200px) {
    .msn-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
    .content-wrapper { flex-direction: column; }
    .aside-sidebar { width: 100%;
    background:transparent; box-shadow: 0;
    
    
    
    } /* 모바일에서는 사이드바 일단 숨김 */
    .msn-grid { grid-template-columns: repeat(2, 1fr); }
    .msn-card.span-2-col { grid-column: span 1; }
}
@media (max-width: 768px) {
    .header-top { gap: 15px; padding: 15px; }
    .search-form { width: 100%; }
    .msn-grid { grid-template-columns: 1fr; padding:0 15px;}
    .article-title { font-size: 24px; }
    .news-list-container, .article-container { padding: 20px; margin: 0 10px;  }
    .tab-btn { width: 100%; margin-right: 0; margin-bottom: 2px; border-radius: 0; }
    .footer-info span:not(:last-child)::after { content: none; }
    .footer-info span { display: block; width: 100%; }
    
    .footer-bottom {display: flex;justify-content: space-between;flex-direction: column;align-items: center;}

    
    .news-list-card { flex-direction: column; }
    .news-list-img { width: 100%; height: auto; aspect-ratio: 16/9; }
    .msn-card.span-2-col .msn-title {
        font-size: 21px; }
    
    
    
}

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