/* H&C — page Téléchargements (/ressources/telechargements/). Se charge après fiche.css et apropos.css
   (`.btn--paper`, `.ex`, `.apf*`).
   2026-10-15 — l'utilisateur a choisi la piste 2 « Le mur de couvertures » parmi les six
   (planche : captures/ressources/planche-telechargements.jpg).

   1. Hero · `.tl` : mur clair + projecteur sur rail ; titre, une phrase, la ligne d'état du formulaire, puis huit
      cartes (couverture dessinée `.tlv`, type, titre, bouton). Le calendrier ouvre la grille sur une carte jaune.
      Le projecteur pivote vers la carte survolée ou au focus (telechargements.js règle --rig-x / --rig-tilt).
   2. Fenêtre `.tld` : le formulaire unique (dialog natif), mémorisé 90 jours ; confirmation dans la même fenêtre.
      `.tlt` : bulle de confirmation des téléchargements suivants.
   3. Comment ça marche · `.tls` : trois temps, photo et « dans une brochure ».
   4. Rideau final `.apf` (apropos.css) puis le pied de page.

   ≤ 1180 px : deux colonnes ; ≤ 640 px : une colonne. */

:root { --tl-muted: #5b6478; --tl-soft: #3d475c; --tl-gold-ink: #7a5c00; --tl-line: rgb(22 33 61 / 0.14); }

/* le projecteur glisse d'une carte à l'autre : --rig-x et --rig-tilt sont de vraies valeurs animables */
@property --rig-x { syntax: "<length-percentage>"; inherits: true; initial-value: 50%; }
@property --rig-tilt { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

/* ---------- communs ---------- */
.tl :is(a, button):focus-visible, .tls :is(a, button):focus-visible, .tld :is(a, button, input, select):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.tl :where(ul, ol), .tls :where(ul, ol) { margin: 0; padding: 0; list-style: none; }
.tl [hidden], .tld [hidden], .tlt[hidden] { display: none !important; }
:where(.tl button, .tld button) { font: inherit; color: inherit; cursor: pointer; }

/* bouton plein sombre sur la carte jaune (même réglage que box.css / classes.css) */
.btn--ink { padding-left: 7px; background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--night); }
.btn--ink .btn__label { flex: 1; text-align: left; }
.btn--ink .btn__icon { background: var(--gold); color: var(--ink); }
.btn--ink:hover .btn__icon { background: var(--gold); transform: rotate(-10deg); }
.btn--sm .btn__icon { width: 30px; height: 30px; }

/* ---------- 1. Hero : le mur de couvertures ---------- */
.tl {
  --rig-x: 70%;
  --rig-y: 12px;
  --rig-w: 72px;
  --rig-tilt: -8deg;
  padding-bottom: clamp(48px, 5vw, 80px);
  transition: --rig-x 0.6s var(--ease-out), --rig-tilt 0.6s var(--ease-out);
}
.tl .cone { --spread: 24deg; --throw: 900px; }
.tl .fh__crumb { margin-bottom: clamp(14px, 2vw, 22px); }
.tl__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); align-items: end; gap: 16px clamp(24px, 5vw, 72px); }
.tl__ht { display: grid; justify-items: start; gap: 14px; }
.tl__h { max-width: 20ch; font-size: clamp(2.1rem, 3.6vw, 3.1rem); }
.tl .fb__lead { margin: 0; max-width: 46ch; font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); color: var(--tl-soft); }

