/* ==========================================================================
   BizTaxCalc — identità visiva istituzionale/fiscale.
   Palette del piano: bianco, accento VERDE #047857 (denaro/fiducia) + NAVY
   #1E3A8A (autorevolezza). NON è il look di pcgamecheck: sobrio, molto bianco,
   "documentazione fiscale/enterprise". Font: Inter se disponibile, poi system-ui
   (nessun CDN esterno per privacy GDPR — Inter va self-hostata in Fase 1).
   ========================================================================== */

:root {
    --bg: #FFFFFF;
    --bg-alt: #F6F8FA;
    --text: #0F172A;      /* titoli */
    --body: #374151;      /* corpo */
    --muted: #6B7280;     /* secondario */
    --border: #E5E7EB;
    --accent: #047857;    /* verde professionale — CTA, netto */
    --accent-dark: #036348;
    --navy: #1E3A8A;      /* intestazioni, link, autorevolezza */
    --danger: #B91C1C;    /* imposte dovute / costo */
    --warn: #B45309;      /* avvisi */
    --warn-bg: #FEF3C7;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --maxw: 960px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--body);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
}
h1, h2, h3 { color: var(--text); font-weight: 700; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky; top: 0; z-index: 20;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.15rem; }
.brand .mark {
    width: 30px; height: 30px; border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), var(--navy));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: .95rem;
}
.brand .biz { color: var(--navy); }
.brand .tax { color: var(--accent); }
.nav a { color: var(--body); margin-left: 22px; font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--navy); text-decoration: none; }

/* Hamburger: nascosto su desktop, mostrato sotto 720px */
.nav-toggle { display: none; }
@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 42px; height: 42px; padding: 10px; margin: 0;
        border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer;
    }
    .nav-toggle-bar {
        display: block; width: 100%; height: 2px; border-radius: 2px; background: var(--navy);
        transition: transform .22s ease, opacity .22s ease;
    }
    .nav {
        position: fixed; top: 62px; left: 0; right: 0; z-index: 19;
        display: flex; flex-direction: column;
        background: var(--bg); border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 24px rgba(0,0,0,.07);
        max-height: 0; overflow: hidden; transition: max-height .26s ease;
    }
    body.nav-open .nav { max-height: 80vh; overflow-y: auto; }
    .nav a { margin: 0; padding: 15px 20px; font-size: 1.02rem; border-top: 1px solid var(--border); }
    .nav a:first-child { border-top: none; }
    /* hamburger → X quando aperto */
    body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
    body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
.lang-switch { margin-left: 22px; font-size: .9rem; color: var(--muted); }
.lang-switch a.active { color: var(--navy); font-weight: 700; }

/* ---- Hero ---- */
.hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 46px 0 40px; }
.hero h1 { font-size: 2.35rem; letter-spacing: -0.02em; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0; }

/* ---- Layout calcolatore ---- */
.calc-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 34px 0; }
@media (max-width: 760px) { .calc-wrap { grid-template-columns: 1fr; } }

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card h2 { font-size: 1.2rem; margin-bottom: 18px; }

/* ---- Form ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input[type="number"], .field select {
    width: 100%; padding: 10px 12px; font-size: 1rem; font-family: var(--font);
    border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(4,120,87,.12); }
.field.check { display: flex; align-items: center; gap: 10px; }
.field.check input { width: auto; }
.field.check label { margin: 0; font-weight: 500; color: var(--body); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }

.btn {
    display: inline-block; width: 100%; padding: 12px 18px; font-size: 1rem; font-weight: 700;
    color: #fff; background: var(--accent); border: none; border-radius: 8px; cursor: pointer;
    font-family: var(--font); transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: transparent; color: var(--muted); border: 1px solid var(--border); width: auto; padding: 8px 14px; font-weight: 500; }

/* ---- Box risultato (evidente, con scomposizione) ---- */
.result-empty { color: var(--muted); font-size: .95rem; text-align: center; padding: 30px 0; }
.result-net {
    background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 8px;
    padding: 18px 20px; margin-bottom: 18px; text-align: center;
}
.result-net .label { font-size: .85rem; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .04em; }
.result-net .amount { font-size: 2rem; font-weight: 800; color: var(--accent-dark); }
.result-net .rate { font-size: .9rem; color: var(--muted); }

