/* ==========================================================================
   Legouas Christian — Plaquiste
   Feuille de style unique pour tout le site.

   Sommaire
     1.  Polices
     2.  Couleurs et réglages généraux
     3.  Éléments communs (conteneur, titres, boutons, pastilles)
     4.  En-tête
     5.  Bouton d'appel mobile
     6.  Accueil : hero
     7.  Accueil : bandeau de réassurance
     8.  Accueil : prestations
     9.  Réalisations : avant/après et galerie
     10. Accueil : pourquoi Christian, étapes, avis
     11. Accueil : contact et zone d'intervention
     12. Page Travaux : filtres, sections, cartes de chantier
     13. Photos en attente et messages d'erreur
     14. Visionneuse
     15. Pages de texte (mentions légales, 404)
     16. Pied de page
     17. Accessibilité
     18. Page « Préparer ma demande »
   ========================================================================== */


/* 1. Polices ---------------------------------------------------------------
   Fichiers Google Fonts (sous-ensemble latin) hébergés avec le site :
   aucune requête vers Google, et le site fonctionne même hors ligne. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
}


/* 2. Couleurs et réglages généraux ---------------------------------------- */

:root {
  --bleu: #1146C8;         /* boutons, accents, chiffres */
  --bleu-fonce: #08245E;   /* blocs sombres, survols */
  --bleu-clair: #E7EDFB;   /* bandeau réassurance, pastilles */
  --beige: #F1EBE2;        /* cartes étapes */
  --fond: #FAF7F2;         /* fond de page */
  --encre: #1A1917;        /* texte principal */
  --gris: #6A6560;         /* texte secondaire */
  --bordure: #EAE3D9;

  --titres: "Bricolage Grotesque", system-ui, sans-serif;
  --texte: "Figtree", system-ui, sans-serif;

  /* Hauteur de l'en-tête : valeur de secours seulement. chantiers.js la
     remplace par la hauteur réelle mesurée, et la tient à jour tout seul.
     Sert à ne pas cacher un titre sous l'en-tête collant. */
  --hauteur-entete: 84px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--texte);
  font-size: clamp(16px, 1.6vw, 17px);
  line-height: 1.55;
}

/* Un élément masqué par le script reste masqué, quel que soit son style */
[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--bleu);
  text-decoration: none;
}

a:hover {
  color: var(--bleu-fonce);
}

h1,
h2,
h3 {
  font-family: var(--titres);
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0;
}


/* 3. Éléments communs ----------------------------------------------------- */

.conteneur {
  max-width: 1240px;
  margin: 0 auto;
}

/* Section classique : marges intérieures fluides */
.section {
  padding: clamp(48px, 8vw, 88px) clamp(16px, 4vw, 40px) 0;
}

.section-titre {
  font-weight: 700;
  font-size: clamp(26px, 4.4vw, 40px);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.section-titre--seul {
  margin-bottom: 28px;
}

.section-sous-titre {
  color: var(--gris);
  font-size: clamp(16px, 1.8vw, 17px);
  margin-bottom: 28px;
}

/* Grille de cartes qui passe seule de 1 à 3 colonnes */
.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(12px, 2vw, 20px);
}

/* Bouton bleu */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bleu);
  color: #fff;
  font-family: var(--texte);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 19px);
  padding: 16px 28px;
  border-radius: 16px;
  transition: background-color 0.15s;
}

.bouton:hover {
  background: var(--bleu-fonce);
  color: #fff;
}

.bouton svg {
  flex: none;
}

/* Bouton clair, utilisé sous la galerie */
.bouton--contour {
  background: #fff;
  color: var(--bleu);
  border: 2px solid var(--bleu);
}

.bouton--contour:hover {
  background: var(--bleu);
  color: #fff;
}

/* Petite pastille arrondie (AVANT, APRÈS…) */
.pastille {
  display: inline-block;
  font-weight: 700;
  font-size: clamp(12px, 1.4vw, 13px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 36, 94, 0.85);
  color: #fff;
}

.pastille--bleue {
  background: var(--bleu);
}

/* Étiquette posée en haut à gauche d'une photo */
.pastille--sur-photo {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  pointer-events: none;
}


