/* ==========================================================================
   main.css — Cascina Sciolla (base + layout + componenti)
   Nessun colore/dimensione hardcoded: solo token da tokens.css.
   Solo transform/opacity per le animazioni; transizioni <= 200ms.
   ========================================================================== */

/* --- Font self-hosted (variabili, subset latino) ------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/inter-var.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/fraunces-var.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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Reset di base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Evita lo scroll orizzontale causato dal drawer off-canvas (position:fixed
     tradotto fuori dal bordo destro): l'overflow sul root si propaga al viewport
     e ritaglia i figli fixed. html resta il contenitore di scroll verticale,
     quindi l'header sticky continua a funzionare. */
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video, svg, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:target { scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }

/* --- Tipografia ---------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--brand-strong);
  letter-spacing: 0.01em;
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { max-width: var(--measure); }

.eyebrow {
  font-family: var(--ff-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--sp-3);
}

/* --- Accessibilità: focus + skip link + sr-only ------------------------- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  top: var(--sp-2); left: var(--sp-2);
  z-index: calc(var(--z-lightbox) + 1);
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  color: var(--brand-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  transform: translateY(-150%);
  transition: transform var(--t) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* --- Layout container ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.section { padding-block: var(--section-pad); }
.section-tint { background: var(--surface-tint); }
.section-head { margin-bottom: var(--sp-7); max-width: var(--measure); }
.section-head h2 { margin-bottom: var(--sp-3); }
.section-intro { color: var(--c-muted); }

/* --- Reveal on scroll (one-shot) — progressive enhancement -------------- */
/* Lo stato nascosto si applica SOLO se il JS è attivo (classe .js su <html>):
   senza JS, o se il JS fallisce, il contenuto resta pienamente visibile. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  /* Sfondo quasi opaco: NIENTE backdrop-filter/filter/transform qui, altrimenti
     l'header diventerebbe il containing block dei figli position:fixed (drawer +
     backdrop) intrappolandoli nella barra invece che nel viewport. */
  background: rgb(var(--rgb-white) / 0.96);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--sh-1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
  transition: min-height var(--t) var(--ease);
}
.site-header.is-scrolled .header-inner { min-height: var(--header-h-compact); }

.brand { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--brand-strong); }
.brand-mark { width: 40px; height: 40px; transition: transform var(--t) var(--ease); }
.site-header.is-scrolled .brand-mark { transform: scale(0.86); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--ff-display); font-weight: 600; font-size: 1.25rem; }
.brand-tag {
  font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c-muted);
}

.nav { display: flex; align-items: center; }
.nav-list { display: flex; align-items: center; gap: var(--sp-2); }
.nav-list a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: var(--sp-2) var(--sp-3);
  color: var(--c-green-800); font-weight: 500; border-radius: var(--r-sm);
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.nav-list a:hover { color: var(--brand-strong); background: var(--surface-tint); }
.nav-lang a {
  border: 0;
  font-weight: 600; letter-spacing: 0.06em;
}
.nav-lang a[aria-current="true"] { background: var(--brand); color: var(--cta-fg); border-color: var(--brand); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid var(--border);
}
.nav-toggle-box { position: relative; width: 22px; height: 16px; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--brand-strong); border-radius: var(--r-pill);
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { content: ""; top: -7px; }
.nav-toggle-bar::after { content: ""; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(90deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { opacity: 0; }

.nav-backdrop {
  position: fixed; inset: 0;
  background: var(--scrim);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease);
  z-index: var(--z-drawer);
}
.nav-backdrop.is-open { opacity: 1; visibility: visible; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: var(--sp-3) var(--sp-6);
  font-weight: 600; border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease), background-color var(--t) var(--ease),
    color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--cta-bg); color: var(--cta-fg); }
