/* ============================================
   BIEUSSON FESTIVAL — Responsive Design
   Agent 11 — Frontend Public Vitrine & Storytelling
   ============================================ */

/* --- Mobile First Approach --- */
/* Base styles are mobile, then we add tablet/desktop */

/* --- Small Devices (phones, < 576px) --- */
@media (max-width: 575.98px) {
    :root {
        --fs-4xl: 2.25rem;
        --fs-5xl: 2.75rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .section {
        padding: var(--space-10) 0;
    }

    .section-lg {
        padding: var(--space-16) 0;
    }

    .section-header {
        margin-bottom: var(--space-8);
    }

    .section-header h2 {
        font-size: var(--fs-2xl);
    }

    /* Hero */
    .hero {
        min-height: 100vh;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .hero-subtitle {
        font-size: var(--fs-md);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    .countdown {
        gap: var(--space-2);
    }

    .countdown-value {
        width: 60px;
        height: 60px;
        font-size: var(--fs-2xl);
    }

    /* Navigation */
    .navbar-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .navbar-actions .btn {
        display: none;
    }

    /* Cards */
    .why-grid,
    .days-grid,
    .artists-grid,
    .culture-grid,
    .tourism-grid,
    .boutique-grid,
    .news-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Event items */
    .event-item {
        flex-direction: column;
        gap: var(--space-4);
    }

    .event-time {
        min-width: auto;
        text-align: left;
        display: flex;
        gap: var(--space-2);
        align-items: center;
    }

    /* Programme filters */
    .programme-filters {
        flex-direction: column;
    }

    .programme-day-tabs {
        overflow-x: auto;
        padding-bottom: var(--space-2);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Cart Sidebar */
    .cart-sidebar {
        width: 100%;
    }

    /* Modal */
    .modal {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-4);
    }

    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form .btn {
        width: 100%;
    }

    /* Partners */
    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: var(--fs-2xl);
    }

    /* CTA Banner */
    .cta-banner {
        padding: var(--space-10) var(--space-4);
        border-radius: var(--radius);
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: var(--space-2) var(--space-4);
        font-size: var(--fs-sm);
    }

    /* Auth */
    .auth-card {
        padding: var(--space-6);
    }
}

/* --- Medium Devices (tablets, 576px - 767px) --- */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        padding: 0 var(--space-6);
    }

    .section {
        padding: var(--space-12) 0;
    }

    /* Hero */
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .countdown-value {
        width: 70px;
        height: 70px;
        font-size: var(--fs-2xl);
    }

    /* Navigation */
    .navbar-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Cards */
    .why-grid,
    .days-grid,
    .artists-grid,
    .tourism-grid,
    .boutique-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .culture-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Partners */
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Large Devices (small desktops, 768px - 991px) --- */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        padding: 0 var(--space-8);
    }

    .section {
        padding: var(--space-16) 0;
    }

    /* Hero */
    .hero-title {
        font-size: clamp(3rem, 6vw, 4rem);
    }

    /* Navigation */
    .navbar-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Cards */
    .why-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .days-grid,
    .artists-grid,
    .tourism-grid,
    .boutique-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .culture-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Partners */
    .partners-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Extra Large Devices (desktops, 992px - 1199px) --- */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    /* Navigation */
    .navbar-nav {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    /* Cards */
    .why-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .days-grid,
    .artists-grid,
    .tourism-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .boutique-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .culture-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- XXL Devices (large desktops, >= 1200px) --- */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    /* Navigation */
    .navbar-nav {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    /* Cards */
    .why-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .days-grid,
    .artists-grid,
    .tourism-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .boutique-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .culture-grid,
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Partners */
    .partners-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Print Styles --- */
@media print {
    .navbar,
    .footer,
    .hamburger,
    .mobile-menu,
    .back-to-top,
    .btn,
    .newsletter-section,
    .cta-banner {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
    }
}

/* --- Dark Mode Media Query (auto) --- */
@media (prefers-color-scheme: dark) {
    /* Optional: uncomment to enable auto dark mode */
    /*
    :root {
        --light: #1a1a2e;
        --white: #16213e;
        --gray-light: #0f3460;
        --dark: #f9f9f9;
        --dark-light: #ecf0f1;
    }
    */
}

/* --- Touch Device Optimizations --- */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        min-width: 48px;
    }

    .nav-link {
        padding: var(--space-3) var(--space-4);
    }

    .card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .artist-card:hover,
    .product-card:hover,
    .culture-card:hover,
    .tourism-card:hover,
    .news-card:hover {
        transform: none;
    }
}

/* --- High Resolution Displays --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Retina optimizations */
    .hero-bg::after {
        opacity: 0.5;
    }
}

/* --- Landscape Mobile --- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
    }

    .hero-title {
        font-size: var(--fs-2xl);
    }

    .countdown-value {
        width: 50px;
        height: 50px;
        font-size: var(--fs-lg);
    }
}

/* --- Safe Area (notch devices) --- */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }

    .footer {
        padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
    }

    .mobile-menu {
        padding-top: calc(var(--nav-height) + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
}
