/* GiCa Rail – Riordini e trasbordi */
@font-face { font-family: "Archivo"; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/archivo-latin.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/archivo-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1EFF; }

:root {
  --bg: #ffffff;
  --ink: #2f2f2f;
  --ink-soft: #555555;
  --muted: #9a9a9a;
  --line: #e4e4e4;
  --tile: #f4f4f4;
  --red: #be1622;
  --red-dark: #a3121c;
  --green: #2f7d32;
  --gutter: clamp(16px, 4vw, 48px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

/* Intestazione */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.site-head img { width: 150px; height: auto; display: block; }
.site-head a:has(img) { display: block; }
.site-head .tag { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.bar { width: 48px; height: 4px; background: var(--red); margin-bottom: 20px; }
h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 52px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
.lead { margin: 0; max-width: 60ch; color: var(--ink-soft); font-size: 17px; }

/* Bottoni e campi */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 16px; padding: 13px 22px;
  border: 0; background: var(--red); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid #c8c8c8; }
.btn.ghost:hover { border-color: var(--ink); }
.input {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid #c8c8c8; border-radius: 0; background: #fff; color: var(--ink);
}
.input:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: var(--red); }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.err { color: var(--red); font-size: 14px; min-height: 1.4em; margin-top: 10px; }

/* Schermata password */
.lock { max-width: 440px; margin: 0 auto; padding: clamp(48px, 11vw, 112px) var(--gutter); }
.lock h1 { font-size: 28px; }
.lock p { margin: 0 0 24px; color: var(--ink-soft); }
.lock form { display: flex; gap: 8px; }
.lock .input { flex: 1; min-width: 0; }

/* Sezioni galleria */
.intro { padding: clamp(36px, 7vw, 80px) 0 clamp(20px, 4vw, 40px); }
section.fase { padding: clamp(20px, 4vw, 40px) 0; }
.sec-head { display: flex; align-items: baseline; gap: 14px; border-top: 2px solid var(--ink); padding-top: 14px; margin-bottom: 20px; }
.sec-head .idx { color: var(--red); font-weight: 700; font-size: 14px; }
.sec-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.sec-head .count { margin-left: auto; color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { position: relative; aspect-ratio: 4 / 3; background: var(--tile); overflow: hidden; }
.tile > button.open { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.tile > button.open:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.tile:hover img { transform: scale(1.03); }
.empty { color: var(--muted); font-size: 15px; padding: 20px 0; }

.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }

/* Visualizzatore */
.lb { position: fixed; inset: 0; background: rgba(20, 20, 20, .94); display: none; align-items: center; justify-content: center; z-index: 20; }
.lb.open { display: flex; }
.lb img { max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); object-fit: contain; }
.lb .cap { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 14px; }
.lb button { position: absolute; background: none; border: 0; color: #fff; font: inherit; font-size: 34px; line-height: 1; padding: 16px; cursor: pointer; }
.lb .x { top: 4px; right: 4px; }
.lb .prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb .next { right: 4px; top: 50%; transform: translateY(-50%); }

@media (max-width: 560px) {
  .site-head img { width: 120px; }
  .site-head .tag { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
