/* ==========================================================================
   Telegònia — Centro Servizi per la Persona
   Foglio di stile condiviso
   Palette: borgogna #832120 / scuro #5c1616 / neutro #efefef
   Font: Lora (titoli) · Open Sans (corpo)
   ========================================================================== */

:root {
  --burgundy: #832120;
  --burgundy-dark: #5c1616;
  --burgundy-light: #a23a39;
  --neutral: #efefef;
  --paper: #ffffff;
  --ink: #2f2b2b;
  --muted: #6f6a6a;
  --line: #e2dede;
  --gold: #c9a86a;
  --shadow: 0 6px 24px rgba(0, 0, 0, .10);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .07);
  --radius: 8px;
  --wrap: 1140px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--neutral);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--burgundy); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--burgundy-dark); }
h1, h2, h3, h4 { font-family: "Lora", Georgia, serif; line-height: 1.25; color: var(--burgundy-dark); font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--burgundy-dark);
  color: rgba(255, 255, 255, .85);
  font-size: .82rem;
  letter-spacing: .02em;
}
.topbar .wrap {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  align-items: center; justify-content: space-between;
  padding-top: 8px; padding-bottom: 8px;
}
.topbar a { color: #fff; }
.topbar a:hover { color: var(--gold); }
.topbar .tb-contacts { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* ---------- Header / brand ---------- */
.site-header { background: var(--paper); box-shadow: var(--shadow-sm); position: relative; z-index: 30; }
.brand {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 0; text-decoration: none;
}
.brand-mark { height: 62px; width: auto; display: block; }
.brand-tag {
  font-family: "Open Sans", sans-serif; font-weight: 600;
  font-size: .76rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); line-height: 1.45;
  padding-left: 16px; border-left: 2px solid var(--line);
}
.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;
}

