/* GiCa Rail – Riordini e Trasbordi */

/* Font ospitati localmente (nessuna richiesta a Google Fonts) */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../assets/fonts/archivo-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../assets/fonts/archivo-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(../assets/fonts/jetbrainsmono-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-20C0, 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(../assets/fonts/jetbrainsmono-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 {
  --bg: #ffffff;
  --ink: #2f2f2f;
  --ink-soft: #555555;
  --muted: #9a9a9a;
  --line: #e4e4e4;
  --grid: #f1f1f1;
  --chassis: #bdbdbd;
  --red: #be1622;
  --font: "Archivo", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --cell: 18px;
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }

/* Tipografia: a capo bilanciati nei titoli, niente righe orfane nei paragrafi */
h1, h2, h3, .statement, .lead { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
/* le parole composte tedesche si sillabano nei testi correnti, mai nei titoli */
:lang(de) p, :lang(de) li { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 10 4 4; -webkit-hyphenate-limit-before: 4; -webkit-hyphenate-limit-after: 4; }
h1, h2, h3, .statement, .consent-text, a { hyphens: manual; -webkit-hyphens: manual; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.red { color: var(--red); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--red); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

/* Griglia a 4 colonne visibile in sottofondo */
.grid-lines { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.grid-lines .wrap { height: 100%; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.grid-lines i { border-left: 1px solid var(--grid); }
.grid-lines .wrap::after { content: ""; position: absolute; top: 0; bottom: 0; right: var(--gutter); border-right: 1px solid var(--grid); }

/* Etichette mono */
.label, .sec-note, dt, .num, .step-num, .copy {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 400;
}
.label { color: var(--ink); margin: 0; display: flex; gap: 14px; }
.idx { color: var(--red); }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }

/* Selettore lingua */
.lang { display: flex; gap: 4px; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; }
.lang a { text-decoration: none; color: var(--muted); padding: 8px 6px; transition: color .2s; }
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--red); }
.brand { width: 150px; padding-left: var(--cell); }
.brand img { width: 100%; height: auto; }

/* Hero */
.hero { display: grid; grid-template-columns: repeat(4, 1fr); padding-top: calc(var(--header-h) + clamp(60px, 12vh, 140px)); padding-bottom: clamp(60px, 10vw, 120px); align-items: end; }
.hero > * { padding-left: var(--cell); }
.hero-text { grid-column: 1 / 3; padding-right: 24px; container-type: inline-size; }
/* Il titolo si adatta alla colonna: --h1-em è la riga più lunga di ogni lingua (in em) più un margine,
   così la parola più lunga non viene mai spezzata e il peso visivo resta uguale fra le lingue. */
.hero h1 {
  --h1-em: 5.45;
  font-size: clamp(3rem, 7.4vw, 6.6rem);
  font-size: min(6.6rem, 100cqw / var(--h1-em));
  line-height: .95; letter-spacing: -0.045em; margin: 0 0 34px; font-weight: 600;
}
:lang(de) .hero h1 { --h1-em: 6; }
:lang(en) .hero h1 { --h1-em: 7.6; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 30ch; margin: 0; }
.hero-photo { grid-column: 3 / 5; margin: 0; aspect-ratio: 4 / 3.2; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }


/* Fatti in riga */
.facts { margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.facts div { padding: 20px 0 22px var(--cell); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div:first-child { grid-column: span 2; }
.facts dt { color: var(--muted); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 1.05rem; }
.facts a { text-decoration: none; }
.facts a:hover { color: var(--red); }

/* Sezioni */
.section { display: grid; grid-template-columns: repeat(4, 1fr); padding-top: clamp(100px, 14vw, 180px); }
.section > * { padding-left: var(--cell); }
.sec-head { grid-column: 1; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); padding-right: 24px; }
.sec-note { color: var(--muted); margin: 18px 0 0; text-transform: none; letter-spacing: 0; font-size: .85rem; line-height: 1.5; }
.sec-body { grid-column: 2 / 5; }
.statement { font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.18; letter-spacing: -0.025em; margin: 0; max-width: 24ch; font-weight: 500; }
.statement a { color: var(--red); text-decoration: none; border-bottom: 1px solid currentColor; white-space: nowrap; }

/* Servizio */
.two-col { display: grid; grid-template-columns: 1fr 1fr; margin-top: clamp(60px, 8vw, 100px); margin-left: calc(var(--cell) * -1); }
.two-col article { padding: 24px 24px 0 var(--cell); border-top: 1px solid var(--line); }
.two-col h3 { font-size: 1.6rem; display: flex; gap: 14px; align-items: baseline; margin-bottom: 14px; }
.two-col h3 .idx { font-family: var(--mono); font-size: .8rem; }
.two-col p { color: var(--ink-soft); margin: 0; max-width: 36ch; }

/* Merci: voci con icona */
.cargo-list { grid-column: 2 / 5; list-style: none; margin: 0; padding-left: 0 !important; border-top: 1px solid var(--line); }
.cargo {
  display: grid; grid-template-columns: 1fr 2fr; align-items: center;
  border-bottom: 1px solid var(--line); padding: 26px 0; cursor: default; position: relative;
}
.cargo .num { position: absolute; left: var(--cell); top: 18px; color: var(--muted); transition: color .3s; }
.cargo-icon {
  width: 128px; height: 54px; margin-left: var(--cell); margin-top: 14px;
  --c-chassis: var(--chassis); --c-load: var(--red);
  transition: transform .7s cubic-bezier(.3,.7,.2,1);
}
.cargo h3 { font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 1.1; padding-left: var(--cell); transition: color .3s, transform .5s; }
.cargo .thumb { display: none; }
.cargo:hover .cargo-icon { transform: translateX(28px); }
.cargo:hover .cargo-icon { --c-chassis: var(--ink); }
.cargo:hover .num { color: var(--red); }
.cargo:hover h3 { transform: translateX(8px); }

.preview {
  position: fixed; left: 0; top: 0; width: 300px; aspect-ratio: 4 / 3; pointer-events: none; z-index: 40;
  opacity: 0; transform: translate3d(-50%, -50%, 0) scale(.92); transition: opacity .25s, transform .25s;
  overflow: hidden;
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview.show { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); }

/* Procedura: righe allineate alla griglia */
.steps { grid-column: 2 / 5; list-style: none; margin: 0; padding-left: 0 !important; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: repeat(3, 1fr); padding: 30px 0 34px; border-bottom: 1px solid var(--line); position: relative; }
.steps li > * { padding-left: var(--cell); padding-right: 24px; margin: 0; }
.steps li::before { content: ""; position: absolute; bottom: -1px; left: 0; height: 1px; width: 0; background: var(--red); transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.steps li.in::before, .no-js .steps li::before { width: 100%; }
.step-num { color: var(--red); }
.steps h3 { font-size: 1.35rem; line-height: 1.2; }
.steps p { color: var(--ink-soft); font-size: 1rem; max-width: 34ch; }

/* Contatti */
.contact-list { display: grid; grid-template-columns: repeat(3, 1fr); margin: clamp(60px, 8vw, 100px) 0 0 calc(var(--cell) * -1); }
.contact-list div { padding: 22px 24px 0 var(--cell); border-top: 1px solid var(--line); }
.contact-list dt { color: var(--muted); margin-bottom: 10px; }
.contact-list dd { margin: 0; font-size: 1.15rem; line-height: 1.45; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--red); }

/* Footer */
.site-footer { display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; margin-top: clamp(120px, 16vw, 200px); padding-top: 0; padding-bottom: 48px; }
.site-footer > * { margin: 0; padding: 28px 0 0 var(--cell); border-top: 1px solid var(--line); }
.footer-logo { grid-column: 1 / 3; width: 100%; height: 72px; object-fit: contain; object-position: left top; }
.social { grid-column: 3; display: flex; flex-direction: column; gap: 4px; }
.social a { text-decoration: none; color: var(--ink-soft); font-size: .95rem; }
.social a:hover { color: var(--red); }
.footer-meta { grid-column: 4; }
.copy { color: var(--muted); margin: 0 0 14px; }
.legal-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.legal-links a, .legal-links button { font: inherit; font-size: .9rem; color: var(--ink-soft); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.legal-links a:hover, .legal-links button:hover { color: var(--red); }
button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

/* Pagine legali */
.legal { display: grid; grid-template-columns: repeat(4, 1fr); padding-top: calc(var(--header-h) + clamp(60px, 10vh, 120px)); }
.legal > * { padding-left: var(--cell); }
.legal .sec-head { grid-column: 1; }
.legal-body { grid-column: 2 / 5; max-width: 68ch; padding-right: 24px; }
.legal-body h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; margin: 0 0 18px; }
.legal-body .updated { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin: 0 0 48px; }
.legal-body h2 { font-size: 1.35rem; line-height: 1.25; margin: 48px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.legal-body h3 { font-size: 1.05rem; margin: 26px 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.legal-body p, .legal-body li { color: var(--ink-soft); line-height: 1.62; }
.legal-body ul { padding-left: 1.2em; }
.legal-body a { color: var(--red); }
.legal-body address { font-style: normal; color: var(--ink); margin: 0 0 8px; }
.legal-body .btn-inline { font: inherit; color: var(--red); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* Banner cookie */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  transform: translateY(100%); transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.consent.show { transform: none; }
.consent-inner { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; padding-top: 22px; padding-bottom: 22px; }
.consent-inner > * { padding-left: var(--cell); }
.consent-title { grid-column: 1; margin: 0; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.consent-text { grid-column: 2 / 4; margin: 0; font-size: .95rem; color: var(--ink-soft); padding-right: 24px; }
.consent-text a { color: var(--ink); }
.consent-actions { grid-column: 4; display: flex; gap: 10px; flex-wrap: wrap; }
.consent button {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 18px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.consent button:hover { border-color: var(--red); color: var(--red); }
.consent button.accept { background: var(--ink); color: #fff; }
.consent button.accept:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* Reveal */
/* nascosto solo se JS è attivo: senza JS il contenuto resta visibile */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 760px) {
  :root { --header-h: 64px; --cell: 0px; }
  .grid-lines { display: none; }
  .brand { width: 120px; }
  /* aree di tocco più comode */
  .brand { padding: 8px 0; }
  .facts a, .contact-list a, .social a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .social { gap: 14px; }

  .hero, .section, .facts, .site-footer { grid-template-columns: 1fr; }
  .hero-text, .hero-photo, .sec-head, .sec-body, .cargo-list, .steps { grid-column: 1; }
  .hero { padding-top: calc(var(--header-h) + 48px); gap: 48px; }
  .hero h1 { font-size: min(3.2rem, 100cqw / var(--h1-em)); line-height: .98; letter-spacing: -0.04em; }
  .hero-text { padding-right: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:first-child { grid-column: 1 / -1; border-bottom: 0; }
  .facts div:last-child { padding-left: 16px; }
  .sec-head { position: static; margin-bottom: 36px; }
  .two-col, .contact-list { grid-template-columns: 1fr; margin-left: 0; }
  .steps li { grid-template-columns: 1fr; row-gap: 10px; }
  .two-col article + article, .contact-list div + div { margin-top: 32px; }

  .cargo { grid-template-columns: 1fr 96px; grid-template-rows: auto auto; row-gap: 10px; padding: 22px 0; }
  .cargo .num { position: static; grid-column: 1; grid-row: 1; }
  .cargo-icon { grid-column: 1; grid-row: 2; width: 96px; height: 40px; margin: 0; }
  .cargo h3 { grid-column: 1; grid-row: 3; font-size: 1.35rem; }
  .cargo .thumb { display: block; grid-column: 2; grid-row: 1 / 4; width: 96px; height: 96px; object-fit: cover; align-self: center; }
  .preview, .hover-hint { display: none; }

  .lang a { padding: 12px 6px; }
  .legal, .consent-inner { grid-template-columns: 1fr; }
  .legal .sec-head, .legal-body, .consent-title, .consent-text, .consent-actions { grid-column: 1; }
  .legal-body { padding-right: 0; }
  .consent-inner { row-gap: 10px; padding-top: 18px; padding-bottom: 18px; }
  .consent-actions { margin-top: 6px; }
  .consent button { flex: 1; }
  .legal-links { gap: 0; }
  .legal-links a, .legal-links button { display: inline-block; padding: 8px 0; }

  .site-footer > *, .footer-logo, .social, .footer-meta { grid-column: 1; }
  .site-footer > * + * { border-top: 0; padding-top: 18px; }
  .footer-logo { height: 70px; }
}

@media (hover: none) { .hover-hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .steps li::before { width: 100%; }
}

@media print { .consent, .site-header, .grid-lines { display: none; } }

/* Tabella cookie */
.cookie-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .92rem; }
.cookie-table th { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; color: var(--muted); text-align: left; }
.cookie-table th, .cookie-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.legal-body code { font-family: var(--mono); font-size: .85em; }
