/* Neurodesign : feuille de style principale
   Pour changer les couleurs du site, modifiez les variables ci-dessous. */

:root {
  --anthracite: #2b3440;
  --anthracite-doux: #4a5a6c;
  --ligne: #66748a;
  --accent: #7fa6c9;
  --fond: #e9edf1;
  --fond-image: #c9d2db;
  --blanc: #ffffff;

  /* Bai Jamjuree est chargée dans le <head> de chaque page. Polices d'origine : "Bricolage Grotesque" (titres) et "DM Sans" (texte) */
  --police-titre: "Bai Jamjuree", "Avenir Next", "Segoe UI", sans-serif;
  --police-texte: "Bai Jamjuree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --largeur: 1240px;
  --marge: 24px;
  --rayon: 16px;
  --espace-section: 144px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

/* Le contenu occupe la hauteur libre : le pied de page reste en bas sur les pages courtes */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--fond);
  color: var(--anthracite);
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.55;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--anthracite);
  transition: color 0.4s ease, opacity 0.4s ease;
}

a:hover {
  color: var(--anthracite-doux);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--police-titre);
  font-weight: 700;
  margin: 0;
}

h1 {
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.conteneur {
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--marge);
}

.lien-evitement {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 12px 18px;
  background: var(--blanc);
}

.lien-evitement:focus {
  top: 16px;
}

/* En-tête */

.bandeau {
  padding: 10px var(--marge);
  background-color: var(--anthracite);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--blanc);
}

.entete {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: var(--largeur);
  margin-inline: auto;
  padding: 22px var(--marge);
}

.logo img {
  width: auto;
  height: 28px;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
}

.menu a {
  display: inline-block;
  padding: 10px 0;
  text-decoration: none;
}

.menu a[aria-current="page"] {
  font-weight: 700;
}

/* Menu mobile : le bouton est ajouté par assets/js/main.js.
   Sans JavaScript, le menu reste affiché normalement. */

.bouton-menu {
  display: none;
}

@media (max-width: 760px) {
  .entete-mobile {
    flex-wrap: nowrap;
  }

  .bouton-menu {
    position: relative;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: -12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--anthracite);
    cursor: pointer;
  }

  .bouton-menu-texte {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .bouton-menu-barres {
    position: relative;
    display: block;
    width: 24px;
    height: 16px;
  }

  .bouton-menu-barres span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.35s ease, opacity 0.2s ease, top 0.35s ease;
  }

  .bouton-menu-barres span:nth-child(1) { top: 0; }
  .bouton-menu-barres span:nth-child(2) { top: 7px; }
  .bouton-menu-barres span:nth-child(3) { top: 14px; }

  .menu-ouvert .bouton-menu {
    color: var(--blanc);
  }

  .menu-ouvert .bouton-menu-barres span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
  }

  .menu-ouvert .bouton-menu-barres span:nth-child(2) {
    opacity: 0;
  }

  .menu-ouvert .bouton-menu-barres span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
  }

  /* Panneau plein écran qui glisse depuis la droite */
  .entete-mobile nav {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    padding: 96px var(--marge) 48px;
    overflow-y: auto;
    background: var(--anthracite);
    color: var(--blanc);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.45s ease, visibility 0s linear 0.45s;
  }

  .menu-ouvert nav {
    transform: none;
    visibility: visible;
    transition: transform 0.45s ease, visibility 0s;
  }

  .entete-mobile .menu {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    font-family: var(--police-titre);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
  }

  .entete-mobile .menu a {
    color: var(--blanc);
    padding: 12px 0;
  }

  .entete-mobile .menu a:hover,
  .entete-mobile .menu a[aria-current="page"] {
    color: var(--accent);
  }

  .defilement-bloque,
  .defilement-bloque body {
    overflow: hidden;
  }
}

/* Boutons */

.boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--anthracite);
  border-radius: 26px;
  background: var(--anthracite);
  color: var(--blanc);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease;
}

