/* =========================================================
   Casello San Calogero — shared stylesheet
   Tono: contemporaneo minimal, anima rurale.
   Motion + Accessibility + UX edition.
========================================================= */

/* =========== CUSTOM PROPERTIES =========== */
:root{
  /* Palette */
  --bg:        #FAF7F1;
  --bg-alt:    #F1ECE0;
  --stone:     #E9E2D2;
  --ink:       #1C1814;
  --ink-soft:  #47423C;
  --muted:     #615C56;   /* raised from #6B6357 → contrast 5.1:1 on --bg */
  --ocra:      #C8A24B;
  --ocra-dark: #8F6E1E;   /* raised from #A07F2D → contrast 5.8:1 on --bg */
  --field:     #5A6940;
  --line:      #D9D2C5;
  --line-dark: #B8AFA0;

  /* Typography */
  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.76, 0, 0.24, 1);

  /* Focus ring */
  --focus-color: var(--ocra-dark);
  --focus-ring:  0 0 0 3px rgba(143, 110, 30, 0.35);

  /* Altezza fascia testo scorrevole — hero = 100vh - questa */
  --marquee-h: 54px;
}

/* =========== RESET & BASE =========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* Text selection */
::selection { background: rgba(200,162,75,.22); color: var(--ink); }

/* Scrollbar (Chrome/Edge) */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--line-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* =========== SKIP LINK =========== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 10000;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 12px 20px;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  transition: top .2s;
  white-space: nowrap;
}
.skip-link:focus { top: 0; outline: none; }

/* =========== FOCUS STYLES =========== */
/* Remove default only when :focus-visible handles it */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Buttons & links in dark contexts */
.hero-slideshow :focus-visible,
.subhero :focus-visible,
section.dark :focus-visible {
  outline-color: var(--ocra);
}
/* Forms */
.form-stack input:focus-visible,
.form-stack textarea:focus-visible,
.form-stack select:focus-visible,
.newsletter input:focus-visible {
  outline: none;
  border-color: var(--ocra-dark);
  box-shadow: var(--focus-ring);
}
/* Nav links */
.nav ul a:focus-visible { outline-offset: 4px; border-radius: 2px; }
/* Buttons */
.btn:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 3px;
  box-shadow: none;
}
/* Slide arrows on dark bg */
.slide-arrow:focus-visible { outline-color: #fff; outline-offset: 4px; }

/* =========== LAYOUT =========== */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

/* =========== PAGE LOADER =========== */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .7s var(--ease-out-expo), visibility .7s;
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.loader-logo {
  width: 150px; height: auto; opacity: 0;
  animation: loaderFadeIn .7s var(--ease-out-expo) .15s forwards;
}
.loader-bar {
  width: 140px; height: 1px;
  background: var(--line);
  position: relative; overflow: hidden;
}
.loader-bar::after {
  content: ""; position: absolute; inset: 0;
  background: var(--ocra);
  transform: translateX(-100%);
  animation: loaderBar 1.1s var(--ease-out-expo) .35s forwards;
}
@keyframes loaderFadeIn { to { opacity: 1; } }
@keyframes loaderBar    { to { transform: translateX(0); } }

/* =========== PAGE TRANSITION =========== */
#page-transition {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--ink);
  pointer-events: none;
  opacity: 1;
  transition: opacity .44s var(--ease-out-expo);
}
#page-transition.out { opacity: 0; }

/* =========== PROGRESS BAR =========== */
#progress-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--ocra-dark), var(--ocra));
  transition: width .1s linear;
  pointer-events: none;
}

/* =========== CUSTOM CURSOR =========== */
#cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 6px; height: 6px;
  background: var(--ocra-dark);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  mix-blend-mode: multiply;
}
#cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9997;
  width: 34px; height: 34px;
  border: 1.5px solid rgba(143,110,30,.4);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  transition: width .35s var(--ease-out-expo), height .35s var(--ease-out-expo), opacity .3s;
}
body.cursor-hover #cursor-ring { width: 58px; height: 58px; border-color: rgba(143,110,30,.2); }
@media (pointer: coarse) { #cursor-dot, #cursor-ring { display: none; } }

/* =========== SCROLL REVEAL =========== */
[data-reveal] {
  opacity: 0;
  transition: opacity .85s var(--ease-out-expo), transform .85s var(--ease-out-expo);
  will-change: opacity, transform;
}
[data-reveal="up"]    { transform: translateY(48px); }
[data-reveal="down"]  { transform: translateY(-32px); }
[data-reveal="left"]  { transform: translateX(-48px); }
[data-reveal="right"] { transform: translateX(48px); }
[data-reveal="scale"] { transform: scale(0.93); }
[data-reveal="fade"]  { transform: none; }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal][style*="--delay"] { transition-delay: var(--delay, 0s); }

/* =========== SPLIT HEADING =========== */
.split-word {
  display: inline-block; overflow: hidden;
  vertical-align: top; margin-right: .22em;
  /* room for descenders (g, p, q) so the reveal mask doesn't clip them */
  padding-bottom: .2em; margin-bottom: -.2em;
}
.split-word span {
  display: inline-block;
  transform: translateY(125%); opacity: 0;
  transition: transform .95s var(--ease-out-expo), opacity .95s var(--ease-out-expo);
}
.hero-ready .split-word span { transform: translateY(0); opacity: 1; }

