/* bienvoirsanslunettes.com : même charte que le site du cabinet (ophtalmologie-val-europe.fr).
   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; }

/* Fond blanc uni. Deux couleurs de texte seulement : noir sur blanc, blanc sur vert (boutons).
   Quatre tailles (46, 34, 24, 18 px), deux graisses. Tailles en rem : elles suivent les réglages du navigateur et la barre d'accessibilité. Tous les textes ont un contraste d'au moins 7:1 (WCAG AAA). */
:root {
  --blanc: #ffffff;
  --texte: #111111;          /* noir, 18,9:1 sur blanc */
  --vert: #1d5560;           /* 8,3:1 sur blanc ; blanc dessus : 8,3:1 */
  --vert-fonce: #143e46;
  --filet: #c9d3d5;          /* séparations décoratives */
  --filet-fort: #767b7e;     /* bordures des éléments interactifs : 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); }
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 { font-size: var(--t3); }
small, table, sup { font-size: var(--t3); }
sup { vertical-align: baseline; }
p { margin: 0 0 0.875rem; }
a { color: var(--texte); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
em, i { font-style: normal; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- 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: 13.125rem; 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, nav.main a[aria-current="page"] { 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.875rem 1.625rem; 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; }
.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; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; }
/* Un mot trop long pour la largeur de l'écran passe à la ligne au lieu de déborder */
body { overflow-wrap: break-word; }

/* ---------- 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; }
.intro-page { padding: 4.5rem 0 3rem; border-top: 0; }
.intro-page h1 { font-size: var(--titre); line-height: 1.15; margin-bottom: 1.25rem; max-width: 56.25rem; }
.intro-page p { max-width: 47.5rem; }

/* Cartes */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(18.75rem, 100%), 1fr)); }
.card { display: flex; flex-direction: column; 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 { margin-bottom: 0; }
a.card { color: var(--texte); text-decoration: none; transition: border-color 0.2s; }
a.card:hover { border-color: var(--vert); }
a.card h3 { text-decoration: underline; }
.option { border-top: 4px solid var(--vert); box-shadow: 0 2px 0.625rem rgba(20, 62, 70, 0.06); }
.option .precision { font-weight: 700; }
.option .lien-rdv, .card .suite { margin-top: auto; padding: 0.5rem 0; font-weight: 700; }
.option .lien-rdv::after, .card .suite::after { content: " →"; content: " →" / ""; }
.option .lien-rdv + .lien-rdv { margin-top: 0; }

/* Listes d'articles par rubrique, listes simples */
.rubrique + .rubrique { margin-top: 3.5rem; }
.rubrique h2 { margin-bottom: 1.5rem; }
ul.large, .alert ul { padding-left: 1.375rem; margin: 0 0 0.875rem; }
ul.large li, .alert li { margin: 0.375rem 0; }

/* Parcours en étapes */
.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); counter-reset: etape; }
.etapes li { counter-increment: etape; border-top: 2px solid var(--texte); padding-top: 1rem; }
.etapes li::before { content: counter(etape); display: block; font-size: var(--t1); font-weight: 700; line-height: 1; margin-bottom: 0.625rem; }
.etapes h3 { margin: 0 0 0.5rem; }

/* Chirurgiens */
.praticiens { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(27.5rem, 100%), 1fr)); }
.praticien { display: grid; grid-template-columns: auto 1fr; gap: 0 1.5rem; align-items: start; background: var(--blanc); border: 1px solid var(--filet-fort); border-radius: var(--rayon); padding: 2rem; }
.praticien.sans-photo { grid-template-columns: 1fr; }
.praticien h3 { margin: 0; }
.praticien img { width: 7.5rem; height: 8.25rem; object-fit: cover; border-radius: var(--rayon); }
.praticien .fonction { margin: 0.375rem 0 1rem; }
.praticien ul { margin: 0 0 1.25rem; padding-left: 1.25rem; }
.praticien li { margin: 4px 0; }

/* 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); }
th, td { text-align: left; padding: 0.875rem 1rem; border-bottom: 1px solid var(--filet-fort); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { border-bottom: 2px solid var(--texte); }

/* Encadrés */
.note { border-left: 4px solid var(--vert); padding: 4px 0 4px 1.25rem; margin: 1.5rem 0; }
.alert { border: 2px solid var(--texte); border-radius: var(--rayon); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.note p:last-child, .alert p:last-child { margin-bottom: 0; }
.todo { background: var(--todo-fond); color: var(--todo-texte); padding: 1px 0.375rem; border-radius: 4px; font-weight: 700; }

/* 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; }

/* ---------- Articles ---------- */
.article { padding: 3.5rem 0 5rem; }
.article-grille { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr) 18.75rem; align-items: start; }
.prose { max-width: 47.5rem; overflow-wrap: break-word; }
.prose h1 { font-size: var(--titre); line-height: 1.15; margin: 0.5rem 0 1rem; }
.prose h2 { font-size: var(--t2); margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: var(--t3); margin: 1.75rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.375rem; margin: 0 0 0.875rem; }
.prose li { margin: 4px 0; }
.prose .lead { font-weight: 700; }
.fil { margin: 0; }
.signature { margin-bottom: 1.75rem; }
details { border-top: 1px solid var(--filet); padding: 0.875rem 0; }
details:last-of-type { border-bottom: 1px solid var(--filet); }
summary { cursor: pointer; font-weight: 700; }
details > div { margin-top: 0.625rem; }
.encart { display: grid; gap: 1.25rem; position: sticky; top: 7.5rem; }
.boite { border: 1px solid var(--filet-fort); border-radius: var(--rayon); padding: 1.375rem; }
.boite h2 { font-size: var(--t3); margin: 0 0 0.5rem; }
.boite ul { padding-left: 1.25rem; margin: 0; }
.avertissement { margin-top: 2.5rem; }
.sources li { margin: 0.375rem 0; }

/* 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(15rem, 100%), 1fr)); }
footer.site h2 { font-size: var(--t3); margin: 0 0 0.5rem; }
footer.site p { margin: 4px 0; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { margin: 4px 0; }

/* Petits écrans */
@media (max-width: 53.75em) {
  .article-grille { grid-template-columns: minmax(0, 1fr); }
  .encart { position: static; }
}
@media (max-width: 47.5em) {
  section { padding: 4rem 0; }
  .wrap { padding: 0 1rem; }
  .brand { width: 10.625rem; }
  .intro-page h1, .prose h1 { font-size: var(--t1); }
  nav.main { gap: 0.375rem 1.125rem; }
  .urgence-grille { grid-template-columns: 3rem 1fr; }
  .etoile-de-vie { width: 3rem; height: 3rem; }
  .urgence-grille .btn { grid-column: 2; justify-self: start; }
  .praticiens, .grid { grid-template-columns: 1fr; }
  .card, .praticien { padding: 1.25rem; }       /* plus de place pour le texte sur téléphone */
  .btn { padding-left: 1rem; padding-right: 1rem; }
  .praticien { grid-template-columns: 1fr; }
  .praticien img { margin-bottom: 1rem; }
}
