@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/inter-800.woff2") format("woff2"); }

:root {
  --ink: #1b2333;
  --ink-soft: #4a5365;
  --line: #e4e7ee;
  --surface: #f5f7fb;
  --accent: #d6e000;
  --accent-hover: #c4cd00;
  --green: #7fb539;
  --error: #b3261e;
  --ok: #1d7a46;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(20, 24, 60, .18);
  --hero-gradient: linear-gradient(125deg, #2f9fe0 0%, #4a4aa8 32%, #4a55a8 62%, #3f7ea3 86%, #2a9a8c 100%);
  --corsi-gradient: linear-gradient(140deg, #52499f 0%, #4b4aa2 55%, #3f62a3 82%, #1fa688 100%);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }

:focus-visible { outline: 3px solid #1f6fd6; outline-offset: 2px; }

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

.icon { flex: none; width: 22px; height: 22px; }

/* Pulsanti */
.btn {
  display: inline-block;
  padding: .85em 1.7em;
  border: 2px solid transparent;
  border-radius: 2px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #10140a; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-outline { border-color: #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: #3a4a9e; }
.btn-note { margin-top: .6rem; color: #fff; font-size: .8rem; }

/* Hero */
.hero { background: var(--hero-gradient); color: #fff; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-top: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(32px, 5vw, 60px);
}
.hero-photo { align-self: end; margin-bottom: calc(clamp(32px, 5vw, 60px) * -1 - 80px); position: relative; z-index: 1; }
.hero-photo img { width: 100%; max-width: 560px; margin-inline: auto; }
.hero-logo { width: clamp(220px, 24vw, 300px); margin-bottom: clamp(20px, 3vw, 36px); }
.hero h1 {
  max-width: 21ch;
  margin-bottom: clamp(20px, 3vw, 32px);
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  font-weight: 400;
  line-height: 1.25;
}
.hero-lead { font-size: 1.3rem; }
.hero-lead strong { font-weight: 700; }
.hero-text > p:not(.hero-lead) { max-width: 44ch; font-size: .95rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 20px; }

/* Intro */
.intro { padding-block: calc(80px + clamp(48px, 7vw, 96px)) clamp(48px, 7vw, 96px); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.intro-lead { font-size: 1.2rem; font-weight: 600; }
.prose p + p { margin-top: 1em; }
.prose .btn { margin-top: 1.75rem; }

/* Citazione e carosello */
.quote { padding-block: clamp(48px, 7vw, 88px); background: var(--surface); }
.quote blockquote { max-width: 820px; margin: 0 auto clamp(32px, 4vw, 48px); text-align: center; }
.quote blockquote p { font-size: clamp(1.35rem, 2.6vw, 2rem); font-weight: 600; line-height: 1.3; }
.quote blockquote footer { margin-top: .75rem; color: var(--ink-soft); }

.carousel { position: relative; }
.carousel-track {
  --visible: 3;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 20px * (var(--visible) - 1)) / var(--visible));
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { display: block; scroll-snap-align: start; overflow: hidden; border-radius: var(--radius); }
.carousel-slide img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .3s; }
.carousel-slide:hover img { transform: scale(1.03); }
.carousel-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
}
.carousel-arrow:hover { background: #fff; }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel > .carousel-arrow { top: calc(50% - 16px); }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 12px; }
.carousel-dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.carousel-dots button::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: auto;
  border-radius: 50%;
  background: #c3c9d6;
}
.carousel-dots button[aria-current="true"]::before { background: #4a4aa8; }

/* Corsi */
.corsi { padding-block: clamp(48px, 6vw, 80px); background: var(--corsi-gradient); color: #fff; scroll-margin-top: 0; }
.corsi-head { display: grid; justify-items: center; gap: 4px; margin-bottom: clamp(32px, 4vw, 48px); }
.corsi-head h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: .12em; }
.corsi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 5vw, 64px); }
.corso-photo {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 11;
  padding: 16px;
  overflow: hidden;
  border-radius: var(--radius);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}
.corso-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(40, 90, 60, .85) 0%, rgba(40, 90, 60, .25) 42%, rgba(40, 90, 60, 0) 65%);
}
.corso-photo h4 { position: relative; font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.corso-photo small { font-size: .78em; font-weight: 600; }
.corso-orari { display: flex; gap: 12px; margin-top: 16px; padding-inline: 12px; font-size: .92rem; }

.corsi-divider { height: 1px; margin-block: clamp(32px, 4vw, 48px); border: 0; background: rgba(255, 255, 255, .22); }
.corsi-cta { text-align: center; }
.corsi-cta h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; line-height: 1.2; }
.corsi-cta h5 { margin: .75rem 0 1.5rem; font-size: 1rem; font-weight: 400; }

/* Titoli con pennellata */
.brush-title { position: relative; display: inline-block; min-width: 234px; margin-bottom: 28px; }
.brush-title h3 {
  position: relative;
  z-index: 1;
  padding-left: 34px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
}
.brush-title img { position: absolute; top: 2px; left: 0; }
.brush-title-center { display: block; width: max-content; max-width: 100%; margin-inline: auto; }

/* Chi siamo */
.chi-siamo { padding-block: clamp(48px, 7vw, 96px); }
.chi-siamo-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.chi-siamo-photo { width: 100%; border-radius: var(--radius); }

/* Insegnanti */
.team { padding-block: clamp(48px, 7vw, 88px); background: var(--surface); }
.team-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.team-grid img { width: 100%; border-radius: var(--radius); }

/* Dove siamo */
.dove { padding-block: clamp(48px, 7vw, 88px); }
.dove-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(32px, 4vw, 56px); align-items: stretch; }
.dove-info h5 { margin-bottom: 16px; font-size: 1.05rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.dove-info h5:not(:first-child) { margin-top: 32px; }
.info-row { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; overflow-wrap: anywhere; text-decoration: none; }
a.info-row:hover span { text-decoration: underline; }
.info-row .icon { color: var(--green); }
.dove-map { width: 100%; min-height: 380px; border: 0; border-radius: var(--radius); box-shadow: 0 2px 12px rgba(20, 24, 60, .1); }

/* Footer */
.site-footer { padding-block: 32px; border-top: 1px solid var(--line); text-align: center; }
.site-footer img { margin-inline: auto; }
.site-footer-legal { margin-top: 20px; color: var(--ink-soft); font-size: .85rem; }

/* Finestre */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(18, 20, 50, .65); }

