/* WPSonar Blog · stile dark sobrio · Onest font */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0e16;
  --bg-soft: #131822;
  --bg-card: #1a2030;
  --border: #232a3a;
  --text: #e8ecf3;
  --text-soft: #9aa3b5;
  --text-dim: #6b7385;
  --accent: #d4a056;
  --accent-soft: #e8c890;
  --link: #7ab8ff;
  --link-hover: #a5d0ff;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* Tema chiaro: attivato da [data-theme="light"] sull'<html> (scelta esplicita).
   Bianco pulito + grigio freddo, card che staccano con ombra. Accent ambra scurito
   per leggibilita' su fondo chiaro. */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f4f6fa;
  --bg-card: #ffffff;
  --border: #e4e8ef;
  --text: #12161d;
  --text-soft: #4a5563;
  --text-dim: #7b8494;
  --accent: #9a6a1f;
  --accent-soft: #7c5417;
  --link: #1a63c9;
  --link-hover: #0f4694;
  --shadow: 0 6px 24px rgba(20,28,45,0.10);
}
/* In light le card di contenuto staccano dal fondo con ombra + bordo netto. */
:root[data-theme="light"] .aeo-tldr,
:root[data-theme="light"] .article-toc {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  border-color: var(--border);
}
/* La topnav vive SOPRA l'hero scuro (position:absolute) → i suoi link restano chiari
   sempre, in entrambi i temi, altrimenti in light sparirebbero su fondo scuro. */
