/* Poivre et Sel · Bien vieillir
   Direction : voir DESIGN.md. Une fiche pratique posée près du téléphone.
   Palette : sel, papier, voile, poivre, gris moulu + un seul accent, le roucou. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Young Serif";
  src: url("/assets/fonts/young-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sel: #f5f2ea;
  --papier: #fffdf8;
  --voile: #e9e4d8;
  --poivre: #1c1a17;
  --gris: #45413b;        /* texte secondaire : 9:1 sur sel */
  --filet: #8b867d;       /* filets et décor seulement, jamais du texte */
  --roucou: #7f2a0e;      /* l'unique accent : 8,4:1 sur sel */
  --roucou-clair: #f0a37f; /* le même accent, éclairci pour le fond poivre : 8,5:1 */
  --gris-clair: #cfc9bc;  /* texte secondaire sur poivre : 10,5:1 */

  --texte: "Atkinson Hyperlegible", Verdana, "DejaVu Sans", sans-serif;
  --titre: "Young Serif", Georgia, "Times New Roman", serif;

  --marge: clamp(1.1rem, 4.5vw, 2.5rem);
  --mesure: 34em;
}

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

html {
  font-size: 118.75%; /* 19 px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}
@media (min-width: 48em) {
  html { font-size: 125%; } /* 20 px */
}

body {
  margin: 0;
  background: var(--sel);
  color: var(--poivre);
  font-family: var(--texte);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  font-family: var(--titre);
  font-weight: 400;
  line-height: 1.14;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.2vw + 1rem, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 1.6vw + 1.15rem, 2.2rem); }
h3 { font-size: 1.3rem; line-height: 1.25; }

p, ul, ol, dl, table, address, fieldset { margin: 0; }
p + p, p + ul, ul + p, p + ol, ol + p { margin-top: 0.9em; }
address { font-style: normal; }
strong { font-weight: 700; }

a {
  color: var(--roucou);
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--poivre); text-decoration-thickness: 0.18em; }

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

.cadre {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--marge);
}
.lecture { max-width: var(--mesure); }
.lecture > * + h2 { margin-top: 2.6rem; }
.lecture > h2 + *, .lecture > h3 + * { margin-top: 0.8rem; }
.lecture > * + h3 { margin-top: 1.9rem; }
.lecture ul, .lecture ol { padding-left: 1.2em; }
.lecture li + li { margin-top: 0.45em; }
.lecture li::marker { color: var(--gris); }

.evitement {
  position: absolute;
  left: var(--marge);
  top: -6rem;
  z-index: 10;
  background: var(--poivre);
  color: var(--sel);
  padding: 0.9rem 1.2rem;
  font-weight: 700;
}
.evitement:focus { top: 0.5rem; color: var(--sel); outline-color: var(--roucou-clair); }

/* ───────── En-tête : le logotype et, surtout, le numéro ───────── */

.entete__haut {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem 2rem;
  padding-block: 1.1rem 1rem;
}
.logo { display: block; color: var(--poivre); line-height: 0; }
.logo:hover { color: var(--poivre); }
.logo__svg { width: clamp(11rem, 44vw, 13.75rem); height: auto; }
.logo__gris { fill: var(--gris); }
.logo__accent { fill: var(--roucou); }

.entete__appel { line-height: 1.1; }
.entete__invite { display: block; font-size: 0.9rem; color: var(--gris); margin-bottom: 0.2rem; }

.numero {
  font-family: var(--titre);
  font-size: clamp(2rem, 7.4vw, 2.6rem);
  line-height: 1.1;
  color: var(--poivre);
  white-space: nowrap;
  text-decoration-color: var(--roucou);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.14em;
}
.numero:hover { color: var(--roucou); text-decoration-thickness: 0.11em; }
.numero--moyen { font-size: 1.5rem; }
.numero--geant { font-size: clamp(2.7rem, 12.5vw, 5.4rem); letter-spacing: -0.01em; }

.menu { border-top: 3px solid var(--poivre); }
.menu ul {
  list-style: none;
  padding-block: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.2rem;
}
.menu a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding-block: 0.3rem;
  color: var(--poivre);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--filet);
}
.menu a:hover { color: var(--roucou); text-decoration-color: var(--roucou); text-decoration-thickness: 3px; }
.menu a[aria-current] { text-decoration-color: var(--roucou); text-decoration-thickness: 4px; }
@media (min-width: 48em) {
  .menu ul { display: flex; flex-wrap: wrap; column-gap: 2rem; }
  .menu a { font-size: 1rem; min-height: 56px; }
}

