/* Strampolati: a street dressed for an Apulian patronal feast. Night indigo everywhere, warm bulbs for what is lit,
   porcelain for text; the logo keeps its own cherry on a porcelain cartouche.
   Shrikhand (display) and Bricolage Grotesque (text), self-hosted, SIL OFL (licences in /fonts/). */
@font-face {
  font-family: "Shrikhand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/shrikhand-400.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-wght.woff2") format("woff2");
}

:root {
  --notte: #0b1040;        /* the ground: night over the street */
  --notte-alta: #161c5c;   /* raised panels */
  --notte-bassa: #070a2c;  /* header and footer */
  --lume: #ffd98a;         /* a lit bulb: actions, display accents (13.4:1 on --notte) */
  --lume-vivo: #ffe9b8;    /* hover */
  --lume-ambra: #ffb547;   /* the warm edge of a bulb */
  --porcellana: #f7f7f2;   /* text (16.8:1 on --notte) */
  --foschia: #c4c8ee;      /* secondary text, tinted from the night (11:1 on --notte) */
  --ciliegia: #9c163d;     /* the logo's cherry */
  --rosa: #ff8fb0;         /* coloured bulbs, error marks (8.4:1 on --notte) */
  --verde: #7ff0de;
  --gutter: max(1.25rem, calc((100% - 72rem) / 2));
  --header-h: 4.5rem;
  --display: "Shrikhand", "Bricolage Grotesque", Georgia, serif;
  --text: "Bricolage Grotesque", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

/* A jump to a section scrolls smoothly (instant with reduced motion, see below) and lands below the pinned bar. */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); scrollbar-color: var(--lume) var(--notte-bassa); }

body {
  margin: 0;
  background: var(--notte);
  color: var(--porcellana);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variation-settings: "wght" 400;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lume); color: var(--notte); }
:focus-visible { outline: 3px solid var(--lume); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(2.25rem, 6.2vw, 4.25rem); color: var(--lume); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.5rem, 3vw, 1.9rem); color: var(--lume); margin-bottom: .6rem; }
p { margin: 0 0 1rem; text-wrap: pretty; }
strong { font-weight: 700; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Buttons: a lit plaque (main action) and a gold thread (second action). */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .7rem 1.4rem;
  font: inherit; font-weight: 700; font-variation-settings: "wght" 700; line-height: 1.2;
  text-decoration: none; border-radius: 999px; cursor: pointer;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.button svg { width: 1.4em; height: 1.4em; flex: none; }
.button-lume {
  background: var(--lume); color: var(--notte); border: 0;
  box-shadow: 0 0 0 3px var(--notte), 0 0 0 5px var(--lume-ambra), 0 12px 28px -10px rgb(0 0 0 / .6);
}
.button-lume:hover { background: var(--lume-vivo); transform: translateY(-2px); box-shadow: 0 0 0 3px var(--notte), 0 0 0 5px var(--lume), 0 18px 36px -10px rgb(0 0 0 / .7); }
.button-lume:active { transform: translateY(0); }
.button-filo { background: transparent; color: var(--lume); border: 2px solid var(--lume); }
.button-filo:hover { background: rgb(255 217 138 / .12); }
.button-grande { font-size: 1.25rem; min-height: 3.75rem; padding-inline: 1.9rem; }

/* A row of bulbs with scallops (festone.svg, a tile from tools/luminarie/festone.mjs) on top of each section. */
#chi-siamo, #cosa-facciamo, #galleria, #contatti, footer {
  background-image: url("/luminarie/festone.svg");
  background-repeat: repeat-x;
  background-position: top center;
  background-size: 96px auto;
}

section { padding: 6rem var(--gutter) 5rem; }

/* Header: logo on a porcelain cartouche (the plaque a luminaria carries at its crown), the four sections, quick
   contacts. It scrolls away with the page; once the first screen is out of sight, header.js adds is-stuck and the
   bar is pinned to the top. */
