/* =====================================================================
   style.css — cheques-cadeaux.fr
   Idée directrice : le chèque et son talon. Une seule forme forte (le chèque
   de la page d'accueil, repris en petit par le résumé « talon » des guides),
   tout le reste reste sobre : texte aligné à gauche, colonne de lecture étroite.
   Toutes les valeurs viennent de tokens.css.
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--e5); }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: var(--taille-base);
  line-height: var(--interligne);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; display: block; }
picture { display: block; }

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

h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: 700;
  line-height: var(--interligne-titre);
  letter-spacing: var(--approche-titre);
  color: var(--encre);
  text-wrap: balance;
}
h1 { font-size: var(--taille-h1); margin: 0 0 var(--e4); }
h2 { font-size: var(--taille-h2); margin: var(--e7) 0 var(--e4); }
h3 { font-size: var(--taille-h3); margin: var(--e6) 0 var(--e3); }
p { margin: 0 0 var(--e4); }

.evitement { position: absolute; left: -999px; top: var(--e2); background: var(--surface); padding: var(--e2) var(--e4); z-index: 10; }
.evitement:focus { left: var(--e2); }

.conteneur { width: 100%; max-width: var(--largeur-site); margin: 0 auto; padding: 0 var(--gouttiere); }
.colonne { max-width: calc(var(--mesure) + 2 * var(--gouttiere)); }

/* ---------------------------------------------------------------- en-tête */
.entete { background: var(--surface); border-bottom: 1px solid var(--trait); }
.entete-in { display: flex; align-items: center; justify-content: space-between; gap: var(--e5); min-height: 4.5rem; flex-wrap: wrap; padding-top: var(--e3); padding-bottom: var(--e3); }
.marque { display: block; flex: 0 0 auto; }
.marque img { width: 13.5rem; height: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--e1) var(--e2); flex-wrap: wrap; }
.nav a {
  display: block; padding: var(--e2) var(--e3); border-radius: var(--rayon-pilule);
  color: var(--encre); text-decoration: none; font-weight: 600; font-size: 1rem;
}
.nav a:hover { background: var(--sapin-voile); color: var(--sapin-fonce); }
.nav a[aria-current="page"] { background: var(--sapin); color: var(--sur-sapin); }

/* ---------------------------------------------------------------- une (accueil) */
.une { padding: var(--e8) 0 var(--e7); }
.une-in { display: grid; gap: var(--e7); align-items: center; }
.une h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem); max-width: 16ch; }
.une .chapo { max-width: 38rem; }

.cheque {
  margin: 0; display: grid; grid-template-columns: 4.5rem 1fr;
  background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre);
  border: 1px solid var(--trait); position: relative; transform: rotate(-1.2deg);
}
.cheque-talon {
  background: var(--sapin); border-radius: var(--rayon-carte) 0 0 var(--rayon-carte);
  display: grid; place-items: center; position: relative;
}
.cheque-talon img { width: 2.6rem; filter: brightness(0) invert(1); }
.cheque-talon::after {
  content: ""; position: absolute; right: -1px; top: var(--e3); bottom: var(--e3);
  border-right: 2px dashed var(--sapin-pale);
}
.cheque-corps { padding: var(--e5) var(--e5) var(--e4); }
.cheque-titre { font-family: var(--police-titre); font-weight: 700; font-size: 1.3rem; margin-bottom: var(--e3); }
.cheque dl { margin: 0; }
.cheque dl div { display: grid; grid-template-columns: 8.5rem 1fr; gap: var(--e3); padding: var(--e3) 0; border-bottom: 1px dotted var(--trait-fort); }
.cheque dl div:last-child { border-bottom: 0; }
.cheque dt { color: var(--encre-douce); font-size: var(--taille-petite); padding-top: 0.15em; }
.cheque dd { margin: 0; font-weight: 600; line-height: 1.35; }

