/* ───────────── Creattivando · stile del ricettario ─────────────
   Colori, caratteri e impaginazione. Cambia le variabili qui sotto
   per ridisegnare tutto il libro in un colpo solo.                */

@font-face { font-family: "Fraunces"; src: url(../assets/fonts/Fraunces-400-normal.ttf); font-weight: 400; }
@font-face { font-family: "Fraunces"; src: url(../assets/fonts/Fraunces-400-italic.ttf); font-weight: 400; font-style: italic; }
@font-face { font-family: "Fraunces"; src: url(../assets/fonts/Fraunces-600-normal.ttf); font-weight: 600; }
@font-face { font-family: "Fraunces"; src: url(../assets/fonts/Fraunces-600-italic.ttf); font-weight: 600; font-style: italic; }
@font-face { font-family: "Fraunces"; src: url(../assets/fonts/Fraunces-900-normal.ttf); font-weight: 900; }
@font-face { font-family: "Caveat";   src: url(../assets/fonts/Caveat-700.ttf); font-weight: 700; }
@font-face { font-family: "Inter";    src: url(../assets/fonts/Inter-Regular.otf); font-weight: 400; }
@font-face { font-family: "Inter";    src: url(../assets/fonts/Inter-Italic.otf); font-weight: 400; font-style: italic; }
@font-face { font-family: "Inter";    src: url(../assets/fonts/Inter-Medium.otf); font-weight: 500; }
@font-face { font-family: "Inter";    src: url(../assets/fonts/Inter-SemiBold.otf); font-weight: 600; }