/* 4. En-tête -------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 242, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #E6DFD5;
}

.entete .conteneur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 16px);
  padding: 12px clamp(16px, 4vw, 40px);
}

.entete-logo {
  flex: none;
}

.entete-logo img {
  height: clamp(40px, 9vw, 60px);
  width: auto;
}

/* Navigation : une liste de liens. Elle accepte autant d'entrées que
   nécessaire ; s'il n'y a plus la place, les liens passent à la ligne
   (à droite du logo) au lieu de déborder de l'écran. */
.nav {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-liste {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px clamp(2px, 1vw, 8px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Sur téléphone, sans le bouton d'appel de l'en-tête, les liens se calent à droite */
@media (max-width: 759px) {
  .nav-liste {
    justify-content: flex-end;
  }
}

/* Lien simple, et intitulé d'un menu déroulant (summary) : même apparence */
.nav a,
.nav summary {
  display: block;
  color: var(--encre);
  font-weight: 600;
  font-size: clamp(15px, 1.7vw, 17px);
  padding: 10px clamp(8px, 1.4vw, 14px);
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.nav a:hover,
.nav summary:hover {
  color: var(--bleu);
  background: var(--bleu-clair);
}

/* Page courante (et menu qui contient la page courante) */
.nav a[aria-current="page"],
.nav-groupe:has([aria-current="page"]) > summary {
  color: var(--bleu-fonce);
  background: var(--bleu-clair);
}

/* Menu déroulant « Prestations » (balise <details>, sans JavaScript).
   Prêt pour les futures pages cloisons.html, doublage.html, plafonds.html
   et combles.html : voir le commentaire MENU PRESTATIONS dans les pages. */
.nav-groupe {
  position: relative;
}

.nav summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav summary::-webkit-details-marker {
  display: none;
}

/* Petite flèche qui pivote à l'ouverture */
.nav summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.nav-groupe[open] > summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.nav-sous-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 50;
  min-width: 230px;
  margin: 0;
  padding: 8px;
  list-style: none;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(26, 25, 23, 0.14);
}

.nav-sous-menu a {
  border-radius: 10px;
}

/* Sur téléphone, le menu s'aligne sur le bord droit pour ne pas sortir de l'écran */
@media (max-width: 759px) {
  .nav-sous-menu {
    left: auto;
    right: 0;
    transform: none;
  }
}

.entete-appel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  background: var(--bleu);
  color: #fff;
  font-weight: 700;
  font-size: clamp(17px, 1.8vw, 19px);
  letter-spacing: 0.2px;
  padding: 14px 22px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(17, 70, 200, 0.28);
  white-space: nowrap;
  transition: background-color 0.15s;
}

.entete-appel:hover {
  background: var(--bleu-fonce);
  color: #fff;
}


/* 5. Bouton d'appel mobile -------------------------------------------------
   Sous 760px : le bouton de l'en-tête disparaît, celui-ci apparaît en bas. */

.appel-mobile {
  display: none;
}

@media (max-width: 759px) {
  .entete-appel {
    display: none;
  }

  .appel-mobile {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(250, 247, 242, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid #E6DFD5;
  }

  .appel-mobile a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 58px;
    background: var(--bleu);
    color: #fff;
    font-weight: 700;
    font-size: clamp(18px, 5vw, 20px);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(17, 70, 200, 0.3);
  }

  .appel-mobile a:hover {
    background: var(--bleu-fonce);
  }

  /* Laisse la place au bouton fixe pour que le pied de page reste lisible */
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}


/* 6. Accueil : hero ------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(440px, 72vh, 620px);
  margin: clamp(10px, 2.5vw, 20px);
  border-radius: 24px;
  overflow: hidden;
  background: var(--bleu-fonce);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 36, 94, 0.35) 0%, rgba(8, 36, 94, 0.62) 45%, rgba(8, 36, 94, 0.92) 100%);
}

.hero-contenu {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: clamp(24px, 5vw, 56px);
}

.hero-pastille {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  /* Translucide mais foncée : le texte blanc reste lisible (contraste AA)
     même quand la photo est claire à cet endroit */
  background: rgba(8, 36, 94, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 600;
  font-size: clamp(12px, 1.5vw, 14px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 16px;
  font-weight: 800;
  font-size: clamp(32px, 6.4vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: pretty;
}

.hero-sous-titre {
  max-width: 520px;
  margin-bottom: 28px;
  color: #EDF1FB;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.5;
}

.hero .bouton {
  font-size: clamp(18px, 2.6vw, 22px);
  padding: 18px 30px;
  box-shadow: 0 10px 30px rgba(8, 36, 94, 0.45);
}


/* 7. Accueil : bandeau de réassurance ------------------------------------- */

.reassurance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 28px;
  margin: 0 clamp(10px, 2.5vw, 20px);
  padding: 18px clamp(16px, 4vw, 32px);
  list-style: none;
  background: var(--bleu-clair);
  border-radius: 18px;
  color: var(--bleu-fonce);
  font-weight: 600;
  font-size: clamp(14px, 1.8vw, 17px);
}

/* Petite pastille ronde entre deux mentions */
.reassurance li + li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 28px;
  vertical-align: middle;
  border-radius: 999px;
  background: var(--bleu);
  opacity: 0.45;
}

/* Sur petit écran : deux colonnes, chaque mention précédée de sa pastille */
@media (max-width: 559px) {
  .reassurance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    justify-items: start;
  }

  .reassurance li {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
  }

  .reassurance li::before,
  .reassurance li + li::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    margin: 0;
    border-radius: 999px;
    background: var(--bleu);
    opacity: 0.45;
  }
}


