/* livre-prepa.com
   Papier froid, encre bleu nuit, surligneur pour les états actifs.
   Literata pour la lecture, Atkinson Hyperlegible pour l'interface. */

:root {
  --paper: #f4f6f9;
  --sheet: #ffffff;
  --ink: #1b2a4a;
  --ink-soft: #46526b;
  --rule: #d5dae3;
  --marker: #f2e34b;
  --marker-ink: #1b2a4a;
  --note: #b9a614;

  --ellipses: #9e2a2b;
  --dunod: #1f4e8c;
  --breal: #136f63;
  --eyrolles: #b8791a;
  --ophrys: #5a3f86;
  --autre: #46526b;

  --serif: 'Literata', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;
  --step-4: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1626;
    --sheet: #172036;
    --ink: #e7ebf3;
    --ink-soft: #a9b3c7;
    --rule: #2c3852;
    --marker: #e8d93c;
    --marker-ink: #141a28;
    --note: #d8c63a;
  }
}

*, *::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(--step-0) / 1.65 var(--serif);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 2px; }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--marker); color: var(--marker-ink); padding: 0.5rem 0.75rem; font-family: var(--sans); z-index: 10; }
.skip:focus { top: 1rem; }

/* ---------- En-tête ---------- */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top__inner { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; }
.brand { font: 700 var(--step-1) / 1 var(--serif); text-decoration: none; letter-spacing: -0.01em; }
.brand__tld { font-weight: 400; color: var(--ink-soft); }
.nav { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; font: var(--step--1) / 1.4 var(--sans); }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current='page'] { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 4px; text-underline-offset: 0.35em; }

/* ---------- Accroche ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem); }
.hero__title {
  font: 700 var(--step-4) / 1.08 var(--serif);
  letter-spacing: -0.02em;
  max-width: 17ch;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.hero__lead { max-width: 60ch; margin: 0; font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); }

/* ---------- Page d'une voie ---------- */
.hero--voie { padding-bottom: clamp(1.25rem, 3vw, 2rem); }
.hero__title--voie { max-width: 22ch; font-size: var(--step-3); }
.hero__aside { max-width: 62ch; margin: 1rem 0 0; font: var(--step--1) / 1.55 var(--sans); color: var(--ink-soft); }
.crumb { margin: 0 0 1rem; font: var(--step--1) / 1.4 var(--sans); }
.other-routes { margin: 2rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); font: var(--step--1) / 1.6 var(--sans); }
.detail__routes { margin: 1rem 0 0; font: var(--step--1) / 1.55 var(--sans); }

/* ---------- Choix de la voie (accueil) ---------- */
.routes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 clamp(1.5rem, 4vw, 3rem); }
.route { padding: 1.25rem 0 1.5rem; border-top: 3px solid var(--ink); }
.route__title { font: 700 var(--step-2) / 1.15 var(--serif); margin: 0; }
.route__title a { text-decoration: none; }
.route__title a:hover { text-decoration: underline; }
.route__text { margin: 0.6rem 0 0; max-width: 34ch; }
.route__count { margin: 0.75rem 0 0; font: var(--step--1) / 1.4 var(--sans); color: var(--ink-soft); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--shelf { background: var(--sheet); border-block: 1px solid var(--rule); }
.section__title { font: 700 var(--step-3) / 1.15 var(--serif); letter-spacing: -0.015em; margin: 0 0 1.5rem; }
.section__year { font-weight: 400; color: var(--ink-soft); }
.section__intro { max-width: 62ch; margin: -0.5rem 0 1.75rem; color: var(--ink-soft); }

/* ---------- Couvertures ---------- */
.cover {
  position: relative;
  flex: none;
  aspect-ratio: 2 / 3;
  border-radius: 2px 5px 5px 2px;
  overflow: hidden;
  background: var(--autre);
  color: #fff;
  box-shadow: inset 6px 0 0 rgb(0 0 0 / 0.22), inset 7px 0 0 rgb(255 255 255 / 0.12), 0 1px 0 rgb(0 0 0 / 0.08), 4px 6px 14px -6px rgb(10 20 40 / 0.35);
}
.cover--ellipses { background: var(--ellipses); }
.cover--dunod { background: var(--dunod); }
.cover--breal { background: var(--breal); }
.cover--eyrolles { background: var(--eyrolles); }
.cover--ophrys { background: var(--ophrys); }
.cover--s { width: 6.5rem; }
.cover--m { width: 8rem; }
.cover--l { width: clamp(8.5rem, 22vw, 11.5rem); }
.cover__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 12% 10% 9% 16%;
}
.cover__title { font: 700 1em / 1.12 var(--serif); hyphens: auto; overflow-wrap: anywhere; }
.cover__sub { margin-top: 0.5em; font: 400 0.62em / 1.3 var(--sans); opacity: 0.85; }
.cover__pub { margin-top: auto; padding-top: 0.4em; border-top: 1px solid rgb(255 255 255 / 0.45); font: 700 0.6em / 1 var(--sans); letter-spacing: 0.02em; }
.cover--s { font-size: 0.6rem; }
.cover--s .cover__face { padding: 11% 8% 8% 14%; }
.cover--s .cover__sub { display: none; }
.cover--m { font-size: 0.8rem; }
.cover--l { font-size: clamp(0.9rem, 0.6rem + 0.9vw, 1.15rem); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* La couverture mène à la fiche Amazon du livre. */
.cover-link { display: block; flex: none; align-self: start; width: fit-content; color: inherit; border-radius: 2px 5px 5px 2px; }
.cover-link:focus-visible { outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .cover-link .cover { transition: transform 0.15s ease-out, box-shadow 0.15s ease-out; }
  .cover-link:hover .cover { transform: translateY(-3px); box-shadow: inset 6px 0 0 rgb(0 0 0 / 0.22), inset 7px 0 0 rgb(255 255 255 / 0.12), 0 1px 0 rgb(0 0 0 / 0.08), 6px 12px 20px -8px rgb(10 20 40 / 0.45); }
}

/* ---------- Mes livres ---------- */
.mine-list { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.mine { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.25rem, 4vw, 2.75rem); align-items: start; }
.mine__title { font: 700 var(--step-2) / 1.15 var(--serif); margin: 0; letter-spacing: -0.01em; }
.mine__title a { text-decoration: none; }
.mine__title a:hover { text-decoration: underline; }
.mine__sub { margin: 0.35rem 0 0; font-size: var(--step-1); font-style: italic; color: var(--ink-soft); }
.mine__meta { margin: 0.9rem 0 0; font: var(--step--1) / 1.5 var(--sans); color: var(--ink-soft); }
.mine__text { max-width: 62ch; margin: 1rem 0 0; }

.note {
  max-width: 62ch;
  margin: 1rem 0 0;
  padding: 0.15rem 0 0.15rem 0.9rem;
  border-left: 3px solid var(--note);
  font: var(--step--1) / 1.55 var(--sans);
  color: var(--ink-soft);
}

/* ---------- Liens d'achat ---------- */
.buy { margin-top: 1.25rem; font-family: var(--sans); }
.buy__label { margin: 0 0 0.4rem; font-size: var(--step--1); font-weight: 700; }
.buy__list { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0 0 0.9rem; padding: 0; }
.buy__list a {
  display: inline-block;
  padding: 0.2rem 0;
  font-size: var(--step--1);
  text-decoration-color: var(--ink-soft);
}
.buy__list a:hover { background: linear-gradient(transparent 55%, var(--marker) 55%); color: var(--ink); }
@media (prefers-color-scheme: dark) { .buy__list a:hover { color: var(--marker-ink); background: var(--marker); } }
.buy__detail { color: var(--ink-soft); }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2rem; }
.chip {
  font: var(--step--1) / 1 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-soft); }
