/**
 * Responsive Media Queries
 */

/* ==================== Tablets & Below (< 1024px) ==================== */
@media (max-width: 1024px) {
    .container {
        --container-padding: var(--space-3);
    }

    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--space-4);
    }

    .news-card-large {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== Mobile (< 768px) ==================== */
@media (max-width: 768px) {

    /* Typography */
    :root {
        --text-4xl: 1.875rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
    }

    /* Header */
    .header-controls {
        gap: var(--space-2);
    }

    .weather-widget,
    .header-date {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Navigation */
    .main-navigation {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-bg);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
        z-index: var(--z-fixed);
    }

    .main-navigation.active {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-6);
    }

    .nav-link {
        padding: var(--space-4);
        border-bottom: 1px solid var(--color-border);
    }

    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        margin-left: var(--space-4);
    }

    /* News Grid */
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card-large .news-card-content {
        padding: var(--space-4);
    }

    .news-card-large .news-card-title {
        font-size: var(--text-xl);
    }

    /* Footer */
    .footer-top {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-search {
        max-width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ==================== Small Mobile (< 480px) ==================== */
@media (max-width: 480px) {
    :root {
        --space-16: 2rem;
        --space-12: 1.5rem;
    }

    .breaking-news-wrapper {
        gap: var(--space-2);
    }

    .header-logo img {
        height: 32px;
    }

    .section-title {
        font-size: var(--text-lg);
    }

    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
        /* Keep it safely within viewport on small screens */
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
    }
}