:root[data-theme="light"] .site-nav a { color: rgba(255,255,255,0.82); }
:root[data-theme="light"] .site-nav a:hover,
:root[data-theme="light"] .site-nav a.active { color: #fff; }
:root[data-theme="light"] .nav-login { color: rgba(255,255,255,0.82); }
:root[data-theme="light"] .theme-toggle { color: rgba(255,255,255,0.82); border-color: rgba(255,255,255,0.25); }
:root[data-theme="light"] .theme-toggle:hover { color: #fff; border-color: var(--accent-soft); }
:root[data-theme="light"] .brand, :root[data-theme="light"] .brand-name { color: #fff; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* --- HEADER ---
   Allineato a home (landing/index.html): nav FLUTTA dentro l'hero (no fascia
   nera sopra). Bg transparent + position absolute + no border-bottom. La
   legibility del testo nav e' garantita dal top-fade del gradient hero
   (.blog-featured-gradient / .article-hero-overlay con background scuro). */
.site-header {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-tag { font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }

.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a { color: var(--text-soft); text-decoration: none; font-size: 15px; transition: color .15s; font-weight: 500; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav .cta-link { background: var(--accent); color: #0a0e16; padding: 8px 16px; border-radius: 6px; font-weight: 600; }
.site-nav .cta-link:hover { background: var(--accent-soft); color: #0a0e16; }
.site-nav .lang-switch { color: var(--text-dim); border: 1px solid var(--border); padding: 5px 10px; border-radius: 4px; font-size: 13px; }
.site-nav .lang-switch:hover { color: var(--text); border-color: var(--accent); }

/* --- BLOG HERO --- */
.blog-hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
  font-size: 48px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-soft) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.blog-hero .lead { font-size: 19px; color: var(--text-soft); max-width: 720px; line-height: 1.55; }

/* === BLOG HOME · FEATURED HERO (full-bleed, immagine + titolo sovrapposto) ===
   Stesso linguaggio di .article-hero-overlay · 16:9 native Pollinations · no deform */
/* Wrapper per attribution overlay (vedi .hero-credit-featured sotto).
   .blog-featured non puo' contenere il link photographer (link-in-link e' HTML
   non valido) -> wrap esterno + credit absolute sopra. */
.blog-featured-wrap { position: relative; }
.blog-featured {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9;          /* 16:9 SEMPRE · no max/min-height (causavano letterbox/crop = "stirata") */
  background-color: var(--bg-soft);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  text-decoration: none; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.blog-featured:not(.has-img) {
  background:
    radial-gradient(ellipse at 28% 18%, rgba(212,160,86,0.20) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.blog-featured-gradient {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  /* Top fade (rgba 0.60 a 0%) garantisce legibility del nav che FLUTTA sopra
     (vedi .site-header position:absolute). Analogo a home .hero-overlay. */
  background: linear-gradient(180deg,
    rgba(10,14,22,0.60) 0%,
    rgba(10,14,22,0.10) 18%,
    rgba(10,14,22,0.42) 56%,
    rgba(10,14,22,0.93) 100%);
}
.blog-featured-content {
  position: relative; z-index: 2; height: 100%;
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 48px 24px 60px;
}
.blog-featured-eyebrow {
  align-self: flex-start;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: #0a0e16; background: var(--accent);
  padding: 6px 14px; border-radius: 4px; margin-bottom: 22px;
}
.blog-featured-content .post-meta { color: rgba(255,255,255,0.82); margin-bottom: 14px; }
.blog-featured-content .post-cat { background: rgba(255,255,255,0.16); color: #fff; }
.blog-featured-content h1 {
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.025em;
  color: #fff; margin-bottom: 16px; max-width: 920px;
  text-shadow: 0 2px 28px rgba(0,0,0,0.55);
}
.blog-featured-excerpt {
  font-size: clamp(16px, 1.5vw, 20px); line-height: 1.55;
  color: rgba(255,255,255,0.88); max-width: 700px; margin-bottom: 24px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.5);
}
.blog-featured-cta {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  color: var(--accent-soft); font-weight: 700; font-size: 16px;
  border: 1px solid rgba(232,200,144,0.4); padding: 11px 24px; border-radius: 8px;
  background: rgba(10,14,22,0.35); backdrop-filter: blur(4px);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.blog-featured:hover .blog-featured-cta {
  background: var(--accent); color: #0a0e16; border-color: var(--accent); transform: translateX(3px);
}
@media (max-width: 768px) {
  /* Mobile: il 16:9 (211px a 375px) e' piu' basso del contenuto (eyebrow+titolo+
     excerpt+CTA ~450px): con overflow:hidden il testo veniva tagliato e finiva
     sotto la topnav assoluta. aspect-ratio diventa min-height, l'altezza cresce
     col testo. L'immagine resta cover/center = mai deformata. */
  .blog-featured {
    aspect-ratio: auto;
    min-height: 56vw;
    overflow: visible;
  }
  .blog-featured-content { padding: 96px 20px 40px; height: auto; }
  .blog-featured-eyebrow { margin-bottom: 16px; }
  .blog-featured-content h1 { font-size: clamp(25px, 6.4vw, 34px); margin-bottom: 12px; text-wrap: balance; }
  .blog-featured-excerpt { font-size: 16px; margin-bottom: 20px; }
}

/* === BLOG HOME · titolo sezione "Tutti gli articoli" === */
.blog-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--text-dim); margin: 0 0 28px;
  display: flex; align-items: center; gap: 18px;
}
.blog-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === post-thumb fallback (articolo senza immagine) === */
.post-thumb[data-noimg="1"] {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 40% 28%, rgba(212,160,86,0.16) 0%, transparent 60%),
    linear-gradient(150deg, var(--bg-soft) 0%, var(--bg-card) 100%);
}
.post-thumb-fallback {
  font-size: 32px; font-weight: 700; letter-spacing: 0.20em;
  color: rgba(212,160,86,0.42);
}

/* --- POST GRID --- */
main { padding: 50px 0 80px; min-height: 60vh; }
.post-grid {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.post-card-featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.post-card-featured .post-thumb { aspect-ratio: 4/3; }
.post-card-featured .post-card-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.post-card-featured .post-title { font-size: 28px; }
@media (max-width: 768px) {
  .post-card-featured { grid-template-columns: 1fr; }
  .blog-hero h1 { font-size: 36px; }
}

.post-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.post-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-soft); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }

.post-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); align-items: center; flex-wrap: wrap; }
.post-cat { background: rgba(212, 160, 86, 0.12); color: var(--accent); padding: 3px 10px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; text-decoration: none; }
.post-cat:hover { background: rgba(212, 160, 86, 0.2); }
.post-date, .post-read { font-weight: 500; }
.post-read::before { content: '· '; color: var(--text-dim); }

.post-title { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.post-title a { color: var(--text); text-decoration: none; transition: color .15s; }
.post-title a:hover { color: var(--accent-soft); }
.post-excerpt { color: var(--text-soft); font-size: 15px; line-height: 1.55; flex: 1; }
.post-read-more { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; align-self: flex-start; }
.post-read-more:hover { color: var(--accent-soft); }

/* --- HERO ATTRIBUTION (Unsplash TOS) ---
   .hero-credit-featured: overlay bottom-right sul big banner (.blog-featured-wrap).
   .hero-credit-card:     line sotto thumb in ogni .post-card.
   Link cliccabili photographer + Unsplash con utm tracking come da TOS. */
.hero-credit {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
}
.hero-credit a {
  color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.35);
  text-underline-offset: 2px; transition: color .15s, text-decoration-color .15s;
}
.hero-credit a:hover { color: var(--accent-soft); text-decoration-color: var(--accent); }
.hero-credit-featured {
  position: absolute;
  bottom: 14px; right: 18px;
  z-index: 3;                /* sopra .blog-featured-gradient (z=1) e .blog-featured-content (z=2) */
  color: rgba(255,255,255,0.78);
  background: rgba(10,14,22,0.55);
  padding: 5px 10px; border-radius: 4px;
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.hero-credit-card {
  display: block;
  padding: 8px 24px 0;       /* allineato al padding del .post-card-body */
  color: var(--text-dim);
}
.hero-credit-card a { text-decoration-color: rgba(255,255,255,0.18); }
@media (max-width: 768px) {
  .hero-credit-featured { bottom: 10px; right: 12px; font-size: 10px; padding: 4px 8px; }
}

/* --- PAGINATION --- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 60px; padding: 24px; border-top: 1px solid var(--border); }
.pagination a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pagination a:hover { color: var(--accent-soft); }
.page-info { color: var(--text-dim); font-size: 14px; }

/* --- EMPTY STATE --- */
.empty-state { text-align: center; padding: 80px 24px; color: var(--text-soft); }
.empty-state h1, .empty-state h2 { color: var(--text); margin-bottom: 12px; font-size: 28px; }
.empty-state a { color: var(--accent); text-decoration: none; }

/* --- SINGLE ARTICLE --- */
.article-header { padding: 60px 0 32px; max-width: 720px; }
.article-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; font-size: 13px; color: var(--text-dim); }
.article-header h1 {
  font-size: 44px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 20px; color: var(--text);
}
@media (max-width: 768px) { .article-header h1 { font-size: 32px; } }
.article-lead {
  font-size: 22px; line-height: 1.5; color: var(--text-soft);
  margin-bottom: 28px; font-weight: 400;
}
.article-author { font-size: 14px; color: var(--text-dim); }
.article-author strong { color: var(--accent); font-weight: 600; }

.article-hero { max-width: 1080px; margin: 32px auto 48px; padding: 0 24px; }
.article-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }

/* === HERO OVERLAY · banner full-width con titolo sovrapposto ===
   width:100% = full-bleed (reset *{margin:0} su body + .article senza max-width).
   height:clamp + background-size:cover = MAI distorto/stirato (cover preserva sempre AR)
   e immagine 1920 sempre downscalata dentro la banda = nitida (no upscaling/sgranatura).
   NIENTE aspect-ratio: il conflitto storico era aspect-ratio + max-height = letterbox >16:9. */
/* Hero DISEGNATO in CSS (no foto): Pollinations cappa a 1024px nativi → ogni foto
   full-width era un upscale sfocato. Gradiente brand + grid vettoriale = nitido
   a QUALSIASI risoluzione/zoom/retina, per sempre. Mai stirato, mai sgranato. */
.article-hero-overlay {
  position: relative;
  width: 100%;
  height: clamp(360px, 42vw, 620px);
  background-color: #0a0e16;
  background-image:
    radial-gradient(120% 130% at 50% -10%, rgba(212,160,86,0.18) 0%, rgba(212,160,86,0) 55%),
    radial-gradient(90% 120% at 100% 115%, rgba(122,184,255,0.12) 0%, rgba(122,184,255,0) 60%),
    linear-gradient(125deg, #0e141f 0%, #0a0e16 45%, #0c1018 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 56px;
  overflow: hidden;
}
.article-hero-overlay::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 38%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse at 50% 38%, #000 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 768px) {
  /* Mobile: altezza AUTO, non fissa. Con altezza fissa (200px) un titolo lungo
     sfora il box (overflow:hidden lo tagliava) e finiva sotto la topnav assoluta.
     min-height tiene la banda visiva, il padding-top lascia spazio alla nav. */
  .article-hero-overlay {
    height: auto;
    min-height: clamp(200px, 52vw, 360px);
    margin-bottom: 32px;
    overflow: visible;
  }
  .article-hero-overlay-content { padding: 104px 20px 40px; }
  .article-hero-overlay-content .article-meta { margin-bottom: 18px; }
  .article-hero-overlay-content h1 {
    font-size: clamp(25px, 6.4vw, 34px);
    line-height: 1.12;
    margin-bottom: 16px;
    text-wrap: balance;
  }
  .article-hero-overlay-content .article-lead { font-size: 16px; margin-bottom: 18px; }
}

.article-hero-overlay-gradient {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(10,14,22,0) 38%, rgba(10,14,22,0.42) 100%);
  pointer-events: none;
  z-index: 1;
}

.article-hero-overlay-content {
  position: relative; z-index: 2;
  max-width: 880px; margin: 0 auto; width: 100%;
  padding: 60px 32px;
  color: #fff;
  text-align: center;
}
.article-hero-overlay-content .article-meta { color: rgba(255,255,255,0.9); margin-bottom: 28px; justify-content: center; }
.article-hero-overlay-content .post-cat { background: var(--accent); color: #0a0e16; }
.article-hero-overlay-content .post-cat:hover { background: var(--accent-soft); }
.article-hero-overlay-content h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.025em;
  margin-bottom: 22px; color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.article-hero-overlay-content .article-lead {
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.5; color: rgba(255,255,255,0.92);
  margin-bottom: 26px; max-width: 720px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}
.article-hero-overlay-content .article-author { color: rgba(255,255,255,0.7); }
.article-hero-overlay-content .article-author strong { color: var(--accent-soft); }

/* === AEO TL;DR box · answer-first, speakable target === */
.aeo-tldr {
  max-width: 720px; margin: 0 auto 40px; padding: 22px 26px;
  background: linear-gradient(135deg, rgba(212,160,86,0.10) 0%, rgba(212,160,86,0.04) 100%);
  border: 1px solid rgba(212,160,86,0.35); border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.aeo-tldr-label {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent); margin-bottom: 8px;
}
.aeo-tldr p { font-size: 17px; line-height: 1.6; color: var(--text); margin: 0; font-weight: 500; }

.article-body {
  max-width: 720px; margin: 0 auto; padding: 0 24px; font-size: 18px; line-height: 1.75; color: var(--text);
}
/* FAQ section · visual distinction (AEO + UX) */
.article-body h2#domande-frequenti, .article-body h2#frequently-asked-questions { margin-top: 64px; }
.article-body h3 { scroll-margin-top: 80px; }
.article-body h2 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  margin: 56px 0 20px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.article-body h3 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin: 36px 0 14px; color: var(--text);
}
.article-body h4 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; color: var(--accent-soft); }
.article-body p { margin: 0 0 22px; }
.article-body a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body a:hover { color: var(--link-hover); }
.article-body strong { color: var(--accent-soft); font-weight: 600; }
.article-body em { color: var(--text); font-style: italic; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 8px 0 8px 22px;
  margin: 28px 0; color: var(--text-soft); font-style: italic; background: rgba(212, 160, 86, 0.04);
}
.article-body code {
  background: var(--bg-soft); padding: 2px 8px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.9em; color: var(--accent-soft);
}
.article-body pre {
  background: var(--bg-soft); padding: 20px; border-radius: 8px;
  overflow-x: auto; margin: 28px 0; border: 1px solid var(--border);
}
.article-body pre code { background: transparent; padding: 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }

/* --- IMMAGINI INLINE NEL CORPO (figure data-wpc-inline) --- */
.article-body figure {
  margin: 44px 0;
  /* leggero bleed oltre la colonna di testo (720px) per dare respiro */
  width: calc(100% + 80px);
  max-width: 800px;
  margin-left: 50%;
  transform: translateX(-50%);
}
.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.article-body figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
  padding: 0 12px;
}
.article-body figure figcaption a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
.article-body figure figcaption a:hover { color: var(--text-soft); }
@media (max-width: 820px) {
  .article-body figure {
    width: 100%; max-width: 100%;
    margin-left: 0; transform: none;
  }
}

/* --- TOGGLE TEMA CHIARO/SCURO --- */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; padding: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
/* icona: in dark mostra il sole (passa a chiaro), in light la luna (passa a scuro) */
.theme-toggle::before { content: "☀"; font-size: 17px; }
:root[data-theme="light"] .theme-toggle::before { content: "🌙"; font-size: 15px; }

/* --- ARTICLE CTA --- */
.article-cta { padding: 72px 0; }
.cta-box {
  max-width: 720px; margin: 0 auto;
  position: relative; overflow: hidden;
  background:
    radial-gradient(560px 280px at 88% -10%, rgba(212,160,86,0.16), transparent 62%),
    linear-gradient(165deg, var(--bg-card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border); border-radius: 18px;
  padding: 44px 46px;
  box-shadow: var(--shadow);
  text-align: left;
}
/* fascia-immagine tematica in cima alla card (scudo/sicurezza), mascherata in dissolvenza */
.cta-box::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 100%;
  background-image: var(--cta-img, none);
  background-size: cover; background-position: right center;
  opacity: 0.10; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
          mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.cta-box > * { position: relative; z-index: 1; }
.cta-box h3 { font-size: 27px; font-weight: 700; margin-bottom: 12px; color: var(--text); letter-spacing: -0.01em; }
.cta-box p { color: var(--text-soft); margin-bottom: 26px; font-size: 16px; max-width: 52ch; }
.cta-box .cta-price { color: var(--accent-soft); font-weight: 600; }
.cta-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cta-button {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #1a1206;
  padding: 14px 26px; border-radius: 12px; font-weight: 600; font-size: 15.5px;
  text-decoration: none;
  box-shadow: 0 10px 26px -10px rgba(212,160,86,0.5);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.cta-button svg { width: 17px; height: 17px; flex: none; transition: transform .18s ease; }
.cta-button:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 36px -12px rgba(212,160,86,0.6); }
.cta-button:hover svg { transform: translateX(3px); }
.cta-button:active { transform: translateY(0); }
.cta-note { color: var(--text-dim); font-size: 13.5px; }

/* --- FOOTER --- */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 0;
  color: var(--text-dim); font-size: 14px; text-align: center;
}
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* === ARTICLE TOC · indice contenuti (anchor jump, AEO-friendly) === */
.article-toc {
  max-width: 720px; margin: 0 auto 40px; padding: 22px 26px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 10px;
}
.article-toc-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent); margin-bottom: 12px;
}
.article-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.article-toc li { margin: 0; padding: 0; }
.article-toc li.toc-l2 { counter-increment: toc; }
.article-toc li.toc-l2 > a::before {
  content: counter(toc) ". "; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.article-toc li.toc-l3 { padding-left: 26px; }
.article-toc li.toc-l3 > a::before { content: '– '; color: var(--text-dim); }
.article-toc a {
  display: inline-block; padding: 5px 0; color: var(--text-soft);
  text-decoration: none; font-size: 15px; line-height: 1.4; transition: color .15s;
}
.article-toc a:hover { color: var(--accent-soft); }

/* anchor jump · evita che l'heading finisca sotto l'header sticky */
.article-body h2, .article-body h3 { scroll-margin-top: 90px; }

/* === ARTICLE NAV · precedente / indice / successivo === */
.article-nav {
  max-width: 720px; margin: 56px auto 0; padding: 28px 0 0;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch;
}
.article-nav-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.article-nav-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.article-nav-link.next { text-align: right; align-items: flex-end; }
.article-nav-dir { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.article-nav-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.article-nav-link:hover .article-nav-title { color: var(--accent-soft); }
.article-nav-index {
  align-self: center; white-space: nowrap;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 99px;
  color: var(--text-soft); text-decoration: none; font-size: 13px; font-weight: 600;
  transition: color .15s, border-color .15s;
}
.article-nav-index:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 720px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-link.next { text-align: left; align-items: flex-start; }
  .article-nav-index { order: 3; justify-self: center; }
}

/* --- accessibility --- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }


/* ============================================================
   topnav (sincronizzato col resto del sito, 2026-05-19)
   ============================================================ */
.topnav {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}
.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ededf3;
}
.logo-mark svg { width: 34px; height: 34px; }
.nav-center {
  display: flex;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.nav-center a {
  color: rgba(237,237,243,0.78);
  text-decoration: none;
  transition: color .15s;
}
.nav-center a:hover, .nav-center a.active { color: #ededf3; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-login {
  color: rgba(237,237,243,0.78);
  text-decoration: none;
  padding: 8px 14px;
  font-size: 14px;
  transition: color .15s;
}
.nav-login:hover { color: #ededf3; }
.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #1a1206;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 22px -10px rgba(212,160,86,0.55);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.nav-cta:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 12px 28px -10px rgba(212,160,86,0.65); }
@media (max-width: 900px) {
  .nav-center { display: none; }
}
/* Mobile stretto: la nav-right sforava il viewport (CTA a right:441 su 375 =
   scroll orizzontale). Compattata: padding e font ridotti, niente wrap. */
@media (max-width: 480px) {
  .topnav { padding: 16px 14px; gap: 6px; flex-wrap: nowrap; }
  /* Su schermi molto stretti (<=400px) il logo testuale ruba spazio al CTA:
     resta l'icona, il wordmark sparisce. Il CTA e' l'elemento che deve stare. */
  .logo-mark { min-width: 0; overflow: hidden; }
  .logo-mark { font-size: 12px; letter-spacing: 0.12em; gap: 8px; }
  .logo-mark svg { width: 26px; height: 26px; }
  .nav-right { gap: 4px; }
  .nav-login { padding: 6px 8px; font-size: 13px; }
  .nav-cta { padding: 8px 12px; font-size: 12.5px; border-radius: 8px; white-space: nowrap; flex: 0 0 auto; }
}
@media (max-width: 400px) {
  .logo-mark { font-size: 0; gap: 0; }
  .logo-mark svg { width: 26px; height: 26px; }
  .nav-login { padding: 6px 6px; font-size: 12.5px; }
}


/* ============================================================
   REDESIGN A · single-article editoriale (2026-08-29)
   Font serif Fraunces + sidebar TOC sticky numerata + palette ambra.
   Scope: SOLO body.blog-single. La blog-home resta intatta.
   ============================================================ */
:root {
  --font-display: 'Fraunces', 'Georgia', 'Times New Roman', serif;
  --readw: 68ch;
}

/* --- hero: titolo serif, numeri in ambra corsivo --- */
.blog-single .article-hero-overlay-content h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.05;
}
.blog-single .article-header h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.028em; }

