/* ===================================
   RESPONSIVE DESIGN
   Styles pour tablettes et mobiles
   =================================== */

/* Tablettes (max 1024px) */
@media (max-width: 1024px) {
    :root {
        --spacing-xl: 2.5rem;
        --spacing-xxl: 3rem;
    }

    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }

    .section-header h2 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.35rem;
    }

    .binome-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .axes-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Tablettes et mobiles (max 768px) */
@media (max-width: 768px) {
    :root {
        --spacing-md: 1.25rem;
        --spacing-lg: 1.75rem;
        --spacing-xl: 2rem;
        --spacing-xxl: 2.5rem;
    }

    /* Sections Ambitions et Engagements responsive */
    .ambitions,
    .engagements {
        padding: 50px 0 !important;
    }

    .ambitions h2,
    .engagements h2 {
        font-size: 2rem !important;
    }

    .ambitions p {
        font-size: 1rem !important;
    }

    .ambition-card,
    .engagement-card {
        padding: 25px !important;
    }

    /* Navigation mobile */
    .navbar {
        width: calc(100% - 20px);
        border-radius: 0 0 15px 15px;
    }

    .navbar .container {
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .nav-top {
        gap: var(--spacing-md);
    }

    .nav-logo {
        height: 35px;
    }

    .nav-title {
        padding: var(--spacing-xs) 0;
        margin-top: var(--spacing-xs);
    }

    .nav-title h1 {
        font-size: 0.9rem;
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        background: var(--primary-dark);
        padding: 100px var(--spacing-md) var(--spacing-md);
        box-shadow: var(--shadow-lg);
        transition: left var(--transition-base);
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        z-index: 1001;
        border-radius: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        padding: var(--spacing-md);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: center;
        color: white !important;
        font-size: 1.1rem;
        border-radius: 0 !important;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background: rgba(255,255,255,0.1) !important;
        color: var(--highlight-color) !important;
    }

    .nav-menu .btn-cta {
        margin-top: var(--spacing-sm);
        border-bottom: none;
        background: var(--highlight-color) !important;
        color: var(--primary-dark) !important;
    }

    /* Navigation toggle animation */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Hero - Reduced height mobile */
    .hero {
        height: 70vh;
        height: 70svh;
        min-height: 400px;
        max-height: 600px;
    }

    .hero-small {
        height: 50vh;
        height: 50svh;
        min-height: 300px;
        max-height: 450px;
    }

    .hero-slide {
        background-attachment: scroll;
        background-position: center 40% !important;
    }

    /* Optimiser l'affichage des images de fond sur mobile */
    .hero[style*="background-image"] {
        background-position: center 40% !important;
        background-size: cover !important;
    }

    .hero-overlay {
        background: rgba(0, 0, 0, 0.4) !important;
    }

    .hero-content {
        padding: calc(70px + var(--spacing-lg)) var(--spacing-sm) var(--spacing-lg);
    }

    .hero-title {
        font-size: 2rem;
        text-shadow: 0 2px 8px rgba(0,0,0,0.4);
    }

    .hero-subtitle {
        font-size: 1.1rem;
        text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    }

    .hero-date {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-nav {
        width: 40px;
        height: 40px;
    }

    .hero-prev {
        left: 10px;
    }

    .hero-next {
        right: 10px;
    }

    .hero-dots {
        bottom: 100px;
    }

    /* Sections */
    section {
        padding: var(--spacing-xl) 0;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    /* Édito */
    .edito-content {
        padding: var(--spacing-lg);
    }

    /* Piliers */
    .pillars-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Binôme */
    .binome-grid {
        gap: var(--spacing-lg);
    }

    .binome-photo {
        height: 280px;
    }

    .binome-info {
        padding: var(--spacing-md);
    }

    .binome-info h3 {
        font-size: 1.5rem;
    }

    /* Axes */
    .axes-grid {
        grid-template-columns: 1fr;
    }

    /* Actualités */
    .actualites-grid {
        grid-template-columns: 1fr;
    }

    /* CTA Rejoindre */
    .cta-rejoindre h2 {
        font-size: 2rem;
    }

    .cta-rejoindre p {
        font-size: 1.125rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-buttons .btn {
        width: 100%;
    }

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

    /* Scroll top button */
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Mobiles (max 480px) */
@media (max-width: 480px) {
    :root {
        --font-size-base: 15px;
        --spacing-sm: 0.875rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 1.75rem;
        --spacing-xxl: 2rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .legal-banner {
        font-size: 0.8125rem;
        padding: var(--spacing-xs);
    }

    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .hero {
        height: 60vh;
        height: 60svh;
        min-height: 350px;
        max-height: 500px;
    }

    .hero-small {
        height: 40vh;
        height: 40svh;
        min-height: 250px;
        max-height: 350px;
    }

    /* Améliorer positionnement des images sur petits écrans */
    .hero[style*="background-image"],
    .hero-slide {
        background-position: center 35% !important;
    }

    .hero-content {
        padding: calc(60px + var(--spacing-md)) var(--spacing-sm) var(--spacing-md);
    }

    .hero-title {
        font-size: 1.65rem;
        text-shadow: 0 2px 8px rgba(0,0,0,0.5);
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    }

    .hero-date {
        font-size: 0.85rem;
    }

    .hero-dots {
        bottom: 90px;
    }

    .hero-scroll-arrow {
        bottom: 20px;
    }

    .hero-nav {
        display: none;
    }

    .btn {
        padding: 10px 24px;
        font-size: 0.9375rem;
    }

    .edito-content {
        padding: var(--spacing-md);
    }

    .pillar-card,
    .axe-card {
        padding: var(--spacing-md);
    }

    .pillar-icon,
    .axe-icon {
        font-size: 2.5rem;
    }

    .binome-photo {
        height: 250px;
    }

    .engagement-item {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
    }

    .check-icon {
        width: 28px;
        height: 28px;
        font-size: 1.125rem;
    }

    .actualite-image {
        height: 180px;
    }

    .actualite-content {
        padding: var(--spacing-md);
    }

    .cta-rejoindre h2 {
        font-size: 1.75rem;
    }

    .cta-rejoindre p {
        font-size: 1rem;
    }

    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-sm);
    }

    .footer-col h4 {
        font-size: 1rem;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }

    .scroll-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Très petits écrans (max 360px) */
@media (max-width: 360px) {
    .hero {
        min-height: 450px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-header h2 {
        font-size: 1.375rem;
    }

    .nav-brand h1 {
        font-size: 1rem;
    }

    .nav-brand .small {
        font-size: 0.75rem;
    }

    .hero-dots {
        bottom: 80px;
    }
}

/* Mode paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: 350px;
    }

    .hero-content {
        padding: calc(50px + var(--spacing-sm)) var(--spacing-md) var(--spacing-sm);
    }

    .hero-title {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-sm);
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--spacing-xs);
    }

    .hero-date {
        margin-bottom: var(--spacing-sm);
    }

    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-buttons .btn {
        width: auto;
        padding: 8px 20px;
        font-size: 0.875rem;
    }

    .hero-scroll-arrow {
        display: none;
    }

    .hero-dots {
        bottom: 15px;
    }

    .hero-nav {
        width: 35px;
        height: 35px;
    }
}

/* Optimisations pour l'impression */
@media print {
    .navbar,
    .legal-banner,
    .hero-scroll-arrow,
    .scroll-top,
    .cta-rejoindre,
    .footer {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
        page-break-after: always;
    }

    section {
        padding: 1.5rem 0;
    }

    .btn {
        border: 1px solid #000;
        color: #000;
    }

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

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

/* Accessibilité - Mode contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0369A1;
        --secondary-color: #DC2626;
        --text-primary: #000000;
        --text-secondary: #374151;
    }

    .btn-primary,
    .btn-secondary {
        border-width: 3px;
    }

    a:focus,
    button:focus {
        outline: 3px solid var(--secondary-color);
        outline-offset: 2px;
    }
}

/* Réduction des mouvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-scroll-arrow {
        animation: none;
    }
}

/* Mode sombre (préparation future) */
@media (prefers-color-scheme: dark) {
    /* À implémenter si besoin */
}

/* ===================================
   RESPONSIVE MODERN EFFECTS
   =================================== */

/* Countdown responsive */
@media (max-width: 768px) {
    .countdown-container {
        gap: 10px;
        margin: 20px 0;
    }

    .countdown-item {
        padding: 12px 15px;
        min-width: 70px;
    }

    .countdown-number {
        font-size: 1.75rem;
    }

    .countdown-label {
        font-size: 0.75rem;
    }

    /* Disable custom cursor on touch devices */
    .custom-cursor {
        display: none !important;
    }

    /* Reduce blob sizes on mobile */
    .blob-1 {
        width: 200px;
        height: 200px;
    }

    .blob-2 {
        width: 150px;
        height: 150px;
    }

    .blob-3 {
        width: 120px;
        height: 120px;
    }

    /* Simpler reveal animations on mobile */
    [data-reveal] {
        transform: translateY(30px);
    }

    /* Footer modern grid */
    .footer-grid-modern {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .countdown-container {
        gap: 8px;
    }

    .countdown-item {
        padding: 10px 12px;
        min-width: 60px;
    }

    .countdown-number {
        font-size: 1.5rem;
    }

    .countdown-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    /* Hide grain overlay on very small screens for performance */
    .grain-overlay {
        display: none;
    }

    /* Reduce animation complexity */
    .blob {
        animation: none;
    }
}

/* Hide scroll progress on mobile for cleaner look */
@media (max-width: 768px) {
    .scroll-progress {
        height: 3px;
    }
}
