/* 반응형 디자인 */

/* 대형 화면 (1400px 이하) - 좌우 배너 숨김 */
@media screen and (max-width: 1400px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .left-banner,
    .right-banner {
        display: none;
    }
    
    .main-section {
        max-width: 900px;
        margin: 0 auto;
    }
}

/* 태블릿 (1024px 이하) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 20px 0;  /* 정적 헤더이므로 여백 감소 */
    }
    
    .headline-article .article-link {
        grid-template-columns: 300px 1fr;
    }
    
    .article-image img {
        height: 200px;
    }
    
    .main-section {
        max-width: 100%;
    }
}

/* 모바일 (768px 이하) */
@media screen and (max-width: 768px) {
    /* 컨테이너 패딩 조정 */
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 20px 0;  /* 정적 헤더 */
    }
    
    /* 헤더 모바일 */
    .header-top .container {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }
    
    .header-main .container {
        padding: 10px;
    }
    
    .search-box {
        display: none;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .logo-sub {
        font-size: 14px;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    /* 네비게이션 모바일 */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        background: white;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        transition: right 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        display: block !important;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 0;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link {
        color: var(--text-color);
        padding: 15px 20px;
        display: block;
        font-size: 16px;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--bg-gray);
        color: var(--primary-color);
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        background: var(--bg-gray);
        box-shadow: none;
        padding: 0;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding-left: 40px;
        color: var(--text-color);
        border-bottom: 1px solid var(--border-color);
        font-size: 14px;
    }
    
    .dropdown-menu a:hover {
        background: white;
        color: var(--primary-color);
    }
    
    /* 헤드라인 모바일 */
    .headline-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .headline-article .article-link {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .article-image img {
        height: 200px;
        width: 100%;
    }
    
    .article-title {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .article-summary {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .headline-sub {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sub-headline {
        padding: 10px;
    }
    
    .sub-headline h3 {
        font-size: 13px;
    }
    
    /* 뉴스 리스트 모바일 */
    .news-board {
        margin-bottom: 20px;
    }
    
    .section-header {
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .news-link {
        grid-template-columns: 80px 1fr;
        gap: 12px;
        padding: 12px 0;
    }
    
    .news-thumb {
        border-radius: 4px;
        overflow: hidden;
    }
    
    .news-thumb img {
        height: 60px;
        width: 80px;
        object-fit: cover;
    }
    
    .news-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 5px;
    }
    
    .news-summary {
        display: none;
    }
    
    .news-meta {
        gap: 10px;
        font-size: 11px;
    }
    
    .news-category {
        font-size: 11px;
    }
    
    /* 배너 영역 모바일 */
    .news-top-banner {
        margin-bottom: 20px;
    }
    
    .news-top-banner .banner-wrapper {
        max-width: 100%;
    }
    
    .middle-banner-ad {
        margin: 20px 0;
    }
    
    .middle-banner-ad .banner-content {
        height: 80px;
    }
    
    /* 페이지네이션 모바일 */
    .pagination {
        gap: 3px;
        margin-top: 20px;
    }
    
    .page-btn,
    .page-num {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    /* 푸터 모바일 */
    .company-info p {
        font-size: 12px;
    }
}

/* 소형 모바일 (480px 이하) */
@media screen and (max-width: 480px) {
    /* 헤더는 정적으로 유지 */
    .main-header {
        position: relative;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .logo-sub {
        font-size: 12px;
    }
    
    .header-top {
        padding: 5px 0;
    }
    
    .social-links {
        gap: 8px;
    }
    
    .social-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .main-content {
        padding: 20px 0;  /* 정적 헤더 */
    }
    
    .article-image img {
        height: 180px;
    }
    
    .article-title {
        font-size: 18px;
    }
    
    .article-summary {
        font-size: 13px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .news-link {
        grid-template-columns: 70px 1fr;
        gap: 10px;
        padding: 10px 0;
    }
    
    .news-thumb img {
        height: 50px;
        width: 70px;
    }
    
    .news-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box;
        overflow: hidden;
    }
    
    .news-meta {
        font-size: 10px;
        flex-wrap: wrap;
    }
    
    .pagination {
        gap: 2px;
    }
    
    .page-btn,
    .page-num {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    /* 배너 크기 조정 */
    .banner-wrapper img {
        max-height: 60px;
    }
    
    /* 푸터 폰트 크기 */
    .footer-content {
        padding: 20px 10px;
    }
    
    .company-info p {
        font-size: 11px;
        line-height: 1.6;
    }
    
    .footer-links a {
        font-size: 12px;
        margin: 0 5px;
    }
}

/* 모바일 메뉴 오버레이 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* 모바일 메뉴 닫기 버튼 */
.mobile-close-btn {
    display: none;
}

/* 모바일 메뉴 헤더 (추가) */
@media screen and (max-width: 768px) {
    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-color);
        cursor: pointer;
        z-index: 10;
        padding: 5px;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.3s;
    }
    
    .mobile-close-btn:hover {
        background: var(--bg-gray);
    }
    
    .main-nav::before {
        content: '메뉴';
        display: block;
        padding: 20px;
        background: var(--primary-color);
        color: white;
        font-size: 18px;
        font-weight: bold;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* 중간 배너 모바일 */
    .middle-banner-ad .banner-content {
        height: 100px;
        font-size: 16px;
    }
    
    /* 오버레이 팝업 모바일 */
    .overlay-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .overlay-ad img {
        height: 350px;
    }
    
    .overlay-ad-text {
        font-size: 28px;
        padding: 15px 30px;
    }
}

/* 프린트 스타일 */
@media print {
    .header-top,
    .main-nav,
    .sidebar,
    .footer-links,
    .mobile-menu-btn,
    .search-box,
    .ad-popup,
    .top-banner-ad,
    .pagination {
        display: none !important;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    .main-footer {
        background: none;
        color: black;
        border-top: 1px solid #000;
    }
    
    .news-item {
        page-break-inside: avoid;
    }
}