/* ligne d'état du formulaire unique */
.tl__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: clamp(22px, 2.6vw, 34px) 0 14px; min-height: 28px; }
.tl__gate { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 0.9375rem; line-height: 1.4; color: var(--tl-soft); }
.tl__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgb(226 174 12 / 0.22); transition: background-color 0.3s, box-shadow 0.3s; }
.tl__gate[data-state="open"] .tl__dot { background: #2a7f55; box-shadow: 0 0 0 4px rgb(42 127 85 / 0.2); }
.tl__reset { padding: 4px 0; border: 0; background: none; font-size: 0.875rem; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tl__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* la grille de huit cartes */
.tl__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tlc {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 16px 14px 16px 16px;
  border-radius: 28px;
  background: #fff;
  color: var(--ink);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.tlc:hover, .tlc:focus-within { transform: translateY(-4px); box-shadow: 0 22px 40px -26px rgb(22 33 61 / 0.5); }
.tlc--cal { background: var(--gold); }
.tlc__tx { display: grid; justify-items: start; align-content: center; gap: 0; min-width: 0; }
.tlc__cat { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tl-gold-ink); }
.tlc--cal .tlc__cat, .tlc--cal .tlc__m { color: rgb(22 33 61 / 0.78); }
.tlc__t { margin: 3px 0 4px; font-size: 1.0625rem; font-weight: 500; line-height: 1.14; letter-spacing: -0.005em; text-wrap: balance; }
.tlc__m { margin: 0; font-size: 0.84375rem; line-height: 1.35; color: var(--tl-muted); }
.tlc__btn { margin-top: 12px; }
.tlc__cv { position: relative; display: block; min-width: 0; }
.tlc__got {
  position: absolute;
  right: -8px;
  bottom: -8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2a7f55;
  box-shadow: 0 0 0 3px #fff;
  color: #fff;
  animation: tlc-pop 0.45s var(--ease-out);
}
.tlc--cal .tlc__got { box-shadow: 0 0 0 3px var(--gold); }
.tlc__got svg { width: 16px; height: 16px; stroke-width: 2.6; }
@keyframes tlc-pop { from { opacity: 0; transform: scale(0.4); } }
.tl__ex { margin-top: clamp(18px, 2.4vw, 28px); }

/* couverture de brochure dessinée (la maquette n'a pas les vraies) */
.tlv {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  aspect-ratio: 96 / 134;
  padding: 13px 10px 11px 18px;
  overflow: hidden;
  border-radius: 3px 8px 8px 3px;
  background: var(--c);
  color: var(--t);
  box-shadow: 0 14px 24px -10px rgb(22 33 61 / 0.4), inset 5px 0 0 rgb(0 0 0 / 0.1), inset 6px 0 0 rgb(255 255 255 / 0.2);
  transform: rotate(-1.5deg);
  transition: transform 0.5s var(--ease-out);
}
.tlv::after {
  content: "";
  position: absolute;
  top: -14%;
  right: -22%;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.34), transparent 70%);
  pointer-events: none;
}
.tlc:hover .tlv, .tlc:focus-within .tlv { transform: rotate(0deg) scale(1.04); }
.tlv__top, .tlv__big, .tlv__bot { position: relative; z-index: 1; }
.tlv__top { font-size: 7.4cqw; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.82; }
.tlv__big { font-weight: 300; letter-spacing: -0.025em; line-height: 0.96; }
.tlv__bot { font-size: 7.2cqw; font-weight: 500; line-height: 1.2; opacity: 0.8; }

