/* =====================================================================
   STARTER CSS du site (fondamentaux). Volontairement sobre et neutre.
   ---------------------------------------------------------------------
   INTEGRATEUR : ce fichier pose des bases propres (typo, en-tete, menu,
   conteneur, pied de page, boutons, formulaires) pour ne pas partir d'une
   page nue. Vous le remplacez/complétez par le CSS de la maquette du client.
   Re-theming rapide : surchargez les variables --c-* ci-dessous.
   ===================================================================== */

/* Police de marque auto-hebergee (RGPD : aucun appel a un CDN de polices, tout
   est servi depuis le site). Inter variable, sous-ensemble latin. Si le fichier
   manque, le repli system-ui ci-dessous prend le relais sans casse. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("/fonts/inter-var-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --c-text: #1f2430;
    --c-muted: #5b6472;
    --c-bg: #ffffff;
    --c-surface: #f4f6fa;
    --c-border: #e6e9f0;
    --c-accent: #1b6ec2;
    --c-accent-ink: #ffffff;
    --container: 1140px;
    --radius: 12px;
    /* Police globale : une seule variable. Inter d'abord, repli systeme ensuite. */
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --shadow: 0 1px 2px rgba(20, 28, 55, .04), 0 12px 30px -18px rgba(20, 28, 55, .2);
}

/* --------------------------------------------------- Base / reset léger */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.01em; color: var(--c-text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 1.6em; }
h3 { font-size: 1.2rem; margin-top: 1.2em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.3em; }
li { margin: .3em 0; }
blockquote { margin: 1.4rem 0; padding: .7rem 1.2rem; border-left: 4px solid var(--c-accent); background: var(--c-surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--c-muted); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 2rem 0; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* --------------------------------------------------- En-tete + menu */
.site-header {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 10px 24px;
    background: var(--c-bg);
    box-shadow: 0 1px 0 var(--c-border);
}
.site-logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--c-text); }
.site-logo:hover { text-decoration: none; }
.site-header nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; }
.site-header nav a { display: block; padding: 10px 14px; border-radius: 999px; color: var(--c-text); font-weight: 600; font-size: .95rem; transition: background .15s ease; }
.site-header nav a:hover { background: var(--c-surface); text-decoration: none; }

/* --------------------------------------------------- Fil d'Ariane */
.breadcrumb { max-width: var(--container); margin: 16px auto 0; padding: 0 24px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; font-size: .85rem; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; color: var(--c-muted); }
.breadcrumb li:not(:last-child)::after { content: "›"; color: var(--c-muted); }
.breadcrumb a { color: var(--c-muted); }
.breadcrumb li:last-child a { color: var(--c-text); font-weight: 600; }

/* --------------------------------------------------- Contenu principal */
main { max-width: var(--container); margin-inline: auto; padding: 36px 24px 72px; }
main > article > .lead, .lead { font-size: 1.2rem; color: var(--c-muted); margin: 0 0 1.4rem; }

/* Sections fournies par le moteur (zones d'intervention, FAQ, maillage) */
.zones, .faq, .related { margin-top: 48px; }
.zones ul, .related ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; }
.zones a, .related a { display: inline-block; padding: 8px 15px; background: var(--c-surface); border-radius: 999px; color: var(--c-text); font-size: .9rem; }
.zones a:hover, .related a:hover { text-decoration: none; background: var(--c-border); }
.faq h3 { margin-top: 1.4em; }

/* Bouton générique réutilisable */
.btn {
    display: inline-block; padding: 13px 26px; border: 0; border-radius: 999px;
    background: var(--c-accent); color: var(--c-accent-ink); font: inherit; font-weight: 700; cursor: pointer;
    transition: filter .15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }

