/* Eldama Publishing: un solo foglio di stile, un tema per libro (classe sul body).
   Font in locale, nessuna chiamata esterna. */

@font-face { font-family: "Baskerville L"; src: url("../fonts/libre-baskerville-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Baskerville L"; src: url("../fonts/libre-baskerville-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Baskerville L"; src: url("../fonts/libre-baskerville-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald L"; src: url("../fonts/oswald-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Oswald L"; src: url("../fonts/oswald-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins L"; src: url("../fonts/Poppins-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins L"; src: url("../fonts/Poppins-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Serif4 L"; src: url("../fonts/SourceSerif4-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f5f2ec; --surface: #ffffff; --ink: #1f2430; --muted: #5d6270;
  --accent: #2f4a6d; --accent-ink: #ffffff; --line: rgba(31, 36, 48, .14);
  --display: "Serif4 L", Georgia, serif;
  --body: "Poppins L", "Segoe UI", sans-serif;
  --radius: 14px;
}

/* Black Culture Word Search: verde notte, crema, oro antico, bronzo (dalla copertina) */
body.t-black {
  --bg: #0c140d; --surface: #152016; --ink: #ece6d8; --muted: #b9b29f;
  --accent: #c8a454; --accent-ink: #0c140d; --bronze: #8b4c2a; --line: rgba(236, 230, 216, .16);
  --display: "Baskerville L", Georgia, serif;
}
/* Sudoku: carta, nero pieno, giallo della copertina */
body.t-sudoku {
  --bg: #f6f3ea; --surface: #ffffff; --ink: #111111; --muted: #4a4a4a;
  --accent: #f7d925; --accent-ink: #111111; --line: #111111;
  --display: "Oswald L", Impact, sans-serif;
}
/* Flower Coloring Book: salvia, verde foglia, cipria */
body.t-flower {
  --bg: #f4f1ea; --surface: #fffdf9; --ink: #33372f; --muted: #6b6f63;
  --accent: #4f8f61; --accent-ink: #ffffff; --blush: #e4cbc1; --sage: #c6ccb6; --line: rgba(51, 55, 47, .14);
  --display: "Baskerville L", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.65 var(--body); overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ---------- fondi a tema ---------- */
.t-black .sfondo {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  font: 700 22px/1 var(--display); letter-spacing: .9em; color: rgba(236, 230, 216, .045);
  word-break: break-all; padding: 12px; text-transform: uppercase;
}
.t-black .sfondo b { color: rgba(200, 164, 84, .22); font-weight: 700; }
.t-sudoku .sfondo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(#111 2px, transparent 2px), linear-gradient(90deg, #111 2px, transparent 2px),
    linear-gradient(rgba(17,17,17,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(17,17,17,.12) 1px, transparent 1px);
  background-size: 180px 180px, 180px 180px, 60px 60px, 60px 60px;
  opacity: .07;
}
.t-flower .sfondo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 420px at 92% 6%, rgba(228, 203, 193, .55), transparent 70%),
    radial-gradient(460px 380px at 4% 96%, rgba(198, 204, 182, .6), transparent 70%);
}

/* ---------- testata ---------- */
.testata { padding: 22px 0 0; }
.testata .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.firma { font: 500 13px/1.2 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.t-sudoku .firma { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 40px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.copertina { position: relative; justify-self: center; width: min(360px, 82%); }
.copertina img {
  width: 100%; height: auto; border-radius: 4px 10px 10px 4px;
  box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 28px 50px -18px rgba(0,0,0,.55);
  transform: rotate(-3deg);
}
.t-black .copertina img { box-shadow: 0 30px 60px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(200,164,84,.25); }
.t-sudoku .copertina img { transform: rotate(-2deg); box-shadow: 10px 10px 0 var(--ink); border-radius: 2px; }
.t-flower .copertina::before {
  content: ""; position: absolute; inset: -9% -12%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, var(--blush), transparent 68%);
}
.sigillo {
  position: absolute; right: -14px; top: -14px; width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; transform: rotate(10deg);
  background: var(--accent); color: var(--accent-ink);
  font: 600 13px/1.1 var(--body); text-transform: uppercase; letter-spacing: .06em;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.6);
}
.sigillo strong { display: block; font: 700 26px/1 var(--display); letter-spacing: 0; }
.t-sudoku .sigillo { border-radius: 0; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }

.occhiello { font: 500 13px/1.3 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.t-sudoku .occhiello { color: var(--ink); background: var(--accent); display: inline-block; padding: 4px 10px; }
h1 { font: 700 clamp(34px, 5.2vw, 56px)/1.08 var(--display); margin: 0 0 18px; letter-spacing: -.01em; }
.t-sudoku h1 { font-weight: 600; text-transform: uppercase; letter-spacing: .01em; line-height: 1.02; }
.t-flower h1 em, .t-black h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.t-sudoku h1 em { font-style: normal; background: linear-gradient(transparent 58%, var(--accent) 58%); }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; max-width: 36em; }

/* ---------- modulo ---------- */
.modulo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 24px 48px -32px rgba(0,0,0,.45);
}
.t-sudoku .modulo { border: 3px solid var(--ink); border-radius: 0; box-shadow: 8px 8px 0 var(--ink); }
.campo { display: block; margin: 0 0 14px; }
.campo span { display: block; font: 500 14px/1.3 var(--body); margin: 0 0 6px; }
.campo span i { font-style: normal; color: var(--muted); font-weight: 400; }
.campo input {
  width: 100%; font: 400 17px/1.3 var(--body); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 14px;
}
.t-sudoku .campo input { border: 2px solid var(--ink); border-radius: 0; background: #fff; }
.campo input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
.consenso { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--muted); margin: 6px 0 18px; cursor: pointer; }
.consenso input { flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.consenso a { color: var(--ink); }
.trappola { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bottone {
  display: inline-flex; justify-content: center; align-items: center; gap: 10px; width: 100%;
  font: 500 17px/1 var(--body); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 17px 22px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.bottone:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -14px color-mix(in srgb, var(--accent) 80%, #000); }
.t-sudoku .bottone { border-radius: 0; border: 3px solid var(--ink); font-family: var(--display); font-size: 20px; text-transform: uppercase; }
.t-sudoku .bottone:hover { box-shadow: 5px 5px 0 var(--ink); }
.nota { font-size: 13px; color: var(--muted); margin: 12px 0 0; text-align: center; }

/* ---------- cosa c'è dentro ---------- */
.dentro { padding: 8px 0 64px; }
.dentro h2 { font: 700 clamp(24px, 3vw, 32px)/1.2 var(--display); margin: 0 0 22px; }
.t-sudoku .dentro h2 { font-weight: 600; text-transform: uppercase; }
.voci { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.voci li { border-top: 2px solid var(--accent); padding: 16px 4px 0; }
.t-sudoku .voci li { border-top: 6px solid var(--ink); }
.voci strong { display: block; font: 700 19px/1.3 var(--display); margin: 0 0 6px; }
.t-sudoku .voci strong { font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.voci p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- pagina di download ---------- */
.pronto { padding: 56px 0 72px; text-align: center; }
.pronto .wrap { max-width: 640px; }
.pronto .bottone { width: auto; min-width: 280px; }
.pronto p { color: var(--muted); }

/* ---------- testi lunghi (informativa) ---------- */
.testo { padding: 32px 0 72px; }
.testo .wrap { max-width: 760px; }
.testo h1 { font-size: clamp(30px, 4.4vw, 44px); }
.testo h2 { font: 700 22px/1.3 var(--display); margin: 36px 0 10px; }
.testo li { margin: 0 0 8px; }
.lingue { display: flex; gap: 14px; font-size: 14px; }
.lingue a[aria-current] { font-weight: 500; text-decoration: none; }

/* ---------- piede ---------- */
.piede { border-top: 1px solid var(--line); padding: 22px 0 30px; font-size: 13px; color: var(--muted); }
.t-sudoku .piede { border-top: 3px solid var(--ink); }
.piede .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }

/* ---------- entrata ---------- */
@media (prefers-reduced-motion: no-preference) {
  .entra { opacity: 0; transform: translateY(14px); animation: entra .7s cubic-bezier(.2,.7,.2,1) forwards; }
  .entra.d1 { animation-delay: .08s; } .entra.d2 { animation-delay: .18s; } .entra.d3 { animation-delay: .3s; } .entra.d4 { animation-delay: .44s; }
  @keyframes entra { to { opacity: 1; transform: none; } }
}

@media (max-width: 820px) {
  .hero { padding: 24px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 34px; }
  .copertina { width: min(250px, 66%); }
  .sigillo { width: 76px; height: 76px; font-size: 11px; right: -18px; }
  .sigillo strong { font-size: 21px; }
  .voci { grid-template-columns: 1fr; }
  .modulo { padding: 20px; }
}