.site-header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  min-height: var(--header-h);
  padding: .5rem var(--gutter);
  background: var(--notte-bassa);
  border-bottom: 1px solid rgb(255 217 138 / .25);
}
.site-header.is-stuck .site-header-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  animation: header-in .35s var(--ease-out);
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / .6);
}
@keyframes header-in { from { transform: translateY(-100%); } }
.site-header-brand {
  display: block; flex: none;
  padding: .45rem 1rem; border-radius: 999px;
  background: var(--porcellana);
  outline: 2px dotted var(--lume); outline-offset: 3px;
}
.site-header-brand:focus-visible { outline: 3px solid var(--lume); outline-offset: 4px; }
.site-header-brand img { display: block; width: 8.5rem; height: auto; }
.site-header ul { display: flex; list-style: none; margin: 0; padding: 0; }
.site-header-sections { margin-left: auto; }
.site-header-sections ul { gap: 0 1.5rem; }
.site-header-sections a {
  display: inline-block; padding-block: .6rem; /* a tap target of about 44px */
  color: var(--porcellana); font-weight: 600; font-variation-settings: "wght" 600;
  text-decoration: none; white-space: nowrap;
  text-underline-offset: .35em; text-decoration-thickness: 2px;
}
.site-header-sections a:hover { color: var(--lume); text-decoration-line: underline; text-decoration-style: dotted; }
/* WhatsApp, call, Instagram: icons only, each a 44px tap target. */
.site-header-contacts { flex: none; }
.site-header-contacts ul { gap: .25rem; }
.site-header-contacts a {
  display: flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  color: var(--lume);
  transition: background-color .2s var(--ease-out);
}
.site-header-contacts a:hover { background: rgb(255 217 138 / .14); }
.site-header-contacts svg { width: 1.55rem; height: 1.55rem; }
/* Narrow screens: the four section links take a row of their own below the cartouche and the icons. */
@media (max-width: 56rem) {
  :root { --header-h: 6.5rem; }
  .site-header-bar { flex-wrap: wrap; min-height: 0; padding-block: .6rem 0; gap: .25rem 0; }
  .site-header-brand { padding: .35rem .8rem; }
  .site-header-brand img { width: 7rem; }
  .site-header-sections { order: 3; flex-basis: 100%; margin-left: 0; }
  .site-header-sections ul { justify-content: space-between; gap: .5rem; }
  .site-header-sections a { font-size: .9375rem; padding-block: .55rem; }
}
@media (max-width: 24rem) {
  .site-header-bar { padding-inline: .75rem; }
  .site-header-sections a { font-size: .8125rem; }
}

/* First screen: the luminaria (drawn by luminarie.js into svg.luminaria) fills it; the text stands at the threshold.
   A pool of warm light where the street meets the gate. */
#inizio {
  position: relative;
  display: grid;
  align-content: end;
  justify-items: center;
  min-height: max(36rem, calc(100svh - var(--header-h)));
  padding-block: 2rem clamp(2rem, 6vh, 4rem);
  overflow: clip;
  text-align: center;
  background: linear-gradient(var(--notte-bassa), var(--notte) 45%, var(--notte-alta));
}
.luminaria { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.inizio-testo { position: relative; z-index: 1; max-width: 62rem; }
/* Phones: text and buttons keep clear of the bulb pillars (luminarie.js: 2.5% margin + 7.5% pillar). */
.inizio-testo > :not(.azioni) { padding-inline: calc(10vw + .75rem); }
@media (min-width: 56rem) { .inizio-testo > :not(.azioni) { padding-inline: 0; } }
.azioni .button { white-space: nowrap; }
@media (max-width: 55.99rem) {
  #inizio { padding-inline: 0; } /* the pillar clearance below is the only side padding */
  .azioni { padding-inline: calc(10vw + .25rem); }
}
.unito { white-space: nowrap; }
/* The smallest phones: the longest word of the title and the WhatsApp plaque stand between the pillars. */
@media (max-width: 22.5rem) {
  #inizio h1 { font-size: 1.8rem; }
  .azioni .button { font-size: 1rem; padding-inline: 1rem; }
}
#inizio h1 {
  font-size: clamp(2.1rem, 6.4vw, 5.25rem);
  color: var(--lume);
  margin-bottom: .6rem;
}
.inizio-sottotitolo {
  font-family: var(--display); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1;
  color: var(--porcellana); margin-bottom: .4rem;
}
.inizio-origine { color: var(--foschia); margin-bottom: 1.75rem; }
.azioni { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.25rem; }

/* L'accensione: bulbs start almost dark and switch on in the order luminarie.js gives them (--d); then a slow chase
   runs along the outer band of the arch. */