.btn-primary:hover { background: var(--cta-bg-hover); color: var(--cta-fg); box-shadow: var(--sh-2); }
.btn-ghost { background: transparent; color: var(--brand-strong); border-color: currentColor; }
.btn-ghost:hover { background: var(--surface-tint); color: var(--brand-strong); }
.btn-on-dark { color: var(--c-white); border-color: rgb(var(--rgb-white) / 0.7); }
.btn-on-dark:hover { background: rgb(var(--rgb-white) / 0.14); color: var(--c-white); }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; color: var(--c-white); overflow: hidden; }
.hero-media, .hero-media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero-media img { object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: var(--hero-overlay); z-index: -1; }
.hero-media { z-index: -2; }
.hero-content {
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: min(90vh, 760px);
  padding-block: calc(var(--header-h) + var(--sp-7)) var(--sp-9);
  justify-content: center;
}
.hero .eyebrow { color: var(--c-cream); }
.hero-title { color: var(--c-white); font-size: var(--fs-hero); max-width: 16ch; margin-bottom: var(--sp-4); }
.hero-sub { color: var(--c-cream); font-size: clamp(1.05rem, 1.6vw, 1.375rem); max-width: 46ch; margin-bottom: var(--sp-6); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero-scroll {
  position: absolute; left: 50%; bottom: var(--sp-5); transform: translateX(-50%);
  color: var(--c-cream); opacity: 0.9;
}
.hero-scroll svg { width: 26px; height: 26px; animation: hero-bounce 2.4s var(--ease) infinite; }
@keyframes hero-bounce { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(6px);} }

/* --- About --------------------------------------------------------------- */
.about-grid { display: grid; gap: var(--sp-7); align-items: center; }
.about-media img {
  width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-2); object-fit: cover;
}
.about-text h2 { margin-bottom: var(--sp-4); }
.about-text p + p { margin-top: var(--sp-4); }
.feature-list {
  display: grid; gap: var(--sp-4);
  margin-top: var(--sp-6);
}
.feature-item { display: flex; align-items: flex-start; gap: var(--sp-3); }
.feature-item .ico {
  flex: 0 0 auto; width: 26px; height: 26px; color: var(--brand);
}
.feature-item b { color: var(--brand-strong); font-family: var(--ff-display); font-size: 1.15rem; font-weight: 600; }
.feature-item span { display: block; color: var(--c-muted); font-size: var(--fs-small); }

/* --- Products cards ------------------------------------------------------ */
.cards { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-1);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--c-green-300); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-tint); color: var(--brand);
}
.card-icon svg { width: 30px; height: 30px; }
.card h3 { margin-bottom: var(--sp-2); }
.card p { color: var(--c-muted); }

/* --- Gallery ------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.gallery-item { margin: 0; }
.gallery-btn {
  display: block; width: 100%; padding: 0;
  border-radius: var(--r-md); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--surface-tint);
  box-shadow: var(--sh-1);
}
.gallery-btn img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.gallery-btn:hover img { transform: scale(1.05); }
.gallery-item:nth-child(4n+1) .gallery-btn { aspect-ratio: 3 / 4; }

/* --- Video --------------------------------------------------------------- */
.video {
  position: relative; margin-top: var(--sp-7);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2);
  background: var(--c-green-900);
}
.video video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--c-white); background: var(--scrim);
  transition: opacity var(--t) var(--ease), background-color var(--t) var(--ease);
}
.video-play:hover { background: rgb(var(--rgb-green-900) / 0.3); }
.video-play svg { width: 76px; height: 76px; filter: drop-shadow(var(--sh-2)); transition: transform var(--t) var(--ease); }
.video-play:hover svg { transform: scale(1.06); }
.video.is-playing .video-play { opacity: 0; visibility: hidden; }

/* --- Contact ------------------------------------------------------------- */
.contact-grid { display: grid; gap: var(--sp-7); align-items: start; }
.contact-info h2 { margin-bottom: var(--sp-5); }
.contact-list { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.contact-list li { display: flex; align-items: flex-start; gap: var(--sp-3); }
.contact-list .ico { flex: 0 0 auto; width: 24px; height: 24px; color: var(--brand); margin-top: 3px; }
.contact-list .lbl { display: block; font-size: var(--fs-small); color: var(--c-muted); }
.contact-list a { color: var(--brand-strong); font-weight: 500; }
.contact-list a:hover { color: var(--brand); }
.contact-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.contact-map {
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2);
  border: 1px solid var(--border);
}
.contact-map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; }

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--c-green-900); color: var(--c-cream);
  padding-block: var(--sp-8) var(--sp-6);
}
.footer-grid { display: grid; gap: var(--sp-7); }
.footer-logo { width: 148px; height: auto; margin-bottom: var(--sp-4); }
.site-footer h2 {
  color: var(--c-white); font-size: var(--fs-h3); margin-bottom: var(--sp-4);
}
.site-footer p, .site-footer li { color: var(--c-cream); }
.site-footer a { color: var(--c-white); }
.site-footer a:hover { color: var(--c-green-300); }
.footer-list { display: grid; gap: var(--sp-2); }
.footer-nav a { display: inline-flex; min-height: 40px; align-items: center; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between;
  margin-top: var(--sp-7); padding-top: var(--sp-5);
  border-top: 1px solid rgb(var(--rgb-white) / 0.15);
  font-size: var(--fs-small);
}
.footer-bottom p { color: rgb(var(--rgb-cream) / 0.8); max-width: none; }

