/* =====================================================
   NEWS WEBSITE - RESPONSIVE STYLESHEET
   Breakpoints:
   - Large Desktop : 1400px+
   - Desktop       : 1200px - 1399px
   - Laptop        : 992px  - 1199px
   - Tablet        : 768px  - 991px
   - Mobile L      : 576px  - 767px
   - Mobile S      : 320px  - 575px
   ===================================================== */

/* -----------------------------------------------------
   1. LARGE DESKTOP (1400px and up)
   ----------------------------------------------------- */
@media (min-width: 1400px) {
    :root {
        --container: 1320px;
    }

    .hero-main-content h2 {
        font-size: 2.1rem;
    }

    .article-title {
        font-size: 2.3rem;
    }

    .news-grid.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* -----------------------------------------------------
   2. DESKTOP (1200px - 1399px)
   ----------------------------------------------------- */
@media (max-width: 1399px) {
    :root {
        --container: 1140px;
    }

    .nav-menu > li > a {
        padding: 15px 13px;
        font-size: 13px;
    }
}

/* -----------------------------------------------------
   3. LAPTOP (992px - 1199px)
   ----------------------------------------------------- */
@media (max-width: 1199px) {
    :root {
        --container: 960px;
    }

    /* Typography */
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.55rem; }
    h3 { font-size: 1.25rem; }

    /* Header */
    .site-logo img {
        max-height: 60px;
    }

    .site-tagline {
        font-size: 11px;
    }

    /* Navigation */
    .nav-menu > li > a {
        padding: 14px 11px;
        font-size: 12.5px;
    }

    /* Hero */
    .hero-section {
        grid-template-columns: 1.6fr 1fr;
        gap: 18px;
    }

    .hero-main {
        min-height: 380px;
    }

    .hero-main-content {
        padding: 24px;
    }

    .hero-main-content h2 {
        font-size: 1.55rem;
    }

    .hero-side-item img {
        width: 95px;
        height: 80px;
    }

    .hero-side-item h4 {
        font-size: .88rem;
    }

    /* News grid */
    .news-grid.cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Article */
    .article-wrapper {
        grid-template-columns: 2fr 1fr;
        gap: 24px;
    }

    .article-title {
        font-size: 1.75rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1.8fr 1fr 1fr 1.4fr;
        gap: 24px;
    }
}

/* -----------------------------------------------------
   4. TABLET (768px - 991px)
   ----------------------------------------------------- */