.dialog-form {
  width: min(600px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(20px, 4vw, 36px);
  border: 0;
  border-radius: var(--radius);
  overflow-y: auto;
}
.dialog-form h2 { padding-right: 36px; font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.dialog-intro { margin: .5rem 0 1.25rem; color: var(--ink-soft); font-size: .95rem; }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.dialog-close:hover { background: var(--surface); }

.field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field > label:not(.choice), .field legend { display: block; margin-bottom: 6px; padding: 0; font-size: .92rem; font-weight: 600; }
.field input:not([type="radio"], [type="checkbox"]), .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #aeb5c3;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font: inherit;
}
.field textarea { resize: vertical; }
.choice { display: flex; gap: 10px; padding-block: 5px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.choice input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: #4a4aa8; }
.field-error { margin-top: 5px; color: var(--error); font-size: .85rem; }
.field-error[hidden], .form-status[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-bottom: 16px; padding: 12px 14px; border-radius: 6px; font-size: .95rem; }
.form-status.is-ok { background: #e7f5ec; color: var(--ok); }
.form-status.is-error { background: #fbeceb; color: var(--error); }

.lightbox { max-width: none; max-height: none; width: 100%; height: 100%; padding: 16px; border: 0; background: transparent; color: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(10, 12, 28, .9); }
.lightbox .dialog-close:hover { background: rgba(255, 255, 255, .15); }
.lightbox img { width: min(900px, 100%); max-height: 80dvh; object-fit: contain; }
.lightbox figure { width: min(900px, 100%); }
.lightbox figcaption { margin-top: 8px; text-align: center; font-size: .92rem; }

/* Tablet */
@media (max-width: 1024px) {
  .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .corsi-grid { gap: 24px; }
  .dove-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .chi-siamo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 880px) {
  .corsi-grid { grid-template-columns: minmax(0, 1fr); max-width: 460px; margin-inline: auto; gap: 32px; }
  .carousel-track { --visible: 2; }
}

/* Mobile */
@media (max-width: 767px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; gap: 24px; }
  .hero-text { order: -1; }
  .hero-photo { margin-bottom: -48px; }
  .hero-photo img { max-width: min(380px, 90%); }
  .intro { padding-top: calc(48px + 40px); }
  .intro-grid, .chi-siamo-grid, .dove-grid { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dove-map { min-height: 320px; }
}

@media (max-width: 480px) {
  .carousel-track { --visible: 1; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-actions .btn { min-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
