/* Pages légales de Bonjour Blois (mentions légales, confidentialité), publiques et servies sans session.
   Langage visuel de la régie : sable, encre, bleu Bonjour Blois et point d'or. Polices du système (aucune
   police ni ressource externe, aucun traceur), thème clair et sombre selon l'appareil, styles d'impression. */

:root {
  color-scheme: light dark;
  --bg: #f3f2ed;
  --surface: #ffffff;
  --sunk: #eceae3;
  --ink: #101014;
  --ink-2: #464650;
  --ink-3: #65646f;
  --line: rgba(16, 16, 20, 0.1);
  --line-2: rgba(16, 16, 20, 0.16);
  --brand: #1f3bf5;
  --brand-wash: #e9ecfe;
  --gold: #ffc629;
  --focus: #1f3bf5;
  --radius: 14px;
  --measure: 46rem;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c10;
    --surface: #14151b;
    --sunk: #191a22;
    --ink: #f1f1f4;
    --ink-2: #b8b8c6;
    --ink-3: #9a9aae;
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);
    --brand: #8596ff;
    --brand-wash: rgba(109, 130, 255, 0.16);
    --focus: #8596ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

::selection { background: var(--gold); color: #101014; }

/* ------------------------------------------------------------------ en-tête */
header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem max(1.25rem, calc((100% - var(--measure)) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: none;
  display: block;
}
.brand:hover span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--gold); }

header.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
header.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.875rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
header.top nav a:hover { color: var(--ink); background: var(--sunk); }
header.top nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--brand-wash);
  box-shadow: inset 0 -3px 0 var(--brand);
}

/* ------------------------------------------------------------------ texte */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 3.5rem;
}

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
h1 {
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
h2 {
  margin: 2.75rem 0 0.875rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.375rem;
  font-weight: 750;
}
h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}
h2:target, h3:target { scroll-margin-top: 1.5rem; }
h2:target::before {
  content: '';
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: 0.15em;
}

p { margin: 0 0 1rem; }

.updated {
  margin-top: 0.75rem;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.lead {
  margin: 1.75rem 0 0;
  padding: 0.25rem 0 0.25rem 1.125rem;
  border-left: 4px solid var(--gold);
  color: var(--ink-2);
  font-size: 1.1875rem;
  line-height: 1.6;
}

strong { font-weight: 700; color: var(--ink); }

a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

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

ul, ol { margin: 0 0 1.25rem; padding-left: 1.375rem; }
li { margin: 0.4rem 0; }
li::marker { color: var(--ink-3); }

/* faits de l'éditeur : une fiche */
ul.facts {
  list-style: none;
  padding: 0.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
ul.facts li {
  margin: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
ul.facts li:last-child { border-bottom: 0; }

/* étapes numérotées (supprimer vos données) */
ol {
  list-style: none;
  counter-reset: etape;
  padding-left: 0;
}
ol > li {
  counter-increment: etape;
  position: relative;
  margin: 0.875rem 0;
  padding-left: 2.75rem;
}
ol > li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.875rem;
  height: 1.875rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  ol > li::before { color: #0b0c10; }
}

/* tableau des prestataires : défile dans son cadre si l'écran est trop étroit, la page ne bouge pas */
.table {
  margin: 1.25rem 0 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table:focus-visible { outline-offset: 2px; }
table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--sunk);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 650; color: var(--ink); }
td { color: var(--ink-2); }

/* ------------------------------------------------------------------ pied */
footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem max(1.25rem, calc((100% - var(--measure)) / 2)) 2.5rem;
  color: var(--ink-3);
  font-size: 0.9375rem;
}
footer p { margin: 0; }
footer a { color: var(--ink-2); }
footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ téléphone */
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  header.top { padding-top: max(0.75rem, env(safe-area-inset-top)); padding-bottom: 0.75rem; }
  header.top nav { margin-left: -0.875rem; }
  main { padding: 2rem 1.25rem 2.5rem; }
  h2 { margin-top: 2.25rem; font-size: 1.25rem; }
  .lead { font-size: 1.0625rem; }
  /* le tableau se lit sans défilement : chaque prestataire devient une fiche */
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  tbody tr { display: block; padding: 0.875rem 1rem; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  tbody td { display: block; padding: 0; border: 0; }
  tbody td + td { margin-top: 0.25rem; }
  tbody td:last-child { color: var(--ink-3); font-size: 0.875rem; }
}

/* ------------------------------------------------------------------ impression */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --sunk: #f2f2f2;
    --ink: #000000;
    --ink-2: #222222;
    --ink-3: #444444;
    --line: #cccccc;
    --brand: #000000;
  }
  body { font-size: 11pt; line-height: 1.5; background: #ffffff; color: #000000; }
  header.top { padding: 0 0 0.5rem; background: none; }
  header.top nav { display: none; }
  main { max-width: none; padding: 1rem 0 0; }
  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; margin-top: 1.25rem; break-after: avoid; page-break-after: avoid; }
  h3 { font-size: 12pt; break-after: avoid; page-break-after: avoid; }
  .lead { border-left-color: #000000; }
  a { color: #000000; text-decoration: underline; }
  main a[href^='http']::after, main a[href^='mailto:']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    color: #444444;
    word-break: break-all;
  }
  .table { overflow: visible; border-color: #cccccc; }
  table { min-width: 0; }
  tr, li, ul.facts { break-inside: avoid; page-break-inside: avoid; }
  ol > li::before { background: none; color: #000000; border: 1px solid #000000; }
  footer { padding: 1rem 0 0; }
}
