/* ARCA — livello componenti per le pagine strumento, blog, libri, metodologia e note legali.
   Da caricare DOPO arca-core.css e DOPO lo <style> locale della pagina.
   Non definisce nuovi colori di brand: rimappa i nomi storici (--panel, --ink-dim, --bond…) sui token di arca-core.css. */

/* Instrument Serif appare più piccolo del serif storico: size-adjust compensa senza toccare i font-size delle pagine */
@font-face{ font-family:'ARCA Serif Text'; src:url('fonts/instrument-serif-latin-400-normal.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; size-adjust:112%; }
@font-face{ font-family:'ARCA Serif Text'; src:url('fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); font-weight:400; font-style:italic; font-display:swap; size-adjust:112%; }

:root{
  --panel:var(--surface); --panel-2:var(--surface-2);
  --ink-dim:var(--ink-2); --ink-faint:var(--ink-3);
  --gold-dim:var(--gold);
  --bond:var(--ink); --stock:var(--brand);              /* serie obbligazioni / azioni, come nel donut della home */
  --serif:'ARCA Serif Text','Instrument Serif',Georgia,'Times New Roman',serif;
  --sans:var(--font-ui);
  --gold-fill:#B8903A;                                   /* oro ufficiale (arca-core) per riempimenti e dettagli */
  --on-gold:#FFFFFF; --gold-hover:color-mix(in srgb,var(--gold) 82%,#000);
  --neg:#A83232;
}
/* Tema chiaro: l'oro usato come testo/segno deve essere AA su bianco → si usa il valore AA già presente nelle pagine storiche (#82642B) */
html[data-theme="light"]{ --gold:#82642B; }
/* ink-3 chiaro è 4.48:1 su bg e 4.2:1 su surface-2 → per i testi piccoli si usa ink-2 */
html[data-theme="light"]{ --ink-faint:var(--ink-2); }
html[data-theme="dark"]{ --gold-fill:#D2AE5E; --on-gold:#231A06; --gold-hover:color-mix(in srgb,var(--gold) 85%,#fff); --neg:#E08A8A; }

/* ===== shell ===== */
.header-tools .seg button.active{ background:var(--ink); color:var(--bg); }
#theme-icon-sun{ display:none; }
html[data-theme="dark"] #theme-icon-moon{ display:none; }
html[data-theme="dark"] #theme-icon-sun{ display:block; }
.page-hero h1.display{ font-size:clamp(2rem,4.6vw,3.2rem); line-height:1.05; margin-top:var(--s3); }
.page-hero .lead{ max-width:72ch; }
.page-hero .tagline{ font-family:var(--font-display); font-style:italic; font-size:1.25rem; color:var(--brand-ink); margin:var(--s3) 0 0; }
.tool-content{ padding-bottom:var(--s8); }
body:has(#dock) .tool-content{ padding-bottom:7rem; }
.tool-foot{ margin-top:var(--s6); padding-top:var(--s4); border-top:1px solid var(--line); font-size:.82rem; line-height:1.6; color:var(--ink-faint); }

/* ===== superfici ===== */
.tool-content .panel, .tool-content .chart-wrap, .tool-content .compare .col, .tool-content .glidepath-viz,
.tool-content article.post, .tool-content article.book, .tool-content .pathbox, .tool-content .relbox, .tool-content .tcard, .tool-content .empty{
  border-radius:var(--r-lg); border-color:var(--line); box-shadow:var(--shadow-1);
}
.tool-content .panel{ padding:clamp(1.1rem,2.6vw,1.75rem); }
.tool-content .metric, .tool-content .interp, .tool-content .callout, .tool-content .tina-callout, .tool-content .lifecard,
.tool-content .methodcard, .tool-content .intro-callout, .tool-content .disc-box, .tool-content .kpi, .tool-content .risk, .tool-content .card3,
.tool-content .subbox, .tool-content .hbbar, .tool-content .allocbar, .tool-content .formula, .tool-content ul.tiers li{ border-radius:var(--r-md); }
.tool-content .panel h2, .tool-content .chart-wrap h2{ font-size:1.5rem; line-height:1.15; letter-spacing:-.01em; }
.tool-content section h2{ color:var(--brand-ink); }

/* ===== controlli ===== */
.tool-content select, .tool-content input[type=number], .tool-content input[type=text], .tool-content input[type=date], .tool-content textarea{
  background:var(--surface-2); border:1px solid var(--line-strong); color:var(--ink); border-radius:var(--r-sm); font-family:var(--font-ui); min-height:44px;
}
.tool-content input[aria-invalid="true"]{ border-color:var(--neg) !important; }
.tool-content .field-error{ color:var(--neg); }
.tool-content input[type=range]::-webkit-slider-runnable-track{ background:var(--line-strong); }
.tool-content input[type=range]::-moz-range-track{ background:var(--line-strong); }
.tool-content input[type=range]::-webkit-slider-thumb{ background:var(--gold-fill); border-color:var(--surface); }
.tool-content input[type=range]::-moz-range-thumb{ background:var(--gold-fill); border-color:var(--surface); }
.tool-content .switch input:checked + .switch-track .switch-thumb{ background:var(--gold-fill); }
.tool-content summary{ color:var(--brand-ink); font-weight:600; }
.tool-content summary:hover{ text-decoration:underline; text-underline-offset:3px; color:var(--brand-ink); }

/* pulsanti: azione primaria = blu del brand; secondari (.ghost, .secondary) restano neutri; selezioni = oro */
.tool-content .btn:not(.ghost), .tool-content a.cta, .tool-content .share-btn:not(.secondary), .dock-share{
  background:var(--brand); color:var(--on-brand); border-color:var(--brand);
}
.tool-content .btn:not(.ghost):hover, .tool-content a.cta:hover, .tool-content .share-btn:not(.secondary):hover, .dock-share:hover{ background:var(--brand-hover); border-color:var(--brand-hover); }
.tool-content .chip[aria-pressed="true"], .tool-content .filters button[aria-pressed="true"], .tool-content .tabs button[aria-selected="true"]{ background:var(--gold); border-color:var(--gold); color:var(--on-gold); }

/* ===== tabelle e testi ===== */
.tool-content th{ color:var(--ink-faint); }
.tool-content .note, .tool-content .hint, .tool-content .count{ color:var(--ink-faint); }

/* ===== barre di allocazione: testo leggibile su ciascun riempimento, in entrambi i temi ===== */
.seg-bond{ background:var(--bond); color:var(--bg); }
.seg-stock{ background:var(--stock); color:var(--on-brand); }
.seg-gold{ background:var(--gold); color:var(--on-gold); }
.hb-seg-global{ background:var(--brand); color:var(--on-brand); }
.hb-seg-home{ background:var(--gold); color:var(--on-gold); }

/* ===== semantica positiva/negativa (fiscalità) ===== */
html[data-theme="light"] .b-ok{ color:#2F7A4D; border-color:#2F7A4D; }
html[data-theme="light"] .hb-dot-eur{ background:#3F8A5E; }

/* ===== stampa: la shell non si stampa ===== */
@media print{ .site-header, .footer, .skip, .page-hero, .mobile-menu, .tool-foot{ display:none !important; } .tool-content{ padding:0 !important; } }
