/* FIBI Books — landing di un libro, versione immersiva. Stesso foglio per ogni libro.
   Cambia solo il tema (variabili --bg, --accent, …), iniettato dalla pagina in un <style> inline
   preso da `tema:` di libro.yml. Nessun font esterno, nessuna terza parte.
   La pagina esce dalla colonna del sito e occupa tutta la larghezza (hero, sezioni, fasce). */

.lp {
  /* valori di riserva: il tema del libro li sovrascrive */
  --bg: #0e1a17; --bg2: #13221e; --card: #172823; --ink: #f2ead8; --muted: #b4ad9a;
  --line: #2b3d37; --accent: #c9a24a; --accent-ink: #1a1405;
  --note-bg: #c9a24a22; --note-ink: #e8d39a; --shadow: #000;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* a tutta larghezza anche dentro <main> */
  width: 100vw; margin-left: calc(50% - 50vw);
  background: var(--bg); color: var(--ink);
  font: 18px/1.65 var(--display);
  padding: 0 0 96px;
  position: relative; overflow-x: clip;
}
body:has(.lp) { overflow-x: clip; }
.lp *, .lp *::before, .lp *::after { box-sizing: border-box; }
.lp h1, .lp h2, .lp h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; color: var(--ink); letter-spacing: normal; }
.lp :where(p) { margin: 0; }
.lp img { max-width: 100%; height: auto; display: block; }
.lp a { color: inherit; }
.lp :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.lp [hidden] { display: none !important; }
.lp-wrap { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.lp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lp-eyebrow { font: 600 12px/1 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.lp-eyebrow.long { font: 600 14px/1.5 var(--ui); letter-spacing: .03em; text-transform: none; max-width: 34em; }
.lp-rule { width: 56px; height: 2px; background: var(--accent); border: 0; margin: 18px 0; }
.lp-fine { font: 13px/1.45 var(--ui); color: var(--muted); }
.lp-note { background: var(--note-bg); color: var(--note-ink); font: 13px/1.4 var(--ui); padding: 10px 16px; text-align: center; }

/* ---------- movimento: solo ornamento (alone, inclinazione, riflesso del pulsante). Niente è nascosto all'arrivo. ---------- */

/* ---------- hero immersivo ---------- */
.lp-hero { position: relative; isolation: isolate; padding-block: 64px 88px; overflow: hidden; }
.lp-hero-bg { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(55% 70% at 22% 45%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(40% 50% at 92% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg2) 70%, var(--bg)) 100%); }
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: center; }
.lp-cover { position: relative; display: grid; place-items: center; padding: 28px; perspective: 1200px; }
.lp-cover::before { content: ""; position: absolute; inset: 4% 0; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent 74%); filter: blur(10px); animation: lp-respiro 7s ease-in-out infinite; }
.lp-cover img { position: relative; width: min(100%, 380px); border-radius: 2px 6px 6px 2px;
  box-shadow: 0 44px 64px -26px var(--shadow), 0 12px 22px -8px var(--shadow), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
  transform: rotateY(-14deg) rotateZ(-1.2deg); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.lp-cover:hover img { transform: rotateY(-4deg) rotateZ(0deg) scale(1.02); }
@keyframes lp-respiro { 0%, 100% { opacity: .72; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
.lp-hero h1 { font-size: clamp(38px, 6.4vw, 74px); letter-spacing: -.015em; margin-top: 16px; }
.lp-sub { font-size: clamp(20px, 2.4vw, 27px); color: var(--accent); font-style: italic; margin-top: 12px; line-height: 1.3; }
.lp-lead { font-size: 20px; color: var(--muted); max-width: 31em; }
.lp-single { margin-top: 22px; font-size: 18px; }
.lp-price { font: 700 24px var(--display); color: var(--accent); }

.lp-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; border: 0; padding: 0; min-width: 0; }
.lp-formats legend { font: 600 12px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; padding: 0; }
.lp-fmt { position: relative; }
.lp-fmt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.lp-fmt label { display: block; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(6px); border-radius: 10px; padding: 16px 18px; cursor: pointer; height: 100%; transition: border-color .15s, background .15s, transform .15s; }
.lp-fmt label:hover { transform: translateY(-2px); }
.lp-fmt input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 3px; }
.lp-fmt input:checked + label { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 14px 30px -18px var(--accent); }
.lp-fmt .n { font: 700 16px var(--display); display: block; }
.lp-fmt .p { font: 700 28px/1.1 var(--display); color: var(--accent); display: block; margin-top: 6px; font-variant-numeric: tabular-nums; }
.lp-fmt .d { font: 13px/1.4 var(--ui); color: var(--muted); display: block; margin-top: 6px; }

.lp-cta { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin-top: 26px; }
.lp-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink); font: 700 16px var(--ui); text-decoration: none; padding: 14px 28px; border-radius: 8px; border: 0; cursor: pointer; position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s, filter .15s; box-shadow: 0 10px 28px -12px var(--accent); }
.lp-btn:hover { filter: brightness(1.08); color: var(--accent-ink); transform: translateY(-2px); box-shadow: 0 16px 34px -12px var(--accent); }
.lp-btn.big { font-size: 18px; padding: 18px 34px; }
.lp-btn.big::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); animation: lp-luce 5.5s ease-in-out 1.6s infinite; }
@keyframes lp-luce { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.lp-btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.lp-btn.ghost:hover { color: var(--ink); }
.lp-link { font: 600 15px var(--ui); color: var(--muted); text-decoration: none; padding: 12px 4px; }
.lp-link:hover { color: var(--ink); }
.lp-rate { display: flex; align-items: center; gap: 12px; margin-top: 22px; font: 14px var(--ui); color: var(--muted); }
.lp-rate svg { width: 100px; height: 20px; color: var(--line); flex: none; }

/* ---------- numeri ---------- */
.lp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); margin: 0; padding: 0; list-style: none; }
.lp-facts li { padding: 28px 12px; text-align: center; border-left: 1px solid var(--line); }
.lp-facts li:first-child { border-left: 0; }
.lp-facts b { display: block; font: 700 clamp(32px, 4.6vw, 52px)/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.lp-facts span { font: 12px/1.3 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; margin-top: 10px; }

/* ---------- sezioni ---------- */
.lp-sec { padding-block: 84px; position: relative; }
.lp-sec.first { padding-top: 64px; }
.lp-sec.alt { background: linear-gradient(180deg, var(--bg2), color-mix(in srgb, var(--bg2) 55%, var(--bg))); }
.lp-head { max-width: 680px; margin-bottom: 44px; }
.lp-head h2 { font-size: clamp(32px, 4.8vw, 52px); margin-top: 14px; }
.lp-head p { color: var(--muted); margin-top: 14px; }
.lp figure { margin: 0; }
.lp figcaption { font: 13px/1.4 var(--ui); color: var(--muted); margin-top: 10px; }
.lp-shot { border-radius: 6px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent), 0 28px 44px -26px var(--shadow); }