.bouton:hover {
  background: var(--anthracite-doux);
  border-color: var(--anthracite-doux);
  color: var(--blanc);
}

.bouton-contour {
  background: transparent;
  color: var(--anthracite);
}

.bouton-contour:hover {
  background: var(--anthracite);
  border-color: var(--anthracite);
}

/* Haut de page d'accueil */

.heros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 48px;
  align-items: center;
  padding-top: 32px;
  padding-bottom: var(--espace-section);
}

.heros h1 {
  margin-bottom: 24px;
}

.insecable {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .saut-large {
    display: none;
  }
}

.surtitre {
  display: block;
  margin-bottom: 16px;
  font-family: var(--police-texte);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: normal;
  color: var(--anthracite-doux);
}

.heros .chapeau {
  max-width: 560px;
  margin-bottom: 30px;
}

.chapeau {
  font-size: 20px;
  line-height: 1.5;
}

.emplacement {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--fond-image);
  font-size: 14px;
  text-align: center;
}

.portrait {
  width: 100%;
  border-radius: 20px;
}

.emplacement-large {
  aspect-ratio: 16 / 9;
  border-radius: 20px;
}

.emplacement-carte {
  aspect-ratio: 4 / 3;
}

.visuel-carte {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.visuel-large {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
}

/* Recadrage qui conserve le logo situé en haut à gauche */
.cadrage-haut-gauche {
  object-position: left top;
}

/* Masque la barre du navigateur en haut de la capture vidéo */
.cadrage-sans-navigateur {
  object-position: 50% 66%;
}

.emplacement-galerie {
  aspect-ratio: 4 / 3;
  border-radius: var(--rayon);
}

.visuel-galerie {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--rayon);
}

/* Image affichée entière : le fond reprend sa couleur, l'enfant reste posée sur le bord bas */
.visuel-entier-turquoise {
  object-fit: contain;
  object-position: center bottom;
  background: #22d3d3;
}

/* Sections */

.section {
  padding-block: var(--espace-section);
}

.section-blanche {
  background: var(--blanc);
}

.section-sombre {
  background: var(--anthracite);
  color: var(--blanc);
}

.section-sombre a {
  color: var(--blanc);
}

.section-titre {
  margin-bottom: 32px;
}

.section-intro {
  max-width: 720px;
  margin-top: -20px;
  margin-bottom: 40px;
}

.suite {
  margin-top: 32px;
}

.grille-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
}

.grille-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 48px;
}

/* Offres */

.offre {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border-radius: var(--rayon);
  background: var(--fond);
}

.offre h3 {
  font-size: 25px;
}

.offre p:nth-of-type(1) {
  flex-grow: 1;
}

.prix {
  font-weight: 700;
}

/* Cartes de projets */

.projet {
  position: relative;
  overflow: hidden;
  border-radius: var(--rayon);
  background: var(--blanc);
  transition: transform 0.6s ease;
}

.projet:hover {
  transform: translateY(-4px);
}

.projet:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.projet-texte {
  padding: 22px;
}

.projet-date {
  margin-bottom: 4px;
  font-size: 14px;
}

.projet h3 {
  margin-bottom: 8px;
  font-size: 23px;
}

.projet h3 a {
  text-decoration: none;
}

.projet h3 a:focus-visible {
  outline: none;
}

/* Toute la carte devient cliquable */
.projet h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.projet-lien {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* À propos */

.sous-titre {
  margin: 0 0 14px;
  font-family: var(--police-texte);
  font-size: 19px;
}

.section-sombre .sous-titre {
  color: var(--accent);
}

.liste-lignes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.liste-lignes li {
  padding: 12px 0;
  border-top: 1px solid var(--ligne);
}

.pile > * + * {
  margin-top: 16px;
}

/* Méthode */

.etapes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: etape;
}

.etapes li {
  counter-increment: etape;
}

