/* audioprothesistes.eu
   Palette tirée de l'audiogramme : rouge = oreille droite, bleu = oreille gauche,
   jaune = zone de la parole, papier millimétré pour la grille. */

@font-face {
  font-family: "Atkinson Next";
  src: url("fonts/atkinson-next-latin.woff2") format("woff2-variations"),
       url("fonts/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #ffffff;
  --paper-2: #f3f6fb;
  --grid: #d6dfee;
  --grid-strong: #b8c6de;
  --ink: #0f1a3a;
  --ink-2: #3b4868;
  --left: #1d4ed8;
  --left-dark: #1638a8;
  --right: #c1121f;
  --banana: #ffe184;
  --banana-2: #fff5cf;

  --font: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --measure: 34rem;
  --wrap: 74rem;
  --gutter: clamp(1rem, 4.5vw, 2.5rem);
  --space: clamp(3rem, 7vw, 5.5rem);
}

/* Taille du texte réglable (20 px par défaut, puis 22 et 24 px) */
html { font-size: 125%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html[data-text="l"] { font-size: 137.5%; }
html[data-text="xl"] { font-size: 150%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 420;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: lining-nums;
}

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

h1, h2, h3 { line-height: 1.12; margin: 0 0 .6em; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(1.8rem, 1.1rem + 3.6vw, 3.7rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.04; }
h1, h2 { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem); font-weight: 760; letter-spacing: -.015em; }
h3 { font-size: 1.25rem; font-weight: 720; letter-spacing: -.005em; line-height: 1.25; }
p { margin: 0 0 1em; }
p, li { max-width: var(--measure); }
strong { font-weight: 720; }

a { color: var(--left); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { color: var(--left-dark); text-decoration-thickness: 3px; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: absolute; left: 1rem; top: -10rem; z-index: 50;
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: .4rem; font-weight: 700;
}
.skip:focus { top: 1rem; color: #fff; }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 2px solid var(--grid); background: var(--paper); position: relative; z-index: 20; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; min-height: 4.2rem; padding-top: .5rem; padding-bottom: .5rem; }

.brand { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; text-decoration: none; color: var(--ink); font-weight: 780; font-size: clamp(.8rem, 4.3vw, 1.05rem); letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 2em; height: 2em; flex: none; }
.brand .tld { font-weight: 450; color: var(--ink-2); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 700; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px;
  padding: .35rem .8rem; min-height: 2.75rem; cursor: pointer;
}
.nav-toggle svg { width: 1.1rem; height: 1.1rem; }
.site-nav { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; color: var(--ink); text-decoration: none; font-weight: 650; padding: .75rem 0; border-bottom: 1px solid var(--grid); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--left); text-decoration: underline; }

.site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper); border-bottom: 2px solid var(--grid); padding: .5rem var(--gutter) 1.25rem;
  box-shadow: 0 12px 24px -12px rgba(15, 26, 58, .25);
}

@media (min-width: 64em) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; padding: 0; border: 0; box-shadow: none; }
  .site-nav ul { display: flex; gap: 1.6rem; }
  .site-nav a { border: 0; padding: .4rem 0; font-size: .95rem; }
}