/* --- layout 2 colonne: sidebar TOC sticky + colonna testo --- */
.blog-single .article-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}
.blog-single .article-layout.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.blog-single .article-main { min-width: 0; }

/* --- sidebar TOC sticky --- */
.blog-single .article-toc-side { position: sticky; top: 96px; align-self: start; }
.blog-single .toc-details { display: block; }
.blog-single .toc-details > summary { list-style: none; }
.blog-single .toc-details > summary::-webkit-details-marker { display: none; }
.blog-single .article-toc-side .article-toc-label {
  display: block;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 14px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.blog-single .article-toc-side nav.article-toc {
  display: flex; flex-direction: column;
  max-width: none; margin: 0; padding: 0;
  background: none; border: none; border-radius: 0;
}
.blog-single .article-toc-side nav.article-toc a {
  position: relative;
  display: block;
  padding: 8.5px 0 8.5px 16px;
  font-size: 14px; line-height: 1.4;
  color: var(--text-dim);
  border-left: 2px solid var(--border);
  transition: color .2s ease, border-color .2s ease;
}
.blog-single .article-toc-side nav.article-toc a .idx {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--accent-soft);
  margin-right: 9px;
}
.blog-single .article-toc-side nav.article-toc a.toc-l3 { padding-left: 30px; font-size: 13.5px; }
.blog-single .article-toc-side nav.article-toc a:hover { color: var(--text); border-left-color: var(--accent-soft); }
.blog-single .article-toc-side nav.article-toc a.active { color: var(--text); border-left-color: var(--accent); }
.blog-single .article-toc-side nav.article-toc a.active .idx { color: var(--accent); }

