/* Asilo Spangaro, landing open day. Mobile first. */

@font-face { font-family: "Caprasimo"; src: url("../fonts/caprasimo-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ABeeZee"; src: url("../fonts/abeezee-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ABeeZee"; src: url("../fonts/abeezee-italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --ground: #f7f4ec;
  --paper: #ffffff;
  --sage: #629395;
  --sage-deep: #4b7b7d;
  --sage-ink: #3f6a6c;
  --sun: #ebb64e;
  --sun-deep: #b5801c; /* sun for text: 3.15:1 on the ground, AA for large type */
  --clay: #b86f5e;
  --clay-deep: #a2584a;
  --ink: #2b2a27;
  --ink-soft: #4d4a45;
  --line: #e4ddcf;

  --display: "Caprasimo", "Cooper Black", Georgia, serif;
  --text: "ABeeZee", "Trebuchet MS", system-ui, sans-serif;

  --gutter: 4.7vw;
  --bar-h: 70px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.45 var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--sage-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--clay-deep); }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--sage) var(--ground); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--paper); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  box-shadow: 0 6px 18px -8px rgba(60, 52, 40, .28);
}
.topbar__in {
  height: var(--bar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--gutter) 0 3.6vw;
}
.topbar__logo { margin-right: auto; }
.topbar__logo img { width: 37.9vw; max-width: 200px; height: auto; }