/* =========== HEADER =========== */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .45s, backdrop-filter .45s, border-color .45s,
              transform .48s var(--ease-out-expo);
}
header.site.is-hidden { transform: translateY(-100%); }
header.site.scrolled {
  background: rgba(250,247,241,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}
.nav {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 80px; gap: 24px;
}
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo {
  height: 36px; width: auto; display: block;
  transition: opacity .3s, filter .45s;
}
.brand-logo:hover { opacity: .78; }

/* Nav links */
.nav ul { list-style: none; display: flex; gap: 24px; }
.nav ul a {
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px; position: relative;
  transition: color .22s;
}
.nav ul a::after {
  content: ""; position: absolute;
  left: 0; right: 100%; bottom: -2px;
  height: 1px; background: var(--ocra-dark);
  transition: right .35s var(--ease-out-expo);
}
.nav ul a:hover { color: var(--ink); }
.nav ul a:hover::after,
.nav ul a[aria-current="page"]::after { right: 0; }
.nav ul a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Lang switcher */
.lang {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .06em;
  flex-shrink: 0;
}
.lang button {
  border: none; background: none; cursor: pointer;
  font: inherit; color: var(--muted);
  padding: 5px 8px; border-radius: 3px;
  min-height: 36px; min-width: 36px;
  transition: color .2s, background .2s;
}
.lang button.on { color: var(--ink); background: var(--stone); }
.lang span { color: var(--line-dark); user-select: none; }

/* Hamburger */
.nav .menu-btn {
  display: none;
  border: none; background: none;
  cursor: pointer; color: var(--ink);
  font-size: 22px; line-height: 1;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 4px;
  z-index: 55; position: relative;
  transition: background .2s;
}
.nav .menu-btn:hover { background: var(--stone); }

/* Header on dark hero */
header.site:not(.scrolled) .nav ul a { color: rgba(255,255,255,.82); }
header.site:not(.scrolled) .nav ul a:hover { color: #fff; }
header.site:not(.scrolled) .nav ul a[aria-current="page"] { color: #fff; }
header.site:not(.scrolled) .nav ul a::after { background: var(--ocra); }
header.site:not(.scrolled) .lang button { color: rgba(255,255,255,.65); }
header.site:not(.scrolled) .lang button.on { color: #fff; background: rgba(255,255,255,.12); }
header.site:not(.scrolled) .lang span { color: rgba(255,255,255,.3); }
header.site:not(.scrolled) .menu-btn { color: #fff; }
header.site:not(.scrolled) .menu-btn:hover { background: rgba(255,255,255,.1); }
/* Doppio logo: bianco quando la navbar è sopra le foto, scuro quando è solida */
.brand-logo--light { display: none; }
header.site:not(.scrolled) .brand-logo--dark { display: none; }
header.site:not(.scrolled) .brand-logo--light { display: block; }
/* drop-shadow minimo sul logo bianco per staccarlo da zone chiare della foto */
header.site:not(.scrolled) .brand-logo--light {
  filter: drop-shadow(0 1px 8px rgba(0,0,0,.4)) drop-shadow(0 2px 18px rgba(0,0,0,.22));
}

/* =========== SEZIONI IN ARRIVO (Bottega, Visita) =========== */
a.is-soon { cursor: default; color: var(--muted); }
.nav ul a.is-soon::after { content: none; }            /* niente underline da link */
header.site:not(.scrolled) .nav ul a.is-soon { color: rgba(255,255,255,.55); }
.soon-badge {
  display: inline-block; margin-left: 7px; vertical-align: middle;
  font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ocra-dark); border: 1px solid var(--line-dark);
  border-radius: 999px; padding: 2px 6px; line-height: 1; white-space: nowrap;
}
header.site:not(.scrolled) .soon-badge { color: #f0c46a; border-color: rgba(255,255,255,.4); }
/* card anteprima disabilitata */
.pcard--soon { cursor: default; }
.pcard--soon:hover { transform: none; box-shadow: 0 1px 2px rgba(28,24,20,.06); }
.pcard--soon:hover .ph img { transform: none; }
.pcard .soon-cta { color: var(--ocra-dark); font-weight: 600; }
/* pulsante disabilitato */
.btn--soon {
  pointer-events: none; cursor: default;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line-dark);
}

/* =========== ARCHIVIO STORICO =========== */
.archive { background: #1a1613; color: #fff; padding: 128px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .archive { padding: 80px 0; } }
.archive h2 { color: #fff; }
.archive .lead { color: rgba(255,255,255,.82); max-width: 60ch; }
.archive-kicker {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ocra);
}
.archive-kicker::before { content: ""; width: 24px; height: 1px; background: var(--ocra); }
/* feature con citazione */
.archive-feature {
  position: relative; margin: 56px 0; width: 100%; aspect-ratio: 2/1; max-height: 62vh;
  overflow: hidden; border-radius: 3px; cursor: pointer; background: #000;
}
.archive-feature img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(.25) sepia(.12) contrast(1.03);
  transition: transform 1.2s var(--ease-out-expo);
}
.archive-feature:hover img { transform: scale(1.04); }
.archive-feature .grad { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,0) 38%, rgba(0,0,0,.78) 100%); }
.archive-feature figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(20px,4vw,44px); z-index: 2; }
.archive-feature blockquote {
  font-family: var(--serif); font-weight: 400; font-size: clamp(20px,2.6vw,34px);
  line-height: 1.25; max-width: 26ch; margin: 0 0 12px; text-shadow: 0 2px 22px rgba(0,0,0,.55);
}
.archive-feature cite { font-style: normal; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.72); }
/* griglia foto */
.archive-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media (max-width: 880px) { .archive-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .archive-grid { grid-template-columns: 1fr; } }
.archive-shot { cursor: pointer; }
.archive-shot .ph { aspect-ratio: 4/3; overflow: hidden; border-radius: 3px; background: #000; }
.archive-shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(.3) sepia(.12) contrast(1.03);
  transition: transform .8s var(--ease-out-expo), filter .5s;
}
.archive-shot:hover img { transform: scale(1.05); filter: grayscale(.08) sepia(.04); }
.archive-shot figcaption { margin-top: 12px; }
.archive-shot .yr { font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--ocra); margin-right: 8px; }
.archive-shot .cap { font-size: 13px; color: rgba(255,255,255,.72); }
/* documenti (mappa, orario) su carta chiara */
.archive-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
@media (max-width: 760px) { .archive-docs { grid-template-columns: 1fr; } }
.archive-doc { cursor: pointer; }
.archive-doc .ph { background: #f3ece0; border-radius: 3px; padding: 16px; display: flex; align-items: center; justify-content: center; }
.archive-doc img { width: 100%; height: auto; display: block; border-radius: 1px; transition: transform .6s var(--ease-out-expo); }
.archive-doc:hover img { transform: scale(1.02); }
.archive-doc figcaption { margin-top: 12px; font-size: 13px; color: rgba(255,255,255,.72); }
.archive-doc .yr { font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--ocra); margin-right: 8px; }
.archive-credit { margin-top: 48px; font-size: 12px; font-style: italic; color: rgba(255,255,255,.5); }