@media (max-width: 991px) {
    :root {
        --container: 720px;
    }

    /* Typography */
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.15rem; }

    body {
        font-size: 14.5px;
    }

    /* Top bar */
    .top-bar .container {
        justify-content: center;
        text-align: center;
    }

    .top-bar-links {
        display: none;
    }

    /* Header */
    .site-header .container {
        flex-direction: column;
        gap: 12px;
    }

    .site-logo img {
        max-height: 55px;
    }

    .header-ad {
        max-width: 100%;
    }

    /* Navigation - Toggle for mobile */
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--secondary);
        flex-direction: column;
        padding-top: 60px;
        transition: left .35s ease;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, .3);
    }

    .nav-menu.open {
        left: 0;
    }

    .nav-menu > li > a {
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        font-size: 14px;
    }

    .nav-menu > li > a:hover,
    .nav-menu > li.active > a {
        background: var(--primary);
    }

    /* Dropdown on mobile */
    .nav-menu .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, .2);
        box-shadow: none;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }

    .nav-menu > li.open .dropdown {
        max-height: 500px;
    }

    .nav-menu .dropdown li a {
        color: #ccc;
        padding-left: 36px;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }

    /* Overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Breaking News */
    .breaking-label {
        padding: 10px 14px;
        font-size: 12px;
    }

    .breaking-ticker a {
        font-size: 13px;
    }

    /* Hero */
    .hero-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-main {
        min-height: 340px;
    }

    .hero-main-content h2 {
        font-size: 1.4rem;
    }

    .hero-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    /* News grid */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .news-grid.cols-3,
    .news-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Article */
    .article-wrapper {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-content {
        font-size: 1rem;
    }

    /* Sidebar */
    .sidebar {
        margin-top: 30px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    /* Section heading */
    .section-heading h2 {
        font-size: 1.25rem;
    }

    /* Pagination */
    .pagination a,
    .pagination span {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

/* -----------------------------------------------------
   5. MOBILE LARGE (576px - 767px)
   ----------------------------------------------------- */
@media (max-width: 767px) {
    :root {
        --container: 100%;
    }

    /* Typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }

    body {
        font-size: 14px;
    }

    .container {
        padding: 0 16px;
    }

    /* Top bar */
    .top-bar {
        font-size: 12px;
        padding: 6px 0;
    }

    .top-bar-date {
        font-size: 12px;
    }

    /* Header */
    .site-header {
        padding: 14px 0;
    }

    .site-logo img {
        max-height: 48px;
    }

    .site-logo-text {
        font-size: 1.5rem;
    }

    .site-tagline {
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    /* Navigation */
    .nav-menu {
        width: 260px;
    }

    /* Breaking News */
    .breaking-news .container {
        gap: 10px;
    }

    .breaking-label {
        padding: 10px 12px;
        font-size: 11px;
    }

    .breaking-label::after {
        right: -8px;
        border-left-width: 8px;
        border-top-width: 8px;
        border-bottom-width: 8px;
    }

    /* Section */
    .section {
        padding: 20px 0;
    }

    .section-heading {
        margin-bottom: 16px;
    }

    .section-heading h2 {
        font-size: 1.15rem;
        padding-left: 10px;
    }

    .section-heading h2::before {
        height: 20px;
        width: 4px;
    }

    .section-heading .view-all {
        font-size: 12px;
    }

    /* Hero */
    .hero-main {
        min-height: 260px;
        border-radius: var(--radius-sm);
    }

    .hero-main-content {
        padding: 18px;
    }

    .hero-main-content h2 {
        font-size: 1.2rem;
    }

    .hero-main-content .meta {
        font-size: 12px;
    }

    .hero-side {
        grid-template-columns: 1fr;
    }

    .hero-side-item img {
        width: 100px;
        height: 80px;
    }

    /* News grid */
    .news-grid,
    .news-grid.cols-2,
    .news-grid.cols-3,
    .news-grid.cols-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .news-card-title {
        font-size: 1rem;
    }

    /* Article */
    .article-wrapper {
        padding: 20px 0;
    }

    .article-title {
        font-size: 1.35rem;
        line-height: 1.35;
    }

    .article-subtitle {
        font-size: 1rem;
    }

    .article-meta {
        gap: 12px;
        font-size: 12px;
    }

    .article-content {
        font-size: .95rem;
        line-height: 1.75;
    }

    /* Share buttons */
    .share-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .share-buttons a {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    /* Widget */
    .widget {
        padding: 16px;
    }

    .widget-title {
        font-size: 1rem;
    }

    /* Trending */
    .trending-list .rank {
        font-size: 1.5rem;
        min-width: 28px;
    }

    .trending-list h4 {
        font-size: .88rem;
    }

    /* Comments */
    .comments-section {
        padding: 18px;
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    /* Footer */
    .site-footer {
        padding: 36px 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-bottom: 30px;
    }

    .footer-col h4 {
        font-size: 1rem;
    }

    /* Breadcrumbs */
    .breadcrumbs {
        font-size: 12px;
        padding: 12px 0;
    }

    /* Search form */
    .search-form {
        max-width: 100%;
    }

    .search-form input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .search-form button {
        padding: 0 16px;
        font-size: 14px;
    }

    /* Quiz */
    .quiz-question {
        padding: 18px;
    }

    .quiz-options label {
        padding: 12px 14px;
        font-size: 14px;
    }

    /* Poll */
    .poll-box {
        padding: 18px;
    }

    .poll-option {
        padding: 12px 14px;
    }

    /* Buttons */
    .btn {
        padding: 9px 18px;
        font-size: 13px;
    }

    /* Scroll to top */
    .scroll-top {
        width: 42px;
        height: 42px;
        bottom: 20px;
        right: 20px;
        font-size: 18px;
    }
}

/* -----------------------------------------------------
   6. MOBILE SMALL (320px - 575px)
   ----------------------------------------------------- */
@media (max-width: 575px) {
    :root {
        --container: 100%;
    }

    /* Typography */
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.05rem; }

    body {
        font-size: 13.5px;
    }

    .container {
        padding: 0 14px;
    }

    /* Header */
    .site-logo img {
        max-height: 42px;
    }

    .site-logo-text {
        font-size: 1.3rem;
    }

    /* Top Bar */
    .top-bar {
        font-size: 11px;
        padding: 5px 0;
    }

    .top-bar-social a {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    /* Nav */
    .nav-menu {
        width: 240px;
    }

    .nav-menu > li > a {
        font-size: 13px;
        padding: 12px 16px;
    }

    /* Breaking News */
    .breaking-news .container {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .breaking-label {
        text-align: center;
        padding: 8px;
    }

    .breaking-label::after {
        display: none;
    }

    .breaking-ticker {
        padding: 10px 0;
    }

    .breaking-ticker a {
        font-size: 12px;
    }

    /* Section */
    .section {
        padding: 16px 0;
    }

    .section-heading h2 {
        font-size: 1.05rem;
    }

    /* Hero */
    .hero-main {
        min-height: 220px;
    }

    .hero-main-content {
        padding: 14px;
    }

    .hero-main-content h2 {
        font-size: 1.05rem;
    }

    .hero-main-content .category {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* News card */
    .news-card-body {
        padding: 14px;
    }

    .news-card-title {
        font-size: .95rem;
    }

    .news-card-excerpt {
        font-size: 13px;
    }

    /* Article */
    .article-title {
        font-size: 1.2rem;
    }

    .article-subtitle {
        font-size: .95rem;
    }

    .article-content {
        font-size: .92rem;
    }

    .article-content blockquote {
        padding: 12px 14px;
        font-size: .9rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Tags */
    .tags a {
        font-size: 12px;
        padding: 4px 10px;
    }

    /* Widget */
    .widget {
        padding: 14px;
    }

    .widget-title {
        font-size: .95rem;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
        padding: 20px 0;
    }

    .pagination a,
    .pagination span {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
        padding: 0 8px;
    }

    /* Footer */
    .footer-logo {
        max-height: 45px;
    }

    .footer-col h4 {
        font-size: .95rem;
        margin-bottom: 14px;
    }

    .footer-links a,
    .footer-contact li,
    .footer-about p {
        font-size: 13px;
    }

    .footer-social a {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .footer-bottom {
        font-size: 12px;
        padding: 14px 0;
    }

    /* Quiz */
    .quiz-question h3 {
        font-size: 1rem;
    }

    .quiz-options label {
        padding: 10px 12px;
        font-size: 13px;
        gap: 8px;
    }

    /* Poll */
    .poll-option {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Buttons */
    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    /* Scroll top */
    .scroll-top {
        width: 38px;
        height: 38px;
        bottom: 16px;
        right: 16px;
        font-size: 16px;
    }

    /* Utility overrides */
    .hide-xs {
        display: none !important;
    }
}

/* -----------------------------------------------------
   7. EXTRA SMALL (below 360px)
   ----------------------------------------------------- */
@media (max-width: 359px) {
    body {
        font-size: 13px;
    }

    .site-logo img {
        max-height: 38px;
    }

    .hero-main {
        min-height: 190px;
    }

    .hero-main-content h2 {
        font-size: .95rem;
    }

    .news-card-title {
        font-size: .9rem;
    }

    .nav-menu {
        width: 220px;
    }
}

/* -----------------------------------------------------
   8. LANDSCAPE MOBILE
   ----------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        padding-top: 50px;
    }

    .nav-menu > li > a {
        padding: 10px 16px;
        font-size: 13px;
    }

    .hero-main {
        min-height: 200px;
    }
}

/* -----------------------------------------------------
   9. PRINT STYLES
   ----------------------------------------------------- */
@media print {
    .top-bar,
    .site-header,
    .main-nav,
    .breaking-news,
    .sidebar,
    .share-buttons,
    .comments-section,
    .site-footer,
    .scroll-top,
    .pagination,
    .widget {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .article-wrapper {
        display: block;
        padding: 0;
    }

    .article-title {
        color: #000;
        font-size: 20pt;
    }

    .article-content {
        font-size: 11pt;
        line-height: 1.6;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
    }
}

/* -----------------------------------------------------
   10. HIGH-DPI (Retina) DISPLAYS
   ----------------------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    .news-card-image img,
    .hero-main img,
    .article-featured-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* -----------------------------------------------------
   11. REDUCED MOTION (Accessibility)
   ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .breaking-ticker a {
        animation: none;
    }
}

/* -----------------------------------------------------
   12. DARK MODE SUPPORT (optional)
   ----------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want automatic dark mode
    :root {
        --bg-body: #121212;
        --bg-white: #1e1e1e;
        --bg-light: #252525;
        --text-dark: #f0f0f0;
        --text-body: #cccccc;
        --text-muted: #999;
        --border: #333;
    }
    */
}

/* -----------------------------------------------------
   13. TOUCH DEVICE ENHANCEMENTS
   ----------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets on touch devices */
    .nav-menu > li > a {
        padding: 16px 18px;
    }

    .news-card:hover {
        transform: none;
    }

    .news-card:hover .news-card-image img {
        transform: none;
    }

    .btn,
    .pagination a,
    .pagination span,
    .share-buttons a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}