/* ---------- 2. La fenêtre du formulaire ---------- */
.tld {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  color: var(--ink);
}
.tld::backdrop { background: rgb(11 22 38 / 0.74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tld[open] { animation: tld-in 0.4s var(--ease-out); }
.tld[open]::backdrop { animation: tld-fade 0.4s ease-out; }
@keyframes tld-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@keyframes tld-fade { from { opacity: 0; } }
html:has(.tld[open]) { overflow: hidden; }

.tld__card {
  position: relative;
  max-height: calc(100dvh - 32px);
  padding: clamp(24px, 3.2vw, 38px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.7);
}
.tld__x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(22 33 61 / 0.08);
  color: var(--ink);
  transition: background-color 0.25s, transform 0.4s var(--ease-out);
}
.tld__x:hover { background: rgb(22 33 61 / 0.16); transform: rotate(90deg); }
.tld__x svg { width: 18px; height: 18px; stroke-width: 1.9; }
.tld__k { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tl-gold-ink); }
.tld__t { margin: 6px 0 0; padding-right: 44px; font-size: clamp(1.5rem, 2.4vw, 1.95rem); font-weight: 400; line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
.tld__d { margin: 10px 0 18px; max-width: 46ch; line-height: 1.5; color: var(--tl-soft); }
.tld__d b { font-weight: 600; color: var(--ink); }
.tld__done { display: grid; justify-items: start; gap: 0; outline: 0; }
.tld__ic { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 50%; background: var(--gold); color: var(--ink); }
.tld__ic svg { width: 26px; height: 26px; stroke-width: 2; }
.tld__done .tld__t { margin: 0; padding-right: 44px; }
.tld__done .diag__note { margin: 0 0 20px; }
.tld__form .diag__go { margin-top: 4px; }

/* bulle de confirmation des téléchargements suivants */
.tlt {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  width: min(520px, calc(100vw - 32px));
  padding: 14px 20px;
  border-radius: 20px;
  background: var(--night);
  box-shadow: 0 24px 50px -20px rgb(0 0 0 / 0.6);
  color: #fff;
  font-size: 0.9375rem;
  line-height: 1.45;
  transform: translateX(-50%);
  animation: tlt-in 0.4s var(--ease-out);
}
.tlt small { display: block; margin-top: 2px; font-size: 0.8125rem; color: rgb(255 255 255 / 0.62); }
@keyframes tlt-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------- 3. Comment ça marche ---------- */
.tls { padding-block: clamp(64px, 8vw, 120px); }
.tls__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: start; gap: clamp(28px, 5vw, 80px); }
.tls__main { display: grid; justify-items: start; gap: 14px; }
.tls__list { width: 100%; margin-top: clamp(14px, 2vw, 26px) !important; border-top: 1px solid var(--tl-line); }
.tls__li { display: grid; grid-template-columns: clamp(56px, 6vw, 84px) minmax(0, 1fr); align-items: baseline; gap: 6px 14px; padding: 18px 0; border-bottom: 1px solid var(--tl-line); }
.tls__n { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: #8a6500; }
.tls__li h3 { margin: 0; font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.tls__li p { margin: 4px 0 0; max-width: 46ch; line-height: 1.5; color: var(--tl-soft); }
.tls__act { margin-top: 10px; }
.tls__side { position: relative; }
.tls__ph { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 28px; background: #14233a; }
.tls__ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tls__in { position: relative; z-index: 1; margin: -72px 20px 0; padding: 22px 24px 20px; border-radius: 24px; background: var(--night); color: #fff; }
.tls__ik { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.tls__in ul { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tls__in li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
.tls__in li svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--gold); stroke-width: 2.2; }
.tls__in .ex { margin-top: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .tl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tlc { grid-template-columns: 112px minmax(0, 1fr); gap: 18px; padding: 18px 18px 18px 18px; }
}
@media (max-width: 1000px) {
  .tl { --rig-x: 70%; }
  .tl__head { grid-template-columns: minmax(0, 1fr); }
  .tls__grid { grid-template-columns: minmax(0, 1fr); }
  .tls__side { max-width: 520px; }
}
@media (max-width: 640px) {
  .tl__grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tlc { grid-template-columns: 104px minmax(0, 1fr); }
  .tl__h { max-width: none; font-size: clamp(1.9rem, 8.4vw, 2.3rem); }
  .tls__in { margin-inline: 12px; }
  .tls__li { grid-template-columns: 48px minmax(0, 1fr); }
  .tld__card { padding: 22px 18px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl, .tlc, .tlv, .tld__x { transition: none; }
  .tlc__got { animation: none; }
  .tld[open], .tld[open]::backdrop, .tlt { animation: none; }
}
