/* rich.css — visual system for blog authority articles. Scoped to .rich-doc. The Astro blog page sets
   `class="rich-doc theme-X"` + inline `style="--accent:<site palette primary>"`; --accentSoft is derived
   via color-mix so ONE accent override re-tints every component. 5 structural themes × per-site accent =
   high per-site variety. Hover micro-interactions included (reduced-motion safe). See blogRich.cjs. */

.rich-doc{--accentSoft:color-mix(in srgb, var(--accent) 13%, var(--surf,#fff));font-family:var(--fb);color:var(--ink)}
.rich-doc h2{margin:1.9em 0 .5em;text-wrap:pretty}.rich-doc h3{margin:1.4em 0 .4em}
.rich-doc p{font-size:1.12rem;line-height:1.75;margin:0 0 1em}
.rich-doc .lead{font-size:1.2rem;line-height:1.6;color:var(--muted)}
.rich-doc section>ul{font-size:1.08rem;line-height:1.65}
/* I link della PROSA prendono il colore dell'accento. `:not(.button)` esclude i BOTTONI del tema
   (`a.button`, es. il «Read more» delle schede d'elenco): sono elementi con FONDO PROPRIO, e il
   loro testo lo decide `gp-customizer.css` (#fff su #55555e). Senza questa esclusione rich.css —
   che carica DOPO il customizer a parita' di specificita' (0,1,1) — vi dipingeva sopra
   `var(--accent)`: accento su grigio scuro, contrasto ~1,4:1 contro i 4,5:1 richiesti.
   L'esclusione morde SOLO la classe `button` esatta: `btn`/`btn-primary`/`cl-cta-button` degli
   altri motori non sono toccati. */
.rich-doc a:not(.button){color:var(--accent);text-decoration:underline;text-underline-offset:2px}

.c-table{margin:1.5em 0;overflow-x:auto}.c-table table{border-collapse:collapse;width:100%;font-size:.96rem}
.c-table figcaption{font-size:.85rem;color:var(--muted);margin-top:.5em;font-style:italic}
.c-callout{display:flex;gap:14px;margin:1.5em 0;padding:16px 18px}.c-callout .ci{flex:0 0 auto;width:26px;height:26px}.c-callout .ci svg{width:26px;height:26px}.c-callout b{display:block;margin-bottom:3px}.c-callout .ct{margin:0;font-size:1.02rem;line-height:1.6}
.c-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:14px;margin:1.6em 0}.c-stats .stat{display:flex;flex-direction:column;padding:16px}.c-stats .v{font-size:1.7rem;font-weight:800;line-height:1}.c-stats .l{font-size:.82rem;margin-top:6px}
.c-check{margin:1.5em 0;padding:18px 20px}.c-check h4{margin:0 0 .6em}.c-check ul{list-style:none;margin:0;padding:0}.c-check li{display:flex;gap:10px;align-items:flex-start;margin:.5em 0;font-size:1.05rem;border-radius:6px;padding:3px 6px;margin-left:-6px}.c-check .ck{flex:0 0 auto;width:20px;height:20px;margin-top:2px}.c-check .ck svg{width:20px;height:20px}
.c-howto{margin:2em 0}.c-howto ol{list-style:none;margin:0;padding:0}.c-howto li{display:flex;gap:16px;margin:0 0 4px;padding:14px 10px;border-radius:8px}.c-howto .n{flex:0 0 auto;width:38px;height:38px;display:flex;align-items:center;justify-content:center;font-weight:800;transition:transform .18s ease}.c-howto b{display:block;margin-bottom:3px}.c-howto .ht{margin:0}
.c-takeaways{margin:1.8em 0;padding:20px 22px}.c-takeaways h3{display:flex;align-items:center;gap:10px;margin:0 0 .6em}.c-takeaways .ci{width:22px;height:22px}.c-takeaways .ci svg{width:22px;height:22px}.c-takeaways ul{margin:0;padding-left:1.1em}.c-takeaways li{margin:.4em 0;font-size:1.05rem}
.c-faq{margin:2em 0}.c-faq details{padding:14px 0}.c-faq summary{cursor:pointer;font-weight:650;font-size:1.08rem;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:12px}.c-faq summary::after{content:"+";font-size:1.4rem;font-weight:400;transition:transform .2s ease}.c-faq details[open] summary::after{content:"–"}.c-faq .fq{margin:.7em 0 0;line-height:1.6}

/* hover micro-interactions (accent-driven, reduced-motion safe) */
@media (hover:hover){
 .c-callout{transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.c-callout:hover{transform:translateY(-3px);box-shadow:0 10px 26px rgba(20,30,40,.13)}
 .c-stats .stat{transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.c-stats .stat:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(20,30,40,.15)}
 .c-table tbody tr{transition:background .15s ease}.c-table tbody tr:hover td{background:var(--accentSoft)}
 .c-faq summary{transition:color .15s ease}.c-faq summary:hover{color:var(--accent)}.c-faq summary:hover::after{transform:scale(1.25)}
 .c-howto li{transition:background .18s ease}.c-howto li:hover{background:var(--accentSoft)}.c-howto li:hover .n{transform:scale(1.08) rotate(-4deg)}
 .c-check li{transition:background .15s ease,color .15s ease}.c-check li:hover{background:var(--accentSoft);color:var(--accent)}
 .c-takeaways{transition:box-shadow .25s ease}.c-takeaways:hover{box-shadow:0 14px 34px rgba(20,30,40,.14)}
}
@media (prefers-reduced-motion:reduce){.rich-doc *{transition:none!important;animation:none!important}}

/* ===== A — Clinical Slate ===== */
.theme-a{--surf:#fff;--ink:#16202B;--muted:#5A6B7B;--line:#DDE4EA;--accent:#2C6E8F;--fd:"Söhne",system-ui,"Segoe UI",sans-serif;--fb:"Söhne",system-ui,"Segoe UI",sans-serif}
.theme-a .rich-doc h2,.theme-a .rich-doc h3,.theme-a .rich-doc h4,.theme-a .rich-doc .n,.theme-a .v,.theme-a .rich-doc summary{font-family:var(--fd)}
.theme-a .rich-doc h2{border-bottom:2px solid var(--line);padding-bottom:.25em}
.theme-a .c-table table{border:1px solid var(--line)}.theme-a .rich-doc th{background:var(--accent);color:#fff;text-align:left;padding:10px 13px}.theme-a td{border:1px solid var(--line);padding:9px 13px}
.theme-a .c-callout{border-left:4px solid var(--accent);background:var(--surf);border-radius:0 6px 6px 0;box-shadow:0 1px 4px rgba(20,30,40,.06)}.theme-a .c-callout.tip{border-left-color:#2f8f5b}.theme-a .c-callout.warning{border-left-color:#c2801c}.theme-a .c-callout .ci{color:var(--accent)}.theme-a .c-callout.tip .ci{color:#2f8f5b}.theme-a .c-callout.warning .ci{color:#c2801c}
.theme-a .c-stats .stat{background:var(--accentSoft);border-radius:8px;text-align:center;align-items:center;border:1px solid transparent}.theme-a .v{color:var(--accent)}.theme-a .l{color:var(--muted)}
.theme-a .c-check{background:var(--surf);border:1px solid var(--line);border-radius:8px}.theme-a .ck{color:#2f8f5b}
.theme-a .c-howto li{border-bottom:1px solid var(--line)}.theme-a .rich-doc .n{border-radius:50%;background:var(--accent);color:#fff}
.theme-a .c-takeaways{background:var(--accentSoft);border-radius:10px;border:1px solid var(--line)}.theme-a .c-takeaways h3{color:var(--accent)}
.theme-a .c-faq details{border-bottom:1px solid var(--line)}

/* ===== B — Warm Editorial ===== */
.theme-b{--surf:#fff;--ink:#2A2019;--muted:#7A6A5C;--line:#E7DDD0;--accent:#B5542C;--fd:"Fraunces",Georgia,serif;--fb:"Iowan Old Style",Charter,Georgia,serif}
.theme-b{background:#FBF7F1}.theme-b .rich-doc h2,.theme-b .rich-doc h3,.theme-b .rich-doc h4,.theme-b .rich-doc summary{font-family:var(--fd);letter-spacing:-.01em}

.theme-b .c-table table{border-radius:10px;overflow:hidden;box-shadow:0 2px 12px rgba(42,32,25,.07)}.theme-b .rich-doc th{background:var(--accent);color:#fff;text-align:left;padding:11px 14px}.theme-b td{padding:10px 14px}.theme-b tbody tr:nth-child(odd) td{background:var(--accentSoft)}.theme-b tbody tr:nth-child(even) td{background:#fff}
.theme-b .c-callout{border-radius:12px;background:var(--accentSoft);border:1px solid var(--line)}.theme-b .c-callout.tip{background:#eaf4ec;border-color:#cfe6d5}.theme-b .c-callout.warning{background:#fbf0dd;border-color:#eed9b0}.theme-b .c-callout .ci{color:var(--accent)}.theme-b .c-callout.tip .ci{color:#3a7d52}.theme-b .c-callout.warning .ci{color:#b5852a}
.theme-b .c-stats{gap:0;background:var(--surf);border:1px solid var(--line);border-radius:12px;overflow:hidden}.theme-b .c-stats .stat{border-right:1px solid var(--line);text-align:center;align-items:center;padding:20px 14px}.theme-b .c-stats .stat:last-child{border-right:none}.theme-b .v{color:var(--accent);font-family:var(--fd)}
.theme-b .c-check{background:var(--surf);border:1px dashed var(--accent);border-radius:12px}.theme-b .ck{color:var(--accent)}
.theme-b .c-howto ol{border-left:2px solid var(--line);margin-left:19px}.theme-b .c-howto li{padding-left:8px}.theme-b .rich-doc .n{margin-left:-39px;border-radius:12px;background:var(--accent);color:#fff;font-family:var(--fd)}
.theme-b .c-takeaways{background:linear-gradient(180deg,var(--accentSoft),#fff);border:1px solid var(--line);border-radius:14px}.theme-b .c-takeaways h3{color:var(--accent)}
.theme-b .c-faq details{background:var(--surf);border:1px solid var(--line);border-radius:10px;margin:.5em 0;padding:14px 18px}

/* ===== C — Bold Modern (dark) ===== */
.theme-c{--surf:#15292D;--ink:#E8F0F0;--muted:#93AAAC;--line:#26424A;--accent:#37C4A8;--fd:"Space Grotesk",system-ui,sans-serif;--fb:system-ui,"Segoe UI",sans-serif}
.theme-c{background:#0E1B1E;padding:8px clamp(6px,2vw,20px);border-radius:16px}.theme-c .rich-doc h2,.theme-c .rich-doc h3,.theme-c .rich-doc h4,.theme-c .rich-doc .n,.theme-c .v,.theme-c .rich-doc summary{font-family:var(--fd)}
.theme-c .lead{color:#B7C9C9}
.theme-c .c-table table{border:1px solid var(--line);border-radius:10px;overflow:hidden}.theme-c .rich-doc th{background:var(--accent);color:#06201B;text-align:left;padding:11px 14px;font-family:var(--fd)}.theme-c td{border-top:1px solid var(--line);padding:10px 14px;color:#CFDDDD}
.theme-c .c-callout{border-radius:12px;background:var(--surf);border:1px solid var(--line);border-left:3px solid var(--accent)}.theme-c .c-callout.tip{border-left-color:#4fd18a}.theme-c .c-callout.warning{border-left-color:#e0b256}.theme-c .c-callout .ci{color:var(--accent)}.theme-c .c-callout.warning .ci{color:#e0b256}.theme-c .c-callout.tip .ci{color:#4fd18a}
.theme-c .c-stats .stat{background:var(--surf);border:1px solid var(--line);border-radius:12px;text-align:left;padding:18px}.theme-c .v{color:var(--accent);font-size:2rem}.theme-c .l{color:var(--muted)}
.theme-c .c-check{background:var(--surf);border:1px solid var(--line);border-radius:12px}.theme-c .ck{color:var(--accent)}
.theme-c .c-howto li{border-bottom:1px solid var(--line)}.theme-c .rich-doc .n{border-radius:10px;background:var(--accentSoft);color:var(--accent);border:1px solid var(--accent);font-size:1.1rem}
.theme-c .c-takeaways{background:var(--surf);border:1px solid var(--accent);border-radius:14px}.theme-c .c-takeaways h3{color:var(--accent)}
.theme-c .c-faq details{border-bottom:1px solid var(--line)}.theme-c .rich-doc summary{color:var(--ink)}

/* `.rich-doc .n` e non `.n`: `n` e' anche una classe hCard sul link dell'autore, fuori dalla
   prosa — senza ambito il tema dipingeva il NOME come un pallino numerato, su tutti e cinque.
   Stessa forma di `.page` sul <body>: un nome generico che collide. */
/* ===== D — Minimal Mono (hairline, single accent) ===== */
.theme-d{--surf:#fff;--ink:#141414;--muted:#6C6C6C;--line:#E6E6E6;--accent:#C1121F;--fd:"Neue Haas Grotesk",system-ui,"Segoe UI",sans-serif;--fb:"Neue Haas Grotesk",system-ui,"Segoe UI",sans-serif}
.theme-d .rich-doc h2,.theme-d .rich-doc h3,.theme-d .rich-doc h4,.theme-d .rich-doc th,.theme-d .rich-doc summary,.theme-d .rich-doc .n{font-family:var(--fd)}
/* 01/09/2026 — I TITOLI DEL TEMA NON DETTANO PIU' LA SCALA. Due giri sullo stesso difetto.
   (1) Il foglio si dichiara «Scoped to .rich-doc» (riga 1) ma i temi selezionano per ELEMENTO:
   con la classe di tema sull'<html> di ogni pagina del bordo, `.theme-* h2` pescava anche
   `h2.entry-title` (schede) e `h2.widget-title` («About Me») — filetto, MAIUSCOLO (a video
   violava R4) e titolo piu' piccolo del testo. (2) Il proprietario: «h2 sembra piu' piccolo
   dell'h3». Misurato: era vero su TUTTI E CINQUE i temi. I temi dichiaravano `font-size` +
   `font-weight` SOLO sull'h2 (1.4-1.5rem = 22,4-24px, peso 600/700) mentre h3 e h4 cadevano
   sulla scala di GeneratePress (29px e 24px, peso 400): l'h2 finiva sotto il suo stesso h3, e
   su theme-a/theme-c perfino sotto l'h4. Gerarchia invertita, non gusto. Un confronto FRA TEMI
   («1.5rem come gli altri quattro») non e' un confronto con la SCALA: quel numero era mio ed
   era sbagliato. Ora nessun tema dichiara corpo o peso sui titoli — vale la scala del
   riferimento, h1 42 > h2 35 > h3 29 > h4 24, tutti a peso 400. Ai temi restano il COLORE e la
   famiglia display (`--fd`), che gia' vestono h2/h3/h4 allo stesso modo: quella e' l'identita'
   del tema, non la gerarchia. Misure e controllo negativo: tests/visual/cascade-resolver.mjs. */
.theme-d .rich-doc h2{color:var(--ink)}
.theme-d .c-table th{text-align:left;text-transform:uppercase;font-size:.78rem;letter-spacing:.06em;color:var(--muted);border-bottom:2px solid var(--ink);padding:8px 12px}.theme-d td{border-bottom:1px solid var(--line);padding:10px 12px}
.theme-d .c-callout{border:1px solid var(--ink);border-radius:0;background:#fff}.theme-d .c-callout .ci{color:var(--accent)}.theme-d .c-callout b{text-transform:uppercase;font-size:.82rem;letter-spacing:.05em;font-family:var(--fd)}
.theme-d .c-stats{border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);gap:0}.theme-d .c-stats .stat{padding:18px 8px;border-right:1px solid var(--line);text-align:center;align-items:center}.theme-d .c-stats .stat:last-child{border-right:none}.theme-d .v{font-family:var(--fd);color:var(--ink)}.theme-d .l{text-transform:uppercase;font-size:.72rem;letter-spacing:.05em}
.theme-d .c-check{border:1px solid var(--line)}.theme-d .ck{color:var(--accent)}.theme-d .c-check h4{text-transform:uppercase;font-size:.85rem;letter-spacing:.05em;font-family:var(--fd)}
.theme-d .rich-doc .n{border-radius:0;background:none;color:var(--accent);border:2px solid var(--ink);font-family:var(--fd)}.theme-d .c-howto li{border-bottom:1px solid var(--line)}
.theme-d .c-takeaways{border:2px solid var(--ink);border-radius:0}.theme-d .c-takeaways h3{text-transform:uppercase;font-size:.95rem;letter-spacing:.05em;font-family:var(--fd)}.theme-d .c-takeaways .ci{color:var(--accent)}
.theme-d .c-faq details{border-bottom:1px solid var(--line)}.theme-d .rich-doc summary{font-family:var(--fd)}

/* ===== E — Vibrant Rounded ===== */
.theme-e{--surf:#fff;--ink:#221A33;--muted:#6E6488;--line:#E9E1FB;--accent:#6D3BEB;--fd:"Cabinet Grotesk","Space Grotesk",system-ui,sans-serif;--fb:system-ui,"Segoe UI",sans-serif}
.theme-e{background:#FAF8FF;padding:8px clamp(6px,2vw,18px);border-radius:20px}.theme-e .rich-doc h2,.theme-e .rich-doc h3,.theme-e .rich-doc h4,.theme-e .v,.theme-e .rich-doc .n,.theme-e .rich-doc summary{font-family:var(--fd)}

.theme-e .c-table table{border-radius:16px;overflow:hidden;border:1px solid var(--line)}.theme-e .rich-doc th{background:var(--accent);color:#fff;text-align:left;padding:12px 15px}.theme-e td{padding:11px 15px;border-top:1px solid var(--line)}
.theme-e .c-callout{border-radius:18px;background:var(--accentSoft);border:none}.theme-e .c-callout.tip{background:#e2f6ea}.theme-e .c-callout.warning{background:#fdefd8}.theme-e .c-callout .ci{color:var(--accent)}.theme-e .c-callout.tip .ci{color:#2fa564}.theme-e .c-callout.warning .ci{color:#d69022}
.theme-e .c-stats .stat{background:var(--accent);color:#fff;border-radius:18px;text-align:center;align-items:center;padding:20px}.theme-e .v{color:#fff}.theme-e .l{color:color-mix(in srgb,#fff 78%,var(--accent))}
.theme-e .c-check{background:var(--surf);border:2px solid var(--accentSoft);border-radius:18px}.theme-e .ck{color:var(--accent)}
.theme-e .rich-doc .n{border-radius:16px;background:var(--accent);color:#fff}.theme-e .c-howto li{background:var(--surf);border:1px solid var(--line);border-radius:16px;margin-bottom:10px}
.theme-e .c-takeaways{background:var(--accent);color:#fff;border-radius:22px}.theme-e .c-takeaways h3{color:#fff}.theme-e .c-takeaways .ci{color:#fff}.theme-e .c-takeaways li{color:color-mix(in srgb,#fff 85%,var(--accent))}
.theme-e .c-faq details{background:var(--surf);border:1px solid var(--line);border-radius:16px;margin:.5em 0;padding:14px 18px}
