/* Police unique : Luciole, conçue pour les personnes malvoyantes (CTRDV), licence CC BY 4.0 */
@font-face { font-family: "Luciole"; src: url("assets/fonts/Luciole-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Luciole"; src: url("assets/fonts/Luciole-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* Charte : blanc, encre et une seule couleur, un vert bleuté ; esprit clinique, sobre et aéré.
   Deux couleurs de texte seulement : noir sur blanc, blanc sur vert (boutons). Deux graisses.
   Tous les textes ont un contraste d'au moins 7:1 (WCAG AAA).
   Tailles en rem : elles suivent les réglages du navigateur et la barre d'outils d'accessibilité.
   Les couleurs passent toutes par ces variables : les thèmes d'accessibilité ne redéfinissent qu'elles. */
:root {
  --blanc: #ffffff;
  --texte: #111111;          /* noir, 18,9:1 sur blanc */
  --vert: #1d5560;           /* 8,3:1 sur blanc */
  --vert-fonce: #143e46;     /* survol des boutons */
  --filet: #c9d3d5;          /* séparations décoratives entre sections */
  --filet-fort: #767b7e;     /* bordures des cartes, tableaux, carte : 4,5:1 */
  --todo-fond: #fff3c4;      /* surlignage provisoire des champs à compléter */
  --todo-texte: #5a4000;
  --titre: 2.875rem; --t1: 2.125rem; --t2: 1.5rem; --t3: 1.125rem;   /* 46, 34, 24, 18 px */
  --rayon: 0.5rem;
  --max: 70rem;
  --police: "Luciole", Verdana, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--blanc); color: var(--texte); font: 400 var(--t3)/1.65 var(--police); }
/* Un mot trop long pour la largeur de l'écran passe à la ligne au lieu de déborder (pas de césure automatique) */
body { overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--police); font-weight: 700; line-height: 1.25; margin: 0; }
h1, h2 { font-size: var(--t1); }
h3 { font-size: var(--t2); }
h4, dt { font-size: var(--t3); }
small, table { font-size: var(--t3); }
p { margin: 0 0 1.1em; }
a { color: var(--texte); text-underline-offset: 0.2em; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- En-tête : collant seulement sur grand écran et texte non agrandi (sinon il masquerait le contenu) ---------- */
header.site { position: relative; z-index: 10; background: var(--blanc); }
@media (min-width: 62.5em) and (min-height: 50em) {
  html:not(.a11y-grand) header.site { position: sticky; top: 0; }
  html:not(.a11y-grand) { scroll-padding-top: calc(var(--hauteur-entete, 9rem) + 1rem); }
}
.entete-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.5rem; }
.tel-entete { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.tel-entete:hover, .tel-entete:focus-visible { text-decoration: underline; }
header.site .entete-bas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-top: 0.5rem; padding-bottom: 0.875rem; }
/* Largeur fixe du logo : sans elle, le SVG prend 300 px par défaut et renvoie le menu à la ligne */
.brand { display: block; flex: none; width: 15.625rem; max-width: 100%; line-height: 0; color: var(--texte); }
.brand .logo { display: block; width: 100%; height: auto; }
nav.main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
nav.main a:not(.btn) { color: var(--texte); text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
nav.main a:not(.btn):hover, nav.main a:not(.btn):focus-visible { text-decoration: underline; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.25em 0.5em; min-height: 2.75rem;
  text-align: center;   /* sur petit écran, le logo Doctolib passe sous le texte au lieu de couper « rendez-vous » */
  padding: 0.75rem 1.5rem; border-radius: var(--rayon);
  background: var(--vert); color: var(--blanc); border: 2px solid var(--vert);
  font-weight: 700; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn.ghost { background: var(--blanc); color: var(--texte); border-color: var(--texte); }
.btn.ghost:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
/* Bouton Doctolib : le logo officiel, en blanc, suit la taille du texte */
.logo-doctolib { display: block; height: 1.15em; width: auto; }
/* « sur » reste collé au logo : sur petit écran, le bouton passe sur deux lignes nettes (« Prendre rendez-vous » / « sur Doctolib ») */
.doctolib-groupe { display: inline-flex; align-items: center; gap: 0.35em; }

/* ---------- Accessibilité ---------- */
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--texte); outline-offset: 3px; }
.lien-evitement { position: fixed; left: 1rem; top: -6rem; z-index: 200; display: flex; align-items: center; min-height: 2.75rem;
  background: var(--texte); color: var(--blanc); padding: 0.625rem 0.875rem; }
.lien-evitement:focus { top: 0.75rem; }

/* ---------- Sections ---------- */
section { padding: 6rem 0; border-top: 1px solid var(--filet); }
section h2 { margin-bottom: 2rem; }
section h3 { margin: 2rem 0 0.75rem; }
.large { max-width: 47.5rem; }

/* Ouverture */
.ouverture { padding: 7.5rem 0 6.5rem; border-top: 0; }
.ouverture h1 { max-width: 56rem; margin-bottom: 1.25rem; font-size: var(--titre); line-height: 1.15; }
.ouverture.centre { text-align: center; }
.ouverture.centre h1 { margin-left: auto; margin-right: auto; }
.ouverture.centre .actions { justify-content: center; }
.ouverture .chapeau { margin-bottom: 2.25rem; }

/* Prise de rendez-vous */
.options { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, 1fr); list-style: none; margin: 0; padding: 0; }
.option.pleine { grid-column: 1 / -1; }
.option {
  display: flex; flex-direction: column; align-items: flex-start; padding: 1.75rem 1.75rem 1.5rem;
  background: var(--blanc); border: 1px solid var(--filet-fort); border-top: 4px solid var(--vert); border-radius: var(--rayon);
}
.option h3 { margin: 0 0 0.25rem; }
.option .precision { font-weight: 700; }
.option .btn { margin-top: auto; }

