/* Kit72Hour.com — foglio di stile principale / main stylesheet
   Mobile-first, nessun framework, nessuna risorsa esterna. */

:root {
  --ink: #1b2830;
  --muted: #4a5a64;
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-alt: #eef4f3;
  --line: #d6d0c4;
  --brand: #0d5c63;
  --brand-dark: #083f45;
  --brand-soft: #dcecea;
  --accent: #a84a12;
  --accent-soft: #fbeadb;
  --news: #33507a;
  --news-soft: #e3eaf5;
  --alert: #8a2b0f;
  --alert-soft: #fde4d8;
  --focus: #12202a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 35, 45, .06), 0 6px 18px rgba(20, 35, 45, .06);
  --max: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
@media (min-width: 48rem) { body { font-size: 1.125rem; } }

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--brand-dark); font-weight: 700; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.9rem); margin-top: 1.8em; }
h3 { font-size: 1.2rem; margin-top: 1.4em; }
p, ul, ol, dl, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: .3em; }

a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--brand-dark); text-decoration-thickness: .14em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.site-footer :focus-visible { outline-color: #ffffff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 1000;
  background: var(--brand-dark); color: #fff; padding: .7rem 1rem; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: .75rem; color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.1rem; }
@media (min-width: 48rem) { .container { padding: 0 1.75rem; } }
.narrow { max-width: 48rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #f8f6f1;
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; min-height: 4rem; }

.brand {
  display: inline-flex; align-items: center; gap: .55rem; margin-right: auto;
  font-weight: 800; font-size: 1.15rem; color: var(--brand-dark); text-decoration: none; letter-spacing: -.01em;
}
.brand img { width: 2.25rem; height: 2.25rem; }
.brand span small { display: none; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
@media (min-width: 30rem) { .brand span small { display: block; } }
.brand, .lang-switch, .menu-toggle { flex-shrink: 0; }
.brand { flex-shrink: 1; min-width: 0; }

.lang-switch { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.lang-switch a, .lang-switch span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 .55rem; font-weight: 700; font-size: .95rem; text-decoration: none;
}
.lang-switch span[aria-current] { background: var(--brand); color: #fff; }
.lang-switch a { color: var(--brand-dark); }
.lang-switch a:hover { background: var(--brand-soft); }

.menu-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 2.75rem; min-width: 2.75rem; padding: 0 .85rem;
  font: inherit; font-weight: 700; font-size: .95rem; color: #fff;
  background: var(--brand); border: 0; border-radius: 999px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: rgba(13, 92, 99, .25); -webkit-appearance: none; appearance: none;
}
.menu-toggle:hover { background: var(--brand-dark); }
.menu-toggle .bars { position: relative; width: 1.15rem; height: .9rem; }
.menu-toggle .bars span { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-toggle .bars span:nth-child(1) { top: 0; }
.menu-toggle .bars span:nth-child(2) { top: .4rem; }
.menu-toggle .bars span:nth-child(3) { top: .8rem; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(.4rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-.4rem) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .menu-toggle .bars span { transition: none; } }

.site-nav { display: none; }
/* Menu mobile nel flusso della pagina (niente posizionamento assoluto): più affidabile su Safari iOS */
.site-nav.is-open {
  display: block; position: static; flex: 0 0 calc(100% + 2.2rem); order: 10; margin: 0 -1.1rem;
  background: var(--surface); border-top: 1px solid var(--line);
  max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* Senza JavaScript il menu resta visibile / Without JS the menu stays visible */
@media (min-width: 48rem) { .site-nav.is-open { flex-basis: calc(100% + 3.5rem); margin: 0 -1.75rem; } }
.no-js .site-nav { display: block; position: static; width: 100%; }
.no-js .menu-toggle { display: none; }
.no-js .header-inner { flex-wrap: wrap; }

.site-nav ul { list-style: none; margin: 0; padding: .5rem 1.1rem 1rem; }
.site-nav li + li { margin-top: 0; border-top: 1px solid #ece7dd; }
.site-nav a {
  touch-action: manipulation; -webkit-tap-highlight-color: rgba(13, 92, 99, .2);
  display: flex; align-items: center; min-height: 3rem; padding: .35rem .25rem;
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.site-nav a:hover { color: var(--brand); }
.site-nav a[aria-current="page"] { color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); padding-left: .9rem; }

@media (min-width: 64rem) {
  .menu-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; box-shadow: none; border: 0; background: transparent; max-height: none; overflow: visible; flex: 0 1 auto; order: 0; margin: 0; }
  .site-nav ul { display: flex; gap: .15rem; padding: 0; }
  .site-nav li + li { border: 0; }
  .site-nav a { min-height: 2.75rem; padding: .3rem .6rem; border-radius: 999px; font-size: .95rem; }
  .site-nav a[aria-current="page"] { box-shadow: none; padding-left: .6rem; background: var(--brand-soft); color: var(--brand-dark); }
  .header-inner { gap: 1rem; flex-wrap: nowrap; }
}

/* ---------- Layout blocks ---------- */
main { display: block; padding-bottom: 3rem; }
.page-head { padding: 2.2rem 0 1.4rem; }
.page-head p.lead { font-size: 1.15em; color: var(--muted); max-width: 46rem; }

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: .25rem .65rem; border-radius: 999px; margin-bottom: .9rem;
}
.badge::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.badge-guide { color: var(--brand-dark); background: var(--brand-soft); }
.badge-news { color: var(--news); background: var(--news-soft); }
.badge-alert { color: var(--alert); background: var(--alert-soft); }

.hero { padding: 2rem 0 1.5rem; }
.hero-grid { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 3rem; } .hero { padding: 3.5rem 0 2.5rem; } }
.hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); }
.hero .lead { font-size: 1.2em; color: var(--muted); }
.hero-art { border-radius: var(--radius); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.4rem 0 .5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .7rem 1.25rem; border-radius: 999px;
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--brand-dark); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--muted); }
.btn-danger { background: var(--alert); color: #fff; }
.btn-danger:hover { background: #6b200b; color: #fff; }
.btn img { width: 1.25rem; height: 1.25rem; }
@media (max-width: 30rem) { .actions .btn { width: 100%; } }

.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.2rem 0; padding: 0; list-style: none; }
@media (min-width: 40rem) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .card-grid.three { grid-template-columns: repeat(3, 1fr); } }
.card-grid > li { margin: 0; }
.card {
  height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.1rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: .2rem; }
