:root {
  --color-bg: #fafaf8;
  --color-surface: #fff;
  --color-text: #2d2d2d;
  --color-text-secondary: #555;
  --color-text-muted: #888;
  --color-accent: #c0392b;
  --color-border: #e8e4df;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  padding: 40px 20px;
}

.container { max-width: 950px; margin: 0 auto; }

/* Header & Nav */
.site-header { 
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
}
.site-header nav { display: flex; align-items: center; gap: 16px; max-width: 950px; margin: 0 auto; width: 100%; }
/* Primary nav (link "Perché Italian Healthy Recipes"): override the generic
   .site-header nav rule above (which stretches to width:100% / margin:auto)
   so it sits inline between the logo and the language switcher. */
.site-header nav.site-nav {
  width: auto; max-width: none; margin: 0;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.site-nav a {
  font-size: 1.05em; font-weight: 600; text-decoration: none; color: #fff;
  padding: 4px 2px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.site-nav a:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }
@media (max-width: 640px) { .site-nav { display: none; } }
.home-link { font-size: 1.4em; text-decoration: none; }
.lang-switcher { margin-left: auto; display: flex; gap: 8px; }
.lang-switcher a { 
  padding: 4px 10px; border-radius: 4px; font-size: 0.85em;
  color: var(--color-text-secondary); text-decoration: none;
  border: 1px solid var(--color-border);
}
.lang-switcher a.active { background: var(--color-accent); color: white; border-color: var(--color-accent); }

main { margin-top: 80px; padding-top: 16px; }

/* Typography */
h1 { 
  font-family: var(--font-sans); font-size: 2em; 
  color: #2e9e5b; margin-bottom: 24px;
  padding-bottom: 12px; border-bottom: 2px solid var(--color-border);
}
/* Titolo delle pagine istituzionali (es. "Perché Italian Healthy Recipes?"):
   più grande e bianco, solo sul layout page (non tocca privacy né ricette). */
/* Titolo della pagina istituzionale: più grande e centrato (colore verde e
   font sans ora ereditati dalle regole globali h1/h2). */
.page-static h1 {
  font-size: 2.2em;
  text-align: center;
}
/* Link nel corpo della pagina istituzionale: verde coerente coi titoli,
   invece del viola/blu di default del browser. */
.page-static .static-page-content a { color: #2e9e5b; text-decoration: underline; }
.page-static .static-page-content a:hover { color: #26824b; }
h2 { font-size: 1.4em; color: #2e9e5b; margin-top: 36px; margin-bottom: 16px; }
h3 { font-size: 1.15em; color: var(--color-text); margin-top: 24px; margin-bottom: 12px; }
p, li { margin-bottom: 8px; color: var(--color-text-secondary); }

/* Recipe content — phase heading inside a procedural <ol>
   (e.g. "Fase 2 — Cottura del riso"). Same font/size/weight as h3, but
   rendered inline as a standalone line inside the <li> flow, not a
   separate block element — keeps the <ol> numbering continuous for the
   photo-mapping tool while still looking like a section heading. */
.fase-title {
  display: block;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 8px;
  margin-bottom: 8px;
}
ul, ol { padding-left: 24px; margin-bottom: 16px; }

/* Tables */
table { 
  width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92em;
  background: var(--color-surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--color-border);
}
th { background: #f5f3f0; font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--color-border); }
td { padding: 8px 12px; border-bottom: 1px solid var(--color-border); }
tr:last-child td { border-bottom: none; }

/* Recipe meta */
.recipe-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; font-size: 0.95em; color: var(--color-text-muted); }
.recipe-description { font-style: italic; margin-bottom: 24px; color: var(--color-text-secondary); }

/* Recipe grid (list pages) */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.recipe-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); transition: transform .15s, box-shadow .15s;
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.recipe-card a { display: block; padding: 20px; text-decoration: none; color: var(--color-text); }
.card-emoji { font-size: 2em; display: block; margin-bottom: 8px; }
.recipe-card h2 { font-size: 1.1em; margin: 0 0 8px; color: var(--color-text); }
.recipe-card p { font-size: 0.9em; color: var(--color-text-muted); }

/* Recipe content — ingredient quantity */
.qty {
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Extra left margin only applies inside the ingredient list/table layout,
   where .qty sits at the right end of a flex row and needs separation from
   the ingredient name on the left. Inside procedure prose (<ol> steps),
   .qty already has normal surrounding word-spacing — an extra 8px margin
   there produced visibly oversized gaps around every bold quantity. */
.ingredients ul .qty,
.ingredient-list .qty {
  margin-left: 8px;
}

/* Recipe content — ingredient list: flex rows with quantity right-aligned */
.ingredients ul,
.ingredient-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 16px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ingredients ul li,
.ingredient-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.93em;
}
.ingredients ul li:last-child,
.ingredient-list li:last-child { border-bottom: none; }
/* Zebra striping */
.ingredients ul li:nth-child(even),
.ingredient-list li:nth-child(even) { background: #f8f6f3; }
.ingredients ul li:nth-child(odd),
.ingredient-list li:nth-child(odd) { background: var(--color-surface); }
.ingredient-name { color: var(--color-text-secondary); }

/* Recipe content — ingredients grid (2 columns) */
.ingredients-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0; }
@media (max-width: 600px) { .ingredients-grid { grid-template-columns: 1fr; } }

/* Recipe content — ingredient group */
.ingredient-group h4 { font-size: 1em; color: var(--color-text); margin-bottom: 8px; font-weight: 600; }

/* Recipe content — recipe cards (for multi-recipe pages like cous cous) */
.recipe { margin: 32px 0; padding: 24px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.recipe-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.recipe-header .emoji { font-size: 1.8em; }
.recipe-header h2 { margin: 0; }
.recipe-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9em; color: var(--color-text-muted); margin-bottom: 16px; }
.steps ol { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.tip { margin-top: 16px; padding: 10px 14px; background: #fdf6f5; border-left: 3px solid var(--color-accent); font-style: italic; color: var(--color-text-secondary); font-size: 0.92em; border-radius: 0 4px 4px 0; }

/* Recipe content — TOC (manual, written into source body per language) */
.toc {
  background: #f5f3f0;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
}
.toc h3 { font-size: 1em; color: var(--color-text); margin-bottom: 10px; margin-top: 0; }
/* list-style: none — the section number is already part of the link text
   (e.g. "1. Ingredienti"), so the browser's own <ol> numbering must be
   suppressed to avoid a duplicated number ("1. 1. Ingredienti"). */
.toc ol, .toc ul { list-style: none; padding-left: 0; margin: 0; }
.toc li { margin-bottom: 5px; font-size: 0.92em; }
.toc a { color: var(--color-accent); }

/* Recipe content — card variants */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; }
.card-accent { border-left: 4px solid var(--color-accent); }
.card-warning { border-left: 4px solid #e67e22; background: #fffbf5; }
.card-info { border-left: 4px solid #3498db; background: #f0f8ff; }
.card-success { border-left: 4px solid #27ae60; background: #f0fff5; }

/* Recipe content — comparison boxes */
.comparison-box { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.comparison-item { padding: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.comparison-item h4 { margin-bottom: 8px; }
.pro { color: #27ae60; }
.con { color: #c0392b; }
.badge { display: inline-block; padding: 2px 8px; background: #27ae60; color: white; border-radius: 10px; font-size: 0.8em; vertical-align: middle; }
@media (max-width: 600px) { .comparison-box { grid-template-columns: 1fr; } }

/* Related recipes */
.related-recipes { margin: 28px 0; }
.related-recipes h3 { font-size: 0.95em; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.related-card {
  display: block; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--color-text-secondary);
  font-size: 0.88em; text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.related-card:hover { border-color: var(--color-accent); box-shadow: 0 2px 8px rgba(0,0,0,.06); color: var(--color-accent); }
/* Thumb wrapper (2026-09-06, richiesta Diego; ridimensionato 2026-09-06 —
   il cerchietto 48px iniziale era troppo piccolo per essere una vera
   anteprima). Ora quadrato a piena larghezza, stesso pattern visivo di
   .ar-thumb/.hp-recipe-thumb (vedi hugo-template-structure.md): mostra la
   cover.webp della ricetta collegata quando esiste, altrimenti resta il
   solo emoji su sfondo neutro come prima. */
.related-thumb {
  /* Ridotto a 2/3 (richiesta Diego, 2026-09-XX): dimensione precedente
     era quadrato a piena larghezza della card. Ora il quadrato occupa 2/3
     della larghezza della card, centrato, con spazio vuoto sui lati —
     solo la miniatura si riduce, la card/griglia restano invariate. */
  aspect-ratio: 1/1; width: 66.67%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface);
}
.related-thumb.has-cover {
  background-size: cover; background-position: center;
}
.related-thumb.has-cover .related-emoji { display: none; }
.related-emoji { font-size: 1.6em; }
.related-title { display: block; padding: 10px 10px 14px; line-height: 1.3; }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }

/* lastmod */
.lastmod { font-size: 0.85em; color: var(--color-text-muted); }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.88em;
  color: var(--color-text-muted);
  margin: -8px 0 20px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--color-accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-text-muted); }
.breadcrumb-current { color: var(--color-text-secondary); }

/* Tags */
.recipe-tags { margin-top: 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { 
  padding: 4px 12px; background: #f5f3f0; border-radius: 20px;
  font-size: 0.85em; color: var(--color-accent); text-decoration: none;
}
.tag:hover { background: var(--color-accent); color: white; }

/* Translations */
.translations { margin-top: 24px; padding: 16px; background: #f5f3f0; border-radius: var(--radius); }
.translations a { margin-right: 12px; color: var(--color-accent); }

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--color-accent); padding: 8px 16px;
  margin: 16px 0; background: #fdf6f5; font-style: italic;
}

/* Footer */
.site-footer { margin-top: 64px; padding: 24px 0; border-top: 1px solid var(--color-border); text-align: center; color: var(--color-text-muted); font-size: 0.85em; }
.footer-links { margin-top: 10px; font-size: 1.05em; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { color: #f5c518; text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
  h1 { font-size: 1.5em; }
  table { font-size: .85em; }
  td, th { padding: 6px 8px; }
  .recipe-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════
   HOMEPAGE — design v2-proposal-A (Giallo Notte)
   Palette: hero #1a1a1a, accent #f5c518, bg #f5f3ef
   Category colors: biscotti #8b5e3c, dolci #c0392b, salati #2d6a4f
   ════════════════════════════════════════════════════ */

/* ── New header (overrides site-header for new design) ── */
.site-header {
  background: #1a1a1a;
  border-bottom: 3px solid #f5c518;
  padding: 0 48px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
}
.site-logo {
  font-family: var(--font-serif);
  font-size: clamp(0.75em, 1.8vw, 1.15em);
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-yellow { color: #f5c518; }
.logo-di     { color: rgba(255,255,255,0.85); }
.site-header .lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
}
.site-header .lang-switcher a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: clamp(0.65em, 1.2vw, 0.78em);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-header .lang-switcher a:hover { color: #fff; }
.site-header .lang-switcher a.active { color: #f5c518; border-color: rgba(245,197,24,0.4); }

/* ── Hero ── */
.hp-hero {
  background: #1a1a1a;
  color: #fff;
  padding: 19px 48px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}
.hp-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245,197,24,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hp-hero-eyebrow {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #f5c518;
  font-weight: 700;
  margin-bottom: 7px;
  position: relative;
  z-index: 1;
}
.hp-hero-eyebrow .sep {
  vertical-align: 0.3em;
  font-size: 0.8em;
  margin: 0 2px;
}
.hp-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.3em, 2.8vw, 2.1em);
  line-height: 1.1;
  margin-bottom: 9px;
  color: #fff;
  border-bottom: none;
  padding-bottom: 0;
  position: relative;
  z-index: 1;
}
.hp-hero-title em { color: #f5c518; font-style: italic; }
.hp-hero-sub {
  font-size: 0.88em;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

/* ── Sections ── */
.hp-section {
  padding: 28px 48px 32px;
  max-width: 1160px;
  margin: 0 auto;
}
.hp-section-cats {
  padding-top: 20px;
}
.hp-section-title {
  font-family: var(--font-serif);
  font-size: 1.5em;
  color: var(--color-text);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: none;
  padding-bottom: 0;
}
.hp-section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, #f5c518, transparent);
}

/* ── Category cards ── */
.hp-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}
.hp-cat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.hp-cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--cat-color, #888);
}
.hp-cat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); }
.hp-cat-icon { font-size: 2.6em; line-height: 1; }
.hp-cat-name {
  font-family: var(--font-serif);
  font-size: 1.35em;
  font-weight: 700;
  color: var(--cat-color, #888);
}
.hp-cat-desc { font-size: 0.88em; color: var(--color-text-muted); line-height: 1.55; }
.hp-cat-why {
  font-size: 0.8em;
  color: var(--color-text);
  background: #f9f7f4;
  border-left: 3px solid #f5c518;
  padding: 7px 10px;
  border-radius: 0 5px 5px 0;
  font-style: italic;
  line-height: 1.5;
  margin-top: 4px;
}
.hp-cat-cta {
  text-align: center;
  margin-top: 24px;
}
.hp-cta-btn {
  display: inline-block;
  background: #1a1a1a;
  color: #f5c518;
  border: 2px solid #f5c518;
  padding: 10px 28px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9em;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.hp-cta-btn:hover { background: #f5c518; color: #1a1a1a; }

/* ── Feature strip ── */
.hp-feature-strip {
  background: #1a1a1a;
  padding: 15px 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}
.hp-feature-item {
  padding: 20px 28px;
  border-right: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background .15s;
}
.hp-feature-item:hover { background: rgba(255,255,255,0.04); }
.hp-feature-item:last-child { border-right: none; }
.hp-feature-icon { font-size: 1.6em; margin-bottom: 8px; text-decoration: none; }
.hp-feature-title {
  font-family: var(--font-serif);
  font-size: 1em;
  color: #f5c518;
  margin-bottom: 6px;
}
.hp-feature-text { font-size: 0.85em; color: rgba(255,255,255,0.6); line-height: 1.6; }

/* ── Recipe grid (homepage) ── */
.hp-recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.hp-recipe-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: transform .2s, box-shadow .2s;
  display: block;
}
.hp-recipe-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,0.1); }
.hp-recipe-thumb {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #888) 15%, #fff), color-mix(in srgb, var(--cat-color, #888) 25%, #fff));
  position: relative;
}
.hp-recipe-emoji { font-size: 3.2em; }
.hp-recipe-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 0.7em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
}
.hp-recipe-body { padding: 16px; }
.hp-recipe-title {
  font-family: var(--font-serif);
  font-size: 1em;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--color-text);
}

/* ── Footer (homepage override) ── */
.site-footer {
  background: #1a1a1a;
  border-top: 3px solid #f5c518;
  color: rgba(255,255,255,0.5);
  padding: 24px 48px;
  margin-top: 0;
}
.site-footer strong { color: #f5c518; }
.site-footer p { color: rgba(255,255,255,0.5); }

/* Footer social icons (Instagram/Facebook) — appare solo se configurati
   in params.instagram_url/facebook_url (config.toml). SVG ufficiali
   brand (simple-icons, CC0) self-hosted in static/icons/, non emoji —
   richiesta esplicita di Diego (2026-09-XX) per icone scontornate che
   richiamino immediatamente i due brand. */
.footer-social { margin-top: 8px; }
.footer-social a {
  display: inline-block; margin: 0 6px; line-height: 0;
  opacity: 0.85; transition: transform .15s, opacity .15s;
}
.footer-social a img { width: 22px; height: 22px; display: block; }
.footer-social a:hover { transform: translateY(-2px); opacity: 1; }

/* ── main margin-top for new fixed header ── */
main { margin-top: 46px; padding-top: 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hp-category-grid, .hp-feature-strip { grid-template-columns: 1fr; }
  .hp-section { padding: 24px 20px; }
  .hp-hero { padding: 16px 20px 14px; }
  .site-header { padding: 0 20px; }
  .hp-feature-strip { padding: 12px 20px; }
  .hp-feature-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .hp-feature-item:last-child { border-bottom: none; }
}

/* ════════════════════════════════════════════════════
   ALL-RECIPES PAGE
   ════════════════════════════════════════════════════ */

.ar-page { max-width: 1160px; margin: 0 auto; padding: 32px 48px; }

.ar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.ar-title {
  font-family: var(--font-serif);
  font-size: 1.8em;
  color: var(--color-text);
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.ar-back {
  font-size: 0.88em;
  color: #f5c518;
  text-decoration: none;
  font-weight: 600;
}
.ar-back:hover { text-decoration: underline; }

/* ── Filters ── */
.ar-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.ar-filter {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  transition: border-color .15s, color .15s, background .15s;
}
.ar-filter:hover { border-color: #f5c518; color: var(--color-text); }
.ar-filter.active {
  background: #1a1a1a;
  border-color: #f5c518;
  color: #f5c518;
}

/* ── Recipe grid ── */
.ar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.ar-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: transform .2s, box-shadow .2s;
  display: block;
}
.ar-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,0.1); }
.ar-thumb {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--cat-color, #888) 12%, #fff),
    color-mix(in srgb, var(--cat-color, #888) 22%, #fff));
  position: relative;
}
.ar-emoji { font-size: 2.8em; }
/* Card thumbnails with cover photo (2026-09-16, revised 2026-09-17,
   redesigned 2026-09-19 "Variante D" — see hugo-template-structure.md).
   Cards WITH a real cover.webp show it as background-image and hide the
   emoji entirely (it was covering the photo) — the category badge alone
   is enough identification over a real photo. Cards WITHOUT a cover are
   unaffected (same emoji-in-gradient look, both use the square
   aspect-ratio now). */
.ar-thumb.has-cover, .hp-recipe-thumb.has-cover {
  background-size: cover; background-position: center;
}
.ar-thumb.has-cover .ar-emoji, .hp-recipe-thumb.has-cover .hp-recipe-emoji {
  display: none;
}
.ar-badge {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 0.68em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
}
.ar-body { padding: 14px 16px; }
.ar-card-title {
  font-family: var(--font-serif);
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--color-text);
}
/* Diet/course pills on cards (Variante D, 2026-09-19) — compact scale of
   the .pill/.pill-diet/.pill-course classes used on single.html, shown
   below the title and above the description on every card grid
   (all-recipes.html, index.html "ultime ricette", browse.js results). */
.ar-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ar-pill {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72em;
  border: 1px solid transparent;
}
.ar-pill-diet   { background: #eaf6ef; color: #2e7d4f; border-color: #bfe4cd; }
.ar-pill-course { background: #eaf3fa; color: #2b6ca3; border-color: #bfdcef; }
.ar-desc {
  font-size: 0.78em;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .ar-grid, .hp-recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .ar-page { padding: 24px 20px; }
}
@media (max-width: 600px) {
  .ar-grid, .hp-recipe-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════
   RECIPE IMAGES
   ════════════════════════════════════════════════════ */

/* Cover image — hero, injected by theme after description */
.recipe-cover {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem auto;
  display: block;
}

/* Step / inline images — placed inside recipe body */
.step-img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
  display: block;
}

/* Step image figures with visible captions */
.step-figure {
  margin: 1rem 0 2rem 0;
  padding: 0;
}
.step-figure .step-img {
  margin-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.step-figure figcaption {
  font-size: 0.78em;
  color: var(--color-text-muted);
  font-style: italic;
  background: #f5f3f0;
  border: 1px solid var(--color-border);
  border-top: none;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 5px 12px 5px 14px;
  line-height: 1.5;
}

/* Recipe scaler (QUICK-NEW-RECIPE.md §3h) — HTML injected by convert.py,
   behaviour driven by hugo/themes/ricette-theme/static/js/scale.js */
.recipe-scaler { background: #f5f3f0; border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent); border-radius: var(--radius);
  padding: 16px 20px; margin: 24px 0; }
.scaler-title { font-size: 0.95em; font-weight: 700; color: var(--color-text); margin-bottom: 14px; }
.scaler-note { font-weight: 400; }
.scaler-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.scaler-row + .scaler-row { border-top: 2px solid #d8d2c8; }
.scaler-connector { font-size: 0.88em; font-style: italic; color: var(--color-text-secondary); padding: 2px 0; }
.scaler-row-label { font-size: 0.92em; color: var(--color-text); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.scaler-anchor-name { font-weight: 700; }
.scaler-exact-group { display: flex; align-items: center; gap: 6px; }
.scaler-exact-group input { border: 1px solid var(--color-border); border-radius: 6px;
  width: 72px; height: 34px; text-align: center; font-size: 1em; font-weight: 700; color: var(--color-accent); }
.scaler-exact-group input:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; }
.scaler-exact-group input.invalid-flash { background: #fbe1df; }
.scaler-exact-group .scaler-unit { color: var(--color-text-muted); font-size: 0.92em; }
.scaler-btn { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
  padding: 7px 14px; border-radius: 6px; font-size: 0.92em; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s; }
.scaler-btn:hover { border-color: var(--color-accent); }
.scaler-btn.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.scaler-stepper { display: flex; align-items: center; border: 1px solid var(--color-border);
  border-radius: 6px; overflow: hidden; background: var(--color-surface); }
.scaler-stepper button { border: none; background: #f0eee9; color: var(--color-text);
  width: 32px; height: 34px; font-size: 1.1em; cursor: pointer; line-height: 1; }
.scaler-stepper button:hover { background: #e5e2dc; }
.scaler-stepper input { border: none; width: 56px; height: 34px; text-align: center; font-size: 1em;
  font-weight: 700; color: var(--color-accent); -moz-appearance: textfield; }
.scaler-stepper input::-webkit-outer-spin-button, .scaler-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scaler-stepper input:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; }
.scaler-stepper input.invalid-flash { background: #fbe1df; }
@media (max-width: 600px) { .scaler-row { flex-direction: column; align-items: flex-start; } }

/* Diet / course pills (Fase 1 tag system, 2026-09-11; season pill removed
   2026-09-18 at Diego's request — didn't add enough value for the
   complexity of a 4th filter dimension).
   Not clickable in this phase — no /tags/... page exists yet for these
   dimensions (see design-proposals/tag-system-mockup-4-recipes.html). */
.tag-groups-row { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 16px; margin-bottom: 4px; }
.tag-group { flex: 1 1 180px; min-width: 160px; }
.tag-group-label { font-size: 0.78em; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 8px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 4px 12px; border-radius: 20px; font-size: 0.85em; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 4px; }
.pill-diet   { background: #eaf6ef; color: #2e7d4f; border-color: #bfe4cd; }
.pill-course { background: #eaf3fa; color: #2b6ca3; border-color: #bfdcef; }
@media (max-width: 600px) { .tag-groups-row { gap: 16px; } }

/* Reading tools — iOS-style toggle switches (2026-09-14, restyled 2026-09-15).
   .reading-tools-btn is a <button role="switch"> styled as a track+knob,
   not a filled pill. Track grey when off, accent-colored with knob slid
   right when on (aria-checked reflects state for accessibility). */
.reading-tools { display: flex; gap: 18px; flex-wrap: wrap; margin: 20px 0; align-items: center; }
.reading-tools-btn { border: none; background: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.9em;
  font-weight: 600; color: var(--color-text); }
.reading-tools-btn[hidden] { display: none; }
.reading-tools-switch { position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: #d5d1c8; flex-shrink: 0; transition: background .2s; }
.reading-tools-switch::before { content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.reading-tools-btn.active .reading-tools-switch { background: var(--color-accent); }
.reading-tools-btn.active .reading-tools-switch::before { transform: translateX(18px); }
/* images-hidden state, toggled on <body> by reading-tools.js */
body.images-hidden .recipe-cover, body.images-hidden .step-figure { display: none; }

/* ════════════════════════════════════════════════════
   BROWSE PAGE (Fase 2 tag system, 2026-09-11)
   See .kiro/steering/hugo-template-structure.md "Pagina /browse/"
   ════════════════════════════════════════════════════ */

.browse-page .ar-grid { margin-top: 24px; }

.browse-filters { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-start; }

.browse-filter-group {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  flex: 1 1 240px;
}
.browse-filter-group h4 {
  font-size: 0.78em; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 10px; color: var(--color-text-muted);
}
.browse-filter-diet   { border-top: 3px solid #2e7d4f; }
.browse-filter-diet h4   { color: #2e7d4f; }
.browse-filter-course { border-top: 3px solid #2b6ca3; }
.browse-filter-course h4 { color: #2b6ca3; }
.browse-filter-tags   { border-top: 3px solid var(--color-accent); flex-basis: 100%; }
.browse-filter-tags h4   { color: var(--color-accent); }
.browse-filter-subtitle {
  font-size: 0.95rem; font-weight: 400; text-transform: none;
  letter-spacing: normal; color: var(--color-text-muted);
}

.browse-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; margin: 0 6px 6px 0;
  border-radius: 20px; font-size: 0.85em; cursor: pointer;
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-secondary);
  transition: all .12s;
  user-select: none;
}
.chip:hover { border-color: var(--color-text-muted); }
.browse-filter-category .chip.active { background: #2d6a4f; border-color: #2d6a4f; color: #fff; }
.browse-filter-diet .chip.active   { background: #2e7d4f; border-color: #2e7d4f; color: #fff; }
.browse-filter-course .chip.active { background: #2b6ca3; border-color: #2b6ca3; color: #fff; }
.browse-chip-wall.chip.active,
.browse-filter-tags .chip.active   { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.browse-tag-search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; position: relative; }
.browse-tag-search-row input {
  flex: 1; max-width: 100%;
  padding: 10px 16px; border: 1.5px solid var(--color-border); border-radius: 20px;
  font-size: 0.92em; font-family: var(--font-sans);
}
.browse-tag-search-row input:focus { outline: none; border-color: var(--color-accent); }
.browse-tag-suggestions {
  position: absolute; top: 100%; left: 0; z-index: 10;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.1);
  max-height: 220px; overflow-y: auto; min-width: 240px;
  display: none;
}
.browse-tag-suggestions.open { display: block; }
.browse-tag-suggestion-item {
  padding: 7px 14px; font-size: 0.87em; cursor: pointer; color: var(--color-text-secondary);
}
.browse-tag-suggestion-item:hover { background: #f5f3f0; color: var(--color-accent); }

.browse-selected-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 12px; border-radius: 20px; font-size: 0.85em;
  background: var(--color-accent); color: #fff;
}
.tag-chip .remove-x { cursor: pointer; font-weight: 700; opacity: 0.8; }
.tag-chip .remove-x:hover { opacity: 1; }

.browse-chip-wall {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--color-border);
  max-height: 160px; overflow-y: auto;
}

.browse-status {
  font-size: 0.85em; color: var(--color-text-muted); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.browse-clear-btn {
  font-size: 0.85em; color: var(--color-accent); cursor: pointer;
  text-decoration: underline; background: none; border: none; padding: 0;
}

.no-results { grid-column: 1 / -1; text-align: center; color: var(--color-text-muted); padding: 30px 0; font-size: 0.9em; }

@media (max-width: 900px) { .browse-filters { flex-direction: column; } }

/* ───────────────────────────────────────────────────────────────────────
   Commenti + rating a stelle (serverless AWS). Reso solo su ricette con
   comments:true nel front matter; popolato da comments.js. Colori via le
   variabili del tema per restare coerente (no palette fissa).
   ─────────────────────────────────────────────────────────────────────── */
.recipe-comments {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--color-border);
}
.comments-title {
  font-family: var(--font-serif);
  color: var(--color-accent);
  margin-bottom: 16px;
}
.comments-rating-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.comments-rating-stars { color: #e8a33d; font-size: 1.3em; letter-spacing: 1px; }
.comments-rating-avg { font-size: 1.3em; font-weight: 700; color: var(--color-text); }
.comments-rating-outof { color: var(--color-text-muted); }
.comments-rating-count { color: var(--color-text-secondary); font-size: 0.9em; }

.comments-list { margin-bottom: 32px; }
.comments-empty { color: var(--color-text-muted); font-style: italic; }
.comment-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}
.comment-author { font-weight: 700; color: var(--color-text); }
.comment-stars { color: #e8a33d; letter-spacing: 1px; }
.comment-date { color: var(--color-text-muted); font-size: 0.85em; margin-left: auto; }
.comment-body { color: var(--color-text-secondary); white-space: pre-wrap; margin: 0; }

/* ── reply dell'autore (annidate, stile "thread" come i blog ricette) ── */
.comment-thread { margin-bottom: 16px; }
.comment-thread .comment-card { margin-bottom: 0; }
.comment-reply {
  margin-left: 36px;
  margin-top: 8px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg);
  position: relative;
}
/* piccola linea/gancio che collega la reply al commento padre */
.comment-reply::before {
  content: "";
  position: absolute;
  left: -24px;
  top: -8px;
  width: 20px;
  height: 26px;
  border-left: 2px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
  border-bottom-left-radius: 8px;
}
.comment-author-badge {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--color-accent);
  border-radius: 999px;
  padding: 2px 8px;
}
.comments-remember-label,
.comments-consent-label { color: var(--color-text-secondary); font-size: 0.9em; }

/* ── Form ── */
.comments-form-wrap {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
}
.comments-form-title { margin-top: 0; color: var(--color-text); }
.comments-field { margin-bottom: 14px; display: flex; flex-direction: column; }
.comments-label { font-weight: 600; color: var(--color-text); margin-bottom: 6px; font-size: 0.95em; }
.comments-input,
.comments-textarea {
  font-family: var(--font-sans);
  font-size: 1em;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 9px 11px;
  width: 100%;
}
.comments-input:focus,
.comments-textarea:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; }
.comments-textarea { resize: vertical; min-height: 90px; }
.comments-email-note { color: var(--color-text-muted); font-size: 0.82em; margin-top: 5px; }

/* stelle input */
.comments-stars-input { display: inline-flex; gap: 4px; }
.comments-star {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  font-size: 1.8em; line-height: 1; color: var(--color-border);
  transition: color 0.1s ease;
}
.comments-star.on { color: #e8a33d; }
.comments-star:hover { color: #e8a33d; }

/* honeypot — nascosto a umani, lasciato nel DOM per i bot */
.comments-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* consenso */
.comments-consent { flex-direction: row; }
.comments-consent-label {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--color-text-secondary); font-size: 0.9em; font-weight: 400;
}
.comments-consent-label input { margin-top: 3px; flex-shrink: 0; }
.comments-consent-label a { color: var(--color-accent); }

.comments-msg { font-size: 0.92em; margin: 8px 0; min-height: 1em; }
.comments-msg.ok { color: #2e7d32; }
.comments-msg.err { color: var(--color-accent); }

.comments-submit {
  background: var(--color-accent); color: #fff; border: none;
  border-radius: 6px; padding: 10px 22px; font-size: 1em; font-weight: 600;
  cursor: pointer;
}
.comments-submit:hover { filter: brightness(1.08); }
.comments-submit:disabled { opacity: 0.6; cursor: default; }


/* legenda "* campo obbligatorio" e nota "(facoltativo)" accanto al label */
.comments-req-legend { color: var(--color-text-muted); font-size: 0.85em; margin: 0 0 14px; }
.comments-opt { color: var(--color-text-muted); font-weight: 400; font-size: 0.85em; }


/* ── Form self-service GDPR (pagina privacy) ── */
.privacy-request {
  margin-top: 40px; padding-top: 24px; border-top: 2px solid var(--color-border);
}
.privacy-req-title { color: var(--color-accent); font-family: var(--font-serif); }
.privacy-req-intro { color: var(--color-text-secondary); font-size: .95em; }
.privacy-req-form {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 20px; margin-top: 14px; max-width: 640px;
}
.privacy-req-opt {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px;
  color: var(--color-text); font-size: .95em;
}
.privacy-req-opt input { margin-top: 4px; flex-shrink: 0; }
.privacy-req-field { display: flex; flex-direction: column; margin: 14px 0; }
.privacy-req-label { font-weight: 600; margin-bottom: 6px; color: var(--color-text); font-size: .9em; }
.privacy-req-input {
  font-family: var(--font-sans); font-size: 1em; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 9px 11px;
}
.privacy-req-input:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; }
.privacy-req-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.privacy-req-msg { font-size: .92em; margin: 8px 0; min-height: 1em; }
.privacy-req-msg.ok { color: #2e7d32; }
.privacy-req-msg.err { color: var(--color-accent); }
.privacy-req-submit {
  background: var(--color-accent); color: #fff; border: none; border-radius: 6px;
  padding: 10px 22px; font-size: 1em; font-weight: 600; cursor: pointer;
}
.privacy-req-submit:hover { filter: brightness(1.08); }
.privacy-req-submit:disabled { opacity: .6; cursor: default; }
