/* =========================================================
   Singulier · feuille de style « Lin et brume »
   ========================================================= */

/* ---------- Couleurs et réglages (modifiables ici) ---------- */
:root {
  --fond: #F3F5F2;
  --surface: #FFFFFF;
  --texte: #26332F;
  --texte-doux: #52605A;
  --trait: #DCE2DC;
  --accent: #2F6B5E;
  --accent-texte: #FFFFFF;
  --logo: #154734;

  --tdah: #E8956B;     --tdah-pale: #FBEEE6;
  --dys: #2E9C80;      --dys-pale: #E4F2EC;
  --autisme: #8E6799;  --autisme-pale: #F0EAF2;

  --syllabe-1: #1F4E8C;
  --syllabe-2: #9C3A1C;

  --taille: 18px;
  --interligne: 1.6;
  --police: "Open Sans", Arial, sans-serif;
  --epaisseur-trait: 1px;
}

/* Réglages choisis par la personne */
html[data-interligne="aere"]      { --interligne: 1.9; }
html[data-interligne="tres-aere"] { --interligne: 2.2; }
html[data-police="arial"]         { --police: Arial, Helvetica, sans-serif; }

html[data-contraste="oui"] {
  --fond: #FFFFFF;
  --surface: #FFFFFF;
  --texte: #000000;
  --texte-doux: #111111;
  --trait: #000000;
  --accent: #0B2E20;
  --logo: #0B2E20;
  --tdah-pale: #FFFFFF;
  --dys-pale: #FFFFFF;
  --autisme-pale: #FFFFFF;
  --syllabe-1: #002B80;
  --syllabe-2: #7A1500;
  --epaisseur-trait: 2px;
}

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

html { font-size: var(--taille); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  line-height: var(--interligne);
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--logo); }

:focus-visible {
  outline: 3px solid var(--logo);
  outline-offset: 3px;
  border-radius: 4px;
}

.conteneur {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.lien-evitement {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--surface);
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 100;
}
.lien-evitement:focus { top: 16px; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.bouton--plein { background: var(--accent); color: var(--accent-texte); border: none; }
.bouton--plein:hover { color: var(--accent-texte); filter: brightness(0.92); }
.bouton--contour {
  background: transparent;
  color: var(--accent);
  border: calc(var(--epaisseur-trait) + 1px) solid var(--accent);
}
.bouton--pilule {
  /* Le bouton du panneau garde une taille fixe pour rester facile à trouver */
  font-size: 15px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--surface);
  color: var(--texte);
  border: var(--epaisseur-trait) solid var(--trait);
}
.bouton--pilule[aria-expanded="true"] {
  background: var(--accent);
  color: var(--accent-texte);
  border-color: var(--accent);
}

/* ---------- En-tête ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--fond);
}
.entete__barre {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.marque {
  display: inline-flex;
  align-items: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--logo);
}
.marque__s {
  height: 38px;
  width: auto;
  margin: -4px -0.08em -4px -4px;
}

/* ---------- Panneau de lecture (tailles fixes pour rester stable) ---------- */
.panneau {
  position: absolute;
  right: 24px;
  top: calc(100% + 8px);
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  color: var(--texte);
  border: var(--epaisseur-trait) solid var(--trait);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(30, 40, 35, 0.10);
}
.panneau[hidden] { display: none; }

.panneau__haut, .panneau__bas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panneau__titre { margin: 0; font-size: 17px; font-weight: 600; }

.bouton-icone {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--texte);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bouton-icone:hover { background: var(--fond); }

.reglage { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 8px; }
.reglage legend, .reglage label { font-size: 13px; color: var(--texte-doux); padding: 0; margin-bottom: 8px; }
.reglage label { margin-bottom: 0; }
.reglage--ligne { flex-direction: row; align-items: center; justify-content: space-between; }

.choix { display: flex; flex-wrap: wrap; gap: 8px; }

.pilule {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  background: var(--surface);
  color: var(--texte);
  border: var(--epaisseur-trait) solid var(--trait);
}
.pilule[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-texte);
  border-color: var(--accent);
}

.curseur { display: flex; align-items: center; gap: 12px; }
.curseur input { flex: 1; min-height: 44px; accent-color: var(--accent); }
.curseur__petit { font-size: 14px; }
.curseur__grand { font-size: 24px; }