.luminaria .bulb { opacity: .13; transition: opacity .45s var(--ease-out) var(--d, 0ms); }
.luminaria.is-lit .bulb { opacity: 1; }
.luminaria.is-running .chase { animation: chase 3.2s ease-in-out calc(var(--k, 0) * -133ms) infinite; }
@keyframes chase { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Who we are: the story beside a photo under an arch; the six names lit like plaques. */
#chi-siamo {
  display: grid; gap: 2.5rem 4rem; align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
.chi-testo { max-width: 38rem; }
.chi-testo p { color: var(--foschia); }
.chi-testo .chi-cast { color: var(--porcellana); font-size: 1.25rem; line-height: 1.9; }
.nome {
  display: inline-block; padding: 0 .55rem; margin-block: .1rem;
  border-radius: 999px; background: rgb(255 217 138 / .14);
  color: var(--lume); font-weight: 700; font-variation-settings: "wght" 700; line-height: 1.6;
  box-shadow: inset 0 0 0 1px rgb(255 217 138 / .45);
}
.chi-sguardi { font-family: var(--display); font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.3; color: var(--lume) !important; margin-top: 1.5rem; }
@media (min-width: 56rem) {
  #chi-siamo { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

/* Photos under an arch, like the galleria of a luminaria. */
.arco { margin: 0; }
.arco img, .gallery img {
  display: block; width: 100%; height: auto;
  border-radius: 50% 50% .6rem .6rem / 28% 28% .6rem .6rem;
  background: var(--notte-alta);
}
.arco { position: relative; padding: .6rem; border-radius: 50% 50% 1rem 1rem / 30% 30% 1rem 1rem; border: 1px solid rgb(255 217 138 / .4); }

/* What we do: the offer beside a photo, then one invitation for private parties and one for organisations. */
.cosa-corpo { display: grid; gap: 2.5rem 4rem; align-items: start; }
.cosa-testo { max-width: 40rem; }
.cosa-testo p { color: var(--foschia); }
.cosa-testo p:first-child { color: var(--porcellana); font-size: 1.25rem; }
.cosa-eventi { color: var(--porcellana) !important; }
.cosa-zona { font-family: var(--display); color: var(--lume) !important; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.3; margin-top: 1.5rem; }
.cosa-foto { max-width: 24rem; justify-self: center; }
@media (min-width: 56rem) {
  .cosa-corpo { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .cosa-foto { justify-self: end; }
}
.inviti { display: grid; gap: 1.5rem; margin-top: 4rem; }
@media (min-width: 48rem) { .inviti { grid-template-columns: 1fr 1fr; } }
.invito {
  padding: 2rem 1.75rem 1.9rem;
  border-radius: 1.5rem;
  background: var(--notte-alta);
  border: 1px solid rgb(255 217 138 / .3);
  display: flex; flex-direction: column; align-items: flex-start;
}
.invito p { color: var(--foschia); flex: 1; margin-bottom: 1.5rem; }

/* Gallery: free-flowing columns (portrait and landscape photos), each photo under an arch.
   page.js collapses it to the first photos with a button for the rest. */
#galleria h2 { margin-bottom: .5rem; }
.galleria-intro { color: var(--foschia); margin-bottom: 2.5rem; }
.gallery { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: .9rem; }
.gallery li { margin: 0 0 .9rem; break-inside: avoid; }
@media (min-width: 56rem) { .gallery { columns: 3; column-gap: 1.25rem; } .gallery li { margin-bottom: 1.25rem; } }
.gallery.is-collapsed li:nth-child(n + 13) { display: none; }
.gallery-more { display: flex; margin: 2rem auto 0; }

/* Contacts: the climax of the street. WhatsApp on one side, the form on the other. */
#contatti {
  background-color: var(--notte-alta);
  background-image: url("/luminarie/festone.svg"), linear-gradient(var(--notte-bassa), var(--notte-alta) 40%);
  background-repeat: repeat-x, no-repeat;
  background-size: 96px auto, auto;
}
#contatti { position: relative; }
/* The crown: an arch of bulbs (luminarie.js) whose opening holds the heading. */
.luminaria-corona {
  position: relative; display: block; inset: auto;
  width: min(70rem, 100%); height: clamp(10rem, 24vw, 17rem);
  margin: -1rem auto calc(-1 * clamp(.5rem, 1.5vw, 1.25rem));
}
#contatti h2 { position: relative; text-align: center; font-size: clamp(2.5rem, 6vw, 4.25rem); margin-bottom: 3rem; }
.contatti-corpo { display: grid; gap: 3rem; align-items: start; max-width: 64rem; margin-inline: auto; }
@media (min-width: 56rem) { .contatti-corpo { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 4rem; } }
.contatti-whatsapp { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.contatti-lead { font-family: var(--display); font-size: clamp(1.4rem, 2.8vw, 1.9rem); line-height: 1.3; margin: 0; }
.contatti-oppure { color: var(--foschia); margin: .5rem 0 0; }
#contatti noscript p { text-align: center; color: var(--foschia); margin-top: 2rem; }

/* The form: porcelain fields on the night, gold focus rings. */
.contact-form { display: grid; gap: 1.1rem; padding: 1.75rem; border-radius: 1.5rem; background: var(--notte); border: 1px solid rgb(255 217 138 / .3); }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 700; font-variation-settings: "wght" 700; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--notte); background: var(--porcellana);
  border: 2px solid var(--porcellana); border-radius: .75rem; padding: .7rem .85rem;
  caret-color: var(--ciliegia);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field ::placeholder { color: #55567f; opacity: 1; } /* 6.5:1 on porcelain (the browser default grey is 4.3:1, under AA) */
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--lume); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--rosa); box-shadow: 0 0 0 3px var(--rosa); }