.call {
  display: inline-flex; align-items: center; gap: .45em;
  height: 33px; padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--sage-deep); color: #fff;
  font-size: 3.85vw; text-decoration: none; letter-spacing: .01em;
}
.call .ico { fill: currentColor; stroke: none; width: 1.05em; height: 1.05em; }
.call:hover { background: var(--sage-ink); color: #fff; }

.burger {
  width: 44px; height: 44px; margin-right: -6px;
  display: grid; place-content: center; gap: 5px;
  background: none; border: 0; cursor: pointer; border-radius: 10px;
}
.burger span { display: block; width: 28px; height: 3px; border-radius: 3px; background: var(--sage-deep); transition: transform .35s var(--ease-out), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav__list {
  list-style: none; margin: 0; padding: 8px var(--gutter) 18px;
  position: absolute; left: 0; right: 0; top: var(--bar-h);
  background: var(--paper);
  box-shadow: 0 14px 22px -14px rgba(60, 52, 40, .35);
  display: grid; gap: 2px;
  transform-origin: top; transform: scaleY(.6); opacity: 0; visibility: hidden;
  transition: transform .35s var(--ease-out), opacity .25s, visibility 0s .35s;
}
.nav__list.is-open { transform: none; opacity: 1; visibility: visible; transition: transform .35s var(--ease-out), opacity .25s; }
.nav__list a {
  display: block; padding: 12px 4px;
  font-family: var(--display); font-size: 1.45rem; color: var(--sage-deep); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.nav__list li:last-child a { border-bottom: 0; }

/* ---------- Trail: pencil dashed line drawn by script ---------- */
main { position: relative; overflow-x: clip; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.trail__line { fill: none; stroke: #b86f5e; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12 10; opacity: .9; }
.trail__mask { fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; }
.plane {
  position: absolute; left: 0; top: 0; width: 62px; height: auto; z-index: 0;
  pointer-events: none; will-change: transform; opacity: 0; transition: opacity .5s;
  filter: drop-shadow(0 2px 2px rgba(120, 70, 50, .12));
}
.plane.is-ready { opacity: 1; }
.plane.is-ready.is-hop { opacity: 0; transition-duration: .2s; }

/* ---------- Intro ---------- */
.intro { position: relative; z-index: 1; text-align: center; padding: 22px var(--gutter) 0; }
.intro h1 {
  margin: 0;
  font: 400 8.85vw/1.05 var(--display);
  letter-spacing: -.005em;
  color: var(--sage);
  text-wrap: balance;
}
.intro__b { color: var(--sun-deep); }
.intro__sub { margin: 1px 0 0; font-size: 3.95vw; line-height: 1.1; color: var(--ink); }

/* ---------- Stops ---------- */
.percorso { position: relative; z-index: 1; padding: 50px 0 24px; }
.stops { list-style: none; margin: 0; padding: 0; }
.stop {
  position: relative;
  display: grid; grid-template-columns: 49% minmax(0, 1fr); align-items: center;
  column-gap: 2.6vw;
}
.stop + .stop { margin-top: 20px; }
.stop + .stop + .stop { margin-top: 96px; }
.stop__photo { display: block; width: 112%; max-width: none; margin: -5% 0 -5% -10%; }
.stop__photo img { width: 100%; height: auto; }
.stop--r .stop__photo { margin: -6% -12% -6% 0; }
.stop--r { grid-template-columns: minmax(0, 1fr) 49.5%; }
.stop--r .stop__photo { order: 2; }
.stop--r .stop__body { order: 1; padding-left: var(--gutter); }
.stop--l .stop__body { padding-right: var(--gutter); }

.stop__when { display: flex; align-items: center; gap: 3.4vw; }
.stop--r .stop__when { flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }

.badge {
  flex: none;
  display: grid; justify-items: center; align-content: center;
  width: 12.2vw; aspect-ratio: 47 / 52;
  border: 2px solid var(--clay); border-radius: 38% 42% 40% 36% / 34% 36% 40% 38%;
  font-family: var(--display); color: var(--ink); line-height: .92;
  background: var(--ground);
}
.badge__d { font-size: 6.4vw; }
.badge__m { font-size: 4.2vw; letter-spacing: .02em; }
.stop--r .badge { width: 12.4vw; margin-bottom: 6px; }

.stop__info { margin: 0; font-size: 3.75vw; line-height: 1.17; color: var(--ink); }
.stop__info a { color: inherit; text-decoration-color: var(--clay); }
.stop__note { position: relative; z-index: 1; justify-self: end; background: var(--ground); padding: 2px 0 2px 6px; grid-column: 1 / -1; order: 3; margin: 2px var(--gutter) 0; font-size: .85rem; line-height: 1.35; color: var(--ink-soft); text-align: right; }

/* Calendar disclosure */
.cal { position: relative; margin-top: 10px; }
.cal__btn {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4em;
  min-height: 32px; padding: 5px 12px 5px 11px;
  border-radius: 999px;
  background: var(--clay-deep); color: #fff;
  font-size: 3.3vw; line-height: 1.1; white-space: nowrap;
  box-shadow: 0 3px 8px -3px rgba(120, 60, 45, .45);
  transition: background-color .2s, transform .2s var(--ease-out);
  user-select: none;
}
.cal__btn::-webkit-details-marker { display: none; }
.cal__btn:hover { background: #8f4b3e; }
.cal__btn:active { transform: translateY(1px); }
.cal[open] .cal__btn { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 4px, transparent 4px 9px); }
.cal__menu {
  list-style: none; margin: 8px 0 0; padding: 6px;
  position: absolute; z-index: 5; left: 0; min-width: 100%;
  background: var(--paper); border: 1.5px solid var(--clay); border-radius: 16px;
  box-shadow: 0 12px 26px -12px rgba(60, 52, 40, .4);
}
.stop--r .cal__menu { left: auto; right: 0; }
.cal__menu a {
  display: block; padding: 10px 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-size: .95rem;
}
.stop__info strong { font-weight: 700; }
.stop__extra { display: block; max-width: 19em; margin: .45em 0 0 auto; text-wrap: balance; font-size: max(.72em, 13.5px); line-height: 1.35; color: var(--ink-soft); }
.cal__menu a:hover, .cal__menu a:focus-visible { background: #f3e6e1; color: #8f4b3e; }
.stop--r .cal { display: flex; flex-direction: column; align-items: flex-start; margin-left: calc(-1 * var(--gutter) + 4.8vw); }

/* Doodles: original XD artwork, gently alive */
.doodle { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; translate: 0 var(--py, 0px); transition: translate .6s cubic-bezier(.16, 1, .3, 1); }
.doodle--sun { width: 15vw; max-width: 74px; animation: sun-turn 38s linear infinite; }
.doodle--star { width: 13vw; max-width: 70px; animation: twinkle 3.6s ease-in-out infinite alternate; }
.doodle--planet { width: 12vw; max-width: 64px; animation: drift 7s ease-in-out infinite alternate; }
@keyframes sun-turn { to { rotate: 360deg; } }
@keyframes twinkle { 0% { scale: .9; rotate: -7deg; } 60% { scale: 1.06; } 100% { scale: 1; rotate: 6deg; } }
@keyframes drift { 0% { rotate: -9deg; scale: 1; } 100% { rotate: 7deg; scale: 1.05; } }

/* ---------- Contacts ---------- */
.contatti, .scrivici { position: relative; z-index: 1; padding: 48px var(--gutter) 0; }
.contatti h2, .scrivici h2 {
  margin: 0 0 14px;
  font: 400 clamp(1.9rem, 8vw, 3rem)/1.05 var(--display);
  color: var(--sage);
}
.contatti__grid { font-style: normal; display: grid; gap: 14px; }
.contatti__grid p { margin: 0; line-height: 1.55; }

/* ---------- Form ---------- */
.scrivici { padding-bottom: 56px; }
.scrivici__lead { margin: 0 0 20px; max-width: 34em; color: var(--ink-soft); }
.form { display: grid; gap: 16px; max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .95rem; color: var(--ink); }
.opt { color: var(--ink-soft); font-size: .85em; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid #8f8676; border-radius: 16px;
  padding: 12px 14px; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
  caret-color: var(--clay);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage-deep); box-shadow: 0 0 0 3px rgba(98, 147, 149, .25); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--clay-deep); }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.field--check input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; accent-color: var(--sage-deep); }
.field--check label { font-size: .9rem; line-height: 1.4; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { margin: 0; min-height: 1.4em; font-size: .95rem; }
.form__status.is-error { color: var(--clay-deep); }
.form__status.is-ok { color: var(--sage-ink); }
.btn {
  justify-self: start;
  font: inherit; font-size: 1.05rem; color: #fff; cursor: pointer;
  background: var(--sage-deep); border: 0; border-radius: 999px;
  padding: 13px 26px; min-height: 48px;
  box-shadow: 0 4px 10px -4px rgba(63, 106, 108, .6);
  transition: background-color .2s, transform .2s var(--ease-out);
}
.btn:hover { background: var(--sage-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Thank-you panel after sending */
.thanks {
  position: relative; max-width: 640px; margin-top: 8px;
  padding: 28px 24px 24px;
  background: var(--paper); border: 2px solid var(--sage); border-radius: 28px;
  box-shadow: 0 10px 26px -16px rgba(60, 52, 40, .45);
  animation: thanks-in .6s var(--ease-out) both;
}
.thanks[hidden], .form[hidden] { display: none; }
.thanks__star { position: absolute; top: -26px; right: 22px; width: 56px; animation: twinkle 3.6s ease-in-out infinite alternate; }
.thanks__title { margin: 0 0 8px; font: 400 clamp(2rem, 8vw, 2.8rem)/1.05 var(--display); color: var(--sage); outline: none; }
.thanks p { margin: 0 0 10px; font-size: 1.1rem; line-height: 1.5; }
.thanks__more { color: var(--ink-soft); font-size: .98rem !important; }
.thanks a[href^="tel"], .stop__info a[href^="tel"] { white-space: nowrap; }
.btn--ghost { background: transparent; color: var(--sage-ink); box-shadow: inset 0 0 0 2px var(--sage); margin-top: 6px; }
.btn--ghost:hover { background: var(--sage-deep); color: #fff; }
@keyframes thanks-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.foot {
  background: var(--sage-deep); color: #fff;
  padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  display: grid; gap: 12px; font-size: .9rem;
}
.foot img { filter: brightness(0) invert(1); width: 140px; }
.foot p { margin: 0; line-height: 1.5; }
.foot a { color: #fff; }
.foot a:focus-visible { outline-color: #fff; }

/* ---------- Phones: date first, then the whole photo, alternating sides ---------- */
@media (max-width: 599px) {
  .percorso { padding-top: 40px; }
  .stop, .stop--r { display: flex; flex-direction: column; }
  .stop + .stop { margin-top: 40px; }
  .stop + .stop + .stop { margin-top: 40px; }
  .stop .stop__body, .stop--r .stop__body { order: 1; padding: 0 var(--gutter); }
  .stop .stop__photo { order: 2; width: 74%; margin: 18px 4% 0 auto; }
  .stop--r .stop__photo { margin: 18px auto 0 4%; }
  .stop--r .stop__body { align-self: flex-end; }
  .stop--r .stop__when { flex-direction: row-reverse; align-items: center; gap: 3.4vw; text-align: right; }
  .stop--r .badge { margin-bottom: 0; }
  .stop--r .cal { align-items: flex-end; margin-left: 0; }
  .badge, .stop--r .badge { width: 16vw; }
  .badge__d { font-size: 8.4vw; }
  .badge__m { font-size: 5vw; }
  .stop__info { font-size: 4.6vw; line-height: 1.22; }
  .cal__btn { font-size: 4.2vw; padding: 9px 16px 9px 14px; }
  .cal { margin-top: 14px; }
}

/* ---------- Larger phones and tablets ---------- */
@media (min-width: 600px) {
  :root { --gutter: 32px; }
  .call { font-size: 1rem; height: 40px; }
  .intro h1 { font-size: 3.4rem; }
  .intro__sub { font-size: 1.35rem; }
  .badge { width: 74px; }
  .stop--r .badge { width: 74px; }
  .badge__d { font-size: 2.3rem; }
  .badge__m { font-size: 1.25rem; }
  .stop__info, .cal__btn { font-size: 1.15rem; }
  .stop__when { gap: 16px; }
  .doodle--sun { max-width: 70px; }
}

/* ---------- Desktop: pill navigation, wider path ---------- */
@media (min-width: 900px) {
  :root { --bar-h: 96px; }
  .topbar { background: rgba(247, 244, 236, .94); box-shadow: none; transition: box-shadow .3s; }
  .topbar.is-scrolled { box-shadow: 0 8px 22px -14px rgba(60, 52, 40, .35); }
  .topbar__in { max-width: 1180px; margin: 0 auto; padding: 0 32px; gap: 18px; }
  .topbar__logo img { width: 210px; max-width: none; }
  .burger { display: none; }
  .nav { order: 2; }
  .nav__list {
    position: static; transform: none; opacity: 1; visibility: visible; transition: none;
    display: flex; gap: 4px; padding: 6px; border-radius: 999px;
    background: var(--sage-deep); box-shadow: none;
  }
  .nav__list a {
    font-family: var(--text); font-size: 1rem; letter-spacing: .06em; text-transform: uppercase;
    color: #fff; border: 0; padding: 10px 20px; border-radius: 999px;
    transition: background-color .2s;
  }
  .nav__list a:hover, .nav__list a:focus-visible { background: var(--sage-ink); color: #fff; }
  .nav__list a:focus-visible { outline-color: #fff; }
  .call { order: 3; height: 44px; padding: 0 20px 0 16px; background: var(--paper); color: var(--sage-deep); border: 2px solid var(--sage); }
  .call:hover { background: var(--sage-deep); color: #fff; }

  .intro { padding-top: 48px; }
  .intro h1 { font-size: clamp(3.8rem, 5.6vw, 6rem); }
  .intro__sub { font-size: 1.6rem; margin-top: 8px; }

  .percorso { max-width: 1120px; margin: 0 auto; padding: 72px 32px 40px; }
  .stops { max-width: 1000px; margin: 0 auto; }
  .stop { grid-template-columns: minmax(0, 500px) minmax(0, 420px); column-gap: 64px; justify-content: center; }
  .stop--r { grid-template-columns: minmax(0, 420px) minmax(0, 500px); }
  .stop + .stop { margin-top: 40px; }
  .stop__photo, .stop--r .stop__photo { width: 100%; margin: 0; }
  .call { font-size: 1rem; }
  .stop--l .stop__body { padding-right: 0; }
  .stop--r .stop__body { padding-left: 0; }
  .stop--r .cal { margin-left: 0; align-items: flex-end; }
  .badge, .stop--r .badge { width: 112px; }
  .badge__d { font-size: 3.4rem; }
  .badge__m { font-size: 1.7rem; }
  .stop__info { font-size: 1.5rem; line-height: 1.25; }
  .cal__btn { font-size: 1.25rem; }
  .stop__when { gap: 22px; }
  .stop--r .stop__when { flex-direction: row-reverse; align-items: center; gap: 22px; }
  .stop__note { font-size: 1rem; max-width: 26em; }
  .stop--r .stop__note { margin-left: auto; text-align: right; }
  .cal { margin-top: 18px; }
  .cal__btn { padding: 12px 24px; min-height: 52px; }
  .doodle--sun { width: 96px; max-width: none; }
  .doodle--star { width: 84px; max-width: none; }
  .doodle--planet { width: 80px; max-width: none; }
  .stop + .stop { margin-top: 96px; }

  .contatti, .scrivici { max-width: 1080px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
  .contatti__grid { grid-template-columns: 1fr 1fr; gap: 32px; font-size: 1.1rem; }
  .form { grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .field:nth-of-type(4), .field--check, .form__status { grid-column: 1 / -1; }
  .foot { grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding-left: max(32px, calc((100vw - 1080px) / 2)); padding-right: max(32px, calc((100vw - 1080px) / 2)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Date badges: one colour per stop, from the XD palette */
.stop:nth-child(1) .badge { border-color: #629395; background: #e3eeed; }
.stop:nth-child(2) .badge { border-color: #e2ad45; background: #fbeed0; }
.stop:nth-child(3) .badge { border-color: #f2977a; background: #ffe6dc; }