.note { margin: 0; font-size: 13px; color: var(--texte-doux); }
.lien-bouton {
  background: none;
  border: none;
  padding: 8px 0;
  min-height: 44px;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Accueil ---------- */
main { padding-top: 24px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 64px; }

.accueil {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}
.accueil__titre {
  margin: 8px 0 0;
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--logo);
}
.accueil__intro { margin: 0; max-width: 680px; font-size: 1.2rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* Logo avec ses trois points cliquables */
.logo-interactif {
  position: relative;
  width: 300px;
  max-width: 80%;
}
.logo-interactif img { display: block; width: 100%; }

.point {
  position: absolute;
  width: 13%;
  min-width: 44px;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.point:hover, .point:focus-visible { transform: translate(-50%, -50%) scale(1.12); }

.point--tdah    { left: 9.2%;  top: 44.6%; --couleur: var(--tdah); }
.point--dys     { left: 86%;   top: 10.6%; --couleur: var(--dys); }
.point--autisme { left: 59.7%; top: 76.5%; --couleur: var(--autisme); }
.point:hover { box-shadow: 0 0 0 4px var(--couleur); }

.point__etiquette {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 6px);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--couleur);
  padding: 2px 10px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .point { transition: none; }
}

/* ---------- Cartes ---------- */
.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.carte {
  scroll-margin-top: 96px;
  background: var(--pale);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}
html[data-contraste="oui"] .carte { border: 2px solid var(--trait); }
.carte:target { border-color: var(--couleur); }
html[data-contraste="oui"] .carte:target { border-width: 3px; border-color: var(--texte); }

.carte--tdah    { --couleur: var(--tdah);    --pale: var(--tdah-pale); }
.carte--dys     { --couleur: var(--dys);     --pale: var(--dys-pale); }
.carte--autisme { --couleur: var(--autisme); --pale: var(--autisme-pale); }

.carte__entete { display: flex; align-items: center; gap: 12px; }
.carte__entete h2 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.carte__pastille { width: 18px; height: 18px; border-radius: 50%; background: var(--couleur); flex: none; }
.carte p { margin: 0; }
.carte--ouverte { border-color: var(--couleur); }
html[data-contraste="oui"] .carte--ouverte { border-width: 3px; border-color: var(--texte); }

/* Détail dépliable : s'ouvre sous les cartes, sur toute la largeur */
.accompagnements { display: flex; flex-direction: column; gap: 20px; }
.detail {
  scroll-margin-top: 96px;
  background: var(--surface);
  border: 2px solid var(--couleur);
  border-radius: 18px;
  padding: 32px;
}
.detail[hidden] { display: none; }
html[data-contraste="oui"] .detail { border-color: var(--texte); }
.detail--tdah    { --couleur: var(--tdah); }
.detail--dys     { --couleur: var(--dys); }
.detail--autisme { --couleur: var(--autisme); }

.detail__entete { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.detail__titre { margin: 0; font-size: 1.4rem; font-weight: 600; }
.detail__rubriques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px 40px;
}
.rubrique h4 { margin: 0 0 8px; font-size: 1rem; font-weight: 600; }
.rubrique p { margin: 0; }
.rubrique ul { margin: 0; padding-left: 1.2em; }
.rubrique li + li { margin-top: 6px; }

.carte__bouton {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.carte__chevron { transition: transform 0.2s ease; flex: none; }
.carte__bouton[aria-expanded="true"] .carte__chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .carte__chevron { transition: none; } }

/* ---------- Séance découverte : encart ---------- */
.detail__action { margin-top: 24px; }

.rdv {
  scroll-margin-top: 96px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 48px;
  background: #FDF4E9;
  border-radius: 24px;
  padding: 24px;
}
html[data-contraste="oui"] .rdv { background: var(--surface); border: 2px solid var(--trait); }
.rdv__image {
  flex: 1 1 340px;
  min-width: 0;
  width: 100%;
  max-width: 520px;
  border-radius: 16px;
}
.rdv__texte { flex: 1 1 300px; min-width: 0; padding: 8px; }
.rdv__texte h2 { margin: 0 0 12px; font-size: 1.6rem; line-height: 1.25; font-weight: 600; color: var(--logo); }
.rdv__texte p { margin: 0 0 24px; }