.lp-brief { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: start; }
.lp-tldr { background: var(--bg2); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: 30px 32px; }
.lp-tldr h2 { font-size: 26px; margin-bottom: 12px; }
.lp-tldr p { font-size: 19px; }
.lp-dl { display: grid; grid-template-columns: auto 1fr; margin: 0; font: 15px/1.4 var(--ui); }
.lp-dl dt, .lp-dl dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.lp-dl dt { color: var(--muted); padding-right: 22px; }

/* perché questo libro */
.lp-story .lp-wrap { max-width: 860px; }
.lp-story .lp-eyebrow { margin-bottom: 26px; display: block; }
.lp-lede { font-size: clamp(24px, 3.4vw, 36px); line-height: 1.32; font-weight: 600; letter-spacing: -.005em; }
.lp-lede::first-letter { color: var(--accent); }
.lp-body { color: var(--muted); font-size: 20px; margin-top: 24px; }

/* dentro il libro */
.lp-list { margin: 0 0 48px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; max-width: 980px; }
.lp-list li { padding-left: 32px; position: relative; }
.lp-list li::before { content: ""; position: absolute; left: 0; top: .42em; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.lp-list li::after { content: ""; position: absolute; left: 6px; top: calc(.42em + 4px); width: 6px; height: 9px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(40deg) scale(.7); }
.lp-gallery { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.lp-gallery .w { grid-column: span 3; }
.lp-gallery .t { grid-column: span 2; }
.lp-gallery .f { grid-column: span 6; }
.lp-gallery .stesa { padding: 22px; border-radius: 14px; background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg2)), var(--bg2)); box-shadow: inset 0 0 0 1px var(--line); }
.lp-gallery .stesa figcaption { text-align: center; font-size: 14px; margin-top: 14px; }