/* Honeypot: out of sight for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ALTCHA widget (vendored, external build): porcelain like the fields. */
.contact-check altcha-widget {
  --altcha-color-base: var(--porcellana);
  --altcha-color-base-content: var(--notte);
  --altcha-border-color: var(--porcellana);
  --altcha-border-radius: .75rem;
  --altcha-color-primary: var(--ciliegia);
  --altcha-color-primary-content: var(--porcellana);
  --altcha-max-width: 100%;
  --altcha-checkbox-border-color: var(--notte); /* the default grey edge is 2.8:1 on porcelain, under 3:1 */
  --altcha-checkbox-outline: 3px solid var(--ciliegia); /* focus ring of the widget's own buttons and fields */
}
/* The checkbox and the "ALTCHA" link have no ring of their own: the browser's default is too faint. */
.contact-check altcha-widget :is(input, a):focus-visible { outline: 3px solid var(--ciliegia); outline-offset: 2px; }

.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.contact-send {
  font: inherit; font-weight: 700; font-variation-settings: "wght" 700; cursor: pointer;
  min-height: 3rem; padding: .7rem 1.6rem; border: 2px solid var(--lume); border-radius: 999px;
  background: transparent; color: var(--lume);
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.contact-send:hover { background: rgb(255 217 138 / .12); }
.contact-send:disabled { opacity: .6; cursor: progress; }
.contact-status { margin: 0; font-weight: 700; font-variation-settings: "wght" 700; color: var(--lume); }
.contact-status[data-kind="error"] { color: var(--rosa); }
/* The kind is also told by a drawn mark (a tick, an exclamation in a circle), not by colour alone. */
.contact-status[data-kind="ok"]::before, .contact-status[data-kind="error"]::before {
  content: ""; display: inline-block; width: 1.15em; height: 1.15em; margin-right: .4em; vertical-align: -.2em;
  background: currentColor;
  -webkit-mask: url("/icons/ok.svg") center / contain no-repeat; mask: url("/icons/ok.svg") center / contain no-repeat;
}
.contact-status[data-kind="error"]::before { -webkit-mask-image: url("/icons/avviso.svg"); mask-image: url("/icons/avviso.svg"); }

/* Floating WhatsApp button: below the first screen, away from the contacts section (page.js toggles is-visible). */
.wa-fluttuante {
  position: fixed; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 9;
  display: grid; place-items: center; width: 3.75rem; height: 3.75rem; border-radius: 50%;
  background: var(--lume); color: var(--notte);
  box-shadow: 0 0 0 3px var(--notte), 0 0 0 5px var(--lume-ambra), 0 14px 30px -8px rgb(0 0 0 / .6);
  visibility: hidden; opacity: 0; transform: translateY(1rem) scale(.9);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility 0s linear .3s;
}
.wa-fluttuante.is-visible { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.wa-fluttuante svg { width: 1.9rem; height: 1.9rem; }
.wa-fluttuante:hover { background: var(--lume-vivo); }
/* Phones only: from 56rem the pinned header carries WhatsApp in view. */
@media (min-width: 56rem) { .wa-fluttuante { display: none; } }

/* Footer, on every page: who we are and the privacy link. */
footer { padding: 4rem var(--gutter) 2.5rem; background-color: var(--notte-bassa); text-align: center; font-size: 1rem; color: var(--foschia); }
footer p { margin: 0; }
footer a { color: var(--lume); font-weight: 700; font-variation-settings: "wght" 700; text-underline-offset: .25em; }
/* Links alone on their line: a tap target of about 44px. */
footer a, .legal-back a { display: inline-block; padding-block: .6rem; }

/* Privacy page: a plain porcelain reading page, the logo at the top, the same footer. */
.legal-page { background: var(--porcellana); color: var(--notte); }
.legal-page footer { color: var(--foschia); }
.legal-top { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 0; }
.legal-top a { display: inline-block; padding-block: .3rem; } /* about 44px with the logo */
.legal-top a:focus-visible, .legal a:focus-visible { outline: 3px solid var(--ciliegia); outline-offset: 3px; }
.legal-logo { display: block; width: 10rem; height: auto; }
.legal { max-width: 42rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
.legal h1 { font-size: clamp(2.25rem, 6vw, 3.25rem); color: var(--ciliegia); margin-bottom: .75rem; }
.legal h2 { font-size: 1.5rem; color: var(--ciliegia); margin: 2.25rem 0 .5rem; }
.legal a { color: var(--ciliegia); font-weight: 700; font-variation-settings: "wght" 700; }
.legal-updated { margin-top: 0; font-size: 1rem; }
.legal ul { padding-left: 1.5rem; }
.legal li + li { margin-top: .5rem; }
.legal-back { margin-top: 2.5rem; }
.legal-page ::selection { background: var(--ciliegia); color: var(--porcellana); }

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