/* =========== ALLORA & OGGI (storytelling presente/passato) =========== */
.thennow { background: var(--bg-alt); padding: 128px 0; border-bottom: 1px solid var(--line); overflow: hidden; }
@media (max-width: 640px) { .thennow { padding: 80px 0; } }
.tn-kicker { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ocra-dark); }
.tn-kicker::before { content: ""; width: 24px; height: 1px; background: var(--ocra-dark); }
.thennow .lead { max-width: 60ch; }
.thennow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 56px 0 40px; }
@media (max-width: 760px) { .thennow-grid { grid-template-columns: 1fr; gap: 40px; } }
.tn-fig { margin: 0; }
.tn-fig .ph { position: relative; aspect-ratio: 1/1; overflow: hidden; border-radius: 4px; background: #000; }
.tn-fig img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.1s var(--ease-out-expo); }
.tn-fig:hover img { transform: scale(1.05); }
.tn-then img { filter: grayscale(1) contrast(1.05); }
.tn-chip { position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #fff;
  background: rgba(28,24,20,.58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: 999px; }
.tn-fig figcaption { margin-top: 14px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.tn-credit { font-size: 12px; font-style: italic; color: var(--muted); margin-top: 8px; }
/* mini-cronologia teaser (home) */
.mini-tl { display: flex; flex-wrap: wrap; gap: 0; margin: 8px 0 32px; border-top: 1px solid var(--line); }
.mini-ev { flex: 1 1 0; min-width: 140px; padding: 22px 24px 22px 0; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); }
.mini-ev:last-child { border-right: none; }
.mini-ev + .mini-ev { padding-left: 24px; }
.mini-yr { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--ocra-dark); letter-spacing: -.01em; line-height: 1; }
.mini-lab { font-size: 14px; color: var(--ink-soft); }
@media (max-width: 560px) { .mini-tl { flex-direction: column; }
  .mini-ev { border-right: none; border-bottom: 1px solid var(--line); padding: 16px 0; }
  .mini-ev + .mini-ev { padding-left: 0; }
  .mini-ev:last-child { border-bottom: none; } }
/* striscia "il tracciato oggi" (light) */
.today-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 32px; }
@media (max-width: 760px) { .today-grid { grid-template-columns: 1fr; } }
.today-fig { margin: 0; }
.today-fig .ph { aspect-ratio: 4/3; overflow: hidden; border-radius: 3px; background: var(--stone); }
.today-fig img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease-out-expo); }
.today-fig:hover img { transform: scale(1.05); }
.today-fig figcaption { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }

/* Mobile nav */
@media (max-width: 880px) {
  .nav ul {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 104px 32px 40px; gap: 0;
    z-index: 40;
    transform: translateX(100%);
    transition: transform .5s var(--ease-out-expo);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav ul.open { display: flex; transform: translateX(0); }
  .nav ul li {
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateX(28px);
    transition: opacity .42s var(--ease-out-expo), transform .42s var(--ease-out-expo);
    transition-delay: calc(var(--i, 0) * 0.055s + 0.12s);
  }
  .nav ul.open li { opacity: 1; transform: none; }
  .nav ul a {
    font-size: 24px; font-family: var(--serif); font-weight: 500;
    color: var(--ink) !important; padding: 18px 0; display: block;
  }
  .nav ul a::after { display: none; }
  .nav .menu-btn { display: flex; }
  /* All nav link states reset on mobile */
  header.site:not(.scrolled) .nav ul a { color: var(--ink) !important; }
}

/* =========== HERO SLIDESHOW =========== */
.hero-slideshow {
  position: relative;
  /* hero + fascia testo scorrevole = 100vh esatti */
  height: calc(100svh - var(--marquee-h, 54px));
  min-height: 420px;
  overflow: hidden; background: #0c0a08;
}
.hero-slideshow .slides { position: absolute; inset: 0; }
.hero-slideshow .slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 2s ease;
}
.hero-slideshow .slide.on { opacity: 1; }
.hero-slideshow .slide img {
  width: 100%; height: 112%; object-fit: cover; object-position: 50% 50%;
  opacity: .64;
  /* --sy da scroll parallax, --mx/--my da mouse parallax */
  transform: translateY(var(--sy, 0px)) translate(var(--mx, 0px), var(--my, 0px));
  will-change: transform;
}

/* Gradiente: vignetta top per navbar, fondo in basso, alone centrale dietro al testo */
.hero-slideshow .grad {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 48%,
      rgba(0,0,0,.64) 0%,
      rgba(0,0,0,.36) 44%,
      rgba(0,0,0,.0)  76%),
    linear-gradient(180deg,
      rgba(0,0,0,.62) 0%,
      rgba(0,0,0,.10) 22%,
      rgba(0,0,0,.10) 52%,
      rgba(0,0,0,.72) 100%);
}

/* Hero ARIA live region */
.hero-announcer {
  position: absolute; left: -9999px;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* Inner: centrato verticalmente, padding-top = altezza navbar */
.hero-slideshow .inner {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 80px 0 84px;   /* top: navbar clearance; bottom: dots clearance */
  color: #fff;
}

/* Kicker: senza decorazione, più silenzioso */
.hero-slideshow .kicker {
  font-size: 10px; font-weight: 600;
  letter-spacing: .32em; text-transform: uppercase;
  color: rgba(255,255,255,.78); margin-bottom: 22px;
  text-shadow: 0 1px 14px rgba(0,0,0,.45);
  display: block;
  opacity: 0; transform: translateY(14px);
  transition: opacity .8s var(--ease-out-expo) .4s,
              transform .8s var(--ease-out-expo) .4s;
}
.hero-ready .hero-slideshow .kicker { opacity: 1; transform: none; }

/* H1: più grande, peso leggero, massimo impatto */
.hero-slideshow h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.02; letter-spacing: -.03em;
  max-width: 16ch; text-wrap: balance;
  text-shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 34px rgba(0,0,0,.5);
}

/* Sub: discreta */
.hero-slideshow .sub {
  font-size: clamp(15px, 1.35vw, 18px);
  max-width: 54ch; margin-top: 20px;
  color: rgba(255,255,255,.96);
  text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 2px 20px rgba(0,0,0,.6);
  font-weight: 400; line-height: 1.62;
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s var(--ease-out-expo) 1.1s,
              transform .8s var(--ease-out-expo) 1.1s;
}
.hero-ready .hero-slideshow .sub { opacity: 1; transform: none; }

.hero-cta {
  margin-top: 30px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .8s var(--ease-out-expo) 1.4s,
              transform .8s var(--ease-out-expo) 1.4s;
}
.hero-ready .hero-cta { opacity: 1; transform: none; }

/* Dots: orizzontali in basso, centrati */
.slide-controls {
  position: absolute; left: 0; right: 0; bottom: 28px;
  display: flex; justify-content: center; z-index: 5;
}
.slide-dots { display: flex; gap: 8px; align-items: center; }
.slide-dots button {
  width: 28px; height: 20px;
  border: none; background: none; cursor: pointer;
  padding: 9px 0; position: relative;
}
.slide-dots button::after {
  content: ""; position: absolute;
  left: 0; right: 0; top: 50%; transform: translateY(-50%);
  height: 1px; background: rgba(255,255,255,.28);
  transition: background .35s, transform .35s var(--ease-out-expo);
}
.slide-dots button.on::after {
  background: rgba(255,255,255,.9);
  transform: translateY(-50%) scaleX(1.5);
  transform-origin: left center;
}

/* Frecce: invisibili di default, compaiono su hover/focus della sezione */
.slide-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: transparent; border: 1px solid rgba(255,255,255,.28);
  color: #fff; width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .35s, background .3s, border-color .3s,
              transform .4s var(--ease-out-expo);
}
.hero-slideshow:hover .slide-arrow,
.slide-arrow:focus-visible { opacity: 1; }
.slide-arrow:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.55);
  transform: translateY(-50%) scale(1.08);
}
.slide-arrow.prev { left: 32px; }
.slide-arrow.next { right: 32px; }
@media (max-width: 640px) {
  /* su mobile si naviga con lo swipe e gli indicatori: niente frecce che coprono il testo */
  .slide-arrow { display: none; }
  .hero-slideshow h1 { font-size: clamp(32px, 8.6vw, 52px); line-height: 1.06; max-width: 18ch; }
  .hero-slideshow .sub { font-size: 15px; max-width: 92%; margin-top: 16px; }
  .hero-cta { margin-top: 24px; }
  /* indicatori più ampi e comodi da toccare */
  .slide-controls { bottom: 22px; }
  .slide-dots { gap: 12px; }
  .slide-dots button { width: 34px; height: 28px; }
}