/* 8. Accueil : prestations ------------------------------------------------ */

.prestations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: clamp(12px, 2vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Toute la carte est un lien vers la page Travaux */
.prestation {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 260px;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bleu-fonce);
  color: #fff;
}

.prestation:hover {
  color: #fff;
}

.prestation img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 0.4s;
}

.prestation::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 36, 94, 0.05), rgba(8, 36, 94, 0.88));
}

.prestation-texte {
  position: relative;
  z-index: 1;
  padding: 20px;
}

.prestation-texte svg {
  margin-bottom: 10px;
}

.prestation h3 {
  margin-bottom: 6px;
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 22px);
  color: #fff;
}

.prestation p {
  color: #E6ECFA;
  font-size: clamp(15px, 1.5vw, 15px);
  line-height: 1.45;
}

.prestation-lien {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s;
}

/* Sur ordinateur (souris), la mention n'apparaît qu'au survol ou au clavier */
@media (hover: hover) and (min-width: 760px) {
  .prestation-lien {
    opacity: 0;
  }

  .prestation:hover .prestation-lien,
  .prestation:focus-visible .prestation-lien {
    opacity: 1;
  }

  .prestation:hover img {
    transform: scale(1.04);
  }
}


/* 9. Réalisations : avant/après et galerie -------------------------------- */

.avant-apres {
  margin-bottom: clamp(16px, 3vw, 28px);
  padding: clamp(16px, 3vw, 28px);
  background: var(--bleu-fonce);
  border-radius: 22px;
}

.avant-apres-titre {
  margin-bottom: 16px;
  color: #BFD0F5;
  font-family: var(--texte);
  font-weight: 600;
  font-size: clamp(13px, 1.5vw, 14px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.avant-apres-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(10px, 2vw, 18px);
}

.avant-apres figure {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
}

.avant-apres .photo,
.avant-apres .photo-attente {
  aspect-ratio: 4 / 3;
}

/* Galerie en colonnes façon « mur de photos » */
.galerie {
  column-width: 280px;
  column-gap: clamp(12px, 2vw, 18px);
}

.galerie figure {
  margin: 0 0 clamp(12px, 2vw, 18px);
  break-inside: avoid;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(26, 25, 23, 0.07);
}

.galerie figcaption {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

/* Une photo sur deux en portrait, pour l'effet de mur */
.galerie figure:nth-child(odd) .photo,
.galerie figure:nth-child(odd) .photo-attente {
  aspect-ratio: 3 / 4;
}

.galerie figure:nth-child(even) .photo,
.galerie figure:nth-child(even) .photo-attente {
  aspect-ratio: 4 / 3;
}

.realisations-suite {
  margin-top: clamp(8px, 2vw, 14px);
  text-align: center;
}

/* Photo cliquable (ouvre la visionneuse) */
.photo-lien {
  display: block;
  position: relative;
}

.photo {
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--beige);
}

.photo-lien .photo {
  transition: opacity 0.2s;
}

.photo-lien:hover .photo {
  opacity: 0.88;
}


/* 10. Accueil : pourquoi Christian, étapes, avis -------------------------- */

.atout {
  padding: 26px;
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 20px;
}

.atout-icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--bleu-clair);
}

.atout h3,
.etape h3 {
  margin-bottom: 8px;
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 22px);
}