/* ---------------------------------------------------------------- héros des autres pages */
.hero { padding: var(--e6) 0 var(--e6); background: var(--surface); border-bottom: 1px solid var(--trait); }
.hero-in { display: grid; gap: var(--e6); align-items: end; }
.hero-texte { max-width: 46rem; }
.hero-img img { border-radius: var(--rayon-carte); width: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.chapo { font-size: var(--taille-chapo); line-height: 1.5; color: var(--encre); }
.surtitre { margin: 0 0 var(--e3); }
.surtitre a {
  display: inline-block; font-weight: 600; font-size: var(--taille-petite);
  color: var(--framboise); background: var(--framboise-pale);
  padding: var(--e1) var(--e3); border-radius: var(--rayon-pilule); text-decoration: none;
}
.surtitre a:hover { color: var(--framboise); text-decoration: underline; }
.meta { color: var(--encre-douce); font-size: var(--taille-petite); display: flex; flex-wrap: wrap; gap: var(--e1) var(--e5); margin: 0; }
.ariane ol { list-style: none; margin: 0 0 var(--e4); padding: 0; display: flex; flex-wrap: wrap; font-size: var(--taille-petite); color: var(--encre-douce); }
.ariane li + li::before { content: "/"; margin: 0 var(--e2); color: var(--trait-fort); }
.ariane a { color: var(--encre-douce); }

/* ---------------------------------------------------------------- lecture */
.prose { padding: var(--e6) 0 var(--e7); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--e4); }
.prose li { margin-bottom: var(--e2); }
.prose blockquote { margin: var(--e5) 0; padding: var(--e2) var(--e5); border-left: 3px solid var(--framboise); color: var(--encre); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; margin: var(--e5) 0; font-size: 1rem; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th { background: var(--sapin); color: var(--sur-sapin); text-align: left; font-weight: 600; }
.prose th, .prose td { padding: var(--e2) var(--e3); border-bottom: 1px solid var(--trait); vertical-align: top; }
.prose tbody tr:nth-child(even) td { background: var(--sapin-voile); }
.prose strong { font-weight: 600; }
.prose h2 { padding-top: var(--e2); }

/* résumé : le talon du chèque */
.resume {
  display: grid; grid-template-columns: 2.25rem 1fr; margin: 0 0 var(--e6);
  background: var(--sapin-pale); border-radius: var(--rayon);
  position: relative; overflow: hidden;
}
.talon { background: var(--sapin); position: relative; }
.talon::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 0;
  border-right: 2px dashed var(--sapin-pale);
}
.resume-corps { padding: var(--e4) var(--e5) var(--e2); }
.resume-titre { font-family: var(--police-titre); font-weight: 700; font-size: 1.15rem; color: var(--sapin-fonce); margin-bottom: var(--e2); }
.resume ul { margin: 0 0 var(--e3); padding-left: 1.1em; }
.resume li { margin-bottom: var(--e2); }

.sommaire { border-left: 3px solid var(--trait-fort); padding: var(--e1) 0 var(--e1) var(--e4); margin: 0 0 var(--e6); }
.sommaire-titre { font-weight: 600; margin-bottom: var(--e2); }
.sommaire ol { margin: 0; padding-left: 1.3em; }
.sommaire li { margin-bottom: var(--e1); }
.sommaire a { color: var(--encre); }
.sommaire a:hover { color: var(--sapin); }

/* encadré : billet à encoches, filet framboise */
.encadre {
  margin: var(--e6) 0; padding: var(--e5) var(--e5) var(--e2);
  background:
    radial-gradient(circle at 0 1.6rem, var(--fond) var(--encoche), transparent calc(var(--encoche) + 1px)),
    radial-gradient(circle at 100% 1.6rem, var(--fond) var(--encoche), transparent calc(var(--encoche) + 1px)),
    var(--surface);
  border-top: 4px solid var(--framboise);
  border-radius: 0 0 var(--rayon) var(--rayon);
  box-shadow: var(--ombre);
}
.encadre-titre { font-family: var(--police-titre); font-weight: 700; font-size: 1.15rem; color: var(--framboise); padding: 0 var(--e3); }
.encadre ul, .encadre ol { padding-left: 1.4em; }

.figure { margin: var(--e6) 0; }
.figure img { border-radius: var(--rayon); }
.figure figcaption { font-size: var(--taille-petite); color: var(--encre-douce); margin-top: var(--e2); }

/* FAQ */
.faq { margin: var(--e7) 0 var(--e6); }
.faq details { border-bottom: 1px solid var(--trait); }
.faq details:first-of-type { border-top: 1px solid var(--trait); }
.faq summary {
  cursor: pointer; padding: var(--e4) var(--e6) var(--e4) 0; font-weight: 600; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: var(--e2); top: var(--e4);
  font-family: var(--police-titre); font-size: 1.3rem; line-height: 1; color: var(--sapin);
  transition: transform var(--duree) ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 var(--e4); color: var(--encre); }

/* auteur */
.auteur-encart {
  display: flex; gap: var(--e4); align-items: flex-start;
  border-top: 1px solid var(--trait); padding-top: var(--e5); margin-top: var(--e6);
}
.pastille {
  flex: 0 0 auto; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--sapin); color: var(--sur-sapin);
  font-family: var(--police-titre); font-weight: 700; font-size: 1.35rem;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--framboise);
}
.pastille-grande { width: 5rem; height: 5rem; font-size: 1.9rem; margin-bottom: var(--e5); }
.auteur-nom { font-weight: 600; margin: 0 0 var(--e1); }
.auteur-bio { margin: 0; color: var(--encre-douce); font-size: 1rem; }