/* --- Back to top --------------------------------------------------------- */
.to-top {
  position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: var(--z-totop);
  width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--cta-fg); border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility var(--t) var(--ease), background-color var(--t) var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--cta-bg-hover); color: var(--cta-fg); }
.to-top svg { width: 22px; height: 22px; }

/* --- Lightbox ------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-lightbox);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
  background: var(--backdrop);
  opacity: 0; visibility: hidden;
  touch-action: none; overscroll-behavior: contain; /* niente scroll della pagina sotto: swipe pulito */
  transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-figure { margin: 0; max-width: min(1100px, 92vw); text-align: center; }
.lightbox-img {
  max-width: 100%; max-height: 80vh; margin-inline: auto;
  border-radius: var(--r-md); box-shadow: var(--sh-2);
}
.lightbox-caption { color: var(--c-cream); margin-top: var(--sp-3); font-size: var(--fs-small); max-width: none; }
.lightbox-btn {
  position: absolute; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; color: var(--c-white); border-radius: var(--r-pill);
  background: rgb(var(--rgb-white) / 0.12);
  transition: background-color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.lightbox-btn:hover { background: rgb(var(--rgb-white) / 0.24); color: var(--c-white); }
.lightbox-close { top: var(--sp-4); right: var(--sp-4); }
.lightbox-prev { left: var(--sp-4); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: var(--sp-4); top: 50%; transform: translateY(-50%); }
.lightbox-btn svg { width: 26px; height: 26px; }

/* --- Privacy / testo lungo ---------------------------------------------- */
.page-head { padding-block: calc(var(--header-h) + var(--sp-7)) var(--sp-6); background: var(--surface-tint); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--fs-h3); margin-top: var(--sp-7); margin-bottom: var(--sp-3); }
.prose p + p, .prose ul { margin-top: var(--sp-4); }
.prose ul { list-style: disc; padding-left: var(--sp-5); }
.prose li { margin-top: var(--sp-2); }
.prose a { text-decoration: underline; }

/* --- 404 ----------------------------------------------------------------- */
.error-page {
  min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: var(--sp-4);
  padding-block: var(--sp-9);
}
.error-code { font-family: var(--ff-display); font-size: clamp(4rem, 14vw, 8rem); color: var(--c-green-300); line-height: 1; }
.error-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-3); }

/* ==========================================================================
   RESPONSIVE — mobile-first
   ========================================================================== */

/* Mobile (<= 640): nav hamburger -> drawer */
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: fixed; top: 0; right: 0; bottom: 0;
    z-index: calc(var(--z-drawer) + 1);
    width: min(84vw, 340px);
    flex-direction: column; align-items: stretch; gap: var(--sp-1);
    padding: calc(var(--header-h) + var(--sp-4)) var(--sp-5) var(--sp-6);
    background: var(--surface);
    box-shadow: var(--sh-2);
    transform: translateX(100%);
    transition: transform var(--t) var(--ease);
    overflow-y: auto;
  }
  .nav-list.is-open { transform: translateX(0); }
  .nav-list a { min-height: 48px; width: 100%; font-size: 1.0625rem; }
  .nav-lang { margin-top: var(--sp-3); }
  .nav-lang a { justify-content: center; }
}