/* ---------- Navigation (CSS-only mobile toggle) ---------- */
.mainnav { background: var(--burgundy); position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow-sm); }
.nav-toggle { display: none; }
.nav-burger {
  display: none; cursor: pointer; color: #fff; padding: 14px 20px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem;
}
.nav-burger::before { content: "\2630  Menu"; }
.mainnav ul {
  list-style: none; margin: 0 auto; padding: 0 8px;
  display: flex; flex-wrap: nowrap; justify-content: center;
  max-width: 1240px;
  overflow-x: auto; scrollbar-width: none;
}
.mainnav ul::-webkit-scrollbar { display: none; }
.mainnav a {
  display: block; color: #fff; padding: 14px 12px; white-space: nowrap;
  text-transform: uppercase; font-size: .72rem; letter-spacing: .02em; font-weight: 600;
  border-bottom: 3px solid transparent;
}
.mainnav a:hover { background: var(--burgundy-dark); color: #fff; }
.mainnav a.active { background: var(--burgundy-dark); border-bottom-color: var(--gold); color: #fff; }

/* ==========================================================================
   HERO SLIDER (pure CSS, radio-controlled, horizontal tabs on TOP)
   ========================================================================== */
.hero {
  position: relative;
  background: var(--burgundy-dark);
  overflow: hidden;
}
.hero-inner { position: relative; display: flex; flex-direction: column; }
.hero-slides {
  position: relative; flex: 1 1 auto;
  min-height: 460px; overflow: hidden;
}
.hero input { position: absolute; opacity: 0; pointer-events: none; }
.slide {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease;
  display: flex; align-items: flex-end;
}
.slide-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  transform-origin: center;
}
.slide::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(92,22,22,.82) 0%, rgba(92,22,22,.45) 45%, rgba(92,22,22,.15) 100%);
}
.slide-caption {
  position: relative; z-index: 2;
  color: #fff; padding: 40px 48px 56px; max-width: 560px;
}
.slide-caption h2 { color: #fff; margin: 0 0 .4em; font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.slide-caption p { color: rgba(255,255,255,.92); margin-bottom: 1.2em; }

/* Activate slide matching checked radio */
#hs1:checked ~ .hero-slides #slide1,
#hs2:checked ~ .hero-slides #slide2,
#hs3:checked ~ .hero-slides #slide3,
#hs4:checked ~ .hero-slides #slide4 { opacity: 1; visibility: visible; }

/* Horizontal tabs on top (a "frame" above the photos) */
.hero-tabs {
  flex: 0 0 auto; display: flex; flex-direction: row; width: 100%;
  position: relative; z-index: 5; background: var(--burgundy-dark);
}
.hero-tabs label {
  flex: 1 1 0; cursor: pointer; min-height: 50px; padding: 12px 10px;
  display: grid; place-items: center; text-align: center;
  color: rgba(255,255,255,.7);
  border-bottom: 4px solid transparent;
  transition: background .25s ease, color .25s ease;
  position: relative;
}
.hero-tabs label + label { border-left: 1px solid rgba(255,255,255,.08); }
.hero-tabs label span {
  text-transform: uppercase; font-size: .72rem; letter-spacing: .11em; font-weight: 600;
  line-height: 1.2;
}
.hero-tabs label:hover { background: rgba(0,0,0,.2); color: #fff; }
#hs1:checked ~ .hero-tabs label[for="hs1"],
#hs2:checked ~ .hero-tabs label[for="hs2"],
#hs3:checked ~ .hero-tabs label[for="hs3"],
#hs4:checked ~ .hero-tabs label[for="hs4"] {
  background: var(--burgundy); color: #fff; border-bottom-color: var(--gold);
}

/* "Le nostre strutture" label strip above the switch */
.hero-structures-label {
  flex: 0 0 auto; z-index: 5;
  background: var(--burgundy-dark); color: var(--gold);
  text-align: center; text-transform: uppercase;
  letter-spacing: .2em; font-size: .7rem; font-weight: 700;
  padding: 12px 10px 4px;
}

/* Video background inside a hero slide (behaves like .slide-bg) */
.slide-video {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}

/* ==========================================================================
   DRONE HERO — scrubbing Telegonia <-> Altheia (JS-driven)
   ========================================================================== */
.dronehero { position: relative; overflow: hidden; background: #000; }
.dronehero-tabs {
  display: flex; background: var(--burgundy-dark);
  position: relative; z-index: 5;
}
.dronehero-tab {
  flex: 1 1 0; border: 0; cursor: pointer; min-height: 50px; padding: 12px 10px;
  background: transparent; color: rgba(255,255,255,.7); font-family: inherit;
  text-transform: uppercase; font-size: .72rem; letter-spacing: .11em; font-weight: 600;
  border-bottom: 4px solid transparent;
  transition: background .25s ease, color .25s ease;
}
.dronehero-tab + .dronehero-tab { border-left: 1px solid rgba(255,255,255,.08); }
.dronehero-tab:hover { background: rgba(0,0,0,.2); color: #fff; }
.dronehero-tab.is-active { background: var(--burgundy); color: #fff; border-bottom-color: var(--gold); }

.dronehero-stage { position: relative; min-height: 460px; overflow: hidden; }
.dronehero-video {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 80%;
}
.dronehero-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(92,22,22,.82) 0%, rgba(92,22,22,.45) 45%, rgba(92,22,22,.12) 100%);
}
.dronehero-caption {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  color: #fff; padding: 40px 48px 56px; max-width: 560px;
}
.dronehero-caption[hidden] { display: none; }
.dronehero-caption h2 { color: #fff; margin: 0 0 .4em; font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.dronehero-caption p { color: rgba(255,255,255,.92); margin-bottom: 1.2em; }

/* ---------- Page banner (inner pages) ---------- */
.page-banner {
  background: linear-gradient(rgba(92,22,22,.78), rgba(92,22,22,.85)), var(--burgundy);
  background-size: cover; background-position: center;
  color: #fff; padding: 54px 0;
}
.page-banner h1 { color: #fff; margin: 0; }
.page-banner .crumbs { color: rgba(255,255,255,.8); font-size: .85rem; margin-top: 8px; }
.page-banner .crumbs a { color: var(--gold); }

/* ---------- Fascia video (rettangolo largo e basso, es. timelapse) ---------- */
.video-band { width: 100%; height: 340px; overflow: hidden; background: #000; position: relative; }
.video-band video { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.video-band .video-band-label {
  position: absolute; left: 0; bottom: 0; z-index: 2; color: #fff;
  padding: 14px 22px; font-size: .85rem; letter-spacing: .04em;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  width: 100%; box-sizing: border-box;
}

/* ==========================================================================
   LAYOUT: main content + right sidebar 260px
   ========================================================================== */
.layout {
  display: grid; grid-template-columns: 1fr 260px; gap: 40px;
  max-width: var(--wrap); margin: 0 auto; padding: 48px 20px;
}
.content { background: var(--paper); padding: 36px 40px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.content > h2:first-child, .content > h1:first-child { margin-top: 0; }
.content section { margin-bottom: 2em; }
.lead { font-size: 1.1rem; color: var(--burgundy-dark); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.widget h3 {
  margin: 0; background: var(--burgundy); color: #fff;
  padding: 12px 18px; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em;
}
.widget .widget-body { padding: 18px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget li a { display: block; padding: 10px 18px; font-size: .92rem; color: var(--ink); }
.widget li a::before { content: "\203A"; color: var(--burgundy); font-weight: 700; margin-right: 8px; }
.widget li a:hover { background: var(--neutral); color: var(--burgundy); }
.widget.cta { background: var(--burgundy); color: #fff; text-align: center; padding: 26px 20px; }
.widget.cta h3 { background: none; padding: 0 0 8px; }
.widget.cta p { color: rgba(255,255,255,.9); font-size: .9rem; }

.contact-line { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: .92rem; }
.contact-line strong { color: var(--burgundy-dark); display: block; }

/* ---------- SVG icons (recolored via CSS mask) ---------- */
.ico {
  display: inline-block; width: 1em; height: 1em; flex: none;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  vertical-align: -0.16em;
}
.ico-pin       { -webkit-mask-image: url('images/icons/pin.svg');       mask-image: url('images/icons/pin.svg'); }
.ico-mail      { -webkit-mask-image: url('images/icons/mail.svg');      mask-image: url('images/icons/mail.svg'); }
.ico-phone     { -webkit-mask-image: url('images/icons/phone.svg');     mask-image: url('images/icons/phone.svg'); }
.ico-yoga      { -webkit-mask-image: url('images/icons/yoga.svg');      mask-image: url('images/icons/yoga.svg'); }
.ico-brain     { -webkit-mask-image: url('images/icons/brain.svg');     mask-image: url('images/icons/brain.svg'); }
.ico-music     { -webkit-mask-image: url('images/icons/music.svg');     mask-image: url('images/icons/music.svg'); }
.ico-health    { -webkit-mask-image: url('images/icons/health.svg');    mask-image: url('images/icons/health.svg'); }
.ico-dumbbell  { -webkit-mask-image: url('images/icons/dumbbell.svg');  mask-image: url('images/icons/dumbbell.svg'); }
.ico-head      { -webkit-mask-image: url('images/icons/head.svg');      mask-image: url('images/icons/head.svg'); }
.ico-palette   { -webkit-mask-image: url('images/icons/palette.svg');   mask-image: url('images/icons/palette.svg'); }
.ico-handshake { -webkit-mask-image: url('images/icons/handshake.svg'); mask-image: url('images/icons/handshake.svg'); }
.ico-meal      { -webkit-mask-image: url('images/icons/meal.svg');      mask-image: url('images/icons/meal.svg'); }
.ico-house     { -webkit-mask-image: url('images/icons/house.svg');     mask-image: url('images/icons/house.svg'); }
.ico-clipboard { -webkit-mask-image: url('images/icons/clipboard.svg'); mask-image: url('images/icons/clipboard.svg'); }

/* Contact icons in sidebar widgets: brand colour */
.contact-line .ico { color: var(--burgundy); font-size: 1.15rem; margin-top: 2px; }
/* Decorative card icons inside the round badge */
.icon .ico { width: 30px; height: 30px; color: var(--burgundy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--burgundy); color: #fff;
  padding: 12px 26px; border-radius: 40px; font-weight: 600;
  letter-spacing: .03em; border: 2px solid var(--burgundy); cursor: pointer;
  text-transform: uppercase; font-size: .82rem; transition: all .2s ease;
}
.btn:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--burgundy); }
.btn-lg { padding: 15px 36px; font-size: .9rem; }

/* ---------- Generic helpers / components ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--paper); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head p { color: var(--muted); }
.divider { width: 70px; height: 3px; background: var(--gold); border: 0; margin: 14px auto 0; }

.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative;
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease;
  display: flex; flex-direction: column;
}
/* bordo luminoso (gold) che appare all'hover */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .4s ease;
  pointer-events: none; z-index: 3;
}
.card:hover { transform: translateY(-7px); box-shadow: 0 22px 45px rgba(92,22,22,.16); }
.card:hover::after { box-shadow: inset 0 0 0 1.5px rgba(201,168,106,.65); }
.card img { height: 190px; object-fit: cover; width: 100%; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.card:hover img { transform: translateY(-5px) scale(1.05); }
.card .card-body { position: relative; padding: 22px 24px; flex: 1; transition: transform .4s ease; }
.card h3 { margin-top: 0; color: var(--burgundy); transition: transform .35s ease, color .35s ease; }
.card:hover h3 { transform: translateY(-3px); }
/* La freccia / nudge appare SOLO sulle card che hanno davvero un link */
.card .card-body a { display: inline-block; transition: transform .3s ease, color .2s ease; }
.card:hover .card-body a { transform: translateX(5px); }
.card .icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--neutral);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px;
}

/* Feature list with check marks */
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding: 8px 0 8px 32px; border-bottom: 1px dashed var(--line); }
.ticks li:last-child { border-bottom: 0; }
.ticks li::before {
  content: "\2713"; position: absolute; left: 0; top: 8px;
  color: #fff; background: var(--burgundy); width: 20px; height: 20px;
  border-radius: 50%; display: grid; place-items: center; font-size: .7rem;
}

.pill-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 4px; }

figure.framed { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
figure.framed figcaption { background: var(--paper); padding: 10px 16px; font-size: .85rem; color: var(--muted); }
.float-img { float: right; width: 320px; max-width: 45%; margin: 4px 0 18px 26px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--burgundy-dark); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 6px; font-family: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--burgundy); box-shadow: 0 0 0 3px rgba(131,33,32,.12);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 4px; }

/* Map */
.map-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); line-height: 0; }
.map-embed iframe { width: 100%; height: 420px; border: 0; }

/* ---------- Stats / numeri ---------- */
.stats { background: var(--paper); }
.stats-grid { gap: 30px; }
.stat { text-align: center; padding: 8px; }
.stat-ring { position: relative; width: 132px; height: 132px; margin: 0 auto 16px; }
.stat-ring svg { width: 132px; height: 132px; transform: rotate(-90deg); display: block; }
.stat-ring-bg { fill: none; stroke: var(--line); stroke-width: 7; }
.stat-ring-fg { fill: none; stroke: var(--burgundy); stroke-width: 7; stroke-linecap: round; stroke-dashoffset: 327; }
.stat-ring .stat-icon { position: absolute; inset: 0; display: grid; place-items: center; }
.stat-ring .stat-icon .ico { width: 38px; height: 38px; color: var(--burgundy); }
.stat-num { font-family: "Lora", serif; font-size: 2.5rem; font-weight: 700; color: var(--burgundy-dark); line-height: 1; }
.stat-label { color: var(--muted); margin-top: 6px; font-size: .95rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--burgundy-dark); color: rgba(255,255,255,.82); margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px;
  max-width: var(--wrap); margin: 0 auto; padding: 50px 20px 30px;
}
.site-footer h4 { color: #fff; font-size: 1.05rem; margin: 0 0 16px; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; font-size: .92rem; }
.footer-brand .brand { padding: 0 0 14px; }
.footer-brand .brand-mark--light { height: 70px; filter: brightness(0) invert(1); }
.footer-brand .brand-tag { color: rgba(255,255,255,.7); border-left-color: rgba(255,255,255,.2); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); text-align: center;
  padding: 18px; font-size: .82rem; color: rgba(255,255,255,.6);
}