/* Scroll hint */
.scroll-hint {
  position: absolute; bottom: 40px; right: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: rgba(255,255,255,.5);
  font-size: 9px; letter-spacing: .24em; text-transform: uppercase;
  z-index: 5; pointer-events: none;
  opacity: 0; transition: opacity .6s 2s;
}
.hero-ready .scroll-hint { opacity: 1; }
.scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,.55), transparent);
  animation: scrollAnim 2.2s var(--ease-in-out) infinite;
}
@keyframes scrollAnim {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  48%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}
@media (max-width: 640px) { .scroll-hint { display: none; } }

/* =========== MARQUEE STRIP =========== */
.marquee-wrap { height: var(--marquee-h); display: flex; align-items: center; background: var(--ink); overflow: hidden; }
.marquee-track {
  display: flex; white-space: nowrap;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-item {
  font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: rgba(255,255,255,.42); padding: 0 36px;
  display: inline-flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.marquee-dot { color: var(--ocra); font-size: 14px; line-height: 1; flex-shrink: 0; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========== SUBPAGE HERO =========== */
.subhero {
  position: relative; height: 56vh; min-height: 420px;
  overflow: hidden; background: #0c0a08;
}
.subhero img {
  position: absolute; inset: 0;
  width: 100%; height: 116%; object-fit: cover; opacity: .56;
  will-change: transform;
}
.subhero-video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 116%; object-fit: cover; opacity: .56;
}
.subhero--video .subhero-fallback { display: none; }
@media (prefers-reduced-motion: reduce) {
  .subhero--video .subhero-video { display: none; }
  .subhero--video .subhero-fallback { display: block; }
}
.subhero .grad {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,.16) 34%, rgba(0,0,0,.9) 100%),
    linear-gradient(90deg, rgba(0,0,0,.58) 0%, rgba(0,0,0,.16) 54%, rgba(0,0,0,.0) 84%);
}
.subhero .inner {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 0 68px; color: #fff;
}
.subhero .kicker {
  font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: #f0c46a; margin-bottom: 20px;
  text-shadow: 0 1px 12px rgba(0,0,0,.55);
  display: inline-flex; align-items: center; gap: 12px;
}
.subhero .kicker::before {
  content: ""; width: 24px; height: 1px; background: var(--ocra); flex-shrink: 0;
}
.subhero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 5.5vw, 74px);
  line-height: 1.03; letter-spacing: -.025em; max-width: 20ch;
  text-wrap: balance;
  text-shadow: 0 1px 2px rgba(0,0,0,.45), 0 2px 30px rgba(0,0,0,.55);
}

/* =========== SECTIONS =========== */
section { padding: 128px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { section { padding: 80px 0; } }
section.alt  { background: var(--bg-alt); }
section.dark { background: var(--ink); color: #fff; }
section.dark h2 { color: #fff; }
section.dark p  { color: rgba(255,255,255,.78); }
section.dark .eyebrow { color: var(--ocra); }
section.dark .eyebrow::before { background: var(--ocra); }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ocra-dark); margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--ocra-dark); flex-shrink: 0; }

h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05; letter-spacing: -.022em;
  margin-bottom: 28px; max-width: 22ch;
  text-wrap: balance;
}
h3 { font-family: var(--serif); font-weight: 500; font-size: 25px; line-height: 1.2; margin-bottom: 12px; text-wrap: balance; }
p  { color: var(--ink-soft); margin-bottom: 18px; }
p.lead {
  font-size: clamp(18px, 1.8vw, 20px); line-height: 1.62;
  color: var(--ink); max-width: 60ch; font-weight: 300;
  text-wrap: pretty;
}
section.dark p.lead { color: rgba(255,255,255,.9); }