.chip[aria-pressed='true'] { background: var(--marker); border-color: var(--marker); color: var(--marker-ink); font-weight: 700; }

/* ---------- Rayons ---------- */
.shelf { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; gap: 1rem clamp(1.5rem, 4vw, 3rem); padding-block: 2rem; border-top: 1px solid var(--rule); }
.shelf[hidden] { display: none; }
.shelf__title { font: 700 var(--step-1) / 1.25 var(--serif); margin: 0; }
.shelf__intro { margin: 0.5rem 0 0; font: var(--step--1) / 1.55 var(--sans); color: var(--ink-soft); }
.shelf__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }

.pick { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.pick__title { font: 700 var(--step-0) / 1.3 var(--serif); margin: 0; }
.pick__title a { text-decoration: none; }
.pick__title a:hover { text-decoration: underline; }
.pick__sub { margin: 0.15rem 0 0; font-style: italic; color: var(--ink-soft); }
.pick__meta { margin: 0.4rem 0 0; font: var(--step--1) / 1.5 var(--sans); color: var(--ink-soft); }
.pick__why { max-width: 60ch; margin: 0.6rem 0 0; }
.pick .note { margin-top: 0.6rem; }
.pick__buy { margin-top: 0.6rem; font-family: var(--sans); }
.pick__buy summary { cursor: pointer; font-size: var(--step--1); font-weight: 700; width: fit-content; padding: 0.25rem 0; }
.pick__buy .buy { margin-top: 0.5rem; }

/* ---------- Fiche livre ---------- */
.detail { padding-block: 2rem 4rem; }
.detail__back { margin: 0 0 2rem; font: var(--step--1) / 1.4 var(--sans); }
.detail__grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: start; }
.detail__title { font: 700 var(--step-3) / 1.12 var(--serif); letter-spacing: -0.015em; margin: 0; max-width: 22ch; }
.detail__sub { margin: 0.5rem 0 0; font-size: var(--step-1); font-style: italic; color: var(--ink-soft); }
.detail__text { max-width: 62ch; margin: 1.25rem 0 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1.25rem; margin: 1.5rem 0 0; font: var(--step--1) / 1.5 var(--sans); }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }

/* ---------- Pages de texte ---------- */
.prose { padding-block: 2.5rem 4rem; max-width: 46rem; }
.prose h1 { font: 700 var(--step-3) / 1.15 var(--serif); margin: 0 0 1.5rem; }
.prose h2 { font: 700 var(--step-1) / 1.3 var(--serif); margin: 2rem 0 0.5rem; }
.todo { background: var(--marker); color: var(--marker-ink); padding: 0 0.2em; }

/* ---------- Pied de page ---------- */
.foot { padding-block: 2rem 3rem; font: var(--step--1) / 1.6 var(--sans); color: var(--ink-soft); }
.foot__inner > p { margin: 0 0 0.5rem; max-width: 70ch; }
.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: 44rem) {
  .mine, .detail__grid { grid-template-columns: 1fr; }
  .mine .cover--l, .detail .cover--l { width: 9rem; }
  .shelf { grid-template-columns: 1fr; padding-block: 1.5rem; }
  .pick { gap: 1rem; }
  .cover--s { width: 5.25rem; }
}

@media print {
  .top nav, .filters, .skip { display: none; }
  .section--shelf { background: none; }
  .pick__buy { display: none; }
}
