/* Guida a schede (template-guida.php): riquadri colorati, piatti in SVG, schede.
   Si carica insieme a blog.css, che veste testata, firma e newsletter.

   I colori degli alimenti stanno solo qui, una classe per colore: `.gd-c-*`
   imposta `--gd-c`, e spicchi, tacche e pallini la leggono. Le scelte del campo
   ACF `colore` sono le stesse sei. */

.gd-corpo {
  --gd-ocra: #B87A1B;

  max-width: 760px; margin: 0 auto; padding: 56px 40px 56px;
  display: flex; flex-direction: column; gap: 40px;
  font-size: 17px; line-height: 1.65; color: var(--ink-soft);
}
/* Il testo libero di un articolo passato a questo template sta sopra le schede:
   lo stacco lo mette già la colonna qui sotto. */
.ar-corpo + .gd-corpo { padding-top: 0; }

.gd-c-verde { --gd-c: #3F7D4E; }
.gd-c-ocra { --gd-c: #B87A1B; }
.gd-c-terracotta { --gd-c: #9C4E42; }
.gd-c-oliva { --gd-c: #7A8C39; }
.gd-c-azzurro { --gd-c: #46788F; }
.gd-c-bordeaux { --gd-c: #803C54; }

.gd-titolo { font-size: 34px; color: var(--ink); line-height: 1.15; margin-bottom: 12px; }

/* I testi che arrivano dall'editor: paragrafi ed elenchi veri. */
.gd-ricco > * + * { margin-top: 12px; }
.gd-ricco ul, .gd-ricco ol { padding-left: 20px; }
.gd-ricco ul li { list-style: disc; }
.gd-ricco ol li { list-style: decimal; }
.gd-ricco li + li { margin-top: 8px; }
.gd-ricco strong { color: var(--ink); }
.gd-ricco a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Riquadri ---- */
.gd-riquadro { padding: 24px 26px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.gd-riquadro-rosa { background: var(--accent-soft); }
.gd-riquadro-caldo { background: var(--bg-alt); border-left-color: var(--gd-ocra); }
.gd-riquadro-titolo { font-size: 24px; color: var(--ink); line-height: 1.25; margin-bottom: 12px; }

/* ---- Piatti ---- */
.gd-piatti-intro { margin-bottom: 24px; }
.gd-piatti-griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 16px; }
.gd-piatto {
  margin: 0; padding: 20px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.gd-piatto svg { width: 136px; max-width: 100%; height: auto; display: block; }
.gd-piatto-nome {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-dim); text-align: center;
}
.gd-bordo { fill: none; stroke: var(--border); stroke-width: 2; }
.gd-spicchio { fill: var(--gd-c); }
.gd-filetto { stroke: var(--surface); stroke-width: 2; }

.gd-piatto-voci { width: 100%; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.gd-piatto-voci li { display: flex; align-items: baseline; gap: 8px; }
.gd-piatto-voci b { margin-left: auto; color: var(--ink); }
.gd-tacca { flex: none; width: 11px; height: 11px; border-radius: 1px; background: var(--gd-c); transform: translateY(1px); }

.gd-pallini {
  width: 100%; min-height: 74px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: flex-end; justify-content: center; gap: 14px;
}
.gd-pallino { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-dim); }
.gd-pallino span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--gd-c); }
.gd-pallino-grande span { width: 40px; height: 40px; }

.gd-nota {
  margin-top: 16px; padding-left: 14px; border-left: 2px solid var(--border);
  font-size: 15px; color: var(--ink-dim);
}

/* ---- Linguette ---- */
.gd-linguette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: -8px; }
.gd-linguetta {
  flex: 1 1 96px; min-width: 0; padding: 12px 10px;
  background: var(--surface); color: var(--ink-dim);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  font-family: var(--font-sans); font-size: 16px; font-weight: 500;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.gd-linguetta:hover { border-color: var(--accent); }
.gd-linguetta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-linguetta[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 700; }

.gd-pannello { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
/* Senza questa riga `display: flex` batte l'attributo `hidden`, e si vedono tutte le schede insieme. */
.gd-pannello[hidden] { display: none; }

/* ---- Barra a due quote ---- */
.gd-barra {
  padding: 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-s);
  display: flex; flex-direction: column; gap: 16px;
}
.gd-barra-titolo { font-size: 24px; color: var(--ink); line-height: 1.25; }
.gd-barra-quote { display: flex; height: 42px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-s); }
.gd-barra-quote span {
  flex: var(--gd-quota) 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.gd-quota-a { background: var(--gd-ocra); color: var(--surface); }
.gd-quota-b { background: var(--accent-soft); color: var(--ink); }
.gd-barra-voci { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--ink-dim); }
.gd-barra-voci div { display: flex; align-items: baseline; gap: 7px; }
.gd-tacca-a { background: var(--gd-ocra); }
.gd-tacca-b { background: var(--accent-soft); border: 1px solid var(--border); }
.gd-barra-nota { padding-top: 14px; border-top: 1px solid var(--border); font-size: 15px; color: var(--ink-dim); }
.gd-barra-nota strong { color: var(--ink); }

/* ---- Tabella delle porzioni ---- */
.gd-tabella-intro { margin-bottom: 18px; font-size: 16px; }
.gd-tabella-nota { margin-bottom: 18px; padding-left: 14px; border-left: 2px solid var(--accent); font-size: 15px; }

.gd-righe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); }
.gd-righe li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: baseline;
}
.gd-righe li:last-child { border-bottom: 0; }
.gd-alimento { grid-column: 1; min-width: 0; font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.gd-dettaglio { grid-column: 1; min-width: 0; font-size: 14px; line-height: 1.5; color: var(--ink-dim); }
.gd-quantita {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; max-width: 190px;
  text-align: right; font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--accent);
}

.gd-segno { display: inline-block; width: .55em; height: .55em; margin-left: .25em; vertical-align: .45em; fill: var(--ink-mute); }
.gd-legenda { margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--border); font-size: 14px; color: var(--ink-dim); }
.gd-legenda li + li { margin-top: 10px; }
.gd-legenda .gd-segno { margin-left: 0; }

/* ---- Fonti ---- */
.gd-fonti { padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--ink-dim); }
.gd-fonti .eyebrow { display: block; margin-bottom: 12px; letter-spacing: .18em; line-height: 1.4; }
.gd-fonti a { color: var(--ink); text-decoration-color: var(--border-strong); }
.gd-fonti a:hover { text-decoration-color: var(--accent); }
.gd-avvertenza { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
  .gd-corpo { padding: 40px 16px; gap: 32px; font-size: 16px; }
  .gd-pannello { gap: 32px; }
  .gd-titolo { font-size: 28px; }
  .gd-riquadro { padding: 20px 16px; }
  .gd-barra { padding: 18px 16px; }
  .gd-righe li { padding: 12px 14px; }
  .gd-quantita { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .gd-linguetta { transition: none; }
}