/* Evidenza sobria sulle parole chiave */
p strong, .lead strong, .caption strong { font-weight: 600; color: var(--ink); }
section.dark p strong, section.dark .lead strong { color: #fff; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; gap: 48px; } }
/* Due blocchi grid-2 impilati nella stessa sezione */
.grid-2 + .grid-2 { margin-top: 112px; }
@media (max-width: 640px) { .grid-2 + .grid-2 { margin-top: 64px; } }
/* Inverte l'ordine delle colonne su desktop (testo a destra, immagine a sinistra),
   mantenendo il titolo in cima su mobile */
@media (min-width: 881px) {
  .grid-2.rev > :first-child { order: 2; }
  .grid-2.rev > :last-child  { order: 1; }
  /* L'immagine non supera l'altezza della colonna testo: si adatta e ritaglia */
  .grid-2.fit { align-items: stretch; }
  .grid-2.fit > div { display: flex; flex-direction: column; }
  .grid-2.fit .figure { flex: 1 1 auto; min-height: 0; }
  .grid-2.fit .figure img { aspect-ratio: auto; height: 100%; }
}

.figure { border-radius: 3px; overflow: hidden; background: var(--stone); }
.figure img { aspect-ratio: 4/5; object-fit: cover; width: 100%; height: 100%; transition: transform .85s var(--ease-out-expo); }
.figure:hover img { transform: scale(1.04); }
.caption { font-size: 12px; color: var(--muted); margin-top: 12px; font-style: italic; line-height: 1.5; }

/* =========== PREVIEW GRID =========== */
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
@media (max-width: 880px) { .preview-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .preview-grid { grid-template-columns: 1fr; } }

.pcard {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
  transition: border-color .3s, transform .5s var(--ease-out-expo), box-shadow .4s;
}
.pcard:hover {
  border-color: var(--ocra-dark);
  transform: translateY(-6px);
  box-shadow: 0 20px 56px rgba(28,24,20,.1);
}
.pcard .ph { aspect-ratio: 4/3; overflow: hidden; background: var(--stone); flex-shrink: 0; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .75s var(--ease-out-expo); }
.pcard:hover .ph img { transform: scale(1.06); }
.pcard .info { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.pcard .lab { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ocra-dark); font-weight: 600; margin-bottom: 10px; }
.pcard h3 { font-size: 22px; margin-bottom: 8px; }
.pcard p  { font-size: 14px; margin-bottom: 16px; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.pcard .arrow {
  font-size: 13px; color: var(--ink); font-weight: 600; letter-spacing: .06em;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap .35s var(--ease-out-expo);
  margin-top: auto;
}
.pcard:hover .arrow { gap: 14px; }

/* =========== PROSEGUI IL RACCONTO (nextlink) =========== */
.nextlink { display:block; padding:28px 32px; border:1px solid var(--line); border-radius:3px; background:var(--bg, #fff); text-decoration:none; transition:border-color .35s, transform .45s var(--ease-out-expo), box-shadow .45s; }
.nextlink:hover { border-color:var(--ocra-dark); transform:translateY(-3px); box-shadow:0 20px 56px rgba(28,24,20,.10); }
.nextlink-k { display:block; font-size:11px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:var(--ocra-dark); }
.nextlink-t { display:block; font-family:var(--serif); font-size:26px; line-height:1.15; color:var(--ink); margin-top:10px; }
.nextlink-d { display:block; font-size:14px; color:var(--muted); margin-top:10px; line-height:1.5; }

/* =========== TIMELINE =========== */
.timeline { margin-top: 56px; border-top: 1px solid var(--line); position: relative; }
.timeline-line {
  position: absolute; left: 116px; top: 0; bottom: 0; width: 1px;
  background: var(--line);
  transform-origin: top; transform: scaleY(0);
  transition: transform 1.4s var(--ease-out-expo);
}
.timeline.is-visible .timeline-line { transform: scaleY(1); }
.ev {
  display: grid; grid-template-columns: 140px 1fr; gap: 40px;
  padding: 32px 0; border-bottom: 1px solid var(--line);
  align-items: baseline; position: relative;
}
.ev-dot {
  position: absolute; left: 110px; top: 42px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
  transition: border-color .3s, background .3s, transform .3s;
}
.ev:hover .ev-dot { background: var(--ocra); border-color: var(--ocra); transform: scale(1.3); }
.ev .yr { font-family: var(--serif); font-size: 36px; font-weight: 500; color: var(--ocra-dark); letter-spacing: -.01em; }
.ev .txt h4 { font-family: var(--serif); font-weight: 500; font-size: 19px; margin-bottom: 6px; }
.ev .txt p  { margin-bottom: 0; font-size: 15px; }
@media (max-width: 640px) {
  .ev { grid-template-columns: 1fr; gap: 8px; }
  .ev .yr { font-size: 28px; }
  .timeline-line, .ev-dot { display: none; }
}

/* =========== STATS =========== */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat {
  padding: 36px; background: var(--bg-alt); border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color .3s, transform .45s var(--ease-out-expo);
}
.stat:hover { border-color: var(--ocra-dark); transform: translateY(-3px); }
.stat .n { font-family: var(--serif); font-size: 54px; line-height: 1; font-weight: 500; color: var(--ink); letter-spacing: -.03em; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.4; }

/* =========== GALLERY =========== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
@media (max-width: 880px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }
.gcard {
  position: relative; border-radius: 4px; overflow: hidden;
  background: var(--stone); cursor: pointer;
  transition: transform .5s var(--ease-out-expo), box-shadow .4s;
}
.gcard:hover { transform: translateY(-4px); box-shadow: 0 20px 56px rgba(28,24,20,.14); }
.gcard img { aspect-ratio: 4/5; object-fit: cover; width: 100%; height: 100%; transition: transform .75s var(--ease-out-expo); display: block; }
.gcard:hover img { transform: scale(1.06); }
.gcard .tag {
  position: absolute; top: 14px; left: 14px;
  background: rgba(28,24,20,.84);
  color: #fff; font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 2px; font-weight: 500;
  transition: background .3s;
}
.gcard:hover .tag { background: var(--ocra-dark); }

/* =========== PRINCIPLES =========== */
.principles {
  margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; border-top: 1px solid var(--line); padding-top: 52px;
}
@media (max-width: 880px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .principles { grid-template-columns: 1fr; } }
.principle {
  padding: 24px; border: 1px solid transparent; border-radius: 4px;
  transition: border-color .3s, background .3s, transform .45s var(--ease-out-expo);
}
.principle:hover { border-color: var(--line); background: var(--bg-alt); transform: translateY(-2px); }
.principle .num { font-family: var(--serif); font-size: 13px; color: var(--ocra-dark); font-weight: 600; margin-bottom: 12px; letter-spacing: .08em; }
.principle h4 { font-family: var(--serif); font-size: 19px; margin-bottom: 8px; font-weight: 500; }
.principle p { font-size: 14px; margin-bottom: 0; line-height: 1.65; }

/* =========== VISIT CARD =========== */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
@media (max-width: 880px) { .visit-grid { grid-template-columns: 1fr; } }
.visit-card { background: var(--ink); color: #fff; padding: 48px; border-radius: 4px; }
.visit-card h3 { color: #fff; }
.visit-card p  { color: rgba(255,255,255,.78); }
.visit-card dl { margin-top: 28px; }
.visit-card dt {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ocra); margin-top: 22px; font-weight: 600;
}
.visit-card dd { color: rgba(255,255,255,.92); font-size: 15px; margin-top: 3px; }

/* =========== BUTTONS =========== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 28px; height: 52px;
  background: var(--ocra-dark); color: #fff;
  font-weight: 600; font-size: 14px; letter-spacing: .04em;
  border-radius: 3px; border: none; cursor: pointer;
  /* --bx / --by dal JS magnetic effect */
  transform: translate(var(--bx, 0px), var(--by, 0px));
  transition: background .25s, transform .4s var(--ease-out-expo), box-shadow .3s;
  text-decoration: none; position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn:hover {
  background: var(--ink);
  transform: translate(var(--bx, 0px), var(--by, 0px)) translateY(-2px);
  box-shadow: 0 12px 36px rgba(28,24,20,.2);
}
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.light {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.45);
}
.btn.light:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* Ripple */
.btn-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.2);
  pointer-events: none;
  transform: scale(0); opacity: 1;
  animation: btnRipple .55s var(--ease-out-expo) forwards;
}
@keyframes btnRipple {
  to { transform: scale(1); opacity: 0; }
}

/* =========== SHOP =========== */
.shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 56px; }
@media (max-width: 880px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .shop-grid { grid-template-columns: 1fr; } }
.product {
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .3s, transform .45s var(--ease-out-expo);
}
.product:hover { border-color: var(--ocra-dark); transform: translateY(-4px); }
.product .ph {
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--stone) 0%, var(--bg-alt) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: var(--serif); font-style: italic;
  font-size: 14px; position: relative;
}
.product .ph .badge {
  position: absolute; top: 14px; left: 14px;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ocra-dark); background: rgba(255,255,255,.9);
  padding: 5px 9px; border-radius: 2px; font-weight: 600;
  font-style: normal; font-family: var(--sans);
}
.product .info { padding: 20px; }
.product h4 { font-family: var(--serif); font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.product .by { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* Newsletter */
.newsletter {
  margin-top: 72px; padding: 56px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px; text-align: center;
}
.newsletter h3 { font-size: 28px; }
.newsletter p { color: var(--ink-soft); }
.newsletter form { display: flex; gap: 12px; max-width: 520px; margin: 24px auto 0; }
.newsletter input {
  flex: 1; padding: 0 18px; height: 52px;
  border: 1.5px solid var(--line); border-radius: 3px;
  font-family: inherit; font-size: 14px; background: var(--bg);
  transition: border-color .2s;
  color: var(--ink);
}
.newsletter input::placeholder { color: var(--muted); }
.newsletter input:hover { border-color: var(--line-dark); }
@media (max-width: 520px) { .newsletter form { flex-direction: column; } }

/* =========== TRASPARENZA =========== */
.pnrr-info { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 880px) { .pnrr-info { grid-template-columns: 1fr; } }
.pnrr-info dt { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ocra); margin-top: 20px; font-weight: 600; }
.pnrr-info dd { color: rgba(255,255,255,.9); font-size: 15px; margin-top: 2px; }
.logos { margin-top: 48px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: 16px; }
.logo-ph {
  padding: 14px 22px; border: 1px solid rgba(255,255,255,.18); border-radius: 3px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.62); font-weight: 500;
  transition: border-color .3s, color .3s;
}
.logo-ph:hover { border-color: var(--ocra); color: var(--ocra); }