/* --------------------------------------------------- Pied de page */
.site-footer { margin-top: 64px; padding: 44px 24px; background: #161b25; color: #cfd4de; }
.site-footer p { max-width: var(--container); margin: 0 auto 12px; }
.site-footer nav { max-width: var(--container); margin-inline: auto; display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: #cfd4de; font-size: .9rem; }
.site-footer a:hover { color: #fff; }

/* --------------------------------------------------- Menu déroulant (sous-menu) */
.site-header nav .has-sub { position: relative; }
.menu-top { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; font-size: .95rem; color: var(--c-text); padding: 10px 14px; border-radius: 999px; }
.menu-top:hover { background: var(--c-surface); }
.menu-caret { width: 15px; height: 15px; transition: transform .2s ease; }
.submenu { list-style: none; margin: 0; }

/* Desktop UNIQUEMENT : sous-menu déroulant au survol (scopé pour ne pas fuir sur mobile) */
@media (min-width: 901px) {
    .submenu { padding: 8px; position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--c-bg); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 200; }
    .has-sub:hover .submenu, .has-sub:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
    .has-sub:hover .menu-caret, .has-sub:focus-within .menu-caret { transform: rotate(180deg); }
    .submenu a { display: block; padding: 9px 14px; border-radius: 8px; color: var(--c-text); font-weight: 500; font-size: .92rem; white-space: nowrap; }
    .submenu a:hover { background: var(--c-surface); text-decoration: none; }
}

/* --------------------------------------------------- Actions d'en-tete (tel + devis) */
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { font-weight: 700; color: var(--c-text); white-space: nowrap; }
.header-cta { padding: 10px 18px; font-size: .95rem; }

/* Desktop : le hamburger et le voile sont masques, le wrapper du menu est transparent
   (display:contents -> nav + actions redeviennent enfants directs du header). */
.nav-toggle { display: none; }
.header-collapse { display: contents; }
.nav-scrim { display: none; }

/* --------------------------------------------------- Liens rapides avant le footer */
.quick-access { max-width: var(--container); margin: 48px auto 0; padding: 0 24px; }
.quick-access ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.quick-access a { font-weight: 600; }

/* --------------------------------------------------- Pied de page (colonnes) */
.footer-inner { max-width: var(--container); margin-inline: auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-col h3 { font-size: 1rem; margin: 0 0 .8em; color: #fff; }
.footer-logo { font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.footer-tagline { color: #aab0bd; font-size: .9rem; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-social { flex-direction: row !important; flex-wrap: wrap; gap: 16px !important; }
.footer-contact a, .footer-nav a { color: #cfd4de; }
.footer-bottom { max-width: var(--container); margin: 32px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; font-size: .85rem; color: #aab0bd; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 18px; }

/* --------------------------------------------------- Menu mobile : hamburger + panneau déroulant */
@media (max-width: 900px) {
    .site-header { flex-wrap: nowrap; padding: 12px 16px; gap: 12px; }
    .site-logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Bouton hamburger (anime en croix a l'ouverture) */
    .nav-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 44px; height: 44px; padding: 0 11px; flex: 0 0 auto;
        border: 0; border-radius: 12px; background: var(--c-surface); cursor: pointer;
        -webkit-tap-highlight-color: transparent; position: relative; z-index: 130;
    }
    .nav-toggle span { display: block; width: 100%; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
    .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Panneau : descend sous la barre, masque par defaut, anime a l'ouverture */
    .header-collapse {
        display: block; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--c-bg); box-shadow: var(--shadow); border-top: 1px solid var(--c-border);
        max-height: calc(100dvh - 68px); overflow-y: auto;
        padding: 6px 16px calc(18px + env(safe-area-inset-bottom, 0px));
        visibility: hidden; opacity: 0; transform: translateY(-10px);
        transition: opacity .22s ease, transform .22s ease, visibility .22s;
        z-index: 120;
    }
    .nav-open .header-collapse { visibility: visible; opacity: 1; transform: none; }

    .site-header nav { width: 100%; }
    .site-header nav ul { flex-direction: column; gap: 0; padding: 0; }
    .site-header nav > ul > li { border-bottom: 1px solid var(--c-border); }
    .site-header nav a, .menu-top { display: flex; align-items: center; width: 100%; text-align: left; padding: 13px 4px; border-radius: 0; font-size: 1rem; font-weight: 600; }

    /* Sous-menu en accordeon (le caret indique l'etat) */
    .menu-top { justify-content: space-between; cursor: pointer; }
    .menu-caret { display: inline-block; width: 18px; height: 18px; transition: transform .25s ease; }
    .has-sub.is-open .menu-caret { transform: rotate(180deg); }
    .submenu { overflow: hidden; max-height: 0; transition: max-height .28s ease; padding-left: 12px; }
    .has-sub.is-open .submenu { max-height: 70vh; }
    .submenu a { padding: 10px 4px; font-size: .95rem; font-weight: 500; }

    /* Actions (tel + devis) en bas du panneau */
    .header-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 12px; }
    .header-cta { text-align: center; }
    .header-phone { padding: 8px 4px; }

    /* Voile derriere le panneau (ferme au clic) */
    .nav-scrim {
        display: block; position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 22, .42);
        opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s;
    }
    .nav-open .nav-scrim { opacity: 1; visibility: visible; }
}

/* --------------------------------------------------- Responsive (spacing) */
@media (max-width: 720px) {
    .breadcrumb { padding: 0 16px; }
    main { padding: 24px 16px 56px; }
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .quick-access { padding: 0 16px; }
}

/* =====================================================================
   Formulaire de contact : style minimal fonctionnel (a remplacer par la maquette).
   ===================================================================== */
.contact-form { max-width: 620px; margin: 1.5rem 0; display: grid; gap: 1rem; }
.contact-form .form-row { display: grid; gap: .35rem; }
.contact-form label { font-weight: 600; }
.contact-form .req { color: #c0392b; }
.contact-form input,
.contact-form textarea {
    width: 100%; padding: .7rem .85rem; font: inherit;
    border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(27, 110, 194, .15); }
.contact-form .form-consent label { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
.contact-form .btn-contact {
    justify-self: start; padding: .8rem 1.6rem; font: inherit; font-weight: 700;
    color: var(--c-accent-ink); background: var(--c-accent); border: 0; border-radius: 999px; cursor: pointer;
}
.contact-form .btn-contact:hover { filter: brightness(1.08); }
.form-error { color: #c0392b; font-size: .9rem; }
.form-alert { padding: .8rem 1rem; border-radius: var(--radius); background: #fdecea; color: #8a1f17; margin: 1rem 0; }
.form-success { padding: .8rem 1rem; border-radius: var(--radius); background: #e8f5e9; color: #1b5e20; margin: 1rem 0; }