/* Bandeau taille du texte */
.textsize { background: var(--paper-2); border-bottom: 1px solid var(--grid); }
.textsize .wrap { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; min-height: 3rem; }
.textsize span { font-size: .85rem; color: var(--ink-2); margin-right: .25rem; }
.textsize button {
  font: inherit; font-weight: 760; color: var(--ink); background: var(--paper);
  border: 2px solid var(--grid-strong); border-radius: .4rem; min-width: 2.75rem; min-height: 2.5rem; padding: 0 .55rem; cursor: pointer; line-height: 1;
}
.textsize button[data-size="m"] { font-size: .8rem; }
.textsize button[data-size="l"] { font-size: .95rem; }
.textsize button[data-size="xl"] { font-size: 1.1rem; }
.textsize button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 740; text-decoration: none; line-height: 1.2; text-align: center;
  min-height: 3.2rem; padding: .7rem 1.4rem; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--primary { background: var(--left); color: #fff; }
.btn--primary:hover { background: var(--left-dark); color: #fff; }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--banana-2); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Fil d'Ariane ---------- */
.crumbs { padding-top: 1.25rem; font-size: .88rem; color: var(--ink-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem .5rem; }
.crumbs li { max-width: none; }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--grid-strong); font-weight: 700; }
.crumbs a { color: var(--ink-2); }

/* ---------- Héros + audiogramme ---------- */
/* Papier millimétré qui apparaît derrière l'audiogramme, jamais derrière le texte */
.hero {
  position: relative; isolation: isolate; background: var(--paper);
  border-bottom: 2px solid var(--grid);
  padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 38%, #000 62%);
          mask-image: linear-gradient(180deg, transparent 0, transparent 38%, #000 62%);
}
@media (min-width: 60em) {
  .hero::before {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 36%, #000 60%);
            mask-image: linear-gradient(90deg, transparent 0, transparent 36%, #000 60%);
  }
}
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.hero__text { padding: .5rem 0; }
.hero h1 { max-width: 14ch; }
.lead { font-size: 1.15rem; line-height: 1.5; color: var(--ink-2); max-width: 30rem; }

.page-hero { position: relative; isolation: isolate; padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 2px solid var(--grid); }
@media (min-width: 60em) {
  .page-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 2.5rem 2.5rem; background-position: -1px -1px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 55%, #000 85%);
            mask-image: linear-gradient(90deg, transparent 0, transparent 55%, #000 85%);
  }
}
.page-hero h1 { max-width: 20ch; margin-top: .6em; }

@media (min-width: 60em) {
  .hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

.audiogram { margin: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: .6rem; padding: 1rem 1rem 1.1rem; }
.audiogram__axis { display: flex; justify-content: space-between; font-weight: 720; font-size: .9rem; margin: 0 .2rem .35rem; }
.audiogram svg { width: 100%; }
.audiogram figcaption { font-size: .92rem; line-height: 1.5; color: var(--ink-2); margin-top: .9rem; }
.audiogram figcaption strong { color: var(--ink); }
.legend { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .9rem; font-weight: 650; }
.legend li { display: inline-flex; align-items: center; gap: .45rem; max-width: none; }
.legend svg { width: 1.2rem; height: 1.2rem; }
.legend .swatch { width: 1.3rem; height: .9rem; background: var(--banana); border: 1px solid #e3c23c; border-radius: 3px; }

.ag-grid line { stroke: var(--grid); stroke-width: 1.5; }
.ag-grid line.ag-zero { stroke: var(--grid-strong); stroke-width: 2.5; }
.ag-label { font-family: var(--font); font-size: 21px; font-weight: 700; fill: var(--ink-2); }
@media (max-width: 40em) { .ag-label { font-size: 27px; } }
.ag-banana { fill: var(--banana); stroke: #e8c64a; stroke-width: 1.5; }
.ag-right { fill: none; stroke: var(--right); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.ag-left { fill: none; stroke: var(--left); stroke-width: 4; stroke-dasharray: 11 8; stroke-linecap: round; }
.ag-o { fill: #fff; stroke: var(--right); stroke-width: 4; }
.ag-x { stroke: var(--left); stroke-width: 4.5; stroke-linecap: round; }
.ag-cursor { stroke: var(--ink); stroke-width: 3; opacity: 0; }

/* Le seul mouvement automatique du site : le balayage des fréquences au chargement */
@media (prefers-reduced-motion: no-preference) {
  .ag-sweep { transform-box: fill-box; transform-origin: left center; animation: ag-sweep 2.4s cubic-bezier(.45, .05, .3, 1) .35s both; }
  .ag-cursor { animation: ag-cursor 2.4s cubic-bezier(.45, .05, .3, 1) .35s both; }
  @keyframes ag-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes ag-cursor {
    0% { transform: translateX(0); opacity: 1; }
    92% { opacity: 1; }
    100% { transform: translateX(var(--sweep)); opacity: 0; }
  }
}

/* ---------- Sections ---------- */
.section { padding: var(--space) 0; }
.section--tint { background: var(--paper-2); border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.section__head { max-width: 40rem; margin-bottom: 2rem; }
.section__head p { color: var(--ink-2); font-size: 1.05rem; }
.prose h2 { margin-top: 2.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--right); font-weight: 700; }
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 60em) {
  .two-col { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 4rem; align-items: start; }
  .two-col > :first-child:not(.prose):not(article) { position: sticky; top: 1.5rem; }
  .two-col > aside { position: sticky; top: 1.5rem; }
}

.more { font-weight: 720; }

/* Code postal */
.cp-form { display: grid; gap: .6rem; max-width: 34rem; margin: 0 0 2rem; }
.cp-form label { font-weight: 720; font-size: 1.05rem; }
.cp-form .row { display: flex; flex-wrap: wrap; gap: .6rem; }
.cp-form input {
  font: inherit; font-size: 1.2rem; font-weight: 650; letter-spacing: .08em; color: var(--ink);
  width: 9ch; flex: 1 1 9ch; min-height: 3.2rem; padding: .5rem .9rem;
  border: 2px solid var(--ink); border-radius: .5rem; background: var(--paper);
}
.cp-form .btn { flex: 1 1 12rem; }
.cp-form .hint { font-size: .88rem; color: var(--ink-2); margin: 0; }
.cp-form .error { color: var(--right); font-weight: 700; margin: 0; min-height: 1.6em; }

/* Grille des régions */
.regions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: .75rem; }
.regions li { max-width: none; }
.regions a {
  display: flex; flex-direction: column; justify-content: space-between; gap: .3rem; height: 100%;
  min-height: 5.5rem; padding: .95rem 1.1rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 2px solid var(--grid-strong); border-radius: .5rem;
}
.regions a:hover { border-color: var(--ink); background: var(--banana-2); color: var(--ink); }
.regions a[aria-current="page"] { border-color: var(--left); box-shadow: inset 0 0 0 2px var(--left); }
.regions strong { font-size: 1.1rem; line-height: 1.2; }
.regions span { font-size: .88rem; color: var(--ink-2); }

/* Parcours en 4 étapes */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.75rem 3.6rem; max-width: 40rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -.1rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 3.5px solid var(--right); background: var(--paper);
  display: grid; place-items: center; font-weight: 800; color: var(--right); font-size: 1.05rem;
}
.steps li::after { content: ""; position: absolute; left: 1.2rem; top: 2.6rem; bottom: .2rem; width: 3px; background: var(--grid-strong); }
.steps li:last-child::after { display: none; }
.steps li:last-child { padding-bottom: 0; }
.steps h3 { margin-bottom: .3em; }
.steps p { margin: 0; color: var(--ink-2); }

/* Comparaison classe 1 / classe 2 */
.classes { display: grid; gap: 1rem; }
@media (min-width: 48em) { .classes { grid-template-columns: 1fr 1fr; } }
.classe { border: 2px solid var(--ink); border-radius: .6rem; padding: 1.3rem 1.4rem; background: var(--paper); }
.classe--1 { background: var(--banana-2); border-color: #d9b52a; }
.classe h3, .prose .classe h3 { margin-top: 0; margin-bottom: .2em; }
.classe .big { font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: .3rem 0 .5rem; }
.classe ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.classe li { margin-bottom: .35em; }

/* Piles : code couleur */
.piles { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem 1.5rem; }
.piles li { display: grid; justify-items: center; gap: .4rem; text-align: center; max-width: none; }
.pile {
  width: calc(var(--d) * .5rem); height: calc(var(--d) * .5rem); border-radius: 50%;
  background: var(--c); display: grid; place-items: center; font-weight: 800; font-size: 1rem;
  color: var(--t, #fff); box-shadow: inset 0 -.25rem 0 rgba(0, 0, 0, .14), 0 0 0 3px #fff, 0 0 0 5px var(--grid-strong);
}
.piles small { font-size: .88rem; color: var(--ink-2); line-height: 1.3; }
.piles b { display: block; color: var(--ink); font-size: .95rem; }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border: 2px solid var(--grid-strong); border-radius: .5rem; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .95rem; }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--grid); vertical-align: top; }
thead th { background: var(--paper-2); font-weight: 760; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 720; }
@media (max-width: 40em) {
  .table-wrap { overflow: visible; }
  table.stack { min-width: 0; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { display: block; padding: .8rem .9rem; border-bottom: 1px solid var(--grid); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack th, table.stack td { display: block; border: 0; padding: .15rem 0; }
  table.stack tbody th { font-size: 1.05rem; padding-bottom: .3rem; }
  table.stack td[data-label]::before { content: attr(data-label) " : "; font-weight: 720; color: var(--ink); }
}

/* Encadré Audipile */
.shop {
  border-left: 6px solid var(--banana); background: var(--banana-2); border-radius: 0 .5rem .5rem 0;
  padding: 1.2rem 1.4rem; margin: 1.5rem 0; max-width: 40rem;
}
.shop p:last-child { margin-bottom: 0; }

/* Note importante */
.note { border: 2px solid var(--right); border-radius: .5rem; padding: 1rem 1.2rem; margin: 1.5rem 0; max-width: 40rem; }
.note p { margin: 0; }
.note strong { color: var(--right); }

/* ---------- Fiches centres ---------- */
.centres { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.centres > li { max-width: none; }
.centre { padding: 1.6rem 0; border-bottom: 2px solid var(--grid); display: grid; gap: .3rem 2rem; }
@media (min-width: 56em) { .centre { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.centre h3 { font-size: 1.3rem; margin: 0 0 .25rem; }
.centre address { font-style: normal; color: var(--ink-2); }
.centre .rating { font-size: .92rem; color: var(--ink-2); margin: .35rem 0 0; }
.centre .rating strong { color: var(--ink); }
.centre .links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
@media (min-width: 56em) { .centre .links { margin-top: 0; justify-content: flex-end; max-width: 26rem; } }
.centre .btn { min-height: 3rem; padding: .55rem 1.1rem; }
.centre .btn--call { flex: 1 1 100%; }
@media (min-width: 30em) { .centre .btn--call { flex: 0 1 auto; } }
.centre .btn--small { font-size: .92rem; flex: 1 1 10rem; }
@media (min-width: 56em) { .centre .btn--small { flex: 0 1 auto; } }

.depts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .4rem 1.5rem; }
.depts li { max-width: none; }
.depts a { display: inline-block; padding: .4rem 0; font-weight: 650; }

.source { font-size: .88rem; color: var(--ink-2); max-width: 44rem; }

/* FAQ */
.faq { border-top: 2px solid var(--ink); max-width: 46rem; }
.faq details { border-bottom: 2px solid var(--grid); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 3rem 1.1rem 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 1.15rem; display: inline; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; border: 2px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; line-height: 1;
}
.faq details[open] summary::after { content: "−"; background: var(--ink); color: #fff; }
.faq .answer { padding: 0 0 1.2rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* Liens entre pages */
.next { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); list-style: none; margin: 0; padding: 0; }
.next li { max-width: none; }
.next a { display: block; padding: 1rem 1.2rem; border: 2px solid var(--ink); border-radius: .5rem; text-decoration: none; color: var(--ink); font-weight: 720; height: 100%; }
.next a span { display: block; font-weight: 420; color: var(--ink-2); font-size: .92rem; margin-top: .2rem; }
.next a:hover { background: var(--banana-2); color: var(--ink); }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: #e6ebf5; padding: 3rem 0 2rem; margin-top: 0; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--banana); }
.site-footer :focus-visible { outline-color: var(--banana); }
.site-footer .cols { display: grid; gap: 2rem; }
@media (min-width: 52em) { .site-footer .cols { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer .ft { color: #fff; font-size: 1.1rem; font-weight: 760; margin-bottom: .7em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer .fine { max-width: none; border-top: 1px solid #2c3a63; margin-top: 2.5rem; padding-top: 1.25rem; font-size: .85rem; color: #b9c3db; }
.site-footer .brand { color: #fff; }
.site-footer .brand .tld { color: #b9c3db; }

@media print {
  .site-header, .textsize, .site-footer, .actions, .cp-form, .nav-toggle { display: none !important; }
  .hero { background: none; }
  a { color: inherit; }
}