/* =========== FORM (contatti) =========== */
.form-stack { display: flex; flex-direction: column; gap: 0; }

.form-group {
  position: relative;
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-stack input,
.form-stack textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  font-family: inherit; font-size: 15px;
  background: var(--bg); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder,
.form-stack input::placeholder,
.form-stack textarea::placeholder { color: var(--muted); opacity: 1; }
.form-group input:hover,
.form-group textarea:hover,
.form-stack input:hover,
.form-stack textarea:hover { border-color: var(--line-dark); }
.form-group textarea,
.form-stack textarea { min-height: 160px; resize: vertical; line-height: 1.6; }

/* Form success state */
.form-success {
  display: none;
  text-align: center; padding: 48px 32px;
  border: 1.5px solid var(--line); border-radius: 4px;
}
.form-success.visible { display: block; }
.form-success-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-alt); border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 22px; color: var(--field);
}
.form-success h3 { font-size: 22px; margin-bottom: 8px; }
.form-success p { color: var(--muted); font-size: 15px; }

/* =========== FOOTER =========== */
footer {
  background: var(--bg-alt);
  padding: 72px 0 36px;
  font-size: 14px; color: var(--ink-soft);
}
footer .grid-f {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 52px;
}
@media (max-width: 880px) { footer .grid-f { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { footer .grid-f { grid-template-columns: 1fr; } }
.footer-logo {
  height: 32px; width: auto; display: block;
  margin-bottom: 18px; opacity: .72;
  transition: opacity .3s;
}
.footer-logo:hover { opacity: 1; }
footer h5 {
  font-family: var(--serif); font-weight: 500; font-size: 15px;
  margin-bottom: 14px; color: var(--ink);
}
footer ul { list-style: none; }
footer ul li { margin-bottom: 10px; }
footer ul a { color: var(--muted); font-size: 13px; transition: color .2s; }
footer ul a:hover { color: var(--ocra-dark); }
.pnrr-strip {
  padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); line-height: 1.8; letter-spacing: .01em;
}
.pnrr-strip strong { color: var(--ink-soft); font-weight: 600; }

/* =========== LIGHTBOX =========== */
.lb {
  position: fixed; inset: 0; background: rgba(12,10,8,.96);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 24px; cursor: zoom-out;
}
.lb.on { display: flex; animation: lbIn .35s var(--ease-out-expo) forwards; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb img {
  max-width: 100%; max-height: 90vh; object-fit: contain;
  transform: scale(.95); transition: transform .55s var(--ease-out-expo);
  cursor: default;
}
.lb.on img { transform: scale(1); }
.lb-close {
  position: absolute; top: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s, transform .3s;
}
.lb-close:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); transform: rotate(90deg); }
.lb-close:focus-visible { outline-color: #fff; }

/* =============================================
   DETAIL MODAL — interventi (click su foto → racconto)
============================================= */
.dx { position: fixed; inset: 0; background: rgba(12,10,8,.96); display: none; align-items: center; justify-content: center; z-index: 110; padding: 24px; }
.dx.on { display: flex; animation: lbIn .35s var(--ease-out-expo) forwards; }
.dx-panel { position: relative; background: var(--bg); color: var(--ink); border-radius: 6px; overflow: hidden; max-width: 1000px; width: 100%; max-height: 88vh; display: grid; grid-template-columns: 1.1fr 1fr; box-shadow: 0 40px 120px rgba(0,0,0,.5); transform: scale(.96); transition: transform .5s var(--ease-out-expo); }
.dx.on .dx-panel { transform: scale(1); }
.dx-media { background: #000; min-height: 0; }
.dx-media img { width: 100%; height: 100%; max-height: 88vh; object-fit: cover; display: block; }
.dx-body { padding: 44px 42px 46px; overflow-y: auto; }
.dx-kicker { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ocra-dark); }
.dx-body h3 { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.12; margin: 12px 0 18px; letter-spacing: -.01em; }
.dx-body p { margin-bottom: 14px; }
.dx-body p:last-child { margin-bottom: 0; }
.dx-close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5); background: rgba(28,24,20,.5); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .3s, background .2s; }
.dx-close:hover { transform: rotate(90deg); background: rgba(28,24,20,.85); }
.dx-close:focus-visible { outline-color: #fff; }
@media (max-width: 720px) {
  .dx-panel { grid-template-columns: 1fr; max-height: 92vh; }
  .dx-media, .dx-media img { max-height: 40vh; }
  .dx-body { padding: 28px 24px 32px; }
  .dx-body h3 { font-size: 24px; }
}
/* affordance card con dettaglio */
.gcard--detail { cursor: pointer; }
.gcard-plus { position: absolute; right: 14px; bottom: 14px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; background: rgba(28,24,20,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .25s, transform .25s; }
.gcard--detail:hover .gcard-plus { background: var(--ocra-dark); transform: scale(1.1); }

/* =========== LANG SWAP =========== */
[data-en] { display: none; }
html[lang="en"] [data-it] { display: none; }
html[lang="en"] [data-en] { display: block; }
html[lang="en"] span[data-en],
html[lang="en"] dt[data-en],
html[lang="en"] dd[data-en]  { display: inline; }
html[lang="en"] dt[data-en]  { display: block; }
html[lang="en"] dd[data-en]  { display: block; }

/* =========== VISUALLY HIDDEN (screen-reader only) =========== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========== REDUCED MOTION =========== */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .split-word span { transform: none !important; opacity: 1 !important; transition: none !important; }
  #page-loader, #page-transition { display: none !important; }
  .scroll-line, .marquee-track, .btn-ripple { animation: none !important; }
  .hero-slideshow .kicker,
  .hero-slideshow .sub,
  .hero-cta { opacity: 1 !important; transform: none !important; transition: none !important; }
  .timeline-line { transform: none !important; }
  header.site { transition: background .01ms, border-color .01ms !important; }
  .nav ul li { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
