/* =========================================================
   OFFICINA DELLA NARRAZIONE
   Identità visiva estratta dalle copertine della collana.
   Carta, matita rossa, bottega. Nessun codice visivo "techno".
   ========================================================= */

:root {
  --paper:        #ECE7DF;  /* crema carta, fondo delle copertine */
  --paper-warm:   #E3DCD1;  /* fascia alternata */
  --card:         #F6F3EE;  /* quasi bianco, blocchi in rilievo */
  --ink:          #26211E;  /* nero caldo, mai #000 */
  --ink-soft:     #5F5850;  /* didascalie e metadati */
  --accent:       #802420;  /* rosso mattone del titolo */
  --accent-soft:  #A3635A;  /* rosso smorzato, hover */
  --rule:         #C7C1B8;  /* filetti e cornici */

  --serif-display: "Playfair Display", Georgia, serif;
  --serif-text:    "EB Garamond", Georgia, serif;

  --maxw: 1080px;
  --measure: 68ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* texture carta appena percettibile */
  background-image:
    repeating-linear-gradient(0deg, rgba(38,33,30,.025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(38,33,30,.02) 0 1px, transparent 1px 4px);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 20px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-soft); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.6rem; }
.measure { max-width: var(--measure); }

/* ── Micro-etichette ────────────────────────────────────── */
.label {
  font-family: var(--serif-text);
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .12em;
  font-size: 13px;
  color: var(--ink-soft);
  display: block;
  margin-bottom: .7rem;
}

/* ── Titolazione ────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--serif-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 .6rem;
}
h1 {
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -.015em;
}
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }

p { margin: 0 0 1.1rem; }
.lead { font-size: 1.15em; color: var(--ink); }
.muted { color: var(--ink-soft); }

/* ── Il rombo: separatore della collana ─────────────────── */
.rhombus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  margin: 3.5rem 0;
  color: var(--accent);
}
.rhombus::before,
.rhombus::after {
  content: "";
  height: 1px;
  background: var(--rule);
  flex: 0 1 130px;
}
.rhombus span {
  width: 7px; height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  display: block;
}
.rhombus span:nth-child(2) { opacity: .55; }
.rhombus span:nth-child(3) { opacity: .3; }

/* ── Cornice a doppia linea (quarta di copertina) ───────── */
.frame {
  border: 1px solid var(--rule);
  padding: 3px;
  border-radius: 2px;
}
.frame > * {
  border: 1px solid var(--rule);
  border-radius: 1px;
  padding: 2.2rem 2rem;
  background: var(--card);
}

/* ── Header / marchio ───────────────────────────────────── */
.site-head {
  border-bottom: 1px solid var(--rule);
  background: rgba(246,243,238,.55);
}
.site-head .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.3rem;
  padding-bottom: 1.3rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif-display);
  font-weight: 900;
  font-size: 1.28rem;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}
.brand em {
  display: block;
  font-family: var(--serif-text);
  font-style: italic;
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--ink-soft);
  text-transform: lowercase;
  font-variant: small-caps;
  margin-top: .15rem;
}
.site-nav a {
  font-size: .95rem;
  color: var(--ink);
  text-decoration: none;
  margin-left: 1.4rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Sezioni ────────────────────────────────────────────── */
section { padding: 4.5rem 0; }
section.alt { background: var(--paper-warm); border-block: 1px solid var(--rule); }

.hero { padding-top: 5rem; padding-bottom: 3.5rem; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { max-width: 56ch; }

/* ── Pulsanti ───────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--serif-text);
  font-size: 1rem;
  letter-spacing: .02em;
  padding: .78rem 1.6rem;
  border-radius: 2px;
  border: 1px solid var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.btn-primary { background: var(--accent); color: var(--card); }
.btn-primary:hover { background: var(--accent-soft); color: var(--card); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: rgba(128,36,32,.07); color: var(--accent); }

/* ── Griglie ────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1.6rem 1.5rem;
}
.card h3 { margin-bottom: .35rem; }
.card p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ── Elenco schede ──────────────────────────────────────── */
.schede {
  columns: 2;
  column-gap: 2.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.schede li {
  break-inside: avoid;
  padding: .42rem 0 .42rem 1.5rem;
  position: relative;
  font-size: 1rem;
  border-bottom: 1px solid var(--rule);
}
.schede li::before {
  content: "";
  position: absolute;
  left: 2px; top: 1.05em;
  width: 5px; height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* ── Modulo iscrizione ──────────────────────────────────── */
.form-block { max-width: 560px; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .9rem;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.field input[type="email"] {
  width: 100%;
  font-family: var(--serif-text);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .8rem .9rem;
}
.field input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(128,36,32,.10);
}
.consent {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: .86rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}
.consent input { margin-top: .35em; accent-color: var(--accent); }
.form-note {
  font-size: .84rem;
  color: var(--ink-soft);
  margin-top: .9rem;
}
.form-msg {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-left: 2px solid var(--accent);
  background: rgba(128,36,32,.05);
  font-size: .95rem;
}
.form-msg[hidden] { display: none; }

/* ── Anteprima schede ───────────────────────────────────── */
.previews {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 2rem 0;
}
.preview-sheet {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1rem .9rem;
  min-height: 175px;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.preview-sheet .ps-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: .92rem;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: .4rem;
}
.preview-sheet .ps-line {
  height: 1px;
  background: var(--rule);
  opacity: .8;
}
.preview-sheet .ps-line.short { width: 60%; }
.preview-sheet .ps-box {
  border: 1px solid var(--rule);
  height: 26px;
  border-radius: 1px;
  margin-top: auto;
}

/* ── Blocco romanzo (ponte discreto) ────────────────────── */
.bridge {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.bridge img { width: 82px; border: 1px solid var(--rule); border-radius: 1px; }
.bridge div { flex: 1 1 260px; }
.bridge p { margin: 0 0 .5rem; font-size: .95rem; color: var(--ink-soft); }

/* ── Footer ─────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--paper-warm);
  padding: 2.6rem 0;
  font-size: .88rem;
  color: var(--ink-soft);
}
.site-foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-foot a { color: var(--ink-soft); }
.site-foot a:hover { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
  body { font-size: 18px; }
  .schede { columns: 1; }
  section { padding: 3.2rem 0; }
  .site-head .wrap { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .site-nav a { margin: 0 1.2rem 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