.grains {
  height: 18px;
  background: url("/assets/img/grains.svg") repeat-x left center;
  border-top: 1px solid var(--filet);
}
.grains--clairs { background-image: url("/assets/img/grains-clairs.svg"); border-top: 0; }

/* ───────── Fil d'Ariane ───────── */

.ariane { padding-top: 1.2rem; font-size: 0.9rem; }
.ariane ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 0.5rem; }
.ariane li { display: flex; align-items: center; min-height: 2rem; color: var(--gris); }
.ariane li + li::before { content: "›"; margin-right: 0.5rem; color: var(--gris); }
.ariane a { color: var(--gris); display: inline-block; padding-block: 0.3rem; }
.ariane a:hover { color: var(--roucou); }

/* ───────── Boutons : 56 px de haut, jamais moins de 48 ───────── */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--roucou);
  border-radius: 3px;
  background: var(--roucou);
  color: var(--papier);
  font: 700 1.05rem/1.2 var(--texte);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.bouton:hover { background: var(--poivre); border-color: var(--poivre); color: var(--papier); }
.bouton--contour { background: transparent; color: var(--poivre); border-color: var(--poivre); }
.bouton--contour:hover { background: var(--poivre); color: var(--sel); }
.bouton--clair { background: var(--sel); border-color: var(--sel); color: var(--poivre); }
.bouton--clair:hover { background: var(--roucou-clair); border-color: var(--roucou-clair); color: var(--poivre); }
.bouton--contour-clair { background: transparent; border-color: var(--sel); color: var(--sel); }
.bouton--contour-clair:hover { background: var(--sel); color: var(--poivre); border-color: var(--sel); }
.boutons { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }

.lien-suite { font-weight: 700; display: inline-block; padding-block: 0.55rem; }
.lien-suite::after { content: " →"; white-space: nowrap; }

/* ───────── Mise en page : une colonne de lecture et une marge utile ───────── */

.page { padding-block: 2rem 4rem; }
.page > .lecture > h1 + .chapeau, .tete .chapeau { margin-top: 1.1rem; }
.chapeau { font-size: 1.2rem; line-height: 1.5; max-width: 30em; }

.tete { padding-block: 2rem 2.4rem; }
.bloc { padding-block: 2.6rem; }
.bloc--voile { background: var(--voile); }
.bloc--filet { border-top: 3px solid var(--poivre); }

.deux { display: grid; gap: 2.5rem; }
@media (min-width: 62em) {
  .deux { grid-template-columns: minmax(0, var(--mesure)) minmax(15rem, 20.5rem); justify-content: space-between; gap: 4rem; align-items: start; }
  .deux--inverse { grid-template-columns: minmax(15rem, 22rem) minmax(0, var(--mesure)); }
}

/* Le carton : un encadré de papier, comme une fiche bristol. */
.carton {
  background: var(--papier);
  border: 2px solid var(--poivre);
  border-radius: 3px;
  padding: 1.3rem 1.3rem 1.5rem;
}
.carton > h2, .carton > h3 { font-size: 1.3rem; }
.carton > * + * { margin-top: 0.8rem; }
.carton ul { list-style: none; padding: 0; }
.carton li { padding-block: 0.6rem; border-top: 1px solid var(--filet); }
.carton li:first-child { margin-top: 0.3rem; }
.carton--note { border-width: 0 0 0 6px; border-radius: 0; background: var(--voile); }
.bloc--voile .carton--note { background: var(--papier); }

/* ───────── Accueil ───────── */

.une { padding-block: 2.4rem 3rem; }
.une h1 { max-width: 12em; }
.une .chapeau { margin-top: 1.2rem; }

/* Le répertoire des services : des lignes et des filets, comme un carnet d'adresses. */
.repertoire { list-style: none; padding: 0; margin-top: 1.6rem; border-top: 3px solid var(--poivre); }
.repertoire > li { border-bottom: 1px solid var(--filet); padding-block: 1.3rem 1.4rem; display: grid; gap: 0.5rem 2.5rem; }
.repertoire h2, .repertoire h3 { font-size: clamp(1.4rem, 1.2vw + 1.1rem, 1.75rem); }
.repertoire h2 a, .repertoire h3 a { color: var(--poivre); text-decoration-color: var(--roucou); text-decoration-thickness: 2px; }
.repertoire h2 a:hover, .repertoire h3 a:hover { color: var(--roucou); }
.repertoire p { max-width: 32em; }
.repertoire .lien-suite { padding-bottom: 0; }
@media (min-width: 56em) {
  .repertoire > li { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); align-items: baseline; }
}