.breakdown { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.breakdown td { padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: .95rem; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.breakdown tr.emphasis td { font-weight: 800; color: var(--text); border-top: 2px solid var(--text); border-bottom: none; }
.breakdown td .note { display: block; font-size: .78rem; color: var(--muted); }
.val-neg { color: var(--danger); }

/* ---- Assumptions / disclaimer / fonti ---- */
.assumptions { font-size: .85rem; color: var(--muted); background: var(--bg-alt); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.assumptions ul { margin: 6px 0 0; padding-left: 18px; }

.sources-box { border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: 8px; padding: 14px 16px; background: #fff; margin-bottom: 14px; }
.sources-box h3 { font-size: .95rem; color: var(--navy); margin-bottom: 8px; }
.sources-box ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.sources-box .updated { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* Riquadro cassa (saldo + acconti) */
.cashflow-box { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; background: #fff; margin-bottom: 14px; }
.cashflow-box h3 { font-size: .95rem; color: var(--accent-dark); margin-bottom: 8px; }
.cashflow-box .breakdown { margin-bottom: 8px; }
.cashflow-box .updated { font-size: .82rem; color: var(--muted); }

.disclaimer { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }

.preview-warning {
    background: var(--warn-bg); border: 1px solid #FCD34D; color: var(--warn);
    border-radius: 8px; padding: 10px 14px; font-size: .85rem; margin-bottom: 16px; font-weight: 500;
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 50px; padding: 28px 0; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; font-size: .85rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-links a { color: var(--body); }
.legal h1 { font-size: 2rem; margin-bottom: 16px; }
.legal h2 { font-size: 1.3rem; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--body); line-height: 1.7; }
.legal ul { padding-left: 22px; }

.badge-preview { display: inline-block; background: var(--warn-bg); color: var(--warn); font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; vertical-align: middle; }

/* ---- SSR: breadcrumb, article, griglie ---- */
.breadcrumb { padding: 12px 20px; font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 4px; }
.article { padding: 20px 20px 10px; }
.article h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 14px; }
.article-section { margin: 26px 0; }
.article-section h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.article-section ol, .article-section ul { padding-left: 20px; }
.article-section li { margin-bottom: 4px; }
.section-title { margin: 30px 0 16px; font-size: 1.4rem; }
.related { font-size: .9rem; color: var(--muted); margin-top: 24px; }
.related a { margin-right: 4px; }

.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 40px; }
.calc-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; text-decoration: none; transition: border-color .15s, transform .15s; }
.calc-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.calc-card-country { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); font-weight: 700; }
.calc-card-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.calc-card-desc { font-size: .85rem; color: var(--muted); }

.faq details { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.faq summary { font-weight: 600; color: var(--text); cursor: pointer; }
.faq details[open] summary { margin-bottom: 6px; }

.glossary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.glossary-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: 8px; background: #fff; text-decoration: none; }
.glossary-item:hover { border-color: var(--accent); text-decoration: none; }
.glossary-item span { font-size: .82rem; color: var(--muted); }
.glossary-item strong { color: var(--navy); font-size: .98rem; }
.glossary-search-wrap { margin: 18px 0 22px; }
.glossary-search { width: 100%; max-width: 480px; padding: 12px 16px; font-size: 1rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.glossary-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,163,74,.12); }
.glossary-empty { color: var(--muted); padding: 20px 0; }
.glossary-src { font-size: .82rem; color: var(--muted); margin-top: 24px; }
.article .lede { font-size: 1.08rem; color: var(--muted); line-height: 1.6; max-width: 70ch; }

.compare-links { display: flex; gap: 12px; margin: 18px 0; }
.compare-links .btn { width: auto; }
.compare-table th { text-align: left; padding: 8px 4px; border-bottom: 2px solid var(--text); font-size: .9rem; }
.compare-table td { vertical-align: top; }

/* ---- Blog ---- */
.lead-sub { color: var(--muted); font-size: 1.05rem; max-width: 680px; margin-bottom: 18px; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.blog-cats a { font-size: .88rem; padding: 6px 13px; border: 1px solid var(--border); border-radius: 20px; color: var(--body); }
.blog-cats a:hover, .blog-cats a.active { background: var(--navy); color: #fff; border-color: var(--navy); text-decoration: none; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-bottom: 40px; }
.post-grid-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
@media (max-width: 860px) { .post-grid-3 { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(15,23,42,.10); text-decoration: none; }
.post-card img { width: 100%; height: auto; display: block; aspect-ratio: 1200/630; object-fit: cover; }
.post-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.post-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-dark); font-weight: 700; }
.post-cat a { color: var(--accent-dark); }
.post-title { font-size: 1.12rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.post-excerpt { font-size: .9rem; color: var(--muted); }
.post-meta { font-size: .8rem; color: var(--muted); }

.blog-post { max-width: 760px; }
.blog-post h1 { font-size: 2.2rem; letter-spacing: -0.02em; margin: 6px 0 10px; }
.post-hero { width: 100%; height: auto; border-radius: 12px; margin: 16px 0 26px; box-shadow: var(--shadow); }
.post-body { font-size: 1.06rem; line-height: 1.75; color: #1f2937; }
.post-body h2 { font-size: 1.5rem; margin: 34px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.post-body h3 { font-size: 1.2rem; margin: 24px 0 8px; }
.post-body p { margin: 0 0 1.1em; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 0 0 1.1em; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--navy); text-decoration: underline; }
.post-body table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; }
.post-body th { background: var(--bg-alt); font-weight: 700; }
.post-body table tr:nth-child(even) td { background: #fafbfc; }
.related-tools { margin: 26px 0; padding: 14px 18px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 10px; font-size: .95rem; }
.related-tools a { color: var(--accent-dark); font-weight: 600; text-transform: capitalize; }

/* Latest posts on home */
.home-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-bottom: 30px; }

/* ---- Comparatore paesi ---- */
.cmp-summary { display: flex; gap: 14px; margin: 20px 0; flex-wrap: wrap; }
.cmp-badge { flex: 1; min-width: 180px; border-radius: 10px; padding: 16px 18px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.cmp-badge span { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.cmp-badge strong { font-size: 1.25rem; }
.cmp-badge em { font-style: normal; font-size: 1rem; font-weight: 700; }
.cmp-badge.best { background: #ECFDF5; border-color: #A7F3D0; color: var(--accent-dark); }
.cmp-badge.worst { background: #FEF2F2; border-color: #FECACA; color: var(--danger); }
.compare-rank th { text-align: left; padding: 8px 6px; border-bottom: 2px solid var(--text); font-size: .85rem; }
.compare-rank td { padding: 7px 6px; font-variant-numeric: tabular-nums; }
.compare-rank tr.cmp-best td { background: #ECFDF5; font-weight: 700; }
.compare-rank tr.cmp-worst td { background: #FEF2F2; }

/* Card strumenti nella home */
.tools-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 10px 0 30px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: #fff; text-decoration: none; box-shadow: var(--shadow); }
.tool-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.tool-card .t { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.tool-card .d { font-size: .88rem; color: var(--muted); }

/* ===== Redesigned home ===== */
/* Hero band (deliberate dark band over a light page) */
.hero-v2 { background: linear-gradient(135deg, #0F172A 0%, #0b3a52 52%, #065f46 100%); color: #fff; margin-bottom: 44px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 48px; align-items: center; padding: 60px 20px 34px; }
.hero-copy { animation: heroIn .6s cubic-bezier(.16,1,.3,1) both; }
.hero-copy h1 { color: #fff; font-size: 3rem; line-height: 1.09; letter-spacing: -0.025em; margin: 0 0 16px; }
.hero-lead { color: #cdeadf; font-size: 1.14rem; line-height: 1.6; max-width: 34ch; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-hero { display: inline-block; padding: 13px 26px; border-radius: 10px; font-weight: 700; font-size: 1rem; text-decoration: none; transition: transform .12s, background .12s, border-color .12s; }
.btn-hero.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(4,120,87,.4); }
.btn-hero.primary:hover { background: #10b981; }
.btn-hero.ghost { color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-hero.ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-hero:hover { text-decoration: none; transform: translateY(-2px); }

.hero-preview { animation: heroIn .7s cubic-bezier(.16,1,.3,1) .1s both; }
.preview-card { background: #fff; color: var(--body); border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.32); max-width: 380px; margin-left: auto; }
.preview-head { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); font-size: 1.02rem; margin-bottom: 12px; }
.preview-head .flag { font-size: 1.25rem; }
.preview-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .94rem; }
.preview-row b { font-variant-numeric: tabular-nums; color: var(--text); }
.preview-row .neg { color: var(--danger); }
.preview-row.net { border-bottom: none; border-top: 2px solid var(--text); margin-top: 4px; padding-top: 12px; font-size: 1.06rem; }
.preview-row.net b { color: var(--accent-dark); font-size: 1.2rem; }
.preview-foot { margin-top: 12px; font-size: .8rem; color: var(--muted); }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 20px 20px 30px; border-top: 1px solid rgba(255,255,255,.14); }
.stat-strip b { display: block; font-size: 1.7rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-strip span { display: block; margin-top: 5px; font-size: .84rem; color: #a7f3d0; }

.home-section { margin: 46px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; border-bottom: 2px solid var(--text); padding-bottom: 9px; }
.section-head h2 { font-size: 1.55rem; margin: 0; }
.see-all { font-size: .92rem; font-weight: 600; color: var(--accent-dark); white-space: nowrap; }
.section-sub { color: var(--muted); margin: 12px 0 22px; max-width: 640px; }

/* Tools bento (2 tiles, one tinted) */
.bento-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bento-tile { display: flex; flex-direction: column; padding: 28px; border-radius: 16px; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.bento-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,23,42,.10); text-decoration: none; }
.bento-tile.accent { background: linear-gradient(135deg, #ECFDF5, #e6f3ff); border-color: #A7F3D0; }
.bento-tile h3 { font-size: 1.3rem; margin: 0 0 8px; color: var(--text); }
.bento-tile p { color: var(--body); margin: 0 0 16px; font-size: .96rem; }
.tile-cta { margin-top: auto; font-weight: 700; color: var(--accent-dark); }

/* Blog: featured + side */
.blog-feature { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.feature-post { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.feature-post:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,23,42,.10); text-decoration: none; }
.feature-post img { width: 100%; aspect-ratio: 1200/630; object-fit: cover; }
.feature-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.feature-title { font-size: 1.3rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.feature-excerpt { color: var(--muted); font-size: .95rem; }
.feature-side { display: flex; flex-direction: column; gap: 14px; }
.mini-post { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: var(--shadow); text-decoration: none; transition: transform .12s; }
.mini-post:hover { transform: translateY(-2px); text-decoration: none; }
.mini-post img { width: 96px; height: 72px; object-fit: cover; }
.mini-title { font-size: .9rem; font-weight: 600; color: var(--text); line-height: 1.3; padding: 8px 12px 8px 0; }

/* Calculators by country */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 16px; }
.country-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.country-card:hover { box-shadow: 0 6px 18px rgba(15,23,42,.09); transform: translateY(-2px); }
.country-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-weight: 700; color: var(--text); background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.country-head .flag { font-size: 1.35rem; line-height: 1; }
.country-forms { display: flex; flex-direction: column; padding: 6px 0; }
.country-forms a { padding: 8px 16px; font-size: .92rem; color: var(--body); border-left: 3px solid transparent; }
.country-forms a:hover { background: #ECFDF5; color: var(--accent-dark); border-left-color: var(--accent); text-decoration: none; }

/* Calculator finder: search + filter chips + grid */
.calc-finder { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
#calc-search { flex: 1; min-width: 240px; padding: 13px 16px; font-size: 1rem; font-family: var(--font); border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
#calc-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(4,120,87,.12); }
.calc-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.calc-filter { padding: 10px 18px; border: 1px solid var(--border); border-radius: 22px; background: #fff; font-weight: 600; font-size: .9rem; font-family: var(--font); color: var(--body); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.calc-filter:hover { border-color: var(--navy); }
.calc-filter.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.calc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 12px; }
.calc-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow); text-decoration: none; transition: transform .12s, border-color .12s, box-shadow .12s; }
.calc-item:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 16px rgba(15,23,42,.08); text-decoration: none; }
.ci-flag { font-size: 1.45rem; line-height: 1; }
.ci-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ci-country { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); font-weight: 700; }
.ci-form { font-size: .95rem; color: var(--text); font-weight: 600; }
.ci-arrow { color: var(--muted); font-weight: 700; }
.calc-empty { text-align: center; color: var(--muted); padding: 34px 0; }

/* SEO content block */
.seo-content { max-width: 768px; margin: 52px auto 24px; }
.seo-content h2 { font-size: 1.75rem; letter-spacing: -0.01em; margin-bottom: 14px; }
.seo-content h3 { font-size: 1.25rem; margin: 30px 0 8px; color: var(--text); }
.seo-content p { color: var(--body); line-height: 1.78; margin-bottom: 1.1em; font-size: 1.02rem; }
.seo-content a { color: var(--navy); text-decoration: underline; }
.seo-content a:hover { color: var(--accent-dark); }

@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-copy, .hero-preview { animation: none; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; padding: 44px 20px 26px; }
  .hero-copy h1 { font-size: 2.3rem; }
  .preview-card { margin: 0 auto; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .bento-2, .blog-feature { grid-template-columns: 1fr; }
}

/* QW-2/5/8: byline, rate table, currency symbol, footer operator */
.byline { font-size: .85rem; color: var(--muted); margin: 2px 0 18px; }
.byline a { color: var(--navy); }
.cur-sym { font-weight: 600; }
.rate-table-section { margin: 26px 0; }
.rate-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .92rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rate-table caption { text-align: left; font-size: .8rem; color: var(--muted); padding: 8px 2px; caption-side: top; }
.rate-table th { text-align: left; background: #eef4f0; color: var(--navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.rate-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.rate-table tbody tr:last-child td { border-bottom: none; }
.rate-table td:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); white-space: nowrap; }
.rate-src { font-size: .78rem; color: var(--muted); margin: 4px 0 0; }
.footer-operator { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.footer-operator a { color: inherit; text-decoration: underline; }

/* QW-7: TL;DR answer-first box */
.tldr { background: #ECFDF5; border: 1px solid #A7F3D0; border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; margin: 6px 0 20px; font-size: .98rem; color: var(--text); }
.tldr strong { color: var(--accent-dark); }

/* A5: blog card title as real heading (reset global h2 styles) */
h2.post-title { font-size: 1.05rem; margin: 0; line-height: 1.35; color: var(--text); font-weight: 700; }

/* B12: result breakdown chart */
.result-chart { margin: 4px 0 16px; }
.result-chart svg { border-radius: 6px; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* B10: tax-rates hub table */
.rates-hub-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .9rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rates-hub-table th { text-align: left; background: #eef4f0; color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rates-hub-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rates-hub-table tbody tr:hover td { background: #f9fbfa; }
.rates-hub-table td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Cookie consent banner */
#cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--navy); color: #fff; box-shadow: 0 -2px 12px rgba(15,23,42,.18); }
#cookie-banner .cc-inner { max-width: var(--maxw); margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; justify-content: space-between; }
#cookie-banner p { margin: 0; font-size: .85rem; line-height: 1.5; max-width: 70ch; }
#cookie-banner a { color: #fff; text-decoration: underline; }
#cookie-banner .cc-btns { display: flex; gap: 10px; flex-shrink: 0; }
#cookie-banner .cc-btn { padding: 9px 20px; font-size: .9rem; font-weight: 700; border-radius: 8px; cursor: pointer; border: 1px solid rgba(255,255,255,.4); font-family: var(--font); }
#cookie-banner .cc-reject { background: transparent; color: #fff; }
#cookie-banner .cc-reject:hover { background: rgba(255,255,255,.12); }
#cookie-banner .cc-accept { background: var(--accent); color: #fff; border-color: var(--accent); }
#cookie-banner .cc-accept:hover { background: var(--accent-dark); }
@media (max-width: 620px) { #cookie-banner .cc-inner { flex-direction: column; align-items: stretch; } #cookie-banner .cc-btns { justify-content: stretch; } #cookie-banner .cc-btn { flex: 1; } }

/* ---- Home: sezione blog ampliata (featured + griglia + categorie) ---- */
.blog-home .section-sub { max-width: 72ch; }
.blog-cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.blog-cat-nav a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
    background: #fff; color: var(--body); font-size: .85rem; font-weight: 600;
}
.blog-cat-nav a:hover { border-color: var(--accent); color: var(--navy); text-decoration: none; }
.blog-cat-nav a span {
    background: var(--bg-alt); color: var(--muted); border-radius: 999px;
    padding: 1px 7px; font-size: .75rem; font-weight: 700;
}

/* Articolo in evidenza: immagine a sinistra, testo a destra */
.post-featured {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 0; margin-bottom: 22px; align-items: stretch;
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    background: #fff; box-shadow: var(--shadow);
}
.post-featured:hover { border-color: var(--accent); text-decoration: none; }
.post-featured img { width: 100%; height: 100%; min-height: 240px; object-fit: cover; display: block; }
.post-featured .post-card-body { padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.post-featured h3.post-title { font-size: 1.5rem; line-height: 1.25; margin: 0; }
.post-featured .post-excerpt { font-size: .98rem; line-height: 1.6; -webkit-line-clamp: 4; }
@media (max-width: 780px) {
    .post-featured { grid-template-columns: 1fr; }
    .post-featured img { min-height: 180px; max-height: 220px; }
    .post-featured .post-card-body { padding: 20px; }
    .post-featured h3.post-title { font-size: 1.25rem; }
}

/* Griglia dei 6 articoli sotto */
.post-grid-6 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.blog-home-cta { margin-top: 24px; text-align: center; }
.blog-home-cta .btn.secondary { padding: 11px 24px; font-weight: 600; }

/* Hub per paese */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 16px 0 30px; }
.hub-card { display: flex; flex-direction: column; gap: 5px; padding: 15px 17px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; background: #fff; }
.hub-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.hub-card strong { color: var(--navy); font-size: .95rem; line-height: 1.3; }
.hub-card span { font-size: .82rem; color: var(--muted); }
.hub-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 14px 0 24px; }
.hub-articles a { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.hub-articles a:hover { border-color: var(--accent); text-decoration: none; }
.hub-articles strong { color: var(--navy); font-size: .9rem; line-height: 1.3; }
.hub-articles span { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.footer-countries { font-size: .82rem; }
.footer-countries a { color: var(--body); }

/* ============================================================
   Mobile: nessuno scroll orizzontale della pagina.
   L'header è position:sticky → usare overflow-x:clip (NON hidden,
   che romperebbe lo sticky). I media non superano mai la larghezza.
   ============================================================ */
html { overflow-x: clip; }
body { overflow-x: clip; max-width: 100%; }
img, svg, video, canvas, iframe, embed, object { max-width: 100%; }
.result-chart svg { width: 100%; }
.chart-legend { flex-wrap: wrap; }
/* Testo/URL molto lunghi (link fonti, glossario) vanno a capo invece di sforare. */
.post-body, .sources-box, .article-section, .seo-content, .breakdown td { overflow-wrap: break-word; }

/* Tabelle larghe (hub aliquote, confronti, tabelle degli articoli): su schermi
   stretti scorrono DENTRO il proprio box, così restano leggibili senza
   trascinare l'intera pagina verso destra. */
@media (max-width: 640px) {
    .rates-hub-table, .rate-table, .compare-table, .post-body table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
