/* Fiches livre (livres-maths/<slug>/) et grille des 24 livres (vitrine + fiches).
   S'appuie sur les variables et composants de livres.css. */

/* --- lien vers la fiche depuis les cartes de la vitrine --- */
.livre h3 a { color: inherit; text-decoration: none; }
.livre h3 a:hover { color: var(--accent); text-decoration: underline; }
.lien-fiche { display: inline-block; margin-top: 4px; font-weight: 600; color: var(--accent); }
.panier .renonciation span { flex: 1; }

/* --- lien « Voir les livres en detail » (haut de la vitrine -> grille du bas) --- */
.voir-detail { display: inline-flex; align-items: center; gap: 8px; margin: 18px auto 0; padding: 12px 22px; border-radius: 999px; background: var(--degrade); color: #fff; font-weight: 700; font-size: 1.02rem; text-decoration: none; box-shadow: var(--ombre-forte); }
.voir-detail:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.voir-detail span { font-size: 1.15em; }
#livres-en-detail { scroll-margin-top: 12px; }

/* --- fil d'Ariane --- */
.ariane { font-size: .88rem; color: var(--encre-pale); padding-top: 18px; padding-bottom: 4px; }
.ariane a { color: var(--encre-douce); }
.ariane span { color: var(--encre); }

/* --- en-tete de fiche --- */
.fiche-heros { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 18px; padding-bottom: 40px; }
.fiche-couverture img { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--ombre-forte); }
.fiche-infos .type { display: inline-block; }
.fiche-infos h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.15; margin: 8px 0 14px; letter-spacing: -.01em; }
.fiche-infos .chapeau { margin: 0; max-width: 62ch; text-align: left; }
.fiche-chiffres { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 22px; }
.fiche-chiffres li { background: var(--accent-clair); color: var(--encre); border-radius: 999px; padding: 6px 14px; font-size: .92rem; }
.fiche-chiffres b { color: var(--accent); }

.fiche-achat { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; display: grid; gap: 12px; max-width: 520px; }
.fiche-prix { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fiche-prix b { font-size: 2rem; color: var(--encre); }
.fiche-prix span { color: var(--encre-pale); font-size: .9rem; }
.option-compagnon { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; background: var(--accent-clair); border-radius: var(--rayon-s); padding: 10px 12px; cursor: pointer; }
.option-compagnon input, .fiche-achat .renonciation input { margin-top: 3px; flex: none; }
.fiche-achat .renonciation { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--encre-douce); }
.fiche-achat .bouton-paypal { width: 100%; }
.lien-panier { text-align: center; font-size: .92rem; font-weight: 600; color: var(--accent); }
.fiche-infos .garanties { margin-top: 14px; max-width: 520px; }

/* --- presentation --- */
.texte-fiche p { font-size: 1.05rem; line-height: 1.7; color: var(--encre-douce); margin: 0 0 16px; }

/* --- sommaire detaille --- */
.sommaire-fiche h3.partie { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 26px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-clair); }
.sommaire-fiche h3.partie:first-child { margin-top: 0; }
.chapitres { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; align-items: start; }
.chap { break-inside: avoid; background: var(--fond); border: 1px solid var(--bord); border-radius: var(--rayon-s); padding: 12px 14px; margin: 0; }
.chap-tete { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; }
.chap-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }
.chap-tete h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.chap-meta { font-size: .8rem; color: var(--encre-pale); white-space: nowrap; }
.chap-detail { margin: 8px 0 0 38px; padding: 0; font-size: .9rem; color: var(--encre-douce); list-style: none; }
.chap-detail li { position: relative; padding-left: 14px; margin: 3px 0; }
.chap-detail li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .55; }

/* --- apercus --- */
.apercus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.apercus figure { margin: 0; }
.apercus img { width: 100%; height: auto; border: 1px solid var(--bord); border-radius: 6px; box-shadow: var(--ombre); background: #fff; }
.apercus figcaption { margin-top: 8px; font-weight: 600; font-size: .92rem; text-align: center; }
.apercus figcaption span { color: var(--encre-pale); font-weight: 400; }

/* --- conseils --- */
.colonnes-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --- pour aller plus loin --- */
.suites { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 16px; align-items: stretch; }
.suites > a, .gratuits { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; text-decoration: none; color: var(--encre); box-shadow: var(--ombre); }
.suites > a:hover { border-color: var(--accent); }
.suites small { display: block; color: var(--encre-pale); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.suites b { display: block; margin-bottom: 4px; }
.suite-livre { display: flex; gap: 14px; align-items: center; }
.suite-livre img { width: 76px; height: auto; border-radius: 4px; box-shadow: var(--ombre); flex: none; }
.suite-livre span { color: var(--encre-douce); font-size: .92rem; }
.suite-livre b { color: var(--encre); }
.suite-niveau { border-top: 4px solid var(--accent) !important; }
.gratuits ul { margin: 8px 0 0; padding-left: 18px; font-size: .92rem; list-style: disc; }
.gratuits a { color: var(--accent); }
.gratuits li { margin: 4px 0; }

/* --- grille des 24 livres (maillage) --- */
.grille-livres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.grille-cycle h3 { margin: 0 0 10px; font-size: 1.05rem; }
.grille-cycle ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.grille-cycle li { display: grid; grid-template-columns: minmax(44px, auto) 1fr; gap: 2px 14px; align-items: center; background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid var(--accent); border-radius: var(--rayon-s); padding: 8px 12px; }
.grille-cycle li b { grid-row: span 2; color: var(--accent); font-size: 1.05rem; }
.grille-cycle li a { font-size: .9rem; color: var(--encre-douce); }
.grille-cycle li a:hover { color: var(--accent); }
.grille-cycle li a[aria-current] { color: var(--encre); font-weight: 700; text-decoration: none; }

@media (max-width: 900px) {
  .suites { grid-template-columns: 1fr 1fr; }
  .suite-livre { grid-column: 1 / -1; }
  .gratuits { grid-column: 1 / -1; }
  .grille-livres { grid-template-columns: 1fr; }
  .colonnes-3 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .fiche-heros { grid-template-columns: 1fr; gap: 22px; }
  .fiche-couverture { max-width: 230px; margin: 0 auto; }
  .apercus { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .chap-detail { margin-left: 0; }
}