.atout p,
.etape p {
  color: #4A4642;
  font-size: 16px;
  line-height: 1.55;
}

.etapes {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.etape {
  padding: 26px;
  background: var(--beige);
  border-radius: 20px;
}

.etape-numero {
  display: block;
  margin-bottom: 12px;
  font-family: var(--titres);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  color: var(--bleu);
}

/* Emplacement d'avis encore vide */
.avis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  margin: 0;
  padding: 26px;
  background: #fff;
  border: 2px dashed #D8CFC2;
  border-radius: 20px;
  color: var(--gris);
}

.avis p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.6;
}

.avis-auteur {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.avis-auteur::before {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--beige);
}


/* 11. Accueil : contact et zone d'intervention ---------------------------- */

.contact {
  margin: clamp(48px, 8vw, 88px) clamp(10px, 2.5vw, 20px) 0;
  padding: clamp(28px, 5vw, 56px);
  background: var(--bleu-fonce);
  border-radius: 24px;
  color: #fff;
}

.contact-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.contact h2 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: clamp(26px, 4.4vw, 40px);
  letter-spacing: -0.015em;
  color: #fff;
}

/* La colonne sert de repère pour la taille du numéro (unité cqi ci-dessous) */
.contact-appel {
  container-type: inline-size;
}

.contact-numero {
  display: block;
  margin-bottom: 18px;
  font-family: var(--titres);
  font-weight: 800;
  font-size: clamp(29px, 6vw, 58px);
  /* …sans jamais dépasser la largeur de sa colonne */
  font-size: min(clamp(29px, 6vw, 58px), 14.5cqi);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
}

.contact-numero:hover {
  color: #BFD0F5;
}

.contact-horaires {
  margin-bottom: 6px;
  color: #C8D6F4;
  font-size: clamp(16px, 1.8vw, 17px);
}

.contact-email {
  margin-bottom: 24px;
  font-size: clamp(16px, 1.8vw, 17px);
}

.contact-email a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.contact-email a:hover {
  color: #BFD0F5;
}

.contact .bouton:hover {
  background: #2A5CD8;
}

/* Lien vers « Préparer ma demande », volontairement plus discret que le
   bouton d'appel juste au-dessus */
.contact-demande {
  margin-top: 16px;
  font-size: clamp(15px, 1.7vw, 16px);
}

.contact-demande a {
  color: #C8D6F4;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-demande a:hover {
  color: #fff;
}

.zone h3 {
  margin-bottom: 14px;
  font-family: var(--texte);
  font-size: clamp(13px, 1.5vw, 14px);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #BFD0F5;
  line-height: 1.4;
}

.zone-carte {
  padding: 16px;
  background: #0C2E72;
  border-radius: 20px;
}

.zone-carte svg {
  width: 100%;
  height: auto;
}

.zone-communes {
  margin-top: 14px;
  color: #C8D6F4;
  font-size: 15px;
  line-height: 1.5;
}


/* 12. Page Travaux -------------------------------------------------------- */

.page-titre {
  padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 40px) 0;
}

.page-titre h1 {
  margin-bottom: 8px;
  font-weight: 800;
  font-size: clamp(32px, 6.4vw, 58px);
  letter-spacing: -0.02em;
}

.page-titre p {
  color: var(--gris);
  font-size: clamp(17px, 2.2vw, 19px);
}

/* Rangée de filtres */
.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.filtre {
  display: inline-block;
  padding: 10px 18px;
  border: 2px solid var(--bleu);
  border-radius: 999px;
  background: #fff;
  color: var(--bleu);
  font-weight: 700;
  font-size: clamp(15px, 1.6vw, 16px);
}

.filtre:hover {
  background: var(--bleu-clair);
  color: var(--bleu-fonce);
}

.filtre[aria-current="true"] {
  background: var(--bleu);
  color: #fff;
}

/* Une section par catégorie */
.categorie {
  scroll-margin-top: calc(var(--hauteur-entete) + 16px);
}

/* Marge (et non padding) : ainsi le titre s'arrête pile sous l'en-tête */
.categorie + .categorie {
  margin-top: clamp(40px, 6vw, 64px);
}

.categorie h2 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: clamp(26px, 4.4vw, 40px);
  letter-spacing: -0.015em;
}

.chantiers {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
}

/* Carte d'un chantier */
.chantier {
  padding: clamp(18px, 3vw, 28px);
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 20px;
}

