/**
 * responsive.css – Base responsive commune (toutes pages, toutes langues).
 * Device-first, sans modifier le design (couleurs/typos).
 * Breakpoints: 1024px (tablette), 768px (mobile).
 */

/* --- Global box-sizing (renforce l'existant) --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Éviter débordement horizontal --- */
html {
    overflow-x: hidden;
}
body {
    overflow-x: hidden;
}

/* --- Safe areas (encoches, barre d'accueil iPhone / Android) --- */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* --- Images et vidéos fluides --- */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}
/* Logo reste proportionnel sur petit écran */
.logo img {
    max-width: 100%;
    object-fit: contain;
}

/* --- Conteneur générique (optionnel pour wrappers) --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* --- Zones tactiles minimales (mobile) : boutons / liens nav --- */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 14px 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .main-nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 10px 12px;
    }
    .lang-switch a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Espacement nav + lang-switch pour éviter les fausses touches */
    .main-nav ul {
        gap: 8px;
    }
    header .lang-switch {
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid rgba(0,0,0,0.06);
    }
    /* Back-to-top : zone plus confortable au doigt */
    .back-to-top {
        min-height: 44px;
        padding: 12px 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Flèche scroll : zone tactile élargie */
    .scroll-down-arrow {
        width: 56px;
        height: 56px;
        bottom: 24px;
    }
    /* Liens contact (tél / email) : plus faciles à taper */
    .contact p a {
        display: inline-block;
        min-height: 44px;
        line-height: 44px;
        padding: 0 8px;
    }
    /* Carte hero : léger recul visuel sur petit écran */
    .hero .card {
        margin-top: 8px;
    }
}

/* ========== Tablette (max-width: 1024px) ========== */
@media (max-width: 1024px) {
    header {
        flex-wrap: wrap;
        padding-left: 16px;
        padding-right: 16px;
    }
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .hero {
        padding-left: 16px;
        padding-right: 16px;
        gap: 40px;
    }
    .hero h2 {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
    main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .segment {
        padding-left: 16px;
        padding-right: 16px;
    }
    footer,
    .back-to-top-wrapper,
    .contact {
        padding-left: 16px;
        padding-right: 16px;
    }
    .logo img {
        max-height: 180px;
        height: auto;
    }
}

/* ========== Mobile (max-width: 768px) ========== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding-top: 16px;
        padding-bottom: 56px;
    }
    .logo {
        margin-top: 0;
    }
    .logo img {
        max-height: 140px;
        margin-left: auto;
        margin-right: auto;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 4px;
    }
    .hero {
        padding: 60px 16px;
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero h2 {
        font-size: 1.75rem;
    }
    .hero p {
        font-size: 1rem;
        line-height: 1.65;
    }
    .card {
        padding: 24px;
    }
    .card h3 {
        font-size: 1.25rem;
    }
    main {
        padding: 40px 16px 60px;
    }
    .segment {
        grid-template-columns: 1fr !important;
        gap: 24px;
        padding-top: 32px;
        padding-bottom: 32px;
    }
    .segment-text h2 {
        font-size: 1.5rem;
    }
    .segment-text p {
        font-size: 1rem;
        line-height: 1.65;
    }
    main p {
        line-height: 1.65;
    }
    .contact h3 {
        font-size: 1.5rem;
    }
    .contact p {
        font-size: 1rem;
    }
    footer .footer-row {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .back-to-top-wrapper {
        padding: 16px;
    }
    /* Éviter overflow sur éléments fixes en largeur */
    .slideshow-track img {
        min-width: 0;
    }
    video {
        min-height: 0;
    }
}

/* --- Fond blanc sous le menu sur téléphone (portrait ET paysage) --- */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
    /* pastille blanche derrière la nav et le switch de langue */
    header .main-nav,
    header .lang-switch {
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 999px;
        padding: 6px 12px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    }
    header .main-nav {
        margin-bottom: 4px;
    }
}

/* --- Ajustement tablette en portrait : garder le logo visible --- */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    header {
        padding-top: 16px;
        padding-bottom: 96px;
    }
    .logo {
        margin-top: 0;
    }
    .logo img {
        max-height: 200px;
    }
}


/* --- Sécurité: éléments susceptibles de déborder + lisibilité mobile --- */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    textarea {
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* Évite le zoom auto sur focus (iOS) */
    }
}

/* --- Réduction des animations si l'utilisateur le demande --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