/* Tablet (>= 641) */
@media (min-width: 641px) {
  .container { padding-inline: var(--sp-6); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery-item:nth-child(4n+1) .gallery-btn { aspect-ratio: 4 / 3; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* Desktop (>= 1025) */
@media (min-width: 1025px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-grid.reverse .about-media { order: 2; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery-item:nth-child(4n+1) .gallery-btn { aspect-ratio: 3 / 4; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   prefers-reduced-motion: niente movimento
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero-scroll svg { animation: none; }
  .btn:hover, .card:hover, .gallery-btn:hover img { transform: none; }
}

/* ==========================================================================
   RIFINITURA — "compatta e squadrata" + arricchimento (override intenzionali)
   Solo token; niente colori hardcoded (regola 10b).
   ========================================================================== */
:root {
  /* angoli squadrati */
  --r-sm: 2px; --r-md: 3px; --r-lg: 3px; --r-pill: 3px;
  /* ritmo più compatto */
  --section-pad: clamp(2.5rem, 5.5vw, 4.5rem);
}

/* Hero: overlay più cinematografico, un filo più compatto */
.hero-overlay {
  background:
    linear-gradient(180deg, rgb(var(--rgb-green-900) / .30) 0%, rgb(var(--rgb-green-900) / .08) 32%, rgb(var(--rgb-green-900) / .60) 100%),
    linear-gradient(90deg, rgb(var(--rgb-green-900) / .46) 0%, rgb(var(--rgb-green-900) / 0) 58%);
}
.hero-content { min-height: min(78vh, 640px); }
.hero-title { text-shadow: 0 2px 22px rgb(var(--rgb-green-900) / .35); }
.hero-sub   { text-shadow: 0 1px 12px rgb(var(--rgb-green-900) / .35); }

/* Eyebrow con lineetta decorativa */
.eyebrow { display: inline-flex; align-items: center; gap: var(--sp-3); }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.hero .eyebrow::before { background: var(--c-cream); }
.section-head { margin-bottom: var(--sp-6); }

/* Card prodotti: foto in cima + corpo compatto, squadrata */
.card { padding: 0; overflow: hidden; border-top: 3px solid transparent; }
.card:hover { border-top-color: var(--brand); }
.card-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-tint); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t) var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: var(--sp-5); }
.card-icon { width: 46px; height: 46px; margin-bottom: var(--sp-3); border: 1px solid var(--border); }
.card-icon svg { width: 24px; height: 24px; }

/* Gallery: mosaico 3x3 uniforme, quadrato, compatto (foto NON sparpagliate) */
.gallery { grid-template-columns: repeat(3, 1fr); gap: var(--sp-1); }
.gallery-btn,
.gallery-item:nth-child(4n+1) .gallery-btn { aspect-ratio: 1 / 1; border-radius: 0; box-shadow: none; }
.gallery-btn { position: relative; }
.gallery-btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgb(var(--rgb-green-900) / .40) 100%);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.gallery-btn:hover::after { opacity: 1; }
.video { margin-top: var(--sp-5); }

/* About: cornice foto sobria e squadrata */
.about-media img { border: 1px solid var(--border); }

/* Contatti/mappa */
.contact-map iframe { min-height: 380px; }

/* Bottone primario: ombra morbida */
.btn-primary { box-shadow: 0 6px 16px rgb(var(--rgb-green-900) / .16); }

@media (prefers-reduced-motion: reduce) {
  .card:hover .card-media img { transform: none; }
}

/* ==========================================================================
   RIFINITURA 2 — logo originale, Chi siamo bilanciato, gallery, bandiere
   (i colori bandiera sono costanti ufficiali, non token di tema)
   ========================================================================== */
.brand-logo { height: 50px; width: auto; transition: height var(--t) var(--ease); }
.site-header.is-scrolled .brand-logo { height: 42px; }
.footer-logo { width: 150px; height: auto; }
.nav-lang a { gap: var(--sp-2); }
.flag { width: 26px; height: 17px; border-radius: 3px; display: inline-block; }

/* Chi siamo: foto grande, all'altezza del testo */
.about-grid { align-items: stretch; }
.about-media, .about-media picture { height: 100%; display: block; }
.about-media img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
@media (min-width: 1025px) {
  .about-grid { grid-template-columns: 1.15fr 1fr; gap: var(--sp-8); }
  .about-media img { min-height: 480px; }
}

/* Gallery: griglia uniforme 3 colonne, 4:3 (mostra bene le piante, non sparpagliata) */
.gallery { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.gallery-btn,
.gallery-item:nth-child(4n+1) .gallery-btn { aspect-ratio: 4 / 3; }

/* Hero: pannello testo leggibile — squadrato con angoli arrotondati + velo verde glass */
:root { --r-round: 16px; }
.hero-content { align-items: flex-start; }
.hero-panel {
  max-width: 44rem;
  padding: var(--sp-6);
  border-radius: var(--r-round);
  background: rgb(var(--rgb-green-900) / 0.32);
  border: 1px solid rgb(var(--rgb-white) / 0.14);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  backdrop-filter: blur(6px) saturate(1.1);
}
.hero-panel .hero-sub { margin-bottom: var(--sp-5); }

/* ==========================================================================
   COOKIE CONSENT (GDPR) — banner + blocco mappa finché non si accetta
   ========================================================================== */
.contact-map { position: relative; }
.map-consent {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3); text-align: center; padding: var(--sp-5);
  background: var(--surface-tint); color: var(--c-green-800);
}
.map-consent p { max-width: 30ch; margin: 0; color: var(--c-green-800); }
.cookie-banner {
  position: fixed; left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4);
  z-index: var(--z-lightbox);
  max-width: 760px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-green-900); color: var(--c-cream);
  border: 1px solid rgb(var(--rgb-white) / 0.14);
  border-radius: var(--r-round, 14px);
  box-shadow: var(--sh-2);
}
.cookie-banner p { flex: 1 1 260px; margin: 0; max-width: none; color: var(--c-cream); font-size: var(--fs-small); }
.cookie-banner a { color: var(--c-white); text-decoration: underline; }
.cookie-actions { display: flex; gap: var(--sp-2); flex: 0 0 auto; }
.cookie-actions .btn { min-height: 40px; padding: var(--sp-2) var(--sp-4); }
.cookie-banner .btn-ghost { color: var(--c-cream); border-color: rgb(var(--rgb-white) / 0.5); }
.cookie-banner .btn-ghost:hover { background: rgb(var(--rgb-white) / 0.12); color: var(--c-white); }

