/* =========================================================================
   Bacchetta S.r.l. — foglio di stile unico.
   Ordine: font, variabili, base, utility, componenti, pagine, responsive.
   ========================================================================= */

/* Font ospitati sul nostro server (variabili, licenza SIL OFL): nessuna richiesta a Google. */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/instrument-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/instrument-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #1C1E21;
  --text: #4A4E54;
  --muted: #5D6168;
  --faint: #B5B6B2;
  --line: #DCDCD7;
  --line-soft: #EDEDEA;
  --bg: #F5F5F2;
  --tile: #E9E9E5;
  --red: #E4261E;
  --red-dark: #C41D16;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --header-h: 77px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
/* Passaggio tra pagine con dissolvenza; l'header resta fermo (browser che supportano le view transitions). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Instrument Sans', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red-dark); }
::selection { background: var(--red); color: #fff; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; } /* vince su display:flex/grid dei componenti */
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 500; }
.skip-link:focus { top: 16px; color: #fff; }

.site {
  min-height: 100vh; display: flex; flex-direction: column;
  background-image: linear-gradient(to right, rgba(28,30,33,.045) 1px, transparent 1px), linear-gradient(to bottom, rgba(28,30,33,.045) 1px, transparent 1px);
  background-size: 96px 96px;
}
main { flex: 1; }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* ---------- Utility ---------- */
.mono { font-family: var(--mono); }
.small-mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.c-text { color: var(--text); }
.kicker { font-family: var(--mono); font-size: 13px; color: var(--red-dark); letter-spacing: .06em; text-transform: uppercase; }
.label { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.link { text-decoration: underline; text-underline-offset: 3px; }
.stack-6, .stack-10, .stack-16, .stack-20, .stack-28, .stack-40 { display: flex; flex-direction: column; }
.stack-6 { gap: 6px; } .stack-10 { gap: 10px; } .stack-16 { gap: 16px; } .stack-20 { gap: 20px; }
.stack-28 { gap: 28px; } .stack-40 { gap: 40px; }
/* Griglia che va a capo da sola: --min è la larghezza minima di una colonna. */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 420px)), 1fr)); }
.row-split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 24px; }

/* ---------- Tipografia ---------- */
.h1 { font-size: clamp(40px, 5vw, 68px); line-height: 1.03; letter-spacing: -.025em; }
.h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -.02em; }
.h2-sm { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.02em; }
.lead { font-size: 17px; line-height: 1.6; color: var(--text); max-width: 520px; }
.narrow { max-width: 480px; }
.body { font-size: 15px; line-height: 1.55; color: var(--text); }
.body-lg { font-size: 16px; line-height: 1.6; color: var(--text); }

