/* Styles communs aux sites. Chaque site ajuste les variables dans css/site.css. */

:root {
  --accent: #283593;
  --accent-strong: #1a237e;
  --accent-soft: #e8eaf6;
  --on-accent: #fff;
  --ink: #1b2130;
  --muted: #5a6273;
  --bg: #fff;
  --bg-alt: #f4f6fa;
  --line: #e2e6ee;
  --footer-bg: #151a26;
  --footer-ink: #c9cfdb;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 8px 24px rgb(16 24 40 / .08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font);
  --header-h: 4.25rem;
  --width: 72rem;
  --width-narrow: 48rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; font: 400 1.0625rem/1.65 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 650; }
p, ul, ol, table { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: min(100% - 2.5rem, var(--width)); margin-inline: auto; }
.container--narrow { width: min(100% - 2.5rem, var(--width-narrow)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: .5rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: 8px; }
.skip-link:focus { top: 1rem; }

/* Boutons */
.button {
  display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.4em; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; line-height: 1.2;
  border: 2px solid var(--accent); transition: background .15s, color .15s, transform .15s;
}
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); transform: translateY(-1px); }
.button--ghost { background: transparent; color: inherit; border-color: currentColor; }
.button--ghost:hover { background: rgb(255 255 255 / .12); color: inherit; border-color: currentColor; }
.button--light { background: #fff; color: var(--accent-strong); border-color: #fff; }
.button--light:hover { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-soft); }
.button--small { padding: .55em 1.1em; font-size: .95rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; }

/* En-tête du site */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgb(255 255 255 / .9); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 16px rgb(16 24 40 / .05); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 1rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: var(--accent); }
.site-nav ul { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.button) { display: block; padding: .5rem .8rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.button):hover, .site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.site-nav .button { margin-left: .5rem; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent); cursor: pointer;
  }
  .nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    content: ""; display: block; width: 1.25rem; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s;
  }
  .nav-toggle__bar { position: relative; }
  .nav-toggle__bar::before { position: absolute; top: -6px; }
  .nav-toggle__bar::after { position: absolute; top: 6px; }
  .nav-open .nav-toggle__bar { background: transparent; }
  .nav-open .nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-open .nav-toggle__bar::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: .75rem 1.25rem 1.25rem; display: none; max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a:not(.button) { padding: .75rem .8rem; }
  .site-nav .button { margin: .5rem 0 0; justify-content: center; }
}

/* Sections */
.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section--alt { background: var(--bg-alt); }
.section--accent { background: var(--accent); color: var(--on-accent); }
.section--accent a:not(.button) { color: inherit; }
.section__header { max-width: 42rem; margin-bottom: 2.5rem; }
.section__header--center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }
.lead { font-size: 1.2rem; color: var(--muted); }

/* Bandeau d'accueil */
.hero { position: relative; isolation: isolate; color: #fff; min-height: min(88vh, 46rem); display: grid; align-items: center; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgb(10 16 40 / .82) 0%, rgb(10 16 40 / .55) 55%, rgb(10 16 40 / .25) 100%); }
.hero__content { padding-block: 5rem; max-width: 40rem; }
.hero h1 { margin-bottom: .3em; }
.hero__subtitle { font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem); opacity: .92; margin-bottom: 2rem; }

/* En-tête des pages intérieures */
.page-header { position: relative; isolation: isolate; background: var(--accent); color: #fff; padding-block: clamp(3rem, 2rem + 4vw, 5rem); overflow: hidden; }
.page-header--image { padding-block: clamp(4rem, 3rem + 6vw, 7.5rem); }
.page-header__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-header--image::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgb(10 16 40 / .8), rgb(10 16 40 / .35)); }
.page-header h1 { margin: 0; }
.page-header__subtitle { margin: .75rem 0 0; font-size: 1.2rem; opacity: .9; }
.page-header__back { display: inline-block; margin-bottom: 1rem; color: #fff; opacity: .85; text-decoration: none; font-weight: 500; }
.page-header__back:hover { color: #fff; opacity: 1; text-decoration: underline; }

/* Cartes */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
a.card { color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgb(16 24 40 / .06), 0 16px 40px rgb(16 24 40 / .14); color: inherit; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-alt); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
a.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__body h3 { margin: 0; }
.card__body p { margin: 0; color: var(--muted); }
.card__more { margin-top: auto; padding-top: .5rem; font-weight: 600; color: var(--accent); }

/* Deux colonnes */
.split { display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .split--reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }

/* Texte riche */
.prose { overflow-wrap: break-word; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-top: 0; }
.prose h3 { margin-top: 2em; color: var(--accent-strong); }
.prose h2 + h3 { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose li > ul, .prose li > ol { margin-top: .35em; }
.prose img { margin: 1.5rem auto; border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }

/* Sommaire */
.toc { margin-top: 2rem; padding: 1.5rem 1.75rem; border-radius: var(--radius); background: var(--accent-soft); }
.toc__title { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: .75rem; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin-bottom: .35em; }
.toc a { text-decoration: none; font-weight: 500; }
.toc a:hover { text-decoration: underline; }

/* Lieux de consultation */
.places { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); list-style: none; padding: 0; margin: 0; }
.place { padding: 1.25rem 1.4rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.place h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.place p { margin: 0 0 .25rem; color: var(--muted); font-size: .97rem; }
.place__tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; }
.place__phone { display: inline-flex; gap: .4em; align-items: center; margin-top: .5rem; font-weight: 600; text-decoration: none; }

/* Pied de page */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: 2.5rem; font-size: .95rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.site-footer p { margin: 0; }
.site-footer a { color: #fff; }
.site-footer__name { font-weight: 700; color: #fff; }

/* Visionneuse photo */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
.lightbox::backdrop { background: rgb(5 8 15 / .92); }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 8px; }
.lightbox button { position: fixed; border: 0; background: rgb(255 255 255 / .12); color: #fff; font-size: 2rem; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; line-height: 1; }
.lightbox button:hover { background: rgb(255 255 255 / .25); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lightbox__next { right: 1rem; top: 50%; translate: 0 -50%; }