/* ==========================================================================
   RIFINITURA 3 — Chi siamo collage (3 foto, no stiramento) + Contatti con stile
   ========================================================================== */
.about-collage {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: var(--sp-2);
  height: 100%;
  min-height: 340px;
}
.about-collage img { width: 100%; height: 100%; min-height: 0; object-fit: cover; border: 0; border-radius: var(--r-md); }
.about-collage img:first-child { grid-row: 1 / span 2; }
@media (min-width: 1025px) { .about-collage { min-height: 460px; } }

/* Contatti: info in card, mappa allineata alla stessa altezza e più grande */
.contact-grid { align-items: stretch; }
.contact-info {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-round); padding: var(--sp-6);
}
.contact-map, .contact-map iframe { height: 100%; }
.contact-map iframe { min-height: 320px; }
.contact-list li { padding-block: var(--sp-3); border-bottom: 1px solid var(--border); align-items: center; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .lbl { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; margin-bottom: 2px; }
.contact-list a { font-size: 1.05rem; }

/* ==========================================================================
   RIFINITURA 4 — header: trasparente sopra l'hero, diventa BIANCO in modo
   GRADUALE allo scroll (non crema/giallo, niente scatto).
   NIENTE backdrop-filter sull'header (intrappolerebbe il drawer fixed).
   ========================================================================== */
html { scroll-padding-top: 88px; }
.site-header {
  position: fixed; left: 0; right: 0; top: 0;
  background: rgb(var(--rgb-white) / 0.90);
  border-bottom: 1px solid var(--border);
  transition: background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.header-inner, .site-header.is-scrolled .header-inner { min-height: 80px; }
/* logo grande che sporge sotto l'header, SENZA cambiare l'altezza dell'header
   (margine negativo = contributo al layout 80px, resa visiva 112px) */
.brand { align-self: center; }
/* Logo: GRANDE e sporgente SOLO in cima all'hero; appena si scrolla (o sulle
   pagine interne) rientra dentro l'header — contenuto e più piccolo — così non
   va mai sopra il contenuto sottostante. Niente più "vaso". */
.brand-logo { height: 54px; margin-bottom: 0; }
.site-header.is-scrolled .brand-logo { height: 54px; margin-bottom: 0; }
.has-hero .site-header:not(.is-compact) .brand-logo { height: 112px; margin-bottom: -32px; }
.brand-logo { transition: height .35s var(--ease), margin-bottom .35s var(--ease), filter .35s var(--ease); }
.site-header.is-scrolled { box-shadow: var(--sh-1); }

/* Homepage: header trasparente sopra la foto, con velo scuro per leggibilità */
.has-hero .site-header { background: transparent; border-bottom-color: transparent; box-shadow: none; }
.has-hero .site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(var(--rgb-green-900) / 0.45) 0%, rgb(var(--rgb-green-900) / 0) 100%);
  opacity: 1; transition: opacity .35s var(--ease);
}
.has-hero .site-header .brand-logo { filter: brightness(0) invert(1); }
.has-hero .site-header .nav-toggle { border-color: rgb(var(--rgb-white) / 0.55); }
.has-hero .site-header .nav-toggle-bar,
.has-hero .site-header .nav-toggle-bar::before,
.has-hero .site-header .nav-toggle-bar::after { background: var(--c-white); }