/* ---------- Séance découverte : fenêtre ---------- */
.fenetre {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px;
  border: var(--epaisseur-trait) solid var(--trait);
  border-radius: 20px;
  background: var(--surface);
  color: var(--texte);
  font-family: var(--police);
  line-height: var(--interligne);
  box-shadow: 0 24px 60px rgba(30, 40, 35, 0.18);
}
.fenetre::backdrop { background: rgba(38, 51, 47, 0.45); }
.fenetre[open] { animation: apparition 0.2s ease-out; }
@keyframes apparition { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fenetre[open] { animation: none; } }

.fenetre__haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.fenetre__etape { margin: 0 0 2px; font-size: 0.85rem; color: var(--texte-doux); }
.fenetre__titre { margin: 0; font-size: 1.4rem; line-height: 1.25; font-weight: 600; color: var(--logo); }
.fenetre__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.fenetre__merci { display: flex; flex-direction: column; gap: 8px; }
.fenetre__merci[hidden] { display: none; }
.fenetre__merci p { margin: 0; }
.fenetre__merci-titre { font-size: 1.2rem; font-weight: 600; color: var(--accent); }

.formulaire { display: flex; flex-direction: column; gap: 20px; }
.etape { display: flex; flex-direction: column; gap: 20px; }
.etape[hidden] { display: none; }
.champ { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ > label, .champ > legend { font-weight: 600; padding: 0; }
.champ > legend { margin-bottom: 6px; }
.champs-ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.facultatif { font-weight: 400; color: var(--texte-doux); font-size: 0.85em; }

.formulaire input[type="text"],
.formulaire input[type="email"],
.formulaire input[type="tel"],
.formulaire textarea {
  font: inherit;
  color: var(--texte);
  background: var(--fond);
  border: var(--epaisseur-trait) solid var(--trait);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 48px;
  width: 100%;
}
.formulaire textarea { resize: vertical; line-height: var(--interligne); }
.formulaire input:focus-visible, .formulaire textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.formulaire [aria-invalid="true"] { border-color: #B3261E; border-width: 2px; }

.options { display: flex; flex-wrap: wrap; gap: 10px; }
.option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 16px 6px 12px;
  border: var(--epaisseur-trait) solid var(--trait);
  border-radius: 999px;
  background: var(--fond);
  cursor: pointer;
  font-weight: 400;
}
.option input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.option:has(input:checked) { border-color: var(--accent); background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }
.champ > .option--accord { border-radius: 12px; align-items: flex-start; padding: 12px 16px; font-weight: 400; }
.option--accord input { margin-top: 3px; }

.aide { margin: 0; font-size: 0.85rem; color: var(--texte-doux); }
.erreur { margin: 0; font-size: 0.9rem; font-weight: 600; color: #B3261E; }
.erreur[hidden] { display: none; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.formulaire .bouton { border-style: solid; }
.formulaire .bouton--plein { border: none; }
.formulaire .bouton[disabled] { opacity: 0.6; cursor: wait; }
.formulaire__statut { margin: 0; font-weight: 600; }
.formulaire__statut:empty { display: none; }
.formulaire__statut--erreur { color: #B3261E; background: #FBEAEA; padding: 14px 16px; border-radius: 12px; }

/* ---------- Pied de page ---------- */
.pied { border-top: var(--epaisseur-trait) solid var(--trait); padding: 24px 0; }
.pied p { margin: 0; font-size: 0.85rem; color: var(--texte-doux); text-align: center; }

/* ---------- Mode syllabique ---------- */
.mot { display: inline-block; margin-right: 0.35em; }
.syl-1 { color: var(--syllabe-1); }
.syl-2 { color: var(--syllabe-2); }

/* ---------- Petits écrans ---------- */
@media (max-width: 600px) {
  .panneau { right: 16px; }
  .accueil__titre { font-size: 1.7rem; }
  .actions { flex-direction: column; align-items: stretch; }
  .fenetre { padding: 20px; }
  .fenetre__actions .bouton { flex: 1 1 auto; justify-content: center; }
  .rdv { padding: 16px; }
}