.chantier h3 {
  margin-bottom: 4px;
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 24px);
}

.chantier-lieu {
  margin-bottom: 10px;
  color: var(--gris);
  font-size: 15px;
  font-weight: 500;
}

.chantier-description {
  max-width: 70ch;
  margin-bottom: 18px;
}

.chantier-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chantier-photos li {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
}

.chantier-photos .photo,
.chantier-photos .photo-attente {
  aspect-ratio: 4 / 3;
}


/* 13. Photos en attente et messages d'erreur ------------------------------ */

/* Remplace une photo pas encore déposée dans assets/img */
.photo-attente {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 18px;
  text-align: center;
  background: var(--bleu-clair);
  border: 2px dashed #9DB3E6;
  border-radius: 18px;
  color: var(--bleu-fonce);
  font-size: 14px;
  line-height: 1.45;
}

.photo-attente strong {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.galerie .photo-attente,
.avant-apres .photo-attente {
  border-radius: 18px 18px 0 0;
}

.avant-apres .photo-attente {
  border-radius: 18px;
  padding-top: 44px;
}

.message-erreur {
  padding: 24px;
  background: #FFF4F2;
  border: 2px solid #E3A89C;
  border-radius: 20px;
  color: #7A2415;
}

.message-erreur strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.message-erreur p + p {
  margin-top: 8px;
}

.message-erreur code {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.chargement {
  color: var(--gris);
}


/* 14. Visionneuse --------------------------------------------------------- */

.visionneuse {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 20, 50, 0.94);
  color: #fff;
}

.visionneuse::backdrop {
  background: rgba(8, 20, 50, 0.6);
}

.visionneuse[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.visionneuse figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 72px 72px 24px;
  max-width: 100%;
  max-height: 100%;
}

.visionneuse img {
  max-width: min(100%, 1600px);
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  width: auto;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

.visionneuse figcaption {
  max-width: 70ch;
  text-align: center;
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.45;
}

.visionneuse-compteur {
  display: block;
  margin-top: 4px;
  color: #BFD0F5;
  font-size: 14px;
}

.visionneuse button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.visionneuse button:hover {
  background: var(--bleu);
}

.visionneuse-fermer {
  top: 14px;
  right: 14px;
}

.visionneuse-precedent,
.visionneuse-suivant {
  top: 50%;
  transform: translateY(-50%);
}

.visionneuse-precedent {
  left: 12px;
}

.visionneuse-suivant {
  right: 12px;
}

@media (max-width: 759px) {
  .visionneuse figure {
    padding: 72px 12px 96px;
  }

  .visionneuse img {
    max-height: calc(100dvh - 230px);
  }

  /* Sur téléphone, les flèches passent en bas pour ne pas cacher la photo */
  .visionneuse-precedent,
  .visionneuse-suivant {
    top: auto;
    bottom: calc(20px + env(safe-area-inset-bottom));
    transform: none;
  }

  .visionneuse-precedent {
    left: calc(50% - 64px);
  }

  .visionneuse-suivant {
    right: calc(50% - 64px);
  }
}

/* Empêche la page de défiler derrière la visionneuse */
body.visionneuse-ouverte {
  overflow: hidden;
}


/* 15. Pages de texte (mentions légales, 404) ------------------------------ */

.texte-page {
  max-width: 760px;
}

.texte-page h2 {
  margin: 36px 0 10px;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 28px);
}

.texte-page p + p {
  margin-top: 10px;
}

.texte-page address {
  font-style: normal;
}

.page-404 {
  text-align: center;
  padding-bottom: clamp(24px, 6vw, 48px);
}

.page-404 .page-titre p {
  margin-bottom: 28px;
}

.page-404 .boutons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}


/* 16. Pied de page -------------------------------------------------------- */

.pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 40px);
  color: var(--gris);
  font-size: 14px;
}

.pied p {
  margin: 0;
}

.pied a {
  color: var(--gris);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pied a:hover {
  color: var(--bleu-fonce);
}


/* 17. Accessibilité ------------------------------------------------------- */

/* Contour bien visible pour la navigation au clavier */
:focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 3px;
}

.contact :focus-visible,
.hero :focus-visible,
.visionneuse :focus-visible,
.avant-apres :focus-visible {
  outline-color: #fff;
}

.prestation:focus-visible {
  outline-offset: 4px;
}

