/* BingeRead - pages livre / liste (statique, mobile d'abord). Mêmes couleurs que le site. */
:root {
  --cream: #faf6f0; --cream-soft: #f3ede2; --ink: #1a1410; --ink-soft: #4a3f37;
  --warm: #d97757; --warm-dark: #b85d3f; --line: rgba(26,20,16,.12);
  --font-display: 'Fraunces', Georgia, serif; --font-body: 'Manrope', system-ui, sans-serif;
  --shadow-md: 0 8px 24px rgba(26,20,16,.10); --shadow-lg: 0 24px 60px rgba(26,20,16,.18);
}
html.night { --cream: #17120f; --cream-soft: #1f1915; --ink: #f2eae0; --ink-soft: #c9bdb0; --line: rgba(242,234,224,.14); --shadow-md: 0 8px 24px rgba(0,0,0,.45); --shadow-lg: 0 24px 60px rgba(0,0,0,.55); color-scheme: dark; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--cream); color: var(--ink); line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; line-height: 1.12; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; border-radius: 6px; }

/* En-tête */
.ph { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.ph::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 200px; background: var(--cream); pointer-events: none; }
@media (max-width: 1180px), (hover: none) { .ph { background: var(--cream); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.ph-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 20px; margin-right: auto; min-width: 0; }
.logo img { width: 32px; height: 32px; border-radius: 8px; flex: none; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.logo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-lang { appearance: none; -webkit-appearance: none; font: 700 12px var(--font-body); color: var(--ink); background: var(--cream-soft); border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px; min-height: 38px; cursor: pointer; text-align: center; text-align-last: center; }
.ph-theme { width: 38px; height: 38px; border-radius: 999px; background: var(--cream-soft); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.ph-theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-theme .moon { display: none; } html.night .ph-theme .moon { display: block; } html.night .ph-theme .sun { display: none; }
.ph-cat { font-weight: 700; font-size: 13px; padding: 9px 14px; min-height: 38px; border-radius: 999px; background: var(--ink); color: var(--cream); white-space: nowrap; display: inline-flex; align-items: center; }
.ph-cat:hover { background: var(--warm); color: #fff; }

.pw { width: 100%; max-width: 1120px; margin: 0 auto; padding: 14px 16px 40px; flex: 1; }
.crumb { font-size: 12px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 2px 0 14px; }
.crumb a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.crumb a:hover { color: var(--warm-dark); }
.crumb b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; line-height: 1.2; padding: 13px 20px; min-height: 46px; border-radius: 999px; text-align: center; transition: background .2s, color .2s, border-color .2s, transform .15s; }
.btn:active { transform: scale(.98); }
.btn-ink { background: var(--ink); color: var(--cream); border: 1px solid var(--ink); }
.btn-ink:hover { background: var(--warm); border-color: var(--warm); color: #fff; }
.btn-warm { background: var(--warm-dark); color: #fff; border: 1px solid var(--warm-dark); }
.btn-warm:hover { background: #9f4e33; border-color: #9f4e33; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--cream-soft); }
.btn-sm { font-size: 13px; padding: 10px 15px; min-height: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--cream-soft); color: var(--ink-soft); }

/* ---------- Page livre ---------- */
.bp { display: grid; gap: 20px; }
.bp-vis { position: relative; display: grid; place-items: center; padding: 26px 16px; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, var(--c1, #3a2a22), var(--c2, #1a1410)); isolation: isolate; }
.bp-glow { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.1); opacity: .55; z-index: -1; }
.bp-vis::after { content: ''; position: absolute; inset: 0; background: rgba(15,10,8,.28); z-index: -1; }
.bp-cov { width: min(58%, 230px); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 8px 8px 4px; box-shadow: 0 18px 40px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06); background: #2a211c; }
.bp-nocov { width: min(58%, 230px); aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; display: grid; place-items: center; padding: 14px; text-align: center; color: #fff; font-family: var(--font-display); font-size: 18px; background: linear-gradient(135deg, var(--c1, #444), var(--c2, #222)); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.bp-info { min-width: 0; }
.bp-cat { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--warm-dark); margin-bottom: 8px; }
html.night .bp-cat { color: #e89577; }
.bp h1 { font-size: clamp(28px, 7.2vw, 44px); margin-bottom: 6px; }
.bp-sub { font-family: var(--font-display); font-style: italic; font-size: 17px; color: var(--ink-soft); margin-bottom: 6px; overflow-wrap: anywhere; }
.bp-author { font-size: 15px; color: var(--ink-soft); margin-bottom: 14px; }
.bp-author b { color: var(--ink); font-weight: 700; }
.bp .chips { margin-bottom: 18px; }
.bp-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.bp-cta .btn-ink { flex: 1 1 200px; }
.aff { font-size: 11.5px; color: var(--ink-soft); margin-top: 10px; opacity: .85; }

.sec { margin-top: 34px; }
.sec[hidden] { display: none; }
.bp-info .sec { margin-top: 26px; }
.sec > h2 { font-size: 23px; margin-bottom: 14px; }
.desc { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); max-width: 68ch; }
.desc p { margin-bottom: 11px; overflow-wrap: anywhere; }
.desc.clamp { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
.more { margin-top: 6px; font-weight: 700; font-size: 13.5px; color: var(--warm-dark); padding: 8px 0; min-height: 40px; }
html.night .more { color: #e89577; }
.more[hidden] { display: none; }

/* Bloc « essaie aussi » */
.try { margin-top: 34px; border: 1px solid var(--line); border-radius: 20px; padding: 18px 16px; background: var(--cream-soft); }
.try h2 { font-size: 20px; margin-bottom: 14px; }
.try-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.try-card img, .try-card .ph-img { width: 96px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 6px 6px 3px; box-shadow: var(--shadow-md); background: #2a211c; }
.try-card h3 { font-size: 19px; margin-bottom: 3px; }
.try-card .by { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.try-card .hook { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.try-card .chips { margin-bottom: 12px; }
.try-card .chips span { background: var(--cream); font-size: 11.5px; padding: 5px 9px; }
.try-act { display: flex; flex-wrap: wrap; gap: 8px; }

/* Grille de livres */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.card { display: block; min-width: 0; }
.card .cv { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 7px 7px 3px; box-shadow: var(--shadow-md); background: #2a211c; transition: transform .25s; }
.card .cv.none { display: grid; place-items: center; padding: 10px; text-align: center; color: #fff; font-family: var(--font-display); font-size: 14px; background: linear-gradient(135deg, var(--c1, #444), var(--c2, #222)); }
.card:hover .cv { transform: translateY(-3px); }
.card .ti { font-family: var(--font-display); font-size: 15px; line-height: 1.2; margin-top: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card .au { font-size: 12px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills a { font-size: 13px; font-weight: 600; padding: 9px 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); }
.pills a:hover { background: var(--cream-soft); border-color: var(--warm); }

/* Barre d'achat collante (téléphone) */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--cream) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; transform: translateY(110%); transition: transform .25s; }
.buybar.show { transform: none; }
.buybar .t { min-width: 0; flex: 1; font-family: var(--font-display); font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar .btn { flex: none; }
body.has-buybar .pf { padding-bottom: 86px; }

/* ---------- Page liste ---------- */
.lh { border-radius: 24px; padding: 26px 18px; color: #fff; background: linear-gradient(135deg, var(--g1, #3a0a14), var(--g2, #7a1a3a)); position: relative; overflow: hidden; }
.lh .em { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.lh .kick { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .8; margin-bottom: 8px; }
.lh h1 { font-size: clamp(28px, 7.4vw, 46px); margin-bottom: 10px; }
.lh p.d { font-size: 15.5px; line-height: 1.6; opacity: .92; max-width: 60ch; }
.lh-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.lh-foot .n { font-size: 13px; font-weight: 700; opacity: .85; margin-right: auto; }
.lh .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.lh .btn-ghost:hover { background: rgba(255,255,255,.14); }

.items { list-style: none; display: grid; gap: 14px; margin-top: 20px; }
.it { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--cream); position: relative; }
.it .cva { display: block; position: relative; align-self: start; }
.it img, .it .cv.none { width: 104px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 6px 6px 3px; box-shadow: var(--shadow-md); background: #2a211c; }
.it .cv.none { display: grid; place-items: center; padding: 8px; text-align: center; color: #fff; font-family: var(--font-display); font-size: 13px; background: linear-gradient(135deg, var(--c1, #444), var(--c2, #222)); }
.it .num { position: absolute; top: -8px; left: -8px; width: 30px; height: 30px; border-radius: 999px; background: var(--warm-dark); color: #fff; font: 800 14px var(--font-body); display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.it h2 { font-size: 20px; margin-bottom: 2px; }
.it h2 a:hover { color: var(--warm-dark); }
.it .sub { font-family: var(--font-display); font-style: italic; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 2px; overflow-wrap: anywhere; }
.it .by { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.it .hook { font-size: 14.5px; line-height: 1.55; color: var(--ink); margin-bottom: 10px; overflow-wrap: anywhere; }
.it .chips { margin-bottom: 12px; }
.it .chips span { font-size: 11.5px; padding: 5px 9px; }
.it .act { display: flex; flex-wrap: wrap; gap: 8px; }

/* Index (tous les livres / toutes les listes) */
.ix h1 { font-size: clamp(30px, 7.6vw, 46px); margin-bottom: 8px; }
.ix .lead { color: var(--ink-soft); max-width: 62ch; margin-bottom: 8px; }
.ix-nav { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.ix-nav::-webkit-scrollbar { display: none; }
.ix-nav a { flex: none; font-size: 13px; font-weight: 700; padding: 9px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--cream-soft); border: 1px solid var(--line); }
.lists { display: grid; gap: 12px; }
.lc { display: block; border-radius: 20px; padding: 20px 18px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); min-width: 0; }
.lc .em { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.lc h3 { font-size: 21px; margin-bottom: 4px; }
.lc p { font-size: 13.5px; opacity: .9; line-height: 1.5; }
.lc .n { font-size: 12px; font-weight: 700; opacity: .8; margin-top: 10px; }

/* Pied de page */
.pf { border-top: 1px solid var(--line); background: var(--cream-soft); padding: 26px 16px 30px; margin-top: 20px; }
.pf-in { max-width: 1120px; margin: 0 auto; display: grid; gap: 16px; }
.pf-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; font-weight: 600; }
.pf-links a { padding: 6px 0; min-height: 36px; display: inline-flex; align-items: center; }
.pf-links a:hover { color: var(--warm-dark); }
.pf small { display: block; font-size: 12px; color: var(--ink-soft); line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); background: var(--ink); color: var(--cream); font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Téléphones : dans une liste, l'accroche et les boutons prennent toute la largeur sous la couverture ---------- */
@media (max-width: 599px) {
  .it { align-items: center; row-gap: 12px; }
  .it > div { display: contents; }
  .it .by { margin-bottom: 0; }
  .it .hook, .it .chips, .it .act { grid-column: 1 / -1; margin-bottom: 0; }
}
/* ---------- Petits téléphones ---------- */
@media (max-width: 359px) {
  .ph-in { padding: 9px 12px; gap: 7px; }
  .logo { font-size: 18px; } .logo img { width: 28px; height: 28px; }
  .ph-cat { padding: 9px 11px; font-size: 12px; }
  .pw { padding-left: 12px; padding-right: 12px; }
  .it { grid-template-columns: 84px minmax(0, 1fr); gap: 11px; padding: 12px; }
  .it img, .it .cv.none { width: 84px; }
  .try-card { grid-template-columns: 80px minmax(0, 1fr); }
  .try-card img, .try-card .ph-img { width: 80px; }
  .ix-nav { margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
}
/* ---------- Tablette ---------- */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
  .lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lh { padding: 34px 28px; }
  .it { grid-template-columns: 128px minmax(0, 1fr); gap: 18px; padding: 18px; }
  .it img, .it .cv.none { width: 128px; }
  .try { padding: 22px; }
  .try-card { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }
  .try-card img, .try-card .ph-img { width: 120px; }
}
@media (min-width: 760px) {
  .ph-in { padding: 12px 24px; }
  .pw { padding: 20px 24px 56px; }
  .bp { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 36px; align-items: start; }
  .bp-vis { padding: 38px 24px; position: sticky; top: 84px; }
  .bp-cov, .bp-nocov { width: min(74%, 250px); }
  .bp-info { padding-top: 8px; }
  .bp-cta .btn-ink { flex: 1 1 200px; max-width: 280px; }
  .bp-info .sec { margin-top: 28px; }
  .buybar { display: none; }
  body.has-buybar .pf { padding-bottom: 30px; }
  .sec > h2 { font-size: 26px; }
  .pf { padding: 32px 24px 36px; }
  .toast { bottom: 32px; }
}
/* ---------- Ordinateur ---------- */
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid.g4 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lists { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .items.sel { grid-template-columns: minmax(0, 1fr); }
  .lh { padding: 44px 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
