/* ==========================================================================
   Reset & Base
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', '돋움', dotum, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}
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 { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}
.content-wrapper {
    display: flex;
    gap: 30px;
    padding: 20px 0;
}
.main-content {
    flex: 1;
    width: 0; /* flex 버그 방지 */
    background-color: #fff;
    /* padding: 20px; */
    /* border: 1px solid #e2e4e8; */
    /* box-shadow: 0 1px 3px rgba(0,0,0,0.02); */
}
.aside.view-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header-top {
    background-color: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
    font-size: 12px;
    padding: 5px 0;
}
.stock-ticker-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.stock-ticker-wrap::-webkit-scrollbar {
    display: none;
}


/* 증시 텍스트 색상 (한국 기준: 상승 빨강, 하락 파랑) */
.stock-ticker {
    display: flex;
    gap: 15px;
    font-size: 14px;
    align-items: center;
}
.stock-up {
    color: #e22926; /* 빨강 */
}
.stock-down {
    color: #1760cc; /* 파랑 */
}

/* 날씨 영역 스타일 */
.weather-area {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
}
.weather-text strong {
    font-weight: bold;
    color: #333;
}

        .weather-icon {
            font-size: 48px;
            line-height: 1;
        }



.header-main {
    background-color: #fff;
    padding: 10px 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1080px;
    margin: 0 auto;
}

        .weather-icon {
            font-size: 48px;
            line-height: 1;
        }
.site-logo {
    display: block;
    width: 180px;
    justify-self: center;
}
.site-logo img {
    width: 100%;
    height: auto;
}
.search-area {
    display: flex;
    border: 2px solid #4CAFCD;
    border-radius: 4px;
    overflow: hidden;
    justify-self: end;
}
.search-input {
    border: none;
    padding: 10px 15px;
    width: 250px;
    outline: none;
}
.search-btn {
    background-color: #4CAFCD;
    color: #fff;
    padding: 0 15px;
    font-weight: bold;
}

.gnb-nav {
    background-color: #fff;
    border-top: 1px solid #ebebeb;
    border-bottom: 2px solid #4caecd;
}
.gnb-nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.gnb-nav-inner::-webkit-scrollbar {
    display: none;
}
.gnb-list {
    display: flex;
    white-space: nowrap;
}
.gnb-link {
    display: block;
    padding: 15px 22px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
.gnb-link:hover, .gnb-link.active {
    color: #4CAFCD;
    text-decoration: none;
}

/* ==========================================================================
   Components
   ========================================================================== */
.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4caecd;
    color: #222;
    margin-top: 30px;
}
.section-title:first-child {
    margin-top: 0;
}