.blog-single .toc-cta { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.blog-single .toc-cta p { font-size: 13px; line-height: 1.55; color: var(--text-dim); margin: 0 0 12px; }
.blog-single .toc-cta a {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--accent);
  text-decoration: none; transition: gap .2s ease;
}
.blog-single .toc-cta a:hover { gap: 11px; }

/* --- colonna testo: larghezza di lettura + tipografia serif sui titoli --- */
.blog-single .article-main .article-body { max-width: var(--readw); margin: 0; padding: 0; }
.blog-single .article-main .aeo-tldr { max-width: var(--readw); margin: 0 0 44px; }
.blog-single .article-body h2 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.85rem; line-height: 1.14; letter-spacing: -0.02em;
  border-bottom: none; padding-bottom: 0;
  margin: 58px 0 22px;
}
.blog-single .article-body h3 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em;
}

/* --- CTA finale: titolo serif --- */
.blog-single .cta-box h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

/* --- article-nav dentro colonna testo (non full width) --- */
.blog-single .article-layout ~ .article-nav,
.blog-single .article-nav { max-width: 1100px; }

/* --- responsive: sidebar collassa in <details> accordion sopra il testo --- */
@media (max-width: 940px) {
  .blog-single .article-layout { grid-template-columns: 1fr; gap: 0; }
  .blog-single .article-toc-side {
    position: static; margin-bottom: 40px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px 20px;
  }
  .blog-single .toc-details > summary {
    cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  }
  .blog-single .toc-details > summary::after {
    content: ""; width: 9px; height: 9px;
    border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: rotate(45deg); transition: transform .25s ease;
  }
  .blog-single .toc-details[open] > summary::after { transform: rotate(-135deg); }
  .blog-single .toc-details:not([open]) .article-toc-label { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .blog-single .toc-details > summary > .article-toc-label { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .blog-single .toc-details[open] nav.article-toc { margin-top: 14px; }
  .blog-single .toc-cta { display: none; }
  .blog-single .article-main .article-body,
  .blog-single .article-main .aeo-tldr { max-width: none; }
}


/* ============================================================
   REDESIGN A · fix tema chiaro single-article (2026-08-30)
   Il bianco puro sotto l'hero scuro era uno stacco brutale.
   Fondo crema caldo (come mock A) + transizione morbida hero→body.
   Scope: SOLO body.blog-single (la blog-home non cambia).
   ============================================================ */
:root[data-theme="light"] body.blog-single {
  --bg: #f6f4ef;         /* crema caldo, non bianco clinico */
  --bg-soft: #efeade;
  --bg-card: #fffdf8;
  --border: #e4ded2;
  --text: #20242c;
  --text-soft: #454b56;
  --text-dim: #767d8a;
  background: #f6f4ef;
}
/* card/box su fondo crema: bordo caldo + ombra tenue */
:root[data-theme="light"] body.blog-single .aeo-tldr,
:root[data-theme="light"] body.blog-single .cta-box,
:root[data-theme="light"] body.blog-single .article-toc-side {
  background: var(--bg-card);
  border-color: var(--border);
}
/* transizione morbida: l'hero scuro sfuma nel crema invece di tagliare netto */
:root[data-theme="light"] body.blog-single .article-hero-overlay {
  margin-bottom: 0;
}
:root[data-theme="light"] body.blog-single .article-hero-overlay::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(180deg, rgba(246,244,239,0) 0%, rgba(246,244,239,0.85) 78%, #f6f4ef 100%);
  z-index: 2; pointer-events: none;
}
:root[data-theme="light"] body.blog-single .article-layout { padding-top: 40px; }