/* ==========================================================================
   ANIMAZIONI & MICRO-INTERAZIONI
   ========================================================================== */

/* Caricamento pagina: leggero fade-in dell'intera pagina */
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }
body { animation: pageFade .5s ease both; }

/* Reveal on scroll — "scroll cinematografico" (classi aggiunte da main.js) */
.reveal {
  opacity: 0;
  transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1), clip-path .9s cubic-bezier(.2, .7, .2, 1);
  will-change: opacity, transform;
}
.reveal--up    { transform: translateY(30px); }
.reveal--left  { transform: translateX(-48px); }
.reveal--right { transform: translateX(48px); }
/* Titolo rivelato con maschera verticale (sweep da sinistra a destra) */
.reveal--mask  { opacity: 1; clip-path: inset(0 100% 0 0); }
/* Linea sottile che cresce da sinistra verso destra */
.reveal--line  { transform: scaleX(0); transform-origin: left center; }

.reveal.is-visible { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }

/* Sfondo organico che "respira": forme sfocate beige/salvia/crema (iniettate da main.js) */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient .blob { position: absolute; border-radius: 50%; filter: blur(75px); opacity: .55; }
.ambient .b1 { width: 440px; height: 440px; background: #e9e2d3; top: -90px; left: -70px;  animation: drift1 28s ease-in-out infinite; }
.ambient .b2 { width: 400px; height: 400px; background: #dde5db; bottom: -120px; right: -60px; animation: drift2 34s ease-in-out infinite; }
.ambient .b3 { width: 320px; height: 320px; background: #f0e8df; top: 42%; left: 52%;        animation: drift3 40s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(70px,50px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-60px,-40px); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-50px) scale(1.1); } }

/* Hero: effetto Ken Burns sullo slide attivo + entrata della didascalia */
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes capIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
#hs1:checked ~ .hero-slides #slide1 .slide-bg,
#hs2:checked ~ .hero-slides #slide2 .slide-bg,
#hs3:checked ~ .hero-slides #slide3 .slide-bg,
#hs4:checked ~ .hero-slides #slide4 .slide-bg {
  animation: kenburns 9s ease-out both;
}
#hs1:checked ~ .hero-slides #slide1 .slide-caption,
#hs2:checked ~ .hero-slides #slide2 .slide-caption,
#hs3:checked ~ .hero-slides #slide3 .slide-caption,
#hs4:checked ~ .hero-slides #slide4 .slide-caption {
  animation: capIn .8s .12s ease both;
}

/* Menu: underline animata in scorrimento */
.mainnav a { position: relative; }
.mainnav a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 6px;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.mainnav a:hover::after { transform: scaleX(1); }

/* Logo: leggero ingrandimento al passaggio del mouse */
.brand-mark { transition: transform .3s ease; }
.brand:hover .brand-mark { transform: scale(1.05); }

/* Bottoni: piccolo "lift" + ombra */
.btn { transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(92, 22, 22, .25); }

/* Link sidebar: micro-spostamento */
.widget li a { transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.widget li a:hover { padding-left: 24px; }

/* Header/nav: ombra più marcata dopo lo scroll */
.mainnav { transition: box-shadow .3s ease; }
body.scrolled .mainnav { box-shadow: 0 4px 18px rgba(0, 0, 0, .18); }

/* Rispetto delle preferenze di accessibilità */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .reveal { opacity: 1; transform: none; clip-path: none; transition: none; }
  .slide, .slide-caption { animation: none !important; }
  .ambient .blob { animation: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .nav-burger { display: block; }
  .mainnav ul {
    display: none; flex-direction: column; flex-wrap: nowrap; padding: 0;
  }
  .nav-toggle:checked ~ ul { display: flex; }
  .mainnav a { border-bottom: 1px solid rgba(255,255,255,.12); padding: 14px 20px; white-space: normal; }
  .mainnav a.active { border-bottom-color: rgba(255,255,255,.12); }
}
@media (max-width: 760px) {
  .hero-slides, .dronehero-stage { min-height: 380px; }
  .dronehero-caption { padding: 28px 24px 40px; }
  .video-band { height: 220px; }
  .slide::after { background: linear-gradient(rgba(92,22,22,.55), rgba(92,22,22,.78)); }
  .slide-caption { padding: 28px 24px 40px; }

  .content { padding: 26px 22px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .float-img { float: none; width: 100%; max-width: 100%; margin: 0 0 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .topbar .wrap { justify-content: center; text-align: center; }
}

/* ==========================================================================
   GALLERIA + LIGHTBOX
   ========================================================================== */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gallery-item {
  border: 0; padding: 0; margin: 0; background: none; cursor: pointer; display: block;
  overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.gallery-item img {
  width: 100%; height: 220px; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; background: rgba(18,6,6,.93); padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox-img { max-width: 92vw; max-height: 86vh; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox-btn {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center; transition: background .2s ease;
}
.lightbox-btn:hover { background: rgba(255,255,255,.25); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Lavora con noi: form extra ---------- */
.check-field { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
.check-field .err-msg { flex-basis: 100%; margin-left: 28px; }
.check-field input[type="checkbox"] { width: auto; margin-top: 3px; flex: 0 0 auto; }
.check-field label { font-weight: 400; font-size: .9rem; margin: 0; color: var(--ink); }
.field input[type="file"] { padding: 9px 12px; background: var(--paper); }
.field .err-msg { display: none; color: #b02a1f; font-size: .8rem; margin-top: 4px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #d33; }
.field.has-error .err-msg { display: block; }
.form-feedback { display: none; padding: 16px 18px; border-radius: var(--radius); margin-top: 10px; }
.form-feedback.is-visible { display: block; }
.form-feedback.ok { background: #eaf5ec; border: 1px solid #b6dcc0; color: #1f6b38; }

@media (max-width: 760px) {
  .gallery-item img { height: 180px; }
  .lightbox-prev { left: 10px; } .lightbox-next { right: 10px; }
  .lightbox-btn { width: 44px; height: 44px; font-size: 1.3rem; }
}