/* 메인 페이지 - 헤드라인 */
.headline-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}
.headline-main {
    flex: 2;
}
.headline-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #eee;
    object-fit: cover;
    margin-bottom: 10px;
}
.headline-title {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 10px;
}
.headline-desc {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.headline-sub {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.sub-news-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.sub-news-item:last-child { border-bottom: none; }
.sub-news-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 메인 페이지 - 카드 섹션 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.card-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.news-card {
    /* border: 2px solid #e2e4e8; */
    background: #fff;
    display: flex;
    flex-direction: column;
}
.news-card-thumb {
    aspect-ratio: 16 / 9;
    background-color: #ccc;
    position: relative;
    overflow: hidden;
}
.news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.news-card:hover .news-card-thumb img {
    transform: scale(1.05);
}
.news-card-thumb.youtube::after {
    content: "▶";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
}
.news-card-body {
    padding: 15px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.news-card-title {
    font-size: 15px;
    font-weight: bold;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* 리스트 페이지 및 일반 리스트 섹션 */
.article-list {
    margin-bottom: 30px;
}
.article-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}
.article-item.compact {
    padding: 15px 0;
}
.article-thumb {
    width: 160px;
    height: 100px;
    background-color: #e5e5e5;
    flex-shrink: 0;
    object-fit: cover;
}
.article-info {
    flex: 1;
    min-width: 0; 
}
.article-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compact .article-title {
    font-size: 15px;
    margin-bottom: 5px;
}
.article-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-meta {
    font-size: 12px;
    color: #999;
}
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
}
.page-link {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
}
.page-link.active {
    background-color: #4CAFCD;
    color: #fff;
    border-color: #4CAFCD;
}

/* 뷰(상세) 페이지 */
.article-view-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.article-view-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.4;
    color: #111;
    margin-bottom: 15px;
    word-break: keep-all;
}
.article-view-meta {
    font-size: 13px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.article-view-body {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}
.article-view-body img {
    margin: 20px auto;
    max-width: 100%;
    height: auto;
}
.article-tools {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px dashed #ddd;
    border-bottom: 1px dashed #ddd;
    display: flex;
    gap: 10px;
}
.tool-btn {
    border: 1px solid #ccc;
    padding: 8px 15px;
    background: #fff;
    border-radius: 3px;
}

/* 사이드바 & 광고 */
.sidebar-widget {
    background-color: #fff;
    border: 1px solid #e2e4e8;
    padding: 20px;
    margin-bottom: 20px;
}
.widget-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #222;
}
.ranking-list li {
    margin-bottom: 10px;
    counter-increment: ranking;
    display: flex;
    align-items: flex-start;
}
.ranking-list li::before {
    content: counter(ranking);
    display: inline-block;
    width: 20px;
    color: #4CAFCD;
    font-weight: bold;
    flex-shrink: 0;
}
.ranking-list a {
    flex: 1;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.ad-banner {
    position: relative;
    width: 100%;
    background-color: #eaeaea;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}
.ad-banner img {
    width: 100%;
    display: block;
}
.ad-label {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    z-index: 10;
}

/* About (매체소개) 페이지 */
.about-wrap {
/*
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e4e8;
*/
}
.tab-menu {
    display: flex;
    border-bottom: #4caecd;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}
.tab-item {
    flex: 1;
    text-align: center;
    min-width: 100px;
}
.tab-link {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    font-weight: bold;
    color: #666;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    /* border-bottom: none; */
    margin-right: -1px;
    width: 100%;
    border-radius: 20px;
}
.tab-link.active {
    background-color: #4CAFCD;
    color: #fff;
    border-color: #4CAFCD;
}
.tab-content-area {
    display: none;
    line-height: 1.8;
    font-size: 15px;
    padding: 30px;
    border: #ededed dashed 1px;
    border-radius: 20px;

    
}
.tab-content-area.active {
    display: block;
}
.tab-content-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #111;
}
.contact-box {
    background: #f5f6f8;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
    word-break: break-all;
}
.contact-box a {
    color: #4CAFCD;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-wrap {
    background-color: #f9f9f9;
    border-top: 1px solid #e5e5e5;
    padding: 40px 0;
    margin-top: 40px;
    color: #666;
    font-size: 13px;
}
.footer-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-weight: bold;
    color: #333;
    flex-wrap: wrap;
}
.footer-info-grid {
    display: grid;
/*    grid-template-columns: repeat(2, 1fr);*/
    gap: 15px;
    line-height: 1.6;
}
.footer-copyright {
    margin-top: 20px;
    color: #999;
}

/* ==========================================================================
   Responsive Design (Mobile / Tablet)
   ========================================================================== */
@media (max-width: 1080px) {
    .content-wrapper { flex-direction: column; }
    .aside.view-sidebar { width: 100%; }
    .headline-section { flex-direction: column; }
    .headline-thumb { height: auto; }
    
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid-4 { grid-template-columns: repeat(3, 1fr); }
    .tab-link { margin-bottom: -1px; }
}

@media (max-width: 768px) {
    /* 1. 기본 레이아웃 & 컨테이너 최적화 (모바일 꽉 차게) */
    .container { padding: 0; }
    .header-top .container, .gnb-nav .container { padding: 0 15px; } 
    .content-wrapper { padding: 10px 0; gap: 0; }
    .main-content { width: auto; padding: 0; border: none; box-shadow: none; background: transparent; }
    
    /* 2. 헤더 재배치: [로고] [날씨] / [ 검색창 ] */
    .header-main { 
        display: flex;
        flex-wrap: wrap; 
        justify-content: space-between;
        align-items: center; 
        padding: 15px; 
    }
    .site-logo { order: 1; width: 130px; justify-self: flex-start; }
    .weather-area {         flex-direction: row;
        column-gap: 10px; order: 2; width: auto; font-size: 13px; justify-content: flex-end; }
    .weather-icon { font-size: 24px}
    
    
    .search-area { order: 3; width: 100%; margin-top: 15px; }
    .search-input { width: 100%; flex: 1; }
    
    /* 3. 섹션 타이틀 및 여백 */
    .section-title { font-size: 18px; margin-top: 25px; margin-bottom: 15px; padding: 0 15px 8px; border-bottom: 2px solid #4caecd; }
    .section-title:first-child { margin-top: 10px; }
    
    /* 4. 메인 헤드라인 */
    .headline-section { flex-direction: column; padding: 0 15px; gap: 15px; margin-bottom: 25px; }
    .headline-title { font-size: 20px; }
    .headline-desc { font-size: 14px; -webkit-line-clamp: 2; }
    .sub-news-title { font-size: 15px; }

    /* 5. 카드 그리드 최적화 (가로 2단, 세로 1단) */
    .card-grid { grid-template-columns: 1fr; padding: 0 15px; gap: 15px; }
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 15px; }
    .card-grid-4 .news-card-title { font-size: 13px; -webkit-line-clamp: 2; }
    .card-grid-4 .news-card-body { padding: 10px; }
    
    /* 6. 일반 리스트 (좌우 배치 유지, 요약 숨김으로 가독성 극대화) */
    .article-list { padding: 0 15px; margin-bottom: 25px; }
    .article-item { gap: 12px; padding: 15px 0; border-bottom: 1px solid #eee; flex-direction: row; align-items: stretch; }
    .article-thumb { width: 110px; height: 75px; flex-shrink: 0; }
    .article-info { display: flex; flex-direction: column; justify-content: center; }
    .article-title { font-size: 15px; margin-bottom: 4px; white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; line-height: 1.3; }
    .article-desc { display: none; } /* 모바일에서는 내용 요약 텍스트 숨김 처리 */
    .article-meta { font-size: 11px; margin-top: auto; }
    
    /* 7. 기사 상세 뷰 */
    .article-view-header { padding: 15px; margin-bottom: 15px; border-bottom: 1px solid #eee; }
    .article-view-title { font-size: 22px; line-height: 1.4; word-break: keep-all; }
    .article-view-meta { flex-direction: column; gap: 5px; font-size: 12px; color: #888; }
    .article-view-body { padding: 0 15px; font-size: 16px; line-height: 1.7; word-break: break-all; }
    .article-tools { margin: 25px 15px 0; padding-top: 15px; flex-wrap: wrap; gap: 5px; }
    .tool-btn { flex: 1; text-align: center; font-size: 13px; padding: 10px 5px; background: #f9f9f9; border-color: #ddd; }

    /* 8. 탭 / 매체소개 */
    .about-wrap { padding: 0; border: none; }
    .tab-menu { padding: 0 15px; margin-bottom: 20px; }
    .tab-item { flex: 1 1 33.33%; min-width: auto; }
    .tab-link { font-size: 13px; padding: 10px 0; }
    .tab-content-area { padding: 15px; margin: 15px }
    .tab-content-title { font-size: 18px; }
    .contact-box { font-size: 13px; padding: 15px; }

    /* 9. 사이드바 영역 (모바일 하단 배치) */
    .aside.view-sidebar { padding: 20px 15px; background: #f5f6f8; margin-top: 20px; }
    .sidebar-widget { padding: 15px; border-radius: 6px; border: 1px solid #e2e4e8; background: #fff; margin-bottom: 15px;}
    .ad-banner { margin-bottom: 15px; }

    /* 10. 푸터 (다크 테마 적용) */
    .footer-wrap { padding: 30px 15px; margin-top: 0; background: #222; color: #aaa; border-top: none; }
    .footer-nav { gap: 10px; justify-content: center; margin-bottom: 25px; }
    .footer-nav a { color: #ddd; font-weight: normal; font-size: 13px; }
    .footer-info-grid { grid-template-columns: 1fr; gap: 10px; text-align: center; font-size: 12px; }
    .footer-copyright { text-align: center; font-size: 11px; color: #777; margin-top: 20px; }
}