@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .program-chapters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 50px 20px 30px;
        text-align: center;
    }

    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
        max-width: 100%;
    }

    .footer-section {
        width: 100%;
        max-width: 320px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-logo {
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }

    .logo-circle {
        margin-bottom: 15px;
    }

    .footer-tagline {
        text-align: center;
        max-width: 280px;
        line-height: 1.6;
        margin: 0 auto;
    }

    .footer-title {
        text-align: center;
        margin-bottom: 20px;
        font-size: 1.1rem;
    }

    .footer-links {
        align-items: center;
        text-align: center;
        width: 100%;
        gap: 15px;
    }

    .footer-link {
        text-align: center;
        font-size: 1rem;
        padding: 8px 0;
        display: block;
        width: 100%;
    }

    .footer-contact {
        align-items: center;
        text-align: center;
        width: 100%;
        gap: 15px;
    }

    .contact-item {
        text-align: center;
        font-size: 1rem;
        line-height: 1.5;
    }

    .footer-social {
        justify-content: center;
        width: 100%;
        gap: 20px;
        margin-top: 10px;
    }

    .footer-social-link {
        width: 45px;
        height: 45px;
    }

    .footer-bottom {
        width: 100%;
        text-align: center;
        margin: 35px auto 0;
        padding-top: 25px;
    }

    .footer-bottom p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Header navigation fixe simplifié */
    .header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 0 20px !important;
        background: linear-gradient(135deg, #081236 0%, #0f2b5c 45%, #1b6fb4 100%) !important;
        /* background: #1e4a73; */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
        padding-bottom: 0 !important;
        box-sizing: border-box;
    }

    .nav {
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
        justify-content: flex-start;
        position: relative;
        padding: 0 !important;
        align-items: center;
    }

    /* Adjust container for fixed header */
    .container {
        padding-top: 60px;
    }

    .mobile-menu-toggle {
        display: flex;
        left: 15px;
        padding: 8px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .hamburger-line {
        width: 22px;
        height: 2px;
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .mobile-menu {
        width: 85%;
        max-width: 350px;
        padding: 80px 25px 30px;
        backdrop-filter: blur(10px);
        background: linear-gradient(135deg,
                rgba(8, 18, 54, 0.95) 0%,
                rgba(20, 136, 205, 0.95) 100%);
        border-right: 2px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-link {
        font-size: 18px;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.3s ease;
        position: relative;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 0;
        height: 2px;
        background: #e91e63;
        transition: width 0.3s ease;
    }

    .mobile-nav-link:hover::before {
        width: 100%;
    }

    .mobile-nav-link:focus {
        outline: 2px solid #e91e63;
        outline-offset: 2px;
        box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.2);
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .nav-link:focus {
        outline: 2px solid #e91e63;
        outline-offset: 2px;
        box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.2);
    }

    .nav-left,
    .nav-right,
    .logo {
        display: none;
    }

    /* Ensure mobile menu toggle is visible and properly positioned */
    .mobile-menu-toggle {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }

    .title-blue {
        color: #3a73c4;
        display: block;
        font-size: clamp(2.5rem, 12vw, 4rem);
        margin-top: -10px;
    }

    .priorities-main-section {
        padding: 50px 20px;
    }

    .program-chapters-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .program-chapter-card {
        padding: 20px 18px;
    }

    .program-chapter-card-noclick {
        padding: 20px 18px;
    }
    
    .chapter-title {
        font-size: 1.1rem;
    }
    
    .program-contact-section {
        padding: 60px 20px;
    }

    .program-contact-title {
        font-size: 2rem;
    }

    .program-contact-subtitle {
        font-size: 1.1rem;
    }

    .contact-hero {
        padding: 60px 20px 50px;
        margin-top: -60px !important;
        padding-top: calc(60px + 50px) !important;
    }

    .contact-hero-title {
        font-size: clamp(2rem, 7vw, 2.5rem);
        line-height: 1.1;
        white-space: normal;
    }

    .contact-content {
        margin-top: 0 !important;
        padding-top: 20px;
    }

    #toast {
        left: auto !important;
        right: 12px !important;
        bottom: 12px !important;
        width: auto !important;
        /* prend la largeur dispo */
        max-width: none !important;
        transform: translateY(16px);
        /* pas de translateX ici */
    }

    #toast.show {
        transform: translateY(0);
    }

    #toast img {
        width: auto;
        /* évite de remplir toute la largeur si trop grand */
        max-width: 100%;
        max-height: 35vh;
        /* ajuste: 25-45vh selon ce que tu veux */
        height: auto;
        margin: 0;
    }
}

@media(max-width:600px) {
    section {
        padding: 30px 16px;
    }
}

@media (max-width: 480px) {
    
    .container {
        padding: 0 15px;
    }

    .footer {
        padding: 40px 15px 25px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }

    .footer-section {
        max-width: 300px;
        padding: 0 10px;
    }

    .logo-circle {
        width: 55px;
        height: 55px;
        margin-bottom: 12px;
    }

    .logo-circle .logo-text {
        font-size: 16px;
    }

    .footer-tagline {
        font-size: 0.9rem;
        max-width: 260px;
    }

    .footer-title {
        font-size: 1rem;
        margin-bottom: 18px;
    }

    .footer-link {
        font-size: 0.9rem;
        padding: 6px 0;
    }

    .contact-item {
        font-size: 0.9rem;
    }

    .footer-social-link {
        width: 40px;
        height: 40px;
    }

    .footer-social-link a {
        font-size: 14px;
    }

    .footer-bottom {
        margin: 30px auto 0;
        padding-top: 20px;
    }

    .footer-bottom p {
        font-size: 0.85rem;
    }

    .priorities-main-section {
        padding: 40px 15px;
    }

    .program-chapter-card {
        padding: 18px 15px;
    }

    .program-chapter-card-noclick {
        padding: 18px 15px;
    }

    .contact-hero {
        padding: 50px 15px 40px;
    }

    .header {
        padding: 0 15px !important;
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }

    .nav {
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }

    .mobile-menu-toggle {
        left: 10px;
    }
}

@media (max-width: 400px) {

    /* Sections */
    .contact-hero {
        padding: 60px 20px 50px;
        height: auto;
        min-height: auto;
    }

    .footer {
        padding: 40px 20px 25px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-logo {
        align-items: center;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }

    .mobile-menu {
        width: 90%;
        padding: 70px 20px 25px;
    }
}

/* High DPI screens adjustments */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .logo-text {
        font-weight: 800;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {

    .contact-hero {
        padding: 30px 20px 25px;
        min-height: auto;
    }

    .mobile-menu {
        height: 100vh;
        overflow-y: auto;
    }
}