/* bloc IA */
.bloc-ia { margin: var(--e6) 0 0; padding: var(--e5); border: 1px dashed var(--trait-fort); border-radius: var(--rayon); }
.bloc-ia-titre { font-size: 1.15rem; margin: 0 0 var(--e3); }
.bloc-ia-liste { list-style: none; padding: 0; margin: 0 0 var(--e4); display: flex; flex-wrap: wrap; gap: var(--e2); }
.bloc-ia-liste li { margin: 0; }
.bloc-ia-liste a {
  display: inline-block; padding: var(--e1) var(--e4); border: 1px solid var(--sapin);
  border-radius: var(--rayon-pilule); text-decoration: none; font-weight: 600; font-size: 1rem;
}
.bloc-ia-liste a:hover { background: var(--sapin); color: var(--sur-sapin); }
.bloc-ia-md { font-size: 1rem; display: flex; flex-wrap: wrap; gap: var(--e2) var(--e4); align-items: baseline; }
.bloc-ia-note { font-size: var(--taille-petite); color: var(--encre-douce); margin: 0; }
.bouton-lien {
  font: inherit; font-size: 1rem; background: none; border: 0; padding: 0; color: var(--sapin);
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* ---------------------------------------------------------------- bandes, cartes, carnets */
.bande { padding: var(--e7) 0; background: var(--sapin-voile); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.section-titre { margin-top: 0; }
.section-auteurs { padding: var(--e7) 0 var(--e8); }
.grille-cartes { display: grid; gap: var(--e5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.carte {
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte);
  overflow: hidden; display: flex; flex-direction: column;
}
.carte-img img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.carte-corps { padding: var(--e4) var(--e5) var(--e5); display: flex; flex-direction: column; flex: 1; }
.carte-rub { color: var(--framboise); font-weight: 600; font-size: var(--taille-petite); margin-bottom: var(--e2); }
.carte h3 { font-size: 1.2rem; margin: 0 0 var(--e3); }
.carte h3 a { color: var(--encre); text-decoration: none; }
.carte h3 a:hover { color: var(--sapin); text-decoration: underline; }
.carte-desc { font-size: 1rem; color: var(--encre-douce); }
.carte-meta { margin: auto 0 0; padding-top: var(--e3); border-top: 1px dashed var(--trait-fort); font-size: var(--taille-petite); color: var(--encre-douce); }

.carnets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.carnets a {
  display: grid; gap: var(--e1); height: 100%; padding: var(--e4) var(--e5) var(--e4) var(--e6);
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  text-decoration: none; color: var(--encre); position: relative;
}
.carnets a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.6rem; background: var(--sapin); border-radius: var(--rayon) 0 0 var(--rayon); }
.carnets a:hover { border-color: var(--sapin); }
.carnets a:hover .carnet-nom { text-decoration: underline; }
.carnet-nom { font-family: var(--police-titre); font-weight: 700; font-size: 1.2rem; color: var(--sapin-fonce); }
.carnet-desc { font-size: 1rem; color: var(--encre-douce); }

.duo { display: grid; gap: var(--e5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.duo .auteur-encart { border: 1px solid var(--trait); border-radius: var(--rayon); padding: var(--e5); margin: 0; background: var(--surface); }

.btn {
  display: inline-block; background: var(--sapin); color: var(--sur-sapin); font-weight: 600;
  padding: var(--e3) var(--e5); border-radius: var(--rayon-pilule); text-decoration: none;
}
.btn:hover { background: var(--sapin-fonce); color: var(--sur-sapin); }
.suite { margin: var(--e5) 0 0; }
.vide { color: var(--encre-douce); }

/* ---------------------------------------------------------------- pied */
.pied { background: var(--sapin-fonce); color: var(--sur-sapin); padding: var(--e7) 0 var(--e6); }
.pied-in { display: grid; gap: var(--e5); }
.pied-marque img { width: 13.5rem; margin-bottom: var(--e2); }
.pied-marque p { margin: 0; }
.pied a { color: var(--sur-sapin); }
.pied-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--e2) var(--e5); }
.pied-note, .pied-copy { font-size: var(--taille-petite); max-width: 52rem; margin: 0; }

/* ---------------------------------------------------------------- grands écrans */
@media (min-width: 900px) {
  :root { --gouttiere: 1.5rem; }
  .une-in { grid-template-columns: 1.1fr 1fr; }
  .hero-image .hero-in { grid-template-columns: 1.25fr 1fr; }
}
@media (max-width: 640px) {
  .entete-in { gap: var(--e2); }
  .marque img { width: 11rem; }
  .nav { width: 100%; overflow-x: auto; }
  .nav ul { flex-wrap: nowrap; }
  .nav a { white-space: nowrap; font-size: 0.95rem; padding: var(--e2) var(--e3); }
  .une { padding: var(--e6) 0; }
  .cheque { grid-template-columns: 3rem 1fr; transform: none; }
  .cheque dl div { grid-template-columns: 1fr; gap: 0; }
  .cheque-corps { padding: var(--e4); }
  .resume { grid-template-columns: 0.9rem 1fr; }
  .resume-corps { padding: var(--e4) var(--e4) var(--e2); }
  .prose table { font-size: 0.95rem; }
}

/* ---------------------------------------------------------------- apparition au défilement (CSS seul) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .grille-cartes > .carte, .carnets > li {
      animation: apparait linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
  .cheque { animation: pose 600ms cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes apparait { from { opacity: .45; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pose { from { opacity: 0; transform: rotate(-4deg) translateY(12px); } to { opacity: 1; transform: rotate(-1.2deg); } }
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .cheque { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .entete, .pied, .bloc-ia, .a-lire { display: none; }
}