/* fascia di conversione */
.lp-band { max-width: 1120px; margin: 0 auto; padding: 26px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; border-block: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%); }
.lp-band p { font: 700 clamp(20px, 2.6vw, 28px)/1.2 var(--display); max-width: 24em; }

/* mini galleria delle pagine */
.lp-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 26px; }
.lp-strip li { min-width: 0; }
.lp-pg { display: block; text-decoration: none; color: var(--ink); }
.lp-pg img { width: 100%; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.lp-pg:hover img { transform: translateY(-6px) scale(1.015); }
.lp-pg-tipo { display: block; margin-top: 16px; font: 600 12px/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lp-pg-dida { display: block; margin-top: 6px; font-size: 16px; line-height: 1.4; color: var(--muted); }
.lp-lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; color: #fff; }
.lp-lb::backdrop { background: rgba(0,0,0,.88); }
.lp-lb[open] { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; justify-items: center; padding: 16px 0; }
.lp-lb figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-height: calc(100dvh - 32px); min-width: 0; }
.lp-lb img { max-width: 100%; max-height: calc(100dvh - 96px); width: auto; height: auto; border-radius: 3px; background: #fff; }
.lp-lb figcaption { font: 14px/1.4 var(--ui); color: #e8e8e8; text-align: center; padding-inline: 8px; }
.lp-lb button { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; width: 48px; height: 48px; font: 400 30px/1 var(--ui); cursor: pointer; }
.lp-lb button:hover { background: rgba(255,255,255,.28); }
.lp-lb .lp-lb-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.lp-lb :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- extra inclusi: descritti, bloccati, mai raggiungibili da qui ---------- */
.lp-extra { background: var(--bg); overflow: hidden; isolation: isolate; }
.lp-extra-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 55% at 85% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%), radial-gradient(50% 50% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.lp-bonus { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 900px; }
.lp-bonus li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 22px 24px; border-radius: 14px; background: color-mix(in srgb, var(--card) 86%, transparent); border: 1px solid var(--line); backdrop-filter: blur(6px); position: relative; }
.lp-bonus li::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); }
.lp-bonus h3 { font-size: 21px; margin-bottom: 4px; }
.lp-bonus p { color: var(--muted); font-size: 16px; line-height: 1.5; }
.lp-bonus-n { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 700 22px var(--display); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 1px var(--accent); }
.lp-pill { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.lp-pill.gold { color: var(--accent-ink); background: var(--accent); }
.lp-bonus-s { background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 18%, var(--card)), var(--card)) !important; border-color: var(--accent) !important; }
.lp-lock { display: flex; gap: 12px; align-items: flex-start; margin-top: 26px; max-width: 900px; font: 14px/1.5 var(--ui); color: var(--muted); }
.lp-lock svg { flex: none; color: var(--accent); margin-top: 1px; }

