/* ============================================
   Responsive Styles - KalhorNews (IRNA Style)
   ============================================ */

/* Large Desktop */
@media (max-width: 1200px) {
    .container { max-width: 960px; }
    .home-sidebar { width: 260px; }
    .headline-main-image { min-height: 240px; }
    .headline-main-content { width: 280px; padding: 15px; }
    .headline-main-title { font-size: 17px; }
    .cat-section-featured { width: 240px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .related-posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet Landscape */
@media (max-width: 992px) {
    .container { max-width: 720px; }

    .home-wrap { flex-direction: column; }
    .home-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .home-sidebar .widget { margin-bottom: 0; }

    .single-wrap { flex-direction: column; }

    .headline-main { flex-direction: column; }
    .headline-main-image { width: 100%; min-height: 220px; position: relative; }
    .headline-main-image img { position: relative; }
    .headline-main-content { width: 100%; }

    .cat-section-body { flex-direction: column; }
    .cat-section-featured { width: 100%; display: flex; gap: 12px; align-items: flex-start; }
    .cat-section-featured img { width: 280px; flex-shrink: 0; }
    .cat-section-featured-title { margin-top: 0; }

    .header-date { display: none; }
    .header-search-form input { width: 130px; }

    .single-article { padding: 18px 20px; }
    .single-title { font-size: 20px; }
    .related-posts-grid { grid-template-columns: repeat(3, 1fr); }

    .footer-grid { grid-template-columns: 1fr 1fr; }
    .error-code { font-size: 80px; }
}

/* Tablet Portrait & Mobile */
@media (max-width: 768px) {
    .container { max-width: 100%; padding: 0 12px; }
    .home-wrap { gap: 12px; }

    .top-bar-left { display: none; }
    .top-bar-inner { justify-content: center; }
    .header-main-inner { padding: 10px 0; }
    .header-search-form { display: none; }
    .header-left { gap: 0; }

    .menu-toggle { display: flex; }

    .primary-menu {
        display: none;
        flex-direction: column;
        position: absolute; top: 100%; right: 0; left: 0;
        background: var(--kn-blue);
        box-shadow: 0 4px 16px rgba(0,0,0,0.2);
        z-index: 1000; padding: 0;
    }
    .primary-menu.active { display: flex; }
    .primary-menu > li > a {
        height: auto; padding: 10px 16px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .primary-menu .sub-menu {
        position: static; opacity: 1; visibility: visible;
        transform: none; box-shadow: none;
        background: rgba(0,0,0,0.2); display: none; padding: 0;
    }
    .primary-menu .sub-menu.active { display: block; }
    .primary-menu .sub-menu .sub-menu { right: 0; }
    .sub-menu-toggle { display: flex !important; }
    .nav-bar { position: relative; }
    .main-navigation { position: relative; }

    .headline-main-image { min-height: 200px; }
    .headline-main-title { font-size: 16px; }
    .headline-main-summary { display: none; }

    .cat-section-featured { flex-direction: column; }
    .cat-section-featured img { width: 100%; }
    .cat-section-featured-title { margin-top: 6px; }

    .cat-section-list-item img { width: 60px; }
    .cat-section-list-title { font-size: 11px; }

    .home-sidebar { grid-template-columns: 1fr; }

    .latest-item-image { width: 90px; }
    .latest-item-title { font-size: 12px; }
    .latest-item-summary { display: none; }

    .single-article { padding: 14px 15px; }
    .single-title { font-size: 18px; }
    .single-meta { font-size: 11px; gap: 8px; flex-wrap: wrap; }

    .post-nav .nav-links { flex-direction: column; }
    .related-posts-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .related-post-title { font-size: 10px; }

    .footer-grid { grid-template-columns: 1fr; }
    .footer-bar-inner { flex-direction: column; text-align: center; }
    .footer-menu-list { justify-content: center; }

    .archive-main { flex-direction: column; }
    .archive-item-image { width: 90px; }
    .archive-item-title { font-size: 12px; }

    .error-code { font-size: 60px; }
    .error-title { font-size: 18px; }
    .error-actions { flex-direction: column; align-items: center; }

    #scroll-to-top { bottom: 15px; left: 15px; width: 36px; height: 36px; }
}

/* Small Phones */
@media (max-width: 576px) {
    .container { padding: 0 10px; }

    .headline-main-image { min-height: 180px; }
    .headline-main-title { font-size: 14px; }
    .headline-side-item { padding: 8px 10px; }
    .headline-side-number { width: 18px; height: 18px; font-size: 10px; }
    .headline-side-title { font-size: 11px; }

    .cat-section-header { padding: 6px 10px; }
    .cat-section-title { font-size: 12px; }
    .cat-section-list-item { padding: 4px 10px; }
    .cat-section-list-item img { width: 50px; }
    .cat-section-list-title { font-size: 10px; }

    .latest-item { padding: 8px 10px; gap: 8px; }
    .latest-item-image { width: 70px; }
    .latest-item-title { font-size: 11px; }
    .latest-item-cat { font-size: 9px; padding: 1px 6px; }

    .single-article { padding: 10px 12px; }
    .single-title { font-size: 16px; }
    .single-meta { font-size: 10px; }

    .archive-item { padding: 8px 10px; }
    .archive-item-image { width: 70px; }

    .home-sidebar { grid-template-columns: 1fr; }
    .site-title { font-size: 20px; }
    .site-logo img { max-height: 45px; }
    .top-bar-right { font-size: 10px; }

    .page-numbers { min-width: 32px; height: 32px; font-size: 12px; }
    .error-code { font-size: 50px; }
    .related-posts-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
    .top-bar, .nav-bar, .breaking-news-bar,
    .home-sidebar, .sidebar, .footer-widgets,
    .single-share, .post-nav, .related-posts, .comments-wrap, #scroll-to-top {
        display: none !important;
    }
    .site-wrapper { box-shadow: none !important; max-width: 100% !important; }
    .headline-box, .cat-section, .latest-news-section, .single-article {
        box-shadow: none !important; border: none !important;
    }
    .container { max-width: 100% !important; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .ticker-track { animation: none !important; }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .kalhornews-theme {
        --kn-gray: #121212;
        --kn-white: #1e1e1e;
        --kn-gray-light: #252525;
        --kn-text: #e0e0e0;
        --kn-text-gray: #aaa;
        --kn-text-light: #777;
        --kn-gray-border: #333;
        --kn-shadow: 0 1px 3px rgba(0,0,0,0.3);
        --kn-shadow-hover: 0 3px 12px rgba(0,0,0,0.4);
    }
    .kalhornews-theme .headline-box,
    .kalhornews-theme .cat-section,
    .kalhornews-theme .latest-news-section,
    .kalhornews-theme .single-article,
    .kalhornews-theme .comments-wrap,
    .kalhornews-theme .archive-header,
    .kalhornews-theme .search-header,
    .kalhornews-theme .post-nav a,
    .kalhornews-theme .related-post-item,
    .kalhornews-theme .archive-item,
    .kalhornews-theme .home-sidebar .widget {
        background: #1e1e1e;
    }
    .kalhornews-theme .primary-menu .sub-menu { background: #333; }
    .kalhornews-theme .primary-menu .sub-menu a { color: #ddd; }
    .kalhornews-theme .single-tags a,
    .kalhornews-theme .tagcloud a,
    .kalhornews-theme .social-item {
        background: #333;
    }
    .kalhornews-theme .header-main { background: #1e1e1e; }
    .kalhornews-theme .breaking-news-bar { background: #1e1e1e; }
    .kalhornews-theme .latest-item-title a,
    .kalhornews-theme .home-sidebar .widget ul li a,
    .kalhornews-theme .cat-section-list-title a,
    .kalhornews-theme .cat-section-featured-title a,
    .kalhornews-theme .archive-item-title a {
        color: #ddd;
    }
}