/* Urgence */
.urgence { padding: 3.5rem 0; }
.urgence-grille { display: grid; grid-template-columns: 4rem 1fr auto; align-items: center; gap: 1.5rem 2rem; }
.etoile-de-vie { width: 4rem; height: 4rem; align-self: start; color: var(--vert); }
.etoile-de-vie path { stroke: var(--blanc); }
.urgence h2 { margin-bottom: 0.5rem; }
.urgence p { max-width: 42.5rem; margin: 0; }
.urgence p + p { margin-top: 0.625rem; }

/* Praticiens */
.praticiens { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(27.5rem, 100%), 1fr)); }
.praticien { background: var(--blanc); border: 1px solid var(--filet-fort); border-radius: var(--rayon); padding: 2rem; }
.praticien .fonction { margin: 0.375rem 0 1rem; }
.praticien h4 { margin: 1.5rem 0 0.5rem; }
.praticien ul { margin: 0; padding-left: 1.25rem; }
.praticien li { margin: 0.25rem 0; }

/* Cartes génériques */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(18.75rem, 100%), 1fr)); }
.card { background: var(--blanc); border: 1px solid var(--filet-fort); border-radius: var(--rayon); padding: 1.75rem; }
.card h3 { margin: 0 0 0.625rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card ul { margin: 0 0 1.1em; padding-left: 1.25rem; }
.card li { margin: 0.25rem 0; }
.card.pleine { grid-column: 1 / -1; }

/* Deux colonnes : titre et plan à gauche, texte à droite */
.colonnes { display: grid; gap: 1.5rem 4rem; grid-template-columns: 1fr 2fr; }
.colonnes h2 { margin: 0 0 1.25rem; }
.adresses { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.adresses li { margin: 0 0 0.75rem; }
.carte { display: block; width: 100%; height: 13.75rem; border: 1px solid var(--filet-fort); border-radius: var(--rayon); margin: 0.5rem 0 0.625rem; }
.lien-autonome { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Tableaux */
.table-scroll { overflow-x: auto; border: 1px solid var(--filet-fort); border-radius: var(--rayon); margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; background: var(--blanc); }
caption { text-align: left; font-weight: 700; padding: 0.875rem 1rem; }
th, td { text-align: left; padding: 0.875rem 1rem; border-bottom: 1px solid var(--filet-fort); vertical-align: top; }
th[scope="row"] { font-weight: 400; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { border-bottom: 2px solid var(--texte); }

/* Lexique */
.lexique { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.lexique dt { font-weight: 700; }
.lexique dd { margin: 0; }

.note { border-left: 4px solid var(--vert); padding: 0.25rem 0 0.25rem 1.25rem; }
.todo { background: var(--todo-fond); color: var(--todo-texte); padding: 1px 6px; border-radius: 4px; font-weight: 700; }

/* Pages de texte (mentions légales, accessibilité) */
article.page { padding: 4rem 0 2rem; max-width: 47.5rem; }
article.page h1 { margin-bottom: 0.75rem; }
article.page h2 { font-size: var(--t2); margin: 2.5rem 0 0.75rem; }
article.page ul, article.page ol { padding-left: 1.25rem; }
article.page li { margin: 0.375rem 0; }
.byline { margin-bottom: 2rem; }

/* Pied de page */
footer.site { border-top: 1px solid var(--filet); padding: 3.5rem 0 4rem; }
footer.site .wrap { display: grid; gap: 1.5rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(16.25rem, 100%), 1fr)); }
footer.site p { margin: 0.25rem 0; }
/* Les liens du pied de page sont tous isolés (jamais dans une phrase) : cible de 44 px de haut */
footer.site a { display: inline-flex; align-items: center; min-height: 2.75rem; }
footer.site .liste-liens { list-style: none; margin: 0; padding: 0; }
footer.site .pied-bas { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem;
  border-top: 1px solid var(--filet); padding-top: 0.75rem; }
footer.site .pied-bas p { margin: 0 0 0 auto; }

/* Petits écrans (en em : suit aussi le zoom du texte) */
@media (max-width: 47.5em) {
  section { padding: 4rem 0; }
  .ouverture { padding: 4.5rem 0 4rem; }
  .wrap { padding: 0 1rem; }
  .brand { width: 12.5rem; }
  .ouverture h1 { font-size: var(--t1); }
  nav.main { gap: 0.25rem 1.125rem; }
  .colonnes { grid-template-columns: 1fr; }
  .urgence-grille { grid-template-columns: 3rem 1fr; }
  .etoile-de-vie { width: 3rem; height: 3rem; }
  .urgence-grille .btn { grid-column: 2; justify-self: start; }
  .praticiens, .options, .grid { grid-template-columns: 1fr; }
  .option, .card, .praticien { padding: 1.25rem; }       /* plus de place pour le texte sur téléphone */
  .btn { padding-left: 1rem; padding-right: 1rem; }
  .lexique { grid-template-columns: 1fr; gap: 0 0; }
  .lexique dd { margin-bottom: 0.75rem; }
}