/* edizioni */
.lp-editions { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 64px; align-items: center; }
.lp table { width: 100%; border-collapse: collapse; font: 15px/1.4 var(--ui); }
.lp th, .lp td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lp thead th { font: 600 12px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid var(--accent); }
.lp tbody th { font-weight: 500; color: var(--muted); width: 30%; }
.lp td.price { font: 700 18px var(--display); }
.lp-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 14px; background: var(--card); }
.lp-seg button { font: 600 13px var(--ui); color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.lp-seg button.on { background: var(--accent); color: var(--accent-ink); }

/* recensioni */
.lp-empty { background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 36px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.lp-empty svg { width: 130px; height: 26px; color: var(--line); }
.lp-empty h3 { font-size: 24px; }
.lp-empty p { color: var(--muted); margin-top: 6px; font-size: 16px; }
.lp-reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-review { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lp-review blockquote { margin: 0; font-size: 16px; }
.lp-review footer { margin-top: auto; font: 13px var(--ui); color: var(--muted); }
.lp-author { max-width: 720px; }
.lp-author p + p { margin-top: 14px; }

/* faq */
.lp details { border-bottom: 1px solid var(--line); padding-block: 8px; max-width: 800px; }
.lp summary { cursor: pointer; font: 700 20px var(--display); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding-block: 8px; }
.lp summary::-webkit-details-marker { display: none; }
.lp summary::after { content: "+"; font: 300 28px/1 var(--ui); color: var(--accent); transition: transform .25s; }
.lp details[open] summary::after { transform: rotate(45deg); }
.lp details p { color: var(--muted); margin: 0 0 14px; font-size: 17px; max-width: 44em; }

/* chiusura */
.lp-closing { padding-block: 110px 120px; text-align: center; overflow: hidden; isolation: isolate; }
.lp-closing-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 80% at 50% 100%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 72%), linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg2) 80%, var(--bg))); }
.lp-closing-in { display: grid; gap: 26px; justify-items: center; }
.lp-mini { width: 120px; height: auto; border-radius: 2px 5px 5px 2px; box-shadow: 0 24px 40px -18px var(--shadow), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent); transform: rotateZ(-3deg); }
.lp-closing h2 { font-size: clamp(34px, 5.6vw, 64px); max-width: 15em; }

/* barra fissa: titolo + pulsante SEMPRE in vista, su ogni dimensione e su ogni libro */
.lp-sticky { position: fixed; inset: auto 0 0 0; z-index: 5; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); }
.lp-sticky-in { max-width: 1120px; margin-inline: auto; padding-inline: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lp-sticky .t { font: 700 16px/1.25 var(--display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-sticky .t small { display: block; font: 12px var(--ui); color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.lp-sticky .lp-btn { padding: 12px 22px; font-size: 15px; flex: none; }
body:has(.lp-sticky) { padding-bottom: 76px; } /* lascia spazio: la barra non copre il piè di pagina del sito */

@media (max-width: 860px) {
  .lp { font-size: 17px; }
  .lp-hero { padding-block: 36px 56px; }
  .lp-hero-grid, .lp-editions, .lp-brief { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .lp-cover img { width: min(72%, 300px); transform: rotateY(-8deg) rotateZ(-1deg); }
  .lp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-facts li:nth-child(3) { border-left: 0; }
  .lp-facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .lp-sec { padding-block: 56px; }
  .lp-list { grid-template-columns: minmax(0, 1fr); }
  .lp-gallery { grid-template-columns: minmax(0, 1fr); }
  .lp-gallery .w, .lp-gallery .t, .lp-gallery .f { grid-column: auto; }
  .lp-strip { display: flex; overflow-x: auto; gap: 16px; scroll-snap-type: x mandatory; margin-inline: -20px; padding: 0 20px 8px; -webkit-overflow-scrolling: touch; }
  .lp-strip li { flex: 0 0 62%; scroll-snap-align: start; }
  .lp-lb[open] { grid-template-columns: 1fr; }
  .lp-lb .lp-lb-n { position: absolute; bottom: 14px; z-index: 2; }
  .lp-lb .prev { left: 14px; } .lp-lb .next { right: 14px; }
  .lp-bonus li { grid-template-columns: 44px minmax(0, 1fr); padding: 18px; }
  .lp-bonus .lp-pill { grid-column: 2; justify-self: start; }
  .lp-bonus-n { width: 40px; height: 40px; font-size: 18px; }
  .lp-band { flex-direction: column; align-items: flex-start; }
  .lp-empty { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; padding: 28px 20px; }
  .lp-reviews { grid-template-columns: minmax(0, 1fr); }
  .lp-formats { grid-template-columns: minmax(0, 1fr); }
  .lp table { font-size: 14px; }
  .lp-closing { padding-block: 72px 88px; }
}
@media (prefers-reduced-motion: reduce) {
  .lp *, .lp *::before, .lp *::after { animation: none !important; transition: none !important; }
  .lp-cover img { transform: none; }
}
