/* Éditions Besson — encre bleu-nuit, carmin de la couverture, or des portées. */

:root {
  --ink: #1b1e28;
  --paper: #fbfaf7;
  --surface: #f4f2ec;
  --carmine: #8e1f26;
  --gold: #a97f2c;
  --slate: #5c6270;
  --rule: #e0dcd2;

  /* boîte d'une couverture dans les grilles */
  --cover-h: 268px;
  --cover-w: 184px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--carmine); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem; }
.prose { max-width: 42em; }
.prose p, .prose ul, .prose ol { line-height: 1.65; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.12; }
h2 { font-size: 1.45rem; }

/* ---------- en-tête ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem 2rem;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .25rem; }
.brand-logo { height: 3rem; width: auto; display: block; }
.brand-tag {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--slate); padding-left: .15rem;
}
.nav { margin-left: auto; display: flex; gap: 1.3rem; font-family: var(--sans); font-size: .92rem; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--carmine); }
.langs { display: flex; gap: .6rem; font-family: var(--sans); font-size: .75rem; letter-spacing: .08em; }
.langs a { color: var(--slate); text-decoration: none; }
.langs a.on { color: var(--carmine); font-weight: 700; }

main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; }

/* ---------- grille de couvertures ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 2rem 1.75rem;
  margin: 2rem 0;
}
.grid-small { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.grid-small img { --cover-h: 190px; --cover-w: 130px; }
.card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .75rem; }
/* Chaque couverture occupe la MÊME boîte : même hauteur, même largeur, quelle
   que soit la géométrie réelle de l'édition. L'image est contenue dans la boîte
   (jamais déformée, jamais rognée) et posée au centre — les trois éditions d'un
   même livre se présentent donc à la même grandeur. */
.card img {
  height: var(--cover-h); width: var(--cover-w); object-fit: contain;
  align-self: center;
  filter: drop-shadow(0 3px 12px rgba(0,0,0,.2));
  transition: transform .18s ease;
}
.card:hover img { transform: translateY(-3px); }
.card h2, .card h3 { margin: 0; font-size: 1.08rem; font-weight: 600; line-height: 1.28; }
.byline { margin: 0; font-size: .9rem; color: var(--slate); font-style: italic; }
.card-edition {
  margin: 0; font-family: var(--sans); font-size: .68rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.card-price { margin: 0; font-family: var(--sans); font-size: .95rem; }
.amount { font-weight: 700; }
.chf { color: var(--slate); font-size: .85rem; }

.badge {
  display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: .18rem .5rem; border-radius: 2px;
}
.badge-out { border: 1px solid var(--gold); color: var(--gold); }
.badge-low { border: 1px solid var(--carmine); color: var(--carmine); }
.badge-soon { border: 1px dashed var(--slate); color: var(--slate); }

/* ---------- fiche livre ---------- */
.book-head {
  display: grid; grid-template-columns: auto 1fr; gap: 2.5rem;
  align-items: start; margin-bottom: 2.5rem;
}
.book-cover {
  height: 360px; width: 244px; object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.28)); border-radius: 1px;
}
.book-intro h1 { margin: 0 0 .3rem; }
.edition { font-family: var(--sans); font-size: .85rem; color: var(--slate); margin: .4rem 0 1.4rem; }
.buybar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .7rem 1.2rem;
  padding: 1.1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.price { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price small { font-size: .95rem; font-weight: 400; color: var(--slate); }
.stock { font-size: .85rem; color: var(--slate); }
.compare { font-family: var(--sans); font-size: .85rem; color: var(--slate); margin-top: .8rem; }

.btn {
  font-family: var(--sans); font-size: .88rem; font-weight: 600;
  background: var(--carmine); color: var(--paper);
  padding: .6rem 1.2rem; border: 0; border-radius: 2px;
  text-decoration: none; display: inline-block; cursor: pointer;
}
.btn:hover { background: #75181e; }
.btn-ghost { background: transparent; color: var(--carmine); border: 1px solid var(--carmine); }

.specs { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.specs dl {
  display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.5rem;
  font-family: var(--sans); font-size: .92rem; margin: 0;
}
.specs dt { color: var(--slate); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding-top: .18rem; }
.specs dd { margin: 0; }
.siblings { margin-top: 3rem; }

/* ---------- bon de commande ---------- */
.order { max-width: 44rem; margin-top: 2rem; font-family: var(--sans); }
.order fieldset { border: 1px solid var(--rule); padding: 1.3rem 1.4rem; margin: 0 0 1.5rem; }
.order legend {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate); padding: 0 .5rem;
}
.order label { display: block; margin-bottom: .9rem; font-size: .9rem; }
.order label small { color: var(--slate); }
.order input[type=text], .order input[type=email], .order input[type=tel],
.order select, .order textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .5rem .6rem;
  border: 1px solid var(--rule); border-radius: 2px; background: var(--paper);
  font: inherit; color: inherit;
}
.order-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.order-table th {
  text-align: left; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--slate); border-bottom: 2px solid var(--rule); padding: .5rem .6rem;
}
.order-table td { border-bottom: 1px solid var(--rule); padding: .7rem .6rem; vertical-align: top; }
.order-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-unavailable { color: var(--slate); }
.qty { width: 4.5rem; padding: .35rem .4rem; border: 1px solid var(--rule); border-radius: 2px; font: inherit; text-align: right; }
.notify { font-size: .8rem; white-space: nowrap; }
.notify input { margin-right: .3rem; }

.totals {
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: .35rem; font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.totals > div { display: flex; justify-content: space-between; }
.totals .grand { border-top: 1px solid var(--rule); margin-top: .4rem; padding-top: .5rem; font-size: 1.15rem; font-weight: 700; }
.order-terms { font-size: .85rem; color: var(--slate); }
.hp { position: absolute; left: -9999px; }

.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: .5rem 0; border-bottom: 1px solid var(--rule); }

/* ---------- pied ---------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--surface); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: start;
  padding-top: 2rem; padding-bottom: 2rem;
  font-family: var(--sans); font-size: .85rem; color: var(--slate);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.footer-nav a { color: var(--slate); text-decoration: none; }
.footer-nav a:hover { color: var(--carmine); }
.footer-note { margin: 0; margin-left: auto; }

@media (max-width: 40rem) {
  .book-head { grid-template-columns: 1fr; gap: 1.5rem; }
  .book-cover { height: 280px; width: 190px; }
  .nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