/* Lien « Aller au contenu », visible seulement au clavier */
.lien-evitement {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--bleu-fonce);
  color: #fff;
  font-weight: 700;
}

.lien-evitement:focus {
  top: 12px;
  color: #fff;
}

/* Texte lu par les lecteurs d'écran mais invisible à l'écran */
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Défilement doux, sauf si la personne a demandé moins d'animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}


/* 18. Page « Préparer ma demande » ----------------------------------------- */

.demande {
  padding-bottom: clamp(8px, 2vw, 16px);
}

/* Une colonne sur téléphone et tablette ; sur grand écran, l'aperçu du
   message reste visible à droite pendant qu'on répond */
.demande-grille {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
  align-items: start;
}

@media (min-width: 1024px) {
  .demande-grille {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  }

  .demande-envoi {
    position: sticky;
    top: calc(var(--hauteur-entete) + 16px);
  }
}

.demande-questions {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
  min-width: 0;
}

.demande-carte {
  min-width: 0;
  margin: 0;
  padding: clamp(20px, 3vw, 28px);
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 20px;
}

/* Titre d'étape : <legend> (étapes 1 et 2) ou <h2> (étape 3), même aspect */
.demande-legende {
  display: block;
  float: left;            /* place la légende dans la carte, comme un titre */
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--titres);
  font-weight: 700;
  font-size: clamp(21px, 2.6vw, 25px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.demande-legende + * {
  clear: both;
}

h2.demande-legende {
  float: none;
}

.demande-etape {
  display: block;
  margin-bottom: 6px;
  font-family: var(--texte);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bleu);
}

.demande-aide {
  margin-bottom: 16px;
  color: var(--gris);
  font-size: 15px;
}

/* Étape 1 : tuiles à choix unique (boutons radio habillés) */
.tuiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 479px) {
  .tuiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tuile {
  position: relative;
  display: block;
  padding: 14px 16px;
  background: var(--fond);
  border: 2px solid var(--bordure);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.tuile--large {
  grid-column: 1 / -1;
}

.tuile:hover {
  border-color: #CFC6B8;
}

/* Le vrai bouton radio reste présent (clavier, lecteurs d'écran) mais invisible */
.tuile input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.tuile:has(input:checked) {
  background: var(--bleu-clair);
  border-color: var(--bleu);
}

.tuile:has(input:focus-visible) {
  outline: 3px solid var(--bleu);
  outline-offset: 3px;
}

.tuile-titre {
  display: block;
  margin-bottom: 2px;
  font-family: var(--titres);
  font-weight: 700;
  font-size: 17px;
}

.tuile-texte {
  display: block;
  color: var(--gris);
  font-size: 14px;
  line-height: 1.4;
}

/* Étape 2 : champs, sur deux colonnes quand la place le permet */
.champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.champ--large {
  grid-column: 1 / -1;
}

.champ label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 15px;
}

.champ select,
.champ input,
.champ textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;        /* 16 px minimum : évite le zoom automatique sur iPhone */
  color: var(--encre);
  background: var(--fond);
  border: 1px solid #D9D0C3;
  border-radius: 12px;
}

.champ textarea {
  min-height: 96px;
  resize: vertical;
}

.champ select:focus-visible,
.champ input:focus-visible,
.champ textarea:focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 1px;
}

/* Étape 3 : aperçu du message, façon bulle de discussion */
.apercu {
  padding: 16px;
  background: var(--bleu-clair);
  border-radius: 16px 16px 16px 4px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.demande-boutons {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.demande-boutons .bouton {
  width: 100%;
}

.demande-boutons-secondaires {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 10px;
}

/* Bouton secondaire : contour bleu, plus petit que le bouton principal */
.bouton--secondaire {
  padding: 13px 16px;
  font-size: 16px;
  background: #fff;
  color: var(--bleu);
  border: 2px solid var(--bleu);
  cursor: pointer;
}

.bouton--secondaire:hover {
  background: var(--bleu-clair);
  color: var(--bleu-fonce);
}

.rappel-photo {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--beige);
  border-radius: 14px;
  font-size: 15px;
}

.rappel-photo strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--titres);
}

.demande-noscript {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--beige);
  border-radius: 14px;
}

/* Confirmation « Message copié », au-dessus du bouton d'appel mobile */
.demande-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 70;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  background: var(--encre);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
}

@media (max-width: 759px) {
  .demande-toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
}