/* Homepage scrollata: header bianco (fade graduale), logo/testo scuri, velo via */
.has-hero .site-header.is-scrolled { background: rgb(var(--rgb-white) / 0.92); border-bottom-color: var(--border); }
.has-hero .site-header.is-scrolled::before { opacity: 0; }
.has-hero .site-header.is-scrolled .brand-logo { filter: none; }
.has-hero .site-header.is-scrolled .nav-toggle { border-color: var(--border); }
.has-hero .site-header.is-scrolled .nav-toggle-bar,
.has-hero .site-header.is-scrolled .nav-toggle-bar::before,
.has-hero .site-header.is-scrolled .nav-toggle-bar::after { background: var(--brand-strong); }

@media (min-width: 1025px) {
  .has-hero .site-header .nav-list a { color: var(--c-white); }
  .has-hero .site-header .nav-list a:hover { color: var(--c-cream); background: rgb(var(--rgb-white) / 0.14); }
  .has-hero .site-header .nav-lang a { border-color: rgb(var(--rgb-white) / 0.6); }
  .has-hero .site-header.is-scrolled .nav-list a { color: var(--c-green-800); }
  .has-hero .site-header.is-scrolled .nav-list a:hover { color: var(--brand-strong); background: var(--surface-tint); }
  .has-hero .site-header.is-scrolled .nav-lang a { border-color: var(--border); }
}

/* ==========================================================================
   RIFINITURA 5 — footer organizzato e allineato (web / tablet / mobile)
   ========================================================================== */
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-7); align-items: start; }
@media (min-width: 769px) {
  .footer-grid { grid-template-columns: 1.7fr 1fr; column-gap: var(--sp-7); }
}
/* brand: logo a sinistra, testo affiancato a destra (senza sforare il logo) */
.footer-brand { display: flex; align-items: center; gap: var(--sp-4); }
.footer-brand .footer-logo { flex: 0 0 auto; margin-bottom: 0; }
.footer-brand p { margin: 0; max-width: 40ch; }
@media (max-width: 480px) {
  .footer-brand { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}
.site-footer h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: var(--sp-3); }
.footer-list { gap: var(--sp-2); }
.footer-logo { width: 128px; margin-bottom: var(--sp-3); }
.footer-bottom { align-items: center; gap: var(--sp-4); }

/* ==========================================================================
   RIFINITURA 6 — divisore decorativo "due piante" (linea · piante · linea)
   + footer-bottom elegante (desktop e mobile)
   ========================================================================== */
.leaf-divider { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-5); color: var(--c-green-300); }
.leaf-divider::before, .leaf-divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .45; }
.leaf-divider .ld-mark { flex: 0 0 auto; width: 42px; height: 28px; color: var(--c-green-100); }

.footer-bottom { border-top: 0; padding-top: 0; margin-top: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2) var(--sp-4); }
.footer-bottom p { font-size: var(--fs-small); max-width: none; }
@media (max-width: 640px) {
  .footer-bottom { justify-content: center; text-align: center; }
  .leaf-divider { margin: var(--sp-5) 0; }
}