.etapes li::before {
  content: counter(etape);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 24px;
  background: var(--accent);
  font-weight: 700;
}

.etapes h3,
.question h3 {
  margin-bottom: 6px;
  font-family: var(--police-texte);
  font-size: 19px;
}

/* Questions fréquentes */

.questions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
}

/* Contact */

.contact-titre {
  margin-bottom: 16px;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.contact-texte {
  max-width: 480px;
  margin-bottom: 24px;
}

.formulaire {
  display: grid;
  gap: 16px;
}

.formulaire label {
  display: grid;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
}

.formulaire input,
.formulaire textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--anthracite);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--anthracite);
  font: inherit;
}

.formulaire input {
  height: 46px;
}

.formulaire textarea {
  resize: vertical;
}

/* Champ invisible qui piège les robots */
.champ-piege {
  position: absolute;
  left: -9999px;
}

.note {
  font-size: 14px;
}

/* Mention de TVA sous les prix */
.grille-3 + .note,
.suite + .note {
  margin-top: 20px;
}

.message-erreur {
  padding: 14px 16px;
  border: 1px solid var(--anthracite);
  border-radius: 10px;
  background: var(--fond);
  font-weight: 500;
}

/* Pages intérieures */

.page-tete {
  padding-top: 56px;
  padding-bottom: 88px;
}

.page-tete h1 {
  margin-bottom: 16px;
}

.page-tete .chapeau {
  max-width: 760px;
}

.fil {
  display: inline-block;
  margin-bottom: 24px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
}

.tableau-defilant {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--fond-image);
  text-align: left;
}

th:last-child,
td:last-child {
  text-align: right;
  white-space: nowrap;
}

th {
  border-bottom: 2px solid var(--anthracite);
}

td:last-child {
  font-weight: 700;
}

.fiche {
  margin-top: 72px;
}

.fiche h2 {
  margin-bottom: 8px;
  font-family: var(--police-texte);
  font-size: 21px;
  letter-spacing: 0;
}

.fiche-bloc + .fiche-bloc {
  margin-top: 28px;
}

.galerie {
  margin-top: 72px;
}

.projet-suivant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.texte-legal {
  max-width: 800px;
}

.texte-legal h2 {
  margin-top: 40px;
  margin-bottom: 10px;
  font-family: var(--police-texte);
  font-size: 22px;
  letter-spacing: 0;
}

.texte-legal p + p {
  margin-top: 12px;
}

.texte-legal ul {
  padding-left: 22px;
}

.a-completer {
  padding: 1px 5px;
  border-radius: 4px;
  background: #ffe8a3;
}

/* Pied de page */

.pied {
  background: var(--anthracite);
  color: var(--blanc);
  font-size: 14px;
}

.pied a {
  color: var(--blanc);
  text-decoration: none;
}

.pied a:hover {
  opacity: 0.75;
}

.pied p {
  max-width: var(--largeur);
  margin-inline: auto;
  padding: 24px var(--marge);
}

/* Animations (le fonctionnement est dans assets/js/animations.js) */

/* Apparition de la page à l'arrivée */
main,
.pied {
  animation: apparition 0.9s ease backwards;
}

@keyframes apparition {
  from {
    opacity: 0;
  }
}

/* Sortie de page en fondu ; l'en-tête reste en place */
.page-sortie main,
.page-sortie .pied {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Apparition au défilement */
.a-reveler {
  opacity: 0;
  transform: translateY(16px);
}

.a-reveler.revele {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s ease var(--delai, 0ms), transform 1.2s ease var(--delai, 0ms);
}

/* Léger zoom de l'image au survol d'un projet */
.projet .visuel-carte {
  transition: transform 1s ease;
}

.projet:hover .visuel-carte {
  transform: scale(1.03);
}

@media print {
  .a-reveler {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 600px) {
  :root {
    --espace-section: 96px;
  }

  .bouton {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }

  .projet:hover,
  .projet:hover .visuel-carte {
    transform: none;
  }
}