:root {
  --cream:   #FAF4E8;
  --paper:   #FFFDF8;
  --ink:     #22302A;
  --muted:   #6B7069;
  --basil:   #2F5D3A;
  --basil-2: #E4EDDF;
  --terra:   #C4572E;
  --terra-2: #F6E3D9;
  --lemon:   #D9A21B;
  --lemon-2: #FBF0CF;
  --wine:    #7A2E3A;
  --wine-2:  #F3E3E5;
  --accent:  var(--basil);
  --accent-2: var(--basil-2);
}
.cat-salse   { --accent: var(--basil); --accent-2: var(--basil-2); }
.cat-forno   { --accent: var(--terra); --accent-2: var(--terra-2); }
.cat-torte   { --accent: #53842B; --accent-2: #EAF0E2; }
.cat-vini    { --accent: var(--wine);  --accent-2: var(--wine-2); }
.cat-formaggi { --accent: #A36E00; --accent-2: #F6EFD9; }
.cat-pesce   { --accent: #16758B; --accent-2: #E3F1F3; }
.cat-dolci   { --accent: #965950; --accent-2: #F3E8E4; }
.cat-liquori { --accent: var(--lemon); --accent-2: var(--lemon-2); }
.cat-carne   { --accent: #AC3A36; --accent-2: #F5E5E3; }
.cat-olio    { --accent: #6D762D; --accent-2: #EEF0DD; }

/* ───────────── Pagina (PDF) ───────────── */
@page {
  size: A5;
  margin: 9mm 13mm 10mm 13mm;
  background: var(--paper);
  @bottom-left  { content: string(book); font: 400 7pt Inter; color: #9AA096; letter-spacing: .08em; text-transform: uppercase; transform: translateY(-3mm); }
  @bottom-right { content: counter(page); font: 600 8pt Inter; color: #6B7069; transform: translateY(-3mm); }
  @bottom-center { content: element(footlogo); vertical-align: middle; transform: translateY(-4mm); }
}
@page full { margin: 0; @bottom-left { content: none } @bottom-center { content: none } @bottom-right { content: none } }
.cover, .back, .divider { page: full; }

html { font-family: Inter, sans-serif; font-size: 8.7pt; line-height: 1.42; color: var(--ink); }
body { margin: 0; background: var(--paper); }
h1, h2 { font-family: Fraunces, serif; font-weight: 600; margin: 0; }
a { color: inherit; text-decoration: none; }

/* ───────────── Copertina e retro ───────────── */
.cover, .back {
  height: 210mm; box-sizing: border-box; padding: 30mm 16mm 18mm;
  background: var(--basil); color: var(--cream); position: relative; overflow: hidden;
  break-after: page;
}
.cover.image-cover { padding: 0; background: var(--cream); }
.cover.image-cover .cover-art { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; }
.cover-deco { position: absolute; right: -28mm; bottom: -22mm; width: 120mm; color: #9FC39A; opacity: .9; }
.cover .brand, .back .brand { font: 600 8.5pt Inter; letter-spacing: .3em; text-transform: uppercase; color: #CFE0C8; margin: 0 0 10mm; }
.cover h1 { string-set: book content(); font-size: 38pt; line-height: 1.02; font-weight: 900; letter-spacing: -.01em; max-width: 110mm; }
.cover .sub { font: 700 24pt Caveat; color: #F2C14E; margin: 5mm 0 0; }
.cover .tagline { font: italic 400 10pt Fraunces; color: #DCE8D6; margin-top: 3mm; max-width: 70mm; }
.cover .edition { position: absolute; left: 16mm; bottom: 16mm; font: 500 7.5pt Inter; letter-spacing: .12em; text-transform: uppercase; color: #B6CDAF; margin: 0; }
.back { break-before: page; break-after: auto; display: block; padding-top: 80mm; text-align: center; }
.back .cover-deco { left: -30mm; right: auto; transform: scaleX(-1); }
.back .sub { font: 700 22pt Caveat; color: #F2C14E; }

/* ───────────── Introduzione e indice ───────────── */
.intro-page { break-after: page; padding-top: 18mm; position: relative; }
.intro-page .deco-wrap { width: 30mm; color: var(--basil); margin-bottom: 6mm; }
.intro-page h2 { font-size: 22pt; color: var(--basil); margin-bottom: 6mm; }
.intro-page p { font: 400 11pt/1.65 Fraunces; max-width: 100mm; margin: 0 0 4mm; }

.toc { break-after: page; padding-top: 4mm; }
.toc h2 { font-size: 22pt; color: var(--basil); margin-bottom: 5mm; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc-cat { font: 600 7.5pt Inter; letter-spacing: .2em; text-transform: uppercase; color: var(--terra); margin: 2mm 0 .4mm; }
.toc-cat:first-child { margin-top: 0; }
.toc-r a { display: block; font: 400 9.7pt/1.08 Fraunces; padding: .2mm 0; border-bottom: .4pt solid #E6E0D2; }
.toc-r a::after { content: leader(" ") target-counter(attr(href), page); font: 600 9pt Inter; color: var(--muted); }

/* ───────────── Divisori di capitolo ───────────── */
.divider {
  height: 210mm; box-sizing: border-box; background: var(--accent); color: var(--cream);
  break-before: page; break-after: page; padding: 0 16mm;
}
.divider .inner { padding-top: 58mm; }
.divider .category-icon {
  display: block; box-sizing: content-box; width: 26mm; height: 26mm; padding: 2mm;
  border-radius: 50%; background: var(--cream); margin-bottom: 8mm;
}
.divider .chap { font: 600 8pt Inter; letter-spacing: .3em; text-transform: uppercase; opacity: .8; margin: 0 0 3mm; }
.divider h1 { font-size: 34pt; font-weight: 900; line-height: 1.05; }
.divider .intro { font: italic 400 12pt/1.5 Fraunces; max-width: 95mm; margin-top: 6mm; opacity: .95; }

/* ───────────── Ricetta ───────────── */
.item { break-before: page; break-inside: avoid-page; }
.item header { border-left: 2.2mm solid var(--accent); padding: .5mm 0 .5mm 5mm; margin-bottom: 3.5mm; }
.kicker { font: 600 7pt Inter; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.kicker .num { display: inline-block; background: var(--accent); color: #fff; padding: .4mm 1.6mm; border-radius: 1mm; margin-right: 2.5mm; letter-spacing: .05em; }
.item h1 { font-size: 22pt; line-height: 1.05; margin: 2mm 0 .5mm; color: var(--ink); }
.item .subtitle { font: 700 15pt Caveat; color: var(--accent); margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 5mm; margin-top: 2.5mm; }
.meta .m { display: flex; flex-direction: column; }
.meta .k { font: 500 6.3pt Inter; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.meta .v { font: 600 8.6pt Inter; color: var(--ink); }
.dot { display: inline-block; width: 2.2mm; height: 2.2mm; border-radius: 50%; border: .5pt solid var(--accent); margin-right: .8mm; vertical-align: middle; }
.dot.on { background: var(--accent); }

.photo { width: 100%; height: 55mm; object-fit: cover; border-radius: 2mm; margin-bottom: 5mm; }

.lead p { font: italic 400 9.6pt/1.45 Fraunces; color: #45514A; margin: 0 0 3mm; }

.sec h2 { font: 600 7.5pt Inter; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0 0 2.5mm; }

.sec-ingredients { background: var(--accent-2); border-radius: 2.5mm; padding: 3mm 4.5mm 2mm; margin-bottom: 4mm; }
.sec-ingredients ul { list-style: none; padding: 0; margin: 0 0 1mm; display: grid; grid-template-columns: 1fr 1fr; column-gap: 6mm; }
.sec-ingredients li { padding: .45mm 0 .45mm 3.5mm; position: relative; break-inside: avoid; font-size: 8.3pt; line-height: 1.3; }
.sec-ingredients li::before { content: ""; position: absolute; left: 0; top: 1.7mm; width: 1.4mm; height: 1.4mm; border-radius: 50%; background: var(--accent); }
.sec-ingredients p { margin: 1mm 0 .3mm; column-span: none; font: italic 600 9pt Fraunces; }
.sec-ingredients p strong { font-weight: 600; }

.sec-method ol { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.sec-method li { counter-increment: step; position: relative; padding-left: 9mm; min-height: 5.6mm; margin-bottom: 1.5mm; break-inside: avoid; }
.sec-method li::before {
  content: counter(step); position: absolute; left: 0; top: -.1mm; width: 5.6mm; height: 5.6mm;
  text-align: center; border-radius: 50%; background: var(--accent); color: #fff; font: 600 7pt/5.6mm Inter;
}

.sec-tip { margin-top: 3.5mm; padding: 2.5mm 4mm 2.5mm 4.5mm; border-left: 1mm solid var(--lemon); background: #FFF8E4; border-radius: 0 2mm 2mm 0; break-inside: avoid; }
.sec-tip h2 { color: #9A6E00; }
.sec-tip p { margin: 0; font: italic 400 8.8pt/1.42 Fraunces; }

.tags { margin-top: 2mm; }
.tags span { display: inline-block; font: 500 6.5pt Inter; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: .5pt solid #D8D2C3; border-radius: 3mm; padding: .5mm 2mm; margin: 0 1.2mm 0 0; }

.deco { width: 100%; height: auto; }

/* ───────────── Anteprima nel browser dell'ebook (dist/<lingua>/index.html) ───────────── */
@media screen {
  body.book { max-width: 720px; margin: 0 auto; padding: 16px; background: var(--cream); }
  .book .cover, .book .back, .book .divider { height: auto; min-height: 60vh; border-radius: 12px; margin-bottom: 24px; }
  .book .item, .book .intro-page, .book .toc { background: var(--paper); border-radius: 12px; padding: 28px; margin-bottom: 24px; }
  .book .toc-r a::after { content: none; }
}

/* Il titolo "Consiglio" scorre sulla stessa riga del testo, per risparmiare spazio */
.sec-tip h2 { display: inline; margin: 0 2mm 0 0; }
.sec-tip p { display: inline; }

/* ───────────── Scheda vino ───────────── */
.wine-label, .oil-label {
  display: flex; align-items: center; gap: 4mm; margin: 0 0 4mm; padding: 3.5mm 4.5mm;
  border: .8pt solid var(--accent); border-radius: 2.5mm; background: var(--accent-2);
}
.wine-label .swatch { flex: none; width: 9mm; height: 9mm; border-radius: 50%; border: .6pt solid rgba(0,0,0,.12); }
.wine-label .swatch.white { background: radial-gradient(circle at 35% 35%, #FBEFB8, #E2C35A); }
.wine-label .swatch.red   { background: radial-gradient(circle at 35% 35%, #C2475A, #6E1B2A); }
.wine-label .doc  { margin: 0; font: italic 600 11pt Fraunces; color: var(--accent); }
.oil-label .swatch { flex: none; width: 9mm; height: 9mm; border-radius: 50%; border: .6pt solid rgba(0,0,0,.12); }
.oil-label .swatch.olive { background: radial-gradient(circle at 35% 35%, #DDE49A, #7C842F); }
.oil-label .cultivar { margin: 0; font: italic 600 11pt Fraunces; color: var(--accent); }
.wine-label .area { margin: .6mm 0 0; font-size: 8.2pt; color: var(--muted); }
.oil-label .area { margin: .6mm 0 0; font-size: 8.2pt; color: var(--muted); }
.wine .sec-profile p { margin: 0 0 4mm; font-size: 9pt; line-height: 1.55; }
.sec-pairs { margin-bottom: 1mm; }
.chips { display: flex; flex-wrap: wrap; gap: 2mm; }
.chip {
  display: inline-block; padding: 1.2mm 3.2mm; border-radius: 4mm; background: var(--accent); color: #fff;
  font: 500 8pt Inter;
}

/* ───────────── Pagina panoramica: zone DOC ───────────── */
.overview header { margin-bottom: 1mm; }
.map-wrap { width: 100%; margin: 0 auto; }
.map-img { width: 100%; height: auto; display: block; }
.doc-map { width: 100%; height: auto; display: block; }
.doc-map .pin  { font: 700 7px Inter; fill: #22302A; }
.doc-map .city { font: 500 6px Inter; fill: #6B7069; }
.doc-map .sea  { font: italic 400 10px Fraunces; fill: #8FA3A8; letter-spacing: .08em; }
.stats { display: flex; justify-content: space-between; gap: 2mm; margin: 1mm 0 1.5mm; padding: 1.2mm 0; border-top: .5pt solid #E3DCCB; border-bottom: .5pt solid #E3DCCB; }
.stat { display: flex; flex-direction: column; }
.stat b { font: 600 11pt Fraunces; color: var(--accent); line-height: 1.1; }
.stat span { font: 500 6.2pt Inter; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.overview .lead p { font-size: 8.2pt; line-height: 1.35; margin: 0 0 2mm; }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4mm 5mm; }
.zone { break-inside: avoid; }
.zone-link { color: inherit; text-decoration: none; }
.zh { display: flex; align-items: center; gap: 1.6mm; }
.zn { flex: none; width: 3.4mm; height: 3.4mm; border-radius: 50%; color: #fff; text-align: center; font: 700 6pt/3.4mm Inter; }
.zname { font: 600 8.6pt/1.15 Fraunces; }
.zrow { display: flex; flex-wrap: wrap; align-items: center; gap: 1mm; margin: .7mm 0 0 5.8mm; }
.zmeta { font: 600 6pt Inter; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 1mm; }
.tp { font: 600 5.8pt Inter; letter-spacing: .06em; text-transform: uppercase; padding: .3mm 1.5mm; border-radius: 2mm; }
.tp-white { background: #F3E6A8; color: #6B5510; }
.tp-red   { background: #8E2A3A; color: #fff; }
.tp-rose  { background: #F4C6CF; color: #7A2E3A; }
.tp-sweet { background: #D9A04A; color: #fff; }
.zwines { font-size: 7.1pt; line-height: 1.28; margin: .7mm 0 0 5.8mm; }
.znote  { font: italic 400 6.9pt/1.25 Fraunces; color: var(--muted); margin: .3mm 0 0 5.8mm; }
.sources { font-size: 6pt; color: var(--muted); margin: 1.5mm 0 0; }
.sources a, .producers .pn a { color: inherit; }

/* Produttori nelle schede vino */
.sec-producers { margin-top: 3mm; }
.sec-producers + .sec-sources { margin-top: 3mm; }
.producers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 5mm; }
.producers li { display: block; padding: .3mm 0; border-bottom: .4pt solid #ECE5D5; break-inside: avoid; font: 400 7pt/1.2 Inter; }
.producers .pn { font-weight: 600; }
.producers .pt { color: var(--muted); }
.pnote { font: italic 400 6.6pt/1.3 Fraunces; color: var(--muted); margin: 1.5mm 0 0; }

/* Logo Creattivando */
.cover .logo-mark { display: block; width: 30mm; height: auto; margin: -10mm 0 9mm; }
.back .logo-mark { display: block; width: 38mm; height: auto; margin: 0 auto 8mm; }
.intro-page .intro-logo { display: block; width: 32mm; height: auto; margin-bottom: 7mm; }

/* Logo piccolo nel piè di pagina di tutte le pagine interne */
.run-logo { position: running(footlogo); width: 8mm; height: auto; }
@media screen { .run-logo { display: none; } }
/* Logo sulle pagine dei capitoli */
.divider { position: relative; }
.divider-logo { position: absolute; right: 14mm; bottom: 14mm; width: 16mm; height: auto; opacity: .9; }
/* Ultima pagina: dati dell'editore */
.back { position: relative; }
.back .publisher {
  position: absolute; left: 0; right: 0; bottom: 18mm; display: flex; flex-direction: column; align-items: center;
  gap: .6mm; font: 400 8pt/1.35 Inter; color: #DCE8D6;
}
.back .brand-logo {
  display: block; width: 38mm; height: 38mm; box-sizing: border-box; object-fit: contain;
  padding: 1.5mm; margin: 0 auto 8mm; border-radius: 50%; background: var(--cream);
}
.back .pb-contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: .8mm 3mm; max-width: 122mm; margin-top: 1mm; }
.back .pb-contact { display: inline-flex; align-items: baseline; gap: 1mm; flex: 0 0 48%; justify-content: center; font-size: 7pt; }
.back .pb-contact-label { font-weight: 600; }
.publisher .pb-brand { font: 600 9.5pt Fraunces; color: var(--cream); }
.publisher .pb-name  { font-weight: 600; color: var(--cream); }
.publisher a { color: inherit; text-decoration: none; }

/* Recupera spazio nelle schede lunghe senza ridurre la dimensione dei caratteri. */
@media print {
  .toc h2 { font-size: 20pt; margin-bottom: 2mm; }
  .toc-cat { font-size: 7.2pt; margin: 1.1mm 0 .2mm; }
  .toc-r a { font-size: 10pt; padding: 0; }

  .item header { margin-bottom: 3mm; }
  .item .body { line-height: 1.35; }
  .sec h2 { margin-bottom: 2mm; }
  .sec-ingredients { padding-top: 2.3mm; padding-bottom: 1.5mm; margin-bottom: 3mm; }
  .sec-method li { margin-bottom: 1mm; }
  .sec-tip { margin-top: 2mm; padding-top: 1.8mm; padding-bottom: 1.8mm; }

  .wine-label, .oil-label { margin-bottom: 3mm; padding-top: 3mm; padding-bottom: 3mm; }
  .sec-producers { margin-top: 2mm; }
  .producers li { padding-top: .2mm; padding-bottom: .2mm; font-size: 6.8pt; line-height: 1.15; }
}