/* RIFINITURA 7 (r9) rimossa in r13: niente più "vaso". Il logo si rimpicciolisce
   e rientra dentro l'header sullo scroll, quindi il contenitore non serve. */

/* ==========================================================================
   RIFINITURA 8 (r10) — copyright ordinato: unità intere, mai spezzate a metà.
   Desktop: in riga con separatori "·". Mobile: ogni unità su riga propria.
   ========================================================================== */
.footer-bottom .copyright {
  display: flex; flex-wrap: wrap; align-items: baseline;
  column-gap: var(--sp-2); row-gap: var(--sp-1, 4px);
  margin: 0; max-width: none;
}
.footer-bottom .copyright .cr-line { overflow-wrap: normal; word-break: normal; hyphens: none; }
.footer-bottom .copyright .cr-sep { opacity: .5; }
@media (max-width: 640px) {
  .footer-bottom .copyright { justify-content: center; }
  .footer-bottom .copyright .cr-sep { display: none; }
  .footer-bottom .copyright .cr-line { flex: 0 0 100%; }
}

/* ==========================================================================
   RIFINITURA 9 (r11) — header "vetro" che sfuma in modo PROGRESSIVO con lo
   scroll (var --solid 0→1, impostata da JS): niente più scatto netto al bianco.
   Logo a sinistra, menu a destra (layout originale); il logo si rimpicciolisce
   e rientra nell'header sullo scroll.
   ========================================================================== */
.has-hero .site-header,
.has-hero .site-header.is-scrolled {
  background-color: rgb(var(--rgb-white) / calc(0.92 * var(--solid, 0)));
  border-bottom-color: rgb(var(--rgb-green-900) / calc(0.12 * var(--solid, 0)));
}
/* lo sfondo segue lo scroll frame-by-frame: nessuna transizione che lo faccia "scattare" */
.has-hero .site-header { transition: box-shadow .35s var(--ease); }
.has-hero .site-header.is-scrolled { box-shadow: var(--sh-1); }

/* velo scuro (scrim) per la leggibilità sull'hero: svanisce mentre entra il vetro */
.has-hero .site-header::before,
.has-hero .site-header.is-scrolled::before { opacity: calc(1 - var(--solid, 0)); transition: none; }

/* un filo d'aria in più sopra il testo hero, così il logo grande non lo tocca */
.has-hero .hero-content { padding-block-start: calc(var(--header-h) + var(--sp-9)); }

/* ==========================================================================
   BLOCCHI CONTENUTO riusabili (Testo, Testo+immagine, Frase, Elenco).
   Solo token del design system (r.10b): colori/spazi/forme da tokens.css.
   ========================================================================== */

/* --- Testo + immagine ---------------------------------------------------- */
.mediatext { display: grid; gap: var(--sp-7); align-items: center; }
.mediatext-media img {
  width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-2);
  object-fit: cover; aspect-ratio: 3 / 2;
}
.mediatext-body h2 { margin-bottom: var(--sp-4); }
.mediatext-body p + p { margin-top: var(--sp-4); }
@media (min-width: 860px) {
  .mediatext { grid-template-columns: 1fr 1fr; }
  .mediatext--imgleft .mediatext-media { order: -1; }
}

/* --- Frase in evidenza --------------------------------------------------- */
.pullquote { max-width: var(--measure); margin-inline: auto; text-align: center; border: 0; padding: 0; }
.pullquote p {
  max-width: none;
  font-family: var(--ff-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  color: var(--brand-strong);
}
.pullquote cite {
  display: block; margin-top: var(--sp-4);
  font-style: normal; color: var(--c-muted); font-size: var(--fs-small);
}

/* --- Elenco con icone ---------------------------------------------------- */
.checklist { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
.checklist-item { display: flex; align-items: flex-start; gap: var(--sp-4); }
.checklist-ico {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--surface-tint); color: var(--brand);
}
.checklist-ico svg { width: 26px; height: 26px; }
.checklist-item h3 { margin-bottom: var(--sp-2); }
.checklist-item p { color: var(--c-muted); }
@media (min-width: 720px) {
  .checklist { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
}