/* ---------- Componenti ---------- */
.photo { border-radius: 8px; overflow: hidden; position: relative; background: var(--tile); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card { border-radius: 8px; background: #fff; border: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 15px 26px; border: 1px solid transparent; border-radius: 6px; font-size: 16px; font-weight: 500; transition: background .15s, color .15s; }
button.btn { cursor: pointer; font-family: inherit; }
.btn-sm { padding: 13px 20px; font-size: 15px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--red); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--red); color: #fff; }
.btn .tag { font-family: var(--mono); font-size: 12px; opacity: .75; }
.btn-disabled { background: var(--line-soft); color: #9A9DA2; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

.rows { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.rows > * { border-bottom: 1px solid var(--line); }


/* ---------- Header ---------- */
.topbar { view-transition-name: topbar; position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; min-height: 76px; }
.logo { padding: 12px 0; }
.logo svg { display: block; width: 164px; height: 52px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav a { padding: 10px 14px; font-size: 15px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--red); }
.lang { display: flex; gap: 6px; margin-left: 12px; padding-left: 16px; border-left: 1px solid var(--line); font-family: var(--mono); font-size: 13px; color: var(--muted); }
.lang b { color: var(--ink); font-weight: 500; }
.lang i { font-style: normal; color: var(--faint); }
/* Il link della lingua non attiva non deve ereditare dimensione e peso dei link del menu. */
.nav .lang a { padding: 0; border: 0; font-size: inherit; font-weight: 400; color: var(--muted); }
.nav .lang a:hover { color: var(--ink); }

/* Hamburger: visibile solo sotto i 900px (vedi Responsive). */
.menu-btn { display: none; position: relative; width: 44px; height: 44px; margin: 0 -10px 0 auto; padding: 0; border: 0; background: none; cursor: pointer; }
.menu-btn span { position: absolute; left: 11px; width: 22px; height: 2px; border-radius: 1px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .2s ease; }
.menu-btn span:nth-child(1) { top: 15px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 27px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Intestazione pagine interne ---------- */
.page-head { padding-top: 72px; padding-bottom: 56px; gap: 24px 56px; align-items: end; }
.page-head.page-head-tight { padding-bottom: 48px; }
/* 404 */
.not-found { min-height: 60vh; padding-bottom: 112px; }
.not-found-links { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.not-found-links a { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 500; }
.not-found-links a span { color: var(--red); transition: transform .15s; }
.not-found-links a:hover span { transform: translateX(4px); }

/* ---------- Home ---------- */
.hero { --min: 460px; gap: 48px; min-height: calc(100vh - var(--header-h)); padding-top: 40px; padding-bottom: 40px; }
.hero-text { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 24px 0; }
.hero-kicker { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--red); }
.hero h1 { font-size: clamp(44px, 5.8vw, 84px); line-height: 1; letter-spacing: -.03em; }
.hero p { max-width: 520px; font-size: 19px; line-height: 1.55; color: var(--text); }
.hero .btns { padding-top: 8px; }
.hero .photo { min-height: 440px; }
.hero .photo img { object-position: center 60%; }

.services { display: flex; flex-direction: column; gap: 48px; padding-top: 64px; padding-bottom: 112px; }
.services-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 56px; }
.services-head .h2 { font-size: clamp(24px, 3vw, 44px); }
.services-grid { --min: 260px; gap: 24px; }
.service-card h3 { font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.service-card .photo { aspect-ratio: 4 / 3; }
.service-card .body { line-height: 1.6; }
.service-body { border-top: 1px solid var(--ink); padding-top: 20px; }
.service-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.dark { background: var(--ink); color: #fff; }
.dark .kicker { color: #FF6B5E; }
.dark .lead { color: #C9CBCE; max-width: 500px; }
.quality-band { --min: 440px; gap: 56px 80px; align-items: center; padding-top: 112px; padding-bottom: 112px; }
.quality-band .btn { margin-top: 8px; }
.dark-rows { border-top: 1px solid var(--text); }
.dark-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--text); }
.dark-rows .norm { font-size: clamp(26px, 2.6vw, 34px); font-weight: 500; letter-spacing: -.015em; }
.dark-rows .desc { font-size: 15px; color: #A9ACB1; }

.badge-pulse.on-dark { background: rgba(228,38,30,.16); color: #FF8A80; }

.sectors { display: flex; flex-direction: column; gap: 56px; padding-top: 112px; padding-bottom: 112px; }
.sectors-head { gap: 24px 56px; align-items: end; }
.sectors-cards { --min: 440px; gap: 24px; }
.list-card { display: flex; flex-direction: column; }
.list-card-head { display: flex; flex-direction: column; gap: 6px; padding: 28px 32px 20px; }
.list-card-head h3 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.list-card-head span { font-size: 14px; color: var(--muted); }
.list-card-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-soft); }
.list-card-rows li { display: flex; align-items: center; gap: 20px; min-height: 60px; padding: 12px 32px; border-bottom: 1px solid var(--line-soft); font-size: 16px; font-weight: 500; }
.list-card-rows .n { width: 20px; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--red-dark); }
.list-card-rows .material { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; }
.grades { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.grade { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-family: var(--mono); font-size: 12px; font-weight: 400; white-space: nowrap; }

.cta-wrap { padding-bottom: 112px; }
.cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 32px; padding: clamp(32px, 5vw, 64px); }
.cta-text { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.cta-text .lead { max-width: none; }

/* ---------- Parco macchine ---------- */
.featured { --min: 300px; gap: 24px; padding-bottom: 72px; }
.machine-card .photo { height: 260px; border-radius: 7px 7px 0 0; background: #fff; }
.machine-body { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.machine-card .model { font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.specs { margin: 0; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-family: var(--mono); text-align: right; }

#list { scroll-margin-top: var(--header-h); }
.list-wrap { padding-top: 72px; padding-bottom: 96px; }
.list-head { align-items: center; gap: 16px; }
.list-head h2 { font-size: 32px; letter-spacing: -.015em; }
.filters { display: flex; flex-wrap: wrap; border: 1px solid var(--ink); border-radius: 6px; overflow: hidden; }
.filters a { padding: 10px 16px; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.filters a.active { background: var(--ink); color: #fff; }
.filters .count { margin-left: 2px; font-family: var(--mono); font-size: 12px; font-weight: 400; opacity: .6; }

.table-scroll { overflow: auto hidden; border-top: 1px solid var(--ink); } /* niente scroll verticale: la dissolvenza sposta le righe di 4px */
.mtable { min-width: 560px; }
.mtable > div { display: grid; grid-template-columns: 160px minmax(0, 1.4fr) minmax(0, 1.4fr); gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.mtable > div:not(.thead):hover { background: #F8F8F6; }
.mtable .thead { padding: 14px 0; border-bottom-color: var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mtable .label { letter-spacing: 0; }
.mtable .m-name { font-weight: 500; }
.mtable.fade > div:not(.thead) { animation: row-in .25s ease both; }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } }

.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.pager-links { display: flex; gap: 6px; }
.pager-links a, .pager-links span { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 13px; }
.pager-links a:hover { border-color: var(--ink); color: var(--ink); }
.pager-links .active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager-links .disabled { color: var(--faint); }

/* ---------- Qualità ---------- */
.certs { --min: 460px; gap: 24px; padding-bottom: 96px; }
.cert-card { position: relative; display: flex; flex-direction: column; border-top-width: 4px; }
.badge-pulse { display: flex; flex: none; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #FDECEB; color: #B81D16; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.cert-badge { position: absolute; top: 24px; right: 24px; }
.badge-pulse::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(228,38,30,.5); } 50% { opacity: .35; box-shadow: 0 0 0 5px rgba(228,38,30,0); } }
.cert-card.accent-red { border-top-color: var(--red); }
.cert-card.accent-ink { border-top-color: var(--ink); }
.cert-head { display: flex; flex-direction: column; gap: 10px; padding: 32px 32px 24px; }
.cert-card .norm { font-size: 40px; font-weight: 500; letter-spacing: -.02em; line-height: 1.05; }
.cert-desc { font-size: 16px; color: var(--text); }
.cert-data { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0 32px; border-top: 1px solid var(--line); }
.cert-data div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line-soft); }
.cert-data dt { font-size: 13px; color: var(--muted); }
.cert-data dd { margin: 4px 0 0; font-family: var(--mono); font-size: 15px; }
.cert-foot { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 20px 32px 28px; }
.cert-scope-label { font-size: 13px; color: var(--muted); }
.cert-scope { font-size: 15px; line-height: 1.55; }

.policy-band { gap: 48px 72px; padding-top: 96px; padding-bottom: 96px; }
.policy > div { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 22px 0; }
.policy .n { padding-top: 3px; font-family: var(--mono); font-size: 13px; color: var(--red-dark); }
.policy-title { font-size: 18px; font-weight: 500; }

.metrology { gap: 48px 72px; align-items: center; padding-top: 96px; padding-bottom: 96px; }
.metrology-photo { height: 380px; border: 1px solid var(--line); }
.metrology-copy { display: flex; flex-direction: column; gap: 24px; }
.metrology-text { max-width: 560px; font-size: 17px; line-height: 1.65; color: var(--text); }
.metrology-photo img { object-position: 55% 50%; }

/* ---------- Download ---------- */
.doc-groups { display: flex; flex-direction: column; gap: 32px; padding-bottom: 96px; }
.doc-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.doc-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.doc-cats a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 6px; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.doc-cats a:hover { background: var(--line-soft); color: var(--ink); }
.doc-cats a.active { background: var(--ink); color: #fff; }
.doc-cats .count { font-family: var(--mono); font-size: 11px; opacity: .6; }
.doc-search { flex: 1 1 240px; max-width: 340px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.doc-search:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.doc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.doc-group { display: flex; flex-direction: column; gap: 12px; }
.doc-group-head { display: flex; align-items: baseline; gap: 12px; padding: 0 4px; }
.doc-group-head h2 { font-size: 20px; letter-spacing: -.01em; }
.doc-count { font-family: var(--mono); font-size: 12px; color: #8C9096; }
.doc-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.doc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 20px; align-items: center; padding: 16px 20px; }
.doc-row:not([hidden]) ~ .doc-row:not([hidden]) { border-top: 1px solid var(--line-soft); }
.doc-row:hover { background: #FAFAF8; }
.doc-icon { display: flex; align-items: flex-end; justify-content: center; width: 44px; height: 52px; padding-bottom: 8px; border: 1px solid #E6E6E2; border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--red-dark); }
.doc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 16px; font-weight: 500; line-height: 1.3; }
.doc-badge { padding: 3px 9px; border-radius: 999px; background: #FDECEB; color: #B81D16; font-family: var(--mono); font-size: 10px; font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.doc-dl { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--ink); border-radius: 6px; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.doc-dl:hover { background: var(--ink); color: #fff; }
.doc-langs { display: flex; align-items: center; gap: 8px; }
.doc-langs > span:not(.doc-dl) { margin-right: 2px; font-size: 13px; color: var(--muted); }
.doc-langs .doc-dl { padding: 10px 14px; }
.doc-langs .mono { font-size: 12px; }
.doc-dl-disabled, .doc-dl-disabled:hover { border-color: #E6E6E2; background: none; color: #9A9DA2; cursor: not-allowed; }
.doc-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; border: 1px dashed #C9CBCE; border-radius: 8px; text-align: center; font-size: 16px; font-weight: 500; }
.doc-reset { font-size: 14px; font-weight: 400; color: var(--red-dark); text-decoration: underline; }
.doc-note { padding: 0 4px; font-size: 14px; color: var(--muted); }

/* ---------- Contatti ---------- */
.contact-layout { --min: 440px; gap: 56px; padding-top: 72px; padding-bottom: 96px; }
.contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.contacts > div { display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line); }
.contacts .v { font-size: 17px; line-height: 1.45; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.map { display: flex; flex-direction: column; min-height: 520px; background: var(--tile); }
.map iframe { flex: 1; width: 100%; min-height: 400px; border: 0; border-radius: 8px 8px 0 0; }
.map-consent { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px; padding: 32px; }
.map-consent p { max-width: 420px; font-size: 15px; line-height: 1.6; color: var(--text); }
.map-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #fff; }
.map-address { font-size: 15px; font-weight: 500; }
.map-link { display: flex; gap: 8px; font-size: 14px; font-weight: 500; }
.map-link span { color: var(--red); }

/* ---------- Pagine legali ---------- */
.prose { max-width: 780px; padding-bottom: 96px; }
.prose section { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 28px 0; border-top: 1px solid var(--line); }
.prose section:first-child { border-top-color: var(--ink); }
.prose .n { padding-top: 5px; font-family: var(--mono); font-size: 13px; color: var(--red-dark); }
.prose h2 { margin-bottom: 12px; font-size: 22px; letter-spacing: -.01em; }
.prose p, .prose li { font-size: 16px; line-height: 1.65; color: var(--text); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 12px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.updated { padding-top: 28px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- Banner cookie ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 720px; max-height: calc(100vh - 32px); overflow-y: auto; margin: 0 auto; padding: 24px 28px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 8px; box-shadow: 0 12px 40px rgba(28,30,33,.16); }
.cookie-banner h2 { margin: 0 32px 10px 0; font-size: 20px; letter-spacing: -.01em; }
.cookie-banner p { font-size: 14px; line-height: 1.6; color: var(--text); }
.cookie-banner p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cookie-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.cookie-close:hover { color: var(--ink); background: var(--bg); }
.cookie-prefs { margin-top: 16px; border-top: 1px solid var(--line); }
.cookie-cat { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; line-height: 1.55; color: var(--text); cursor: pointer; }
.cookie-cat input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red); }
.cookie-cat strong { color: var(--ink); font-weight: 500; }
.cookie-cat em { margin-left: 6px; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cookie-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #C9CBCE; font-size: 14px; }
.footer a { color: #C9CBCE; }
.footer a:hover { color: #fff; }
.footer-in { display: flex; flex-direction: column; gap: 48px; padding-top: 64px; padding-bottom: 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 40px; }
.footer-logo { height: 44px; width: auto; align-self: flex-start; }
.footer-tagline { line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-address { font-style: normal; line-height: 1.5; }
.footer-muted { color: #8C9096; }
.footer-label { margin-bottom: 6px; font-family: var(--mono); font-size: 12px; color: #8C9096; text-transform: uppercase; letter-spacing: .06em; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid #34373C; font-size: 12px; color: #8C9096; }
.footer-bottom a { color: #8C9096; }
.footer-bottom > span { line-height: 1.7; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* =========================================================================
   Responsive
   ========================================================================= */

/* Sotto i 900px menu e logo non stanno su una riga: menu a scomparsa. */
@media (max-width: 900px) {
  :root { --header-h: 65px; }
  .topbar-in { min-height: 64px; gap: 0 16px; }
  .logo svg { width: 126px; height: 40px; }
  .menu-btn { display: block; }
  /* Apertura animata con altezza e opacità; visibility toglie i link dal tab quando è chiuso. */
  .nav { flex-basis: 100%; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; max-height: 0; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: max-height .35s var(--ease-out), opacity .25s ease, transform .35s var(--ease-out), visibility 0s linear .35s; }
  .nav.open { max-height: 420px; padding-bottom: 16px; opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
  .nav a.active { border-bottom-color: var(--red); }
  .lang { margin: 12px 0 0; padding: 0; border: 0; }
}

@media (max-width: 760px) {
  .page-head { padding-top: 48px; padding-bottom: 40px; }
  .mtable { min-width: 0; }
  .mtable .thead { display: none; }
  .mtable > div { grid-template-columns: 1fr; gap: 4px; }
  .cert-head { padding: 24px 20px 20px; }
  .cert-card .norm { font-size: 32px; }
  .cert-data { padding: 0 20px; }
  .cert-foot { padding: 20px 20px 24px; }
}

@media (max-width: 600px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .list-card-head, .list-card-rows li { padding-left: 20px; padding-right: 20px; }
  .list-card-rows .material { grid-template-columns: 1fr; }
  .grades { justify-content: flex-start; }
  /* Su telefono i pulsanti vanno sotto il titolo, che altrimenti resterebbe troppo stretto. */
  .doc-row { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .doc-row > :last-child { grid-column: 2; justify-self: start; }
}

@media (max-width: 480px) {
  .contacts { grid-template-columns: 1fr; }
  .doc-search { max-width: none; }
  .cta .btn { width: 100%; justify-content: center; }
  .cookie-banner { padding: 20px; }
  .cookie-actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .nav, .menu-btn span { transition: none; }
  .mtable.fade > div { animation: none; }
  /* Il punto "In corso" resta animato ma solo in dissolvenza, senza l'alone che si espande. */
  .badge-pulse::before { animation-name: fade-pulse; }
}
@keyframes fade-pulse { 50% { opacity: .35; } }