.card > :last-child { margin-bottom: 0; }
.card .icon { width: 2.6rem; height: 2.6rem; margin-bottom: .4rem; }
.card-link { position: relative; }
.card-link a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:hover { border-color: var(--brand); }
.card-link:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.card-link a:focus-visible { outline: none; }

.note {
  border-left: 5px solid var(--brand); background: var(--surface-alt);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.4rem 0;
}
.note > :last-child { margin-bottom: 0; }
.note-warm { border-left-color: var(--accent); background: var(--accent-soft); }
.note-alert { border-left-color: var(--alert); background: var(--alert-soft); }
.note strong:first-child { color: var(--brand-dark); }

.principles { display: grid; gap: 1rem; margin: 1.5rem 0; padding: 0; list-style: none; counter-reset: p; }
@media (min-width: 48rem) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principles li { margin: 0; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 1.1rem 1.2rem; counter-increment: p; }
.principles h3 { margin: .3rem 0 .4rem; }
.principles li::before { content: counter(p); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: .5rem; }

.section { padding: 1rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.5rem 0 2rem; margin: 2rem 0; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0 2rem; }
.toc h2 { font-size: 1rem; margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.toc ol { margin: 0; }
.toc li { padding: .15rem 0; }

.meta { font-size: .92rem; color: var(--muted); }

/* ---------- Checklist ---------- */
.tools {
  display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 1rem 0 1.5rem; box-shadow: var(--shadow);
}
@media (min-width: 56rem) { .tools { grid-template-columns: 1fr auto; align-items: center; } }
.progress-wrap label, .progress-text { font-weight: 700; }
progress { width: 100%; height: 1rem; border-radius: 999px; overflow: hidden; appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: #ece7dd; }
progress::-webkit-progress-bar { background: #ece7dd; }
progress::-webkit-progress-value { background: var(--brand); }
progress::-moz-progress-bar { background: var(--brand); }
.tool-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.tool-buttons .btn { min-height: 2.9rem; padding: .55rem 1rem; font-size: .95rem; }
.reset-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .25rem; }
.reset-confirm[hidden] { display: none; }
.status-msg { min-height: 1.5em; font-weight: 600; color: var(--brand-dark); margin: 0; }

fieldset.personalize { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.5rem; background: var(--surface); }
fieldset.personalize legend { font-weight: 700; padding: 0 .4rem; color: var(--brand-dark); }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.9rem; padding: .3rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); cursor: pointer; font-weight: 600; }
.chip input { width: 1.25rem; height: 1.25rem; accent-color: var(--brand); }

