/* =========================
   BASE
   ========================= */

:root {
  --bg: #ffffff;
  --bg-soft: #e8f2f8;
  --bg-footer: #f5f5f5;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #0b5ed7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* =========================
   ACCESSIBILITÀ
   ========================= */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: #000;
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 1000;
}

/* =========================
   HEADER / NAV
   ========================= */

.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-weight: 600;
  font-size: 1.1rem;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}
.brand:hover,
.brand:focus {
  text-decoration: none;
}

.logo {
  height: 56px;
  width: auto;
  display: block;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus {
  text-decoration: underline;
}

/* =========================
   HERO
   ========================= */

.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-soft);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.hero-tagline {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

/* =========================
   SEZIONI GENERICHE
   ========================= */

main > section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

section h2 {
  margin-top: 0;
}

/* =========================
   DOTAZIONI
   ========================= */

.dotazioni {
  padding-left: 1.2rem;
}

.dotazioni li {
  margin-bottom: 0.4rem;
}

/* =========================
   GALLERY
   ========================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* titoli Esterni / Interni */
.gallery-section-title {
  grid-column: 1 / -1;
  margin: 2rem 0 0.5rem;
  font-size: 1.25rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.25rem;
}

.gallery figure {
  margin: 0;
  aspect-ratio: 4 / 3;
}

.gallery img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 4px;
  object-fit: cover;
}

.gallery figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* =========================
   VIDEO
   ========================= */

video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================
   CONTATTI
   ========================= */

#contatti a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

#contatti a:hover,
#contatti a:focus {
  text-decoration: underline;
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
  background: var(--bg-footer);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  text-decoration: underline;
}

/* =========================
   RESPONSIVE MINIMO
   ========================= */

@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}
.hero-logo {
  width: min(360px, 92%);
  height: auto;
  display: block;
  margin: 0 auto 1.25rem;
}
.hero h1 {
  margin: 0 0 0.5rem;
}
.contact-form {
  max-width: 520px;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.form-consent label {
  display: inline;
  margin: 0;
  font-weight: normal;
  line-height: 1.4;
}

.form-field input:not([type="checkbox"]),
.form-field textarea {
  width: 100%;
  padding: 0.5rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
}


.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  max-width: 100%;
}



.contact-form button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  font: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.contact-form button:hover,
.contact-form button:focus {
  opacity: 0.9;
}

.contact-alt {
  margin-top: 1.5rem;
}
/* =========================
   LIGHTBOX (GALLERY)
   ========================= */

.gallery img.js-lightbox {
  cursor: zoom-in;
}

body.lb-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}

.lightbox.is-open {
  display: block;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.lightbox__dialog {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lightbox__figure {
  margin: 0;
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  display: grid;
  gap: 0.5rem;
}

.lightbox__img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  background: #111;
}

.lightbox__caption {
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
}

.lightbox__controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.lightbox__btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.lightbox__btn:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.lightbox__nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  pointer-events: none;
}

.lightbox__nav .lightbox__btn {
  pointer-events: auto;
}

@media (max-width: 600px) {
  .lightbox__caption {
    font-size: 0.9rem;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.legal-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}
.legal-wrap h1 {
  margin-top: 1rem;
}
.legal-meta {
  margin: 0.5rem 0 1.5rem;
  opacity: 0.85;
}
.legal-section {
  margin: 1.5rem 0;
}
.legal-section h2 {
  margin: 1.25rem 0 0.5rem;
}
.legal-section ul {
  padding-left: 1.25rem;
}
.legal-note {
  padding: 0.9rem 1rem;
  border-left: 4px solid currentColor;
  background: rgba(0, 0, 0, 0.03);
  margin: 1rem 0;
}
.legal-back {
  margin-top: 1.5rem;
}
.legal-wrap h2,
.legal-wrap h3 {
  scroll-margin-top: 6rem;
}
/* Override: le pagine legal non devono usare il layout a sezioni della home */
.legal-wrap > section {
  max-width: none;
  margin: 0;
  padding: 0;
}
.gallery figure {
  position: relative;
}

.gallery figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
}

.gallery img {
  user-select: none;
  -webkit-user-drag: none;
}
