/* admission-parallele.org
   Signalétique : chaque voie d'admission est une « ligne » avec son badge.
   Vert profond pour le commerce, cobalt pour les ingénieurs, ambre pour les états actifs.
   Barlow Semi Condensed pour les titres et repères, Source Serif 4 pour la lecture. */

:root {
  --paper: #f5f6f2;
  --sheet: #ffffff;
  --ink: #10241f;
  --ink-soft: #4a5a55;
  --rule: #d5dbd5;
  --commerce: #0e6b5c;
  --ingenieurs: #2f4db0;
  --signal: #f2b035;
  --signal-ink: #10241f;
  --callout: #eef3ee;

  --sign: 'Barlow Semi Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --read: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;

  --s--1: 0.875rem;
  --s-0: 1.0625rem;
  --s-1: 1.25rem;
  --s-2: 1.625rem;
  --s-3: 2.125rem;
  --s-4: clamp(2.25rem, 1.4rem + 3.6vw, 3.9rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1714;
    --sheet: #15211d;
    --ink: #e6ece9;
    --ink-soft: #a8b6b0;
    --rule: #2a3a35;
    --commerce: #33a08c;
    --ingenieurs: #7c93ea;
    --signal: #f2b035;
    --signal-ink: #10241f;
    --callout: #1b2a25;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--s-0) / 1.7 var(--read);
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--signal); color: var(--signal-ink); padding: 0.5rem 0.75rem; font-family: var(--sign); z-index: 10; }
.skip:focus { top: 1rem; }