.loin { display: grid; gap: 1.4rem 4rem; }
.loin h2 { font-size: clamp(1.8rem, 3vw + 1rem, 2.9rem); max-width: 11em; }
@media (min-width: 56em) {
  .loin { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

/* ───────── Fiche service ───────── */

.transport-numero { margin-top: 1.6rem; border-top: 3px solid var(--poivre); border-bottom: 1px solid var(--filet); padding-block: 1.1rem 1.3rem; }
.transport-numero p + p { margin-top: 0.5rem; }

.faire { display: grid; gap: 2rem; margin-top: 2.6rem; }
@media (min-width: 40em) {
  .faire { grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; }
}
.faire h2 { font-size: 1.35rem; padding-bottom: 0.6rem; border-bottom: 3px solid var(--poivre); }
.faire--non h2 { border-bottom-color: var(--filet); }
.faire ul { list-style: none; padding: 0; margin-top: 0.3rem; }
.faire li { position: relative; padding: 0.7rem 0 0.7rem 1.7rem; border-bottom: 1px solid var(--filet); margin: 0; }
.faire li::before { content: ""; position: absolute; left: 0; top: 1.22rem; width: 0.7rem; height: 0.7rem; background: var(--poivre); }
.faire--non li::before { height: 3px; top: 1.5rem; background: var(--gris); }

.questions h3 { margin-top: 1.7rem; }
.questions h3 + p { margin-top: 0.5rem; }

.outils { margin-top: 1rem; }
[hidden] { display: none !important; }
.feuille { display: none; }

/* ───────── Tableau des tarifs ───────── */

.tableau { width: 100%; border-collapse: collapse; margin-top: 1.4rem; border-top: 3px solid var(--poivre); }
.tableau caption { text-align: left; padding-bottom: 0.7rem; color: var(--gris); }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: 0.9rem 1.2rem 0.9rem 0; border-bottom: 1px solid var(--filet); }
.tableau thead th { font-size: 0.9rem; color: var(--gris); font-weight: 700; }
.tableau tbody th { font-family: var(--titre); font-weight: 400; font-size: 1.15rem; line-height: 1.25; }
.tableau tbody th a { color: var(--poivre); text-decoration-color: var(--roucou); }
.tableau td:last-child { padding-right: 0; font-weight: 700; white-space: nowrap; }
@media (max-width: 47.99em) {
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tableau, .tableau tbody, .tableau tr, .tableau th, .tableau td { display: block; }
  .tableau tr { padding-block: 1rem; border-bottom: 1px solid var(--filet); }
  .tableau th, .tableau td { border: 0; padding: 0.15rem 0; }
  .tableau td::before { content: attr(data-titre) " : "; color: var(--gris); font-weight: 400; }
  .tableau td:last-child { white-space: normal; }
}

/* ───────── Formulaires : une colonne, étiquettes au-dessus, erreurs en toutes lettres ───────── */

.formulaire { max-width: 30rem; margin-top: 1.4rem; }
.champ { border: 0; padding: 0; min-width: 0; margin-top: 1.5rem; }
.champ:first-of-type { margin-top: 0; }
.champ > label, .champ > legend { display: block; padding: 0; font-weight: 700; font-size: 1.05rem; line-height: 1.35; }
.aide { color: var(--gris); font-size: 0.92rem; line-height: 1.45; margin-top: 0.25rem; }
.champ input[type="text"], .champ input[type="tel"], .champ input[type="email"], .champ select, .champ textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--gris);
  border-radius: 3px;
  background: var(--papier);
  color: var(--poivre);
  font: 400 1.05rem/1.4 var(--texte);
}
.champ textarea { min-height: 9rem; resize: vertical; }
.champ input:focus-visible, .champ select:focus-visible, .champ textarea:focus-visible { border-color: var(--poivre); outline-offset: 2px; }
.champ [aria-invalid="true"] { border-color: var(--roucou); border-width: 3px; }
.choix {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 52px;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--gris);
  border-radius: 3px;
  background: var(--papier);
  cursor: pointer;
}
.choix input { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; accent-color: var(--roucou); }
.choix:has(input:checked) { border-color: var(--poivre); box-shadow: inset 0 0 0 1px var(--poivre); }
.choix:has(input:focus-visible) { outline: 4px solid var(--roucou); outline-offset: 2px; }
.erreur { margin-top: 0.45rem; padding: 0.55rem 0.8rem; border-left: 6px solid var(--roucou); background: var(--papier); color: var(--poivre); font-weight: 700; line-height: 1.4; }
.erreur__mot { color: var(--roucou); }
.formulaire__note { margin-top: 1.5rem; font-size: 0.92rem; color: var(--gris); }
.formulaire__note + p { margin-top: 1.1rem; }
.piege { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }

.message { margin-top: 1.4rem; padding: 1.2rem 1.3rem; background: var(--papier); border: 2px solid var(--poivre); border-left-width: 8px; border-radius: 3px; }
.message--erreur { border-color: var(--roucou); }
.message ul { padding-left: 1.2em; }
.message li { padding-block: 0.2rem; }
.message a { display: inline-block; padding-block: 0.35rem; }
.apercu { margin-top: 1.4rem; }
.apercu pre { margin: 0.8rem 0 0; padding: 1rem; background: var(--voile); font: 0.8rem/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ───────── Textes juridiques ───────── */

.juridique h2 { font-size: 1.5rem; margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--filet); }
.juridique h3 { font-size: 1.15rem; margin-top: 1.5rem; }
.juridique h2 + *, .juridique h3 + * { margin-top: 0.7rem; }
.juridique ul { padding-left: 1.2em; }
.juridique li + li { margin-top: 0.35em; }

/* ───────── Bas de page : le numéro, clair sur poivre ───────── */

.appel { background: var(--poivre); color: var(--sel); padding-block: 3rem 3.2rem; }
.appel h2 { color: var(--gris-clair); font-family: var(--texte); font-weight: 400; font-size: 1.2rem; }
.appel a { color: var(--sel); }
.appel a:hover { color: var(--roucou-clair); }
.appel :focus-visible, .pied :focus-visible { outline-color: var(--roucou-clair); }
.appel .numero { color: var(--sel); text-decoration-color: var(--roucou-clair); }
.appel .numero:hover { color: var(--roucou-clair); }
.appel .numero--geant { display: inline-block; margin-top: 0.5rem; }
.appel__texte { color: var(--gris-clair); margin-top: 0.9rem; }
.appel__texte .numero--moyen { margin-left: 0.3rem; }
.appel__grille { display: grid; gap: 2.2rem 4rem; }
.appel__autres p + p { margin-top: 0.9rem; }
.appel__autres .bouton { min-width: 15rem; }
@media (min-width: 62em) {
  .appel__grille { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}

.pied { background: var(--poivre); color: var(--gris-clair); font-size: 0.92rem; padding-bottom: 2rem; }
.pied a { color: var(--sel); display: inline-block; padding-block: 0.42rem; }
.pied a:hover { color: var(--roucou-clair); }
.pied__grille { display: grid; gap: 2rem 3rem; padding-top: 2rem; }
@media (min-width: 48em) {
  .pied__grille { grid-template-columns: 1.3fr 1fr 1fr; }
}
.pied__marque { font-family: var(--titre); font-size: 1.3rem; color: var(--sel); }
.pied__titre { color: var(--sel); font-weight: 700; margin-bottom: 0.2rem; }
.pied ul { list-style: none; padding: 0; }
.pied address { margin-top: 0.9rem; line-height: 1.5; }
.pied__bas { margin-top: 2rem; padding-top: 1.1rem; border-top: 1px solid var(--gris); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 2rem; }
.pied__bas p { margin: 0; }

.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Respirations entre les blocs d'une fiche */
.faire + .lecture, .lecture + .lecture, .lecture + .questions { margin-top: 2.8rem; }
.numero { text-decoration-skip-ink: none; text-underline-offset: 0.24em; }

/* Ajustements après relecture des captures */
.champ:first-of-type { margin-top: 1.5rem; }
.formulaire > input[type="hidden"]:first-child + .champ { margin-top: 0; }
.champ > label.choix { display: flex; padding: 0.4rem 0.9rem; font-weight: 400; font-size: 1.05rem; }
.champ > legend { margin-bottom: 0.1rem; }
h2 + .chapeau { margin-top: 0.8rem; }
.appel .bouton--clair, .appel .bouton--clair:hover, .appel .bouton--contour-clair:hover { color: var(--poivre); }
@media (max-width: 47.99em) {
  .tableau caption { display: block; padding-top: 0.8rem; }
}
