/**
 * Styles responsive - Mobile First
 * 
 * Breakpoints :
 * - Mobile : < 576px (défaut)
 * - Small tablets : 576px - 767px
 * - Tablets : 768px - 1023px
 * - Desktop : 1024px - 1279px
 * - Large Desktop : 1280px+
 */

/* ══════════════════════════════════════════════════════════════
   SMALL TABLETS (576px+)
   ══════════════════════════════════════════════════════════════ */

@media (min-width: 576px) {
    /* Grilles */
    .grid-2-sm { grid-template-columns: repeat(2, 1fr); }
    
    /* Cards en grille */
    .oeuvres-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ══════════════════════════════════════════════════════════════
   TABLETS (768px+)
   ══════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    /* Variables */
    :root {
        --container-padding: 2rem;
        --header-height: 90px;
    }
    
    /* Typographie */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    
    .lead { font-size: 1.25rem; }
    
    /* Header */
    .site-tagline {
        display: block;
    }
    
    .logo-main {
        font-size: 1.75rem;
    }
    
    /* Grilles */
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3-md { grid-template-columns: repeat(3, 1fr); }
    
    /* Cards */
    .oeuvres-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .peintres-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mouvements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Peintre Header */
    .peintre-header .container {
        grid-template-columns: 300px 1fr;
        gap: var(--space-2xl);
    }
    
    .peintre-portrait {
        margin: 0;
        max-width: 300px;
    }
    
    .peintre-citation {
        font-size: 1.5rem;
    }
    
    /* Oeuvre Details */
    .oeuvre-content {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: var(--space-2xl);
    }
    
    .oeuvre-details {
        position: sticky;
        top: calc(var(--header-height) + var(--space-lg));
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
    
    /* Sections */
    .section {
        padding: var(--space-3xl) 0;
    }
    
    /* Hero */
    .home-hero h1 {
        font-size: 3rem;
    }
    
    .home-hero-bg {
        width: 50%;
        opacity: 0.4;
    }
    
    /* Masonry */
    .masonry {
        columns: 2;
    }
    
    /* Timeline */
    .timeline {
        padding-left: var(--space-2xl);
    }
    
    /* FAQ */
    .faq-item summary {
        font-size: 1.125rem;
    }
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP (1024px+)
   ══════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
    /* Variables */
    :root {
        --container-padding: 3rem;
    }
    
    /* Typographie */
    h1 { font-size: 3rem; }
    h2 { font-size: 2rem; }
    
    /* Header */
    .menu-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex;
    }
    
    /* Grilles */
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4-lg { grid-template-columns: repeat(4, 1fr); }
    
    /* Cards */
    .oeuvres-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .peintres-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mouvements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Hero */
    .home-hero {
        min-height: 80vh;
    }
    
    .home-hero h1 {
        font-size: 3.5rem;
    }
    
    .home-hero-bg {
        width: 45%;
        opacity: 0.6;
        right: 0;
    }
    
    /* Masonry */
    .masonry {
        columns: 3;
    }
    
    /* Peintre Header */
    .peintre-header .container {
        grid-template-columns: 400px 1fr;
        gap: var(--space-3xl);
    }
    
    .peintre-portrait {
        max-width: 400px;
    }
    
    /* Search */
    .search-panel input {
        font-size: 1.25rem;
    }
}

/* ══════════════════════════════════════════════════════════════
   LARGE DESKTOP (1280px+)
   ══════════════════════════════════════════════════════════════ */

@media (min-width: 1280px) {
    /* Typographie */
    h1 { font-size: 3.5rem; }
    
    /* Grilles */
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .grid-6-xl { grid-template-columns: repeat(6, 1fr); }
    
    /* Cards */
    .peintres-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Hero */
    .home-hero h1 {
        font-size: 4rem;
    }
    
    /* Masonry */
    .masonry {
        columns: 4;
    }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE MENU (< 1024px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
    /* Menu mobile overlay */
    .nav-menu {
        display: flex !important; /* Force display on mobile */
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        flex-direction: column;
        padding: var(--space-lg);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.is-open {
        transform: translateX(0);
    }
    
    .nav-item {
        border-bottom: 1px solid var(--color-border-light);
    }
    
    .nav-link {
        padding: var(--space-md) 0;
        font-size: 1.125rem;
        justify-content: space-between;
    }
    
    /* Dropdown mobile */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
    }
    
    .has-dropdown.is-open .dropdown-menu {
        max-height: 1000px;
    }
    
    .has-dropdown.is-open .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    .dropdown-content {
        padding: var(--space-sm) var(--space-md);
    }
    
    .dropdown-list--grid {
        grid-template-columns: 1fr;
    }
    
    /* Hamburger animation */
    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Body scroll lock */
    body.menu-open {
        overflow: hidden;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE UTILITIES
   ══════════════════════════════════════════════════════════════ */

/* Hide on breakpoints */
@media (max-width: 575px) {
    .hidden-xs { display: none !important; }
}

@media (min-width: 576px) and (max-width: 767px) {
    .hidden-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hidden-md { display: none !important; }
}

@media (min-width: 1024px) {
    .hidden-lg { display: none !important; }
}

/* Show on breakpoints */
@media (max-width: 767px) {
    .show-md { display: none !important; }
}

@media (min-width: 768px) {
    .show-mobile { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════════════ */

@media print {
    /* Hide non-essential elements */
    .site-header,
    .site-footer,
    .breadcrumb,
    .internal-nav,
    .ad-container,
    .btn,
    .search-toggle {
        display: none !important;
    }
    
    /* Reset colors */
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    /* Show URLs */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        page-break-inside: avoid;
    }
}

/* ══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ══════════════════════════════════════════════════════════════
   HIGH CONTRAST MODE
   ══════════════════════════════════════════════════════════════ */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #8b0000;
        --color-text: #000;
        --color-text-muted: #333;
        --color-border: #000;
    }
    
    .card {
        border: 2px solid var(--color-border);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}