/* ---------- En-tête ---------- */
.top { background: var(--ink); color: var(--paper); }
@media (prefers-color-scheme: dark) { .top { background: #08100d; color: var(--ink); } }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; padding-block: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font: 700 var(--s-1) / 1 var(--sign); text-decoration: none; letter-spacing: 0.01em; }
.brand__tld { font-weight: 500; opacity: 0.7; }
.brand__mark { width: 1.6rem; height: 1rem; border-radius: 0.5rem; background: linear-gradient(90deg, var(--commerce) 0 50%, var(--ingenieurs) 50% 100%); box-shadow: 0 0 0 2px currentColor; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; font: 600 var(--s-0) / 1.4 var(--sign); }
.nav a { text-decoration: none; padding-block: 0.25rem; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current='page'] { box-shadow: inset 0 -3px 0 var(--signal); }

/* ---------- Badges de ligne ---------- */
.line {
  display: inline-grid; place-items: center;
  min-width: 2.75rem; height: 1.75rem; padding: 0 0.45rem;
  border-radius: 0.45rem;
  font: 700 0.95rem / 1 var(--sign); letter-spacing: 0.02em;
  color: #fff; background: var(--ink-soft);
}
.line--commerce { background: var(--commerce); }
.line--ingenieurs { background: var(--ingenieurs); }
@media (prefers-color-scheme: dark) { .line { color: #0b1411; } }

/* ---------- Accueil ---------- */
.hero { background: var(--ink); color: var(--paper); padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem); }
@media (prefers-color-scheme: dark) { .hero { background: #08100d; color: var(--ink); } }
.hero__title { font: 700 var(--s-4) / 1.02 var(--sign); letter-spacing: -0.01em; margin: 0 0 1.25rem; max-width: 18ch; text-wrap: balance; }
.hero__lead { max-width: 60ch; font-size: var(--s-1); line-height: 1.6; opacity: 0.9; }
.hero__lead p { margin: 0 0 0.75rem; }
.hero__lead a { color: inherit; }

.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--finder { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.section__title { font: 700 var(--s-3) / 1.1 var(--sign); margin: 0 0 1.5rem; }

/* ---------- Outil d'orientation ---------- */
.finder__form { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.seg { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.seg legend { float: left; width: 7.5rem; padding: 0; margin-right: 0.25rem; font: 700 var(--s-0) / 2.4 var(--sign); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-block; padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--rule); border-radius: 999px;
  font: 600 var(--s-0) / 1.2 var(--sign);
  background: var(--sheet);
}
.seg label:hover span { border-color: var(--ink-soft); }
.seg input:checked + span { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.finder__count { font: 600 var(--s-1) / 1.4 var(--sign); margin: 0 0 1rem; min-height: 1.4em; }
.finder__results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 0 clamp(1.5rem, 4vw, 3rem); }
.routes-group[hidden], .route[hidden] { display: none; }
.routes-group__title { font: 700 var(--s-1) / 1.3 var(--sign); margin: 0 0 0.25rem; padding-bottom: 0.5rem; border-bottom: 3px solid var(--ink); }
.routes { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.route { display: grid; grid-template-columns: 3.25rem 1fr; gap: 0.9rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.route .line { margin-top: 0.15rem; }
.route__name { font: 700 var(--s-1) / 1.25 var(--sign); margin: 0; }
.route__name a { text-decoration: none; }
.route__name a:hover { text-decoration: underline; }
.route__meta { margin: 0.2rem 0 0; font: 600 var(--s--1) / 1.4 var(--sign); color: var(--ink-soft); letter-spacing: 0.01em; }
.route__text { margin: 0.35rem 0 0; font-size: var(--s-0); line-height: 1.55; }
.finder__note { max-width: 70ch; margin: 0.5rem 0 0; font-size: var(--s--1); color: var(--ink-soft); }

.hubs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem clamp(1.5rem, 4vw, 2.5rem); }
.hub { border-top: 3px solid var(--ink); padding-top: 0.9rem; }
.hub__title { font: 700 var(--s-2) / 1.15 var(--sign); margin: 0 0 0.4rem; }
.hub__title a { text-decoration: none; }
.hub__title a:hover { text-decoration: underline; }
.hub p { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.hub-next { margin: 2rem 0 0; max-width: 70ch; }

/* ---------- Pages ---------- */
.page { padding-block: 1.5rem 4rem; }
.page--toc { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; grid-template-areas: 'crumbs crumbs' 'head head' 'body toc'; column-gap: clamp(2rem, 5vw, 4rem); }
.page--toc .crumbs { grid-area: crumbs; }
.page--toc .page__head { grid-area: head; }
.page--toc .prose { grid-area: body; }
.page--toc .toc { grid-area: toc; align-self: start; position: sticky; top: 1.5rem; }

.crumbs ol { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; font: 500 var(--s--1) / 1.4 var(--sign); color: var(--ink-soft); }
.crumbs li + li::before { content: '›'; margin-right: 0.35rem; }

.page__head { margin-bottom: 2rem; max-width: 46rem; }
.page__lines { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 0.9rem; }
.page__title { font: 700 var(--s-4) / 1.05 var(--sign); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
.page__chapo { font-size: var(--s-1); line-height: 1.55; margin: 1rem 0 0; color: var(--ink-soft); }
.page__date { margin: 1rem 0 0; font: 500 var(--s--1) / 1.4 var(--sign); color: var(--ink-soft); }

.toc { font-family: var(--sign); border-left: 3px solid var(--rule); padding-left: 1rem; }
.toc__title { margin: 0 0 0.5rem; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; font-weight: 500; line-height: 1.3; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.prose { max-width: 44rem; }
.prose h2 { font: 700 var(--s-2) / 1.2 var(--sign); margin: 2.5rem 0 0.75rem; }
.prose h3 { font: 700 var(--s-1) / 1.3 var(--sign); margin: 1.75rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose > :first-child { margin-top: 0; }
.callout { background: var(--callout); border-left: 4px solid var(--signal); padding: 0.9rem 1.1rem; margin: 1.5rem 0; }
.callout p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font: 500 var(--s-0) / 1.4 var(--sign); }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
thead th { border-bottom: 2px solid var(--ink); font-weight: 700; }
tbody th { font-weight: 600; }

.cards { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0; border-top: 3px solid var(--ink); }
.card { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.card__title { font: 700 var(--s-1) / 1.25 var(--sign); margin: 0; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__lines { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.5rem 0 0 !important; }
.card__text { margin: 0.4rem 0 0 !important; color: var(--ink-soft); }

/* ---------- Pied de page ---------- */
.foot { border-top: 1px solid var(--rule); padding-block: 2rem 3rem; font-size: var(--s--1); color: var(--ink-soft); }
.foot__inner > p { max-width: 70ch; margin: 0 0 1rem; }
.foot__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font: 600 var(--s-0) / 1.4 var(--sign); }
.foot__consent { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* ---------- Petits écrans ---------- */
@media (max-width: 52rem) {
  .page--toc { display: block; }
  .toc { position: static; margin: 0 0 2rem; }
}
@media (max-width: 30rem) {
  .seg legend { float: none; width: 100%; line-height: 1.6; }
  .route { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media print {
  .top nav, .finder__form, .skip, .toc { display: none; }
  .hero, .top { background: none; color: var(--ink); }
}