.check-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem .6rem; margin: 0 0 1.2rem; box-shadow: var(--shadow);
}
.check-group[hidden] { display: none; }
.check-group h3 { display: flex; align-items: center; gap: .7rem; margin: 0 0 .5rem; }
.check-group h3 img { width: 2.2rem; height: 2.2rem; flex: none; }
.check-group .group-count { margin-left: auto; font-size: .85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.check-group .group-intro { color: var(--muted); font-size: .95em; margin-bottom: .5rem; }
.check-group.adapt { border-style: dashed; border-color: var(--accent); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { margin: 0; border-top: 1px solid #efeae1; }
.checklist li:first-child { border-top: 0; }
.checklist label {
  display: grid; grid-template-columns: 1.6rem 1fr; gap: .8rem; align-items: start;
  padding: .7rem .2rem; cursor: pointer; min-height: 3rem;
}
.checklist input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: .1rem 0 0;
  width: 1.6rem; height: 1.6rem; border: 2px solid var(--brand); border-radius: 6px; background: #fff;
  display: grid; place-items: center; cursor: pointer;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.checklist input[type="checkbox"]::after {
  content: ""; width: .5rem; height: .9rem; border: solid #fff; border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -2px); opacity: 0;
}
.checklist input[type="checkbox"]:checked { background: var(--brand); }
.checklist input[type="checkbox"]:checked::after { opacity: 1; }
.checklist input[type="checkbox"]:checked + span { color: var(--muted); }
.checklist .hint { display: block; font-size: .9em; color: var(--muted); }

/* ---------- Family plan template ---------- */
.plan-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.plan-sheet h2 { margin-top: .2rem; font-size: 1.35rem; display: flex; align-items: center; gap: .6rem; }
.plan-sheet h2 .num { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: 1rem; flex: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.blank-table { width: 100%; border-collapse: collapse; font-size: .95em; min-width: 32rem; }
.blank-table th, .blank-table td { border: 1px solid #b9b2a5; padding: .5rem .6rem; text-align: left; vertical-align: top; }
.blank-table th { background: var(--surface-alt); color: var(--brand-dark); font-weight: 700; }
.blank-table td { height: 2.6rem; }
.blank-table td.prefilled { color: var(--ink); font-weight: 600; }
.fill-lines { list-style: none; padding: 0; margin: 0; }
.fill-lines li { margin: 0; padding: .9rem 0 .35rem; border-bottom: 1px solid #b9b2a5; }
.fill-lines li span { font-weight: 600; }
.write-box { border: 1px solid #b9b2a5; border-radius: 6px; min-height: 5.5rem; margin: .4rem 0 1rem; }
.tickbox-list { list-style: none; padding: 0; columns: 1; }
@media (min-width: 48rem) { .tickbox-list { columns: 2; } }
.tickbox-list li { break-inside: avoid; margin: 0 0 .5rem; padding-left: 2rem; position: relative; }
.tickbox-list li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1.2rem; height: 1.2rem; border: 2px solid var(--brand); border-radius: 4px; }

/* ---------- News / events ---------- */
.filter-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; padding: 0; list-style: none; }
.filter-legend li { margin: 0; }
.event {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.25rem .6rem; margin: 0 0 1.25rem; box-shadow: var(--shadow); border-top: 6px solid var(--news);
}
.event.italy { border-top-color: var(--brand); }
.event.alert { border-top-color: var(--alert); }
.event h3 { margin-top: .1rem; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: .5rem 0 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.facts > div { display: grid; grid-template-columns: 1fr; padding: .55rem .8rem; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
@media (min-width: 40rem) { .facts > div { grid-template-columns: 11rem 1fr; gap: 1rem; } }
.facts dt { font-weight: 700; color: var(--brand-dark); }
.facts dd { margin: 0; }
.facts dd ul { margin: .2rem 0 0; }
.sources-list { font-size: .95em; }

.example {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.2rem; margin: 0 0 1rem;
}
.example .msg {
  background: #f1f1ef; border: 1px solid #ddd8ce; border-radius: 14px 14px 14px 4px; padding: .7rem .9rem; margin: .4rem 0 .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; overflow-wrap: anywhere;
}
.example .why { margin: 0 0 .5rem; }
.example h3 { margin-top: .2rem; font-size: 1.1rem; }

.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: .2rem 0 .6rem 3rem; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: .1rem; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }

.source-card h3 { margin-bottom: .2rem; }
.source-card .url { font-size: .9em; color: var(--muted); overflow-wrap: anywhere; }
.source-card .who { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .2rem; }

.figure-inline { float: right; width: 9rem; margin: 0 0 1rem 1.2rem; }
@media (max-width: 40rem) { .figure-inline { float: none; display: block; width: 7rem; margin: 0 0 .8rem; } }
.clearfix::after { content: ""; display: table; clear: both; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dark); color: #e7f0ef; padding: 2.2rem 0 5.5rem; font-size: .95rem; }
.site-footer a { color: #ffffff; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .05em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 2.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.2); margin-top: 1.5rem; padding-top: 1rem; font-size: .88rem; color: #cfe0de; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 3rem; padding: 0 1rem; border-radius: 999px; border: 2px solid #fff;
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; transform: translateY(.75rem);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--brand-dark); }
.back-to-top svg { width: 1.1rem; height: 1.1rem; }
.back-to-top:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } }

.print-only { display: none; }
.section > h2:first-child { margin-top: 1.2rem; }
