/* Patriziato Sant'Antonio – homepage
   CSS puro, nessuna dipendenza, nessun font esterno. Mobile first. */

:root {
  /* Colori: dallo stemma (blu e rosso) e dal bosco della valle */
  --ink: #18241e;
  --muted: #56625a;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --line: #dce2d9;
  --blu: #1f4fa3;
  --blu-scuro: #163a7a;
  --rosso: #c4161c;
  --bosco: #1b3326;
  --bosco-testo: #dfe8e1;

  /* Font di sistema: zero download */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "TeX Gyre Pagella", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.125rem, 4vw, 2.5rem);
  --section: clamp(3.25rem, 7vw, 6rem);
  --header-h: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

p { margin: 0; }

a {
  color: var(--blu);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { color: var(--blu-scuro); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--blu); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 100;
  padding: .6rem 1rem; border-radius: 6px;
  background: var(--ink); color: #fff;
}
.skip:focus { top: .75rem; color: #fff; }

/* ── Pulsanti ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.35rem;
  border: 1.5px solid transparent; border-radius: 8px;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--blu); color: #fff; }
.btn-primary:hover { background: var(--blu-scuro); color: #fff; }
.btn-ghost { border-color: #b7c2b9; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }

/* ── Header ───────────────────────────────────────────── */
/* Il filetto in alto riprende lo stemma partito: metà blu, metà rosso */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-top: 4px solid var(--blu);
  border-image: linear-gradient(90deg, var(--blu) 0 50%, var(--rosso) 50% 100%) 1;
  box-shadow: 0 1px 0 var(--line);
}

.header-bar { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }

.brand {
  display: flex; align-items: center; gap: .75rem;
  margin-right: auto;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand img { width: 38px; height: 48px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.1875rem; }
.brand-sub { font-size: .875rem; color: var(--muted); }

.menu-toggle {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 2.75rem; padding: 0 .9rem;
  font: 600 .9375rem/1 var(--sans); color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: transform .2s ease, background-color .2s ease;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-open .menu-icon { background-color: transparent; }
.menu-open .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute; inset: 100% 0 auto;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 16px 24px -16px rgb(24 36 30 / .3);
}
.menu-open .site-nav { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: .25rem var(--gutter) 1rem; }
.site-nav li + li { border-top: 1px solid var(--line); }
.site-nav a {
  display: block; padding: .9rem 0;
  font-size: 1.0625rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--blu); }

@media (min-width: 70rem) {
  .menu-toggle { display: none; }
  .site-nav {
    display: block; position: static;
    max-height: none; overflow: visible;
    background: none; border: 0; box-shadow: none;
  }
  .site-nav ul { display: flex; gap: .125rem; padding: 0; }
  .site-nav li + li { border: 0; }
  .site-nav a { padding: .5rem .75rem; border-radius: 6px; font-size: .975rem; }
  .site-nav a:hover { background: var(--bg); }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--blu); border-radius: 0; }
}

/* ── Hero: immagini a tutta larghezza con zoom lento e dissolvenza ── */
.hero {
  position: relative;
  isolation: isolate;
  display: flex; flex-direction: column; justify-content: center;
  min-height: clamp(26rem, 74svh, 46rem);
  overflow: hidden;
  background: var(--bosco);
  color: #fff;
}

.hero-slides, .slide, .slide img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-slides { z-index: -2; }
.slide { opacity: 0; transition: opacity 1.6s ease; }
.slide.is-active { opacity: 1; }
.slide img { object-fit: cover; }
.slide:nth-child(1) img { object-position: 60% 45%; transform-origin: 62% 55%; }
.slide:nth-child(2) img { object-position: 50% 50%; transform-origin: 30% 40%; }
.slide:nth-child(3) img { object-position: 50% 60%; transform-origin: 70% 65%; }

/* Velatura per leggere il testo su qualsiasi foto */
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(12 24 17 / .25) 0%, rgb(12 24 17 / 0) 30%, rgb(12 24 17 / .35) 62%, rgb(12 24 17 / .78) 100%),
    linear-gradient(90deg, rgb(12 24 17 / .45) 0%, rgb(12 24 17 / 0) 65%);
}

.hero-content {
  display: flex; flex-direction: column; align-items: flex-start;
  padding-block: 2.5rem 4.5rem;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.75rem, 1.4rem + 5.2vw, 5.5rem);
  line-height: 1;
  letter-spacing: -.015em;
  text-shadow: 0 2px 28px rgb(0 0 0 / .35);
}

/* Nel codice è un h2 dopo l'h1; a schermo compare sopra il titolo */
.hero .hero-lead {
  order: -1;
  max-width: 30ch;
  margin: 0 0 .75rem;
  font-weight: 400;
  text-wrap: balance;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.75rem);
  line-height: 1.35;
  color: rgb(255 255 255 / .92);
  text-shadow: 0 1px 16px rgb(0 0 0 / .4);
}

.hero .btn { margin-top: 2rem; }
.hero h1 + .hero-lead + .btn { margin-top: 2.25rem; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--bg); color: var(--ink); }
.hero :focus-visible { outline-color: #fff; }

/* Indicatori delle immagini */
.hero-controls {
  position: absolute; left: 0; right: 0; bottom: clamp(1.25rem, 3vw, 2rem);
  display: flex; align-items: center; justify-content: flex-end; gap: .5rem;
}
.hero-dots { display: flex; }
.hero-dot {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  background: none; border: 0; cursor: pointer;
}
.hero-dot::before {
  content: ""; width: 1.75rem; height: 3px; border-radius: 2px;
  background: rgb(255 255 255 / .45);
  transition: background-color .3s;
}
.hero-dot:hover::before { background: rgb(255 255 255 / .8); }
.hero-dot[aria-current="true"]::before { background: #fff; }

/* Zoom lento (effetto Ken Burns); disattivato se il sistema chiede movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .slide.is-active img, .slide.is-leaving img { animation: zoom-lento 9s linear both; }
  @keyframes zoom-lento {
    from { transform: scale(1); }
    to { transform: scale(1.12); }
  }
}

/* ── Sezioni ──────────────────────────────────────────── */
.section { padding-block: var(--section); }
.section h2 { font-size: clamp(1.75rem, 1.35rem + 1.4vw, 2.375rem); }

.section-albo { background: var(--surface); border-top: 1px solid var(--line); }

.albo-grid { display: grid; gap: 2rem; }
.section-head > p:not(.section-links) { max-width: 34ch; margin-top: .9rem; color: var(--muted); }
.section-links { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; margin-top: 1.5rem; font-weight: 600; }

@media (min-width: 56rem) {
  .albo-grid { grid-template-columns: minmax(16rem, 1fr) 2fr; gap: 4rem; }
  .section-head { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}

/* Elenco pubblicazioni */
.notices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.notice {
  position: relative;
  display: grid; grid-template-columns: 4.25rem 1fr; gap: 0 1.25rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.notice.no-date { grid-template-columns: 1fr; }

.notice-date { font-family: var(--serif); line-height: 1; text-align: center; padding-top: .15rem; }
.notice-day { display: block; font-size: 2.25rem; font-weight: 700; color: var(--rosso); }
.notice-month { display: block; margin-top: .35rem; font: 500 .8125rem/1.2 var(--sans); color: var(--muted); }

.notices .notice-title { font-family: var(--sans); font-size: 1.1875rem; font-weight: 600; line-height: 1.35; }
.notice-title a { color: var(--ink); text-decoration: none; }
.notice-title a::after { content: ""; position: absolute; inset: 0; border-radius: 6px; } /* tutta la riga è cliccabile */
.notice:hover .notice-title a { color: var(--blu); text-decoration: underline; text-decoration-thickness: 1px; }
.notice-title a:focus-visible { outline: none; }
.notice-title a:focus-visible::after { outline: 3px solid var(--blu); outline-offset: 2px; }
.notice-desc { margin-top: .35rem; color: var(--muted); }

.notice-state { padding: 1.5rem 0; color: var(--muted); }

/* Segnaposto durante il caricamento */
.sk { display: block; height: .85rem; border-radius: 4px; background: #e6ebe4; }
.sk-day { width: 2.5rem; height: 2.4rem; margin-inline: auto; }
.sk-title { width: 72%; height: 1.15rem; margin-top: .2rem; }
.sk-text { width: 94%; margin-top: .7rem; }
.sk-line { width: 100%; margin-top: .8rem; }
.sk.short { width: 55%; }

@media (prefers-reduced-motion: no-preference) {
  .sk { animation: attesa 1.2s ease-in-out infinite alternate; }
  @keyframes attesa { to { opacity: .45; } }
}

/* Il Patriziato: se il contenuto ha una foto, testo a sinistra e foto a destra */
.section-about h2 { margin-bottom: 1.5rem; font-size: clamp(1.75rem, 1.35rem + 1.4vw, 2.375rem) !important; }

@media (min-width: 56rem) {
  .prose:has(> figure:not(.pdf)) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 4rem; align-items: start; max-width: none;
  }
  .prose:has(> figure:not(.pdf)) > * { grid-column: 1; }
  .prose:has(> figure:not(.pdf)) > figure:not(.pdf) { grid-column: 2; grid-row: 1 / span 20; margin-top: 0; }
}

/* Contenuto HTML del CMS */
.prose { max-width: 40rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .35em; }
.prose img { border-radius: 10px; }
.prose figure { margin: 1.75rem 0 0; }
.prose figcaption { margin-top: .6rem; font-size: .875rem; color: var(--muted); }
.prose blockquote { margin-inline: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.prose th, .prose td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
.prose .state { color: var(--muted); }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem;
  background: var(--bosco); color: var(--bosco-testo);
  font-size: .975rem;
}
.site-footer a { color: #fff; text-decoration-color: rgb(255 255 255 / .4); }
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }
.site-footer :focus-visible { outline-color: #fff; }

.footer-grid { display: grid; gap: 2.25rem; }
.footer-brand { display: flex; align-items: flex-start; gap: 1rem; }
.footer-brand img { width: 44px; height: 56px; flex: none; }
.footer-brand strong { font-family: var(--serif); font-size: 1.1875rem; color: #fff; }
.footer-title { margin-bottom: .75rem; font: 600 1rem/1.3 var(--sans); color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-note { margin-top: .45rem; }
.site-footer p a { overflow-wrap: break-word; }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / .14);
  font-size: .875rem; color: rgb(223 232 225 / .8);
}

@media (max-width: 39.99rem) {
  .footer-bottom { flex-direction: column; text-align: center; gap: .6rem; }
}
@media (min-width: 40rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 3rem; } }

/* ── Pagine interne: intestazione con foto ───────────────────── */
.page-hero {
  position: relative;
  isolation: isolate;
  display: flex; align-items: flex-end;
  min-height: clamp(16rem, 36vh, 23rem);
  overflow: hidden;
  background: var(--bosco);
  color: #fff;
}
.page-hero.is-tall { min-height: clamp(28rem, 82svh, 48rem); align-items: center; }

.page-hero-img, .page-hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-hero-img { z-index: -2; }
.page-hero-img img { object-fit: cover; object-position: 50% 55%; }
.page-hero--hero-1 .page-hero-img img { object-position: 62% 40%; }

.page-hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(12 24 17 / .3) 0%, rgb(12 24 17 / .45) 45%, rgb(12 24 17 / .82) 100%),
    linear-gradient(90deg, rgb(12 24 17 / .4) 0%, rgb(12 24 17 / 0) 70%);
}

.page-hero-content { padding-block: 3.5rem clamp(2.25rem, 4vw, 3.25rem); }
.page-hero.is-tall .page-hero-content { padding-block: 5rem 6rem; }

.page-hero h1 {
  max-width: 28ch;
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
  line-height: 1.08;
  text-shadow: 0 2px 24px rgb(0 0 0 / .3);
}
.page-hero.is-tall h1 { max-width: 14ch; font-size: clamp(2.75rem, 1.4rem + 5.2vw, 5.5rem); line-height: 1; }

.page-lead {
  max-width: 40ch;
  margin-top: .9rem;
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1rem + .55vw, 1.45rem);
  line-height: 1.4;
  color: rgb(255 255 255 / .92);
  text-wrap: balance;
}
.page-date { margin-bottom: .6rem; font-size: .9375rem; font-weight: 600; color: rgb(255 255 255 / .9); }
.page-hero-link { margin-top: 2rem; }
.page-hero :focus-visible { outline-color: #fff; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: .875rem; }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: rgb(255 255 255 / .55); }
.crumbs a { color: rgb(255 255 255 / .88); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }

.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(1rem, 3vh, 2rem);
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; margin-left: -1.375rem;
  border-radius: 50%;
  color: #fff;
}
.scroll-cue:hover { color: #fff; background: rgb(255 255 255 / .12); }

/* Corpo di pagine e articoli */
.prose-page { max-width: 46rem; }
.page-back { max-width: 46rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-weight: 600; }

/* Gallerie nel contenuto del CMS (anche quelle importate da WordPress) */
.prose .galleria, .prose .gallery, .prose .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
  gap: .625rem;
  margin-top: 1.5rem; padding: 0;
  list-style: none;
}
.prose .galleria > *, .prose .gallery > *, .prose .wp-block-gallery > * { margin: 0; }
.prose .galleria a, .prose .gallery a, .prose .wp-block-gallery a { display: block; border-radius: 8px; overflow: hidden; }
.prose .galleria img, .prose .gallery img, .prose .wp-block-gallery img {
  width: 100%; height: 100%;
  aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 8px;
}
.prose figure img, .prose .galleria img, .prose .gallery img, .prose .wp-block-gallery img,
.prose a[href$=".jpg"] img, .prose a[href$=".jpeg"] img, .prose a[href$=".png"] img, .prose a[href$=".webp"] img { cursor: zoom-in; }

/* ── Ricordi: elenco e paginazione ────────────────────────────── */
.ricordi-intro { margin-bottom: 2.75rem; color: var(--muted); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 2.75rem 2rem;
  margin: 0; padding: 0;
  list-style: none;
}
.post { position: relative; display: flex; flex-direction: column; }
.post-media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: #e6ebe4; }
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-media.is-empty,
.notice-thumb.is-empty {
  background: #e3e7e1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3ada5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center / 2.75rem no-repeat;
}
.post-body { padding-top: 1rem; }
.post-date { display: block; margin-bottom: .35rem; font-size: .875rem; font-weight: 600; color: var(--rosso); }
.post .post-title { font-size: 1.3125rem; line-height: 1.25; overflow-wrap: anywhere; }
.post-title a { color: var(--ink); text-decoration: none; }
.post-title a::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.post:hover .post-title a { color: var(--blu); text-decoration: underline; text-decoration-thickness: 1px; }
.post-title a:focus-visible { outline: none; }
.post-title a:focus-visible::after { outline: 3px solid var(--blu); outline-offset: 6px; }
.post-excerpt { margin-top: .5rem; font-size: 1rem; color: var(--muted); }

.pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 3.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.page-list { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.page-list a, .page-gap {
  display: grid; place-items: center;
  min-width: 2.75rem; height: 2.75rem; padding: 0 .5rem;
  border-radius: 8px;
  font-weight: 600; color: var(--ink); text-decoration: none;
}
.page-list a:hover { background: var(--surface); color: var(--blu); }
.page-list a[aria-current="page"] { background: var(--blu); color: #fff; }
.page-step {
  display: inline-flex; align-items: center;
  min-height: 2.75rem; padding: 0 1.1rem;
  border: 1.5px solid #c9d1c7; border-radius: 8px;
  font-weight: 600; color: var(--ink); text-decoration: none;
}
a.page-step:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.page-step[aria-disabled="true"] { border-color: transparent; color: #98a39b; }
@media (max-width: 34rem) {
  .page-list { order: -1; width: 100%; justify-content: center; }
}

/* ── Contatti ─────────────────────────────────────────────────── */
.contact-grid { display: grid; gap: 4rem; }
@media (min-width: 60rem) {
  .contact-grid { grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 1fr); gap: 5rem; align-items: start; }
}
.contact-sub { margin-top: .6rem; color: var(--muted); }
.contact-intro { margin-top: 1.25rem; }

.contact-form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .975rem; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  width: 100%; min-height: 2.625rem;
  padding: .5rem .8rem;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1.5px solid #c9d1c7; border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 10rem; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 3px rgb(31 79 163 / .2); }
.field [aria-invalid="true"] { border-color: var(--rosso); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(196 22 28 / .18); }
.field-error { font-size: .9rem; font-weight: 500; color: var(--rosso); }

.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: .75rem; }
.field-check input { width: 1.375rem; height: 1.375rem; margin: .15rem 0 0; accent-color: var(--blu); }
.field-check label { font-weight: 400; }
.field-check .field-error { grid-column: 2; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-send { width: 100%; background: var(--bosco); min-height: 2.875rem; margin-top: .25rem; border-radius: 999px; font-size: 1rem; }
.btn-send:disabled { opacity: .7; cursor: progress; }

.form-status { padding: .9rem 1rem; border-radius: 8px; background: #fbeaea; font-weight: 600; color: #8f1116; }
.form-done { margin-top: 2rem; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.section .form-done h3 { font-size: 1.5rem; color: var(--bosco); }
.form-done p { margin-top: .5rem; }

.contact-info {
  position: relative;
  margin-top: 2.25rem;
  padding: 3.75rem 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
  text-align: center;
}
.contact-icon {
  position: absolute; top: 0; left: 50%;
  display: grid; place-items: center;
  width: 4.5rem; height: 4.5rem; margin: -2.25rem 0 0 -2.25rem;
  border-radius: 50%;
  background: var(--bosco); color: #fff;
  box-shadow: 0 0 0 6px var(--bg);
}
.contact-info { padding: 4.25rem clamp(1.75rem, 4vw, 3rem) 2.75rem; }
.section .contact-info h2 { font-size: 1.375rem; }
.contact-info h2 + p { margin-top: .6rem; line-height: 1.6; }
.contact-info p + h2 { margin-top: 2rem; }
.map-link { font-weight: 600; }

/* ── Lightbox ─────────────────────────────────────────────────── */
html.lb-lock { overflow: hidden; }
html.lb-lock body { padding-right: var(--lb-sw, 0px); }

.lb { position: fixed; inset: 0; z-index: 1000; color: #fff; touch-action: none; }
.lb[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgb(12 19 15 / .95); opacity: 0; transition: opacity .34s ease; }
.lb.is-open .lb-backdrop { opacity: var(--lb-fade, 1); }

.lb-bar, .lb-nav, .lb-foot { opacity: 0; transition: opacity .3s ease; }
.lb.is-open .lb-bar, .lb.is-open .lb-nav, .lb.is-open .lb-foot { opacity: 1; }

.lb-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  height: 3.75rem; padding: 0 .625rem 0 1.25rem;
}
.lb-counter { font: 500 .9375rem/1 var(--sans); font-variant-numeric: tabular-nums; color: rgb(255 255 255 / .85); }
.lb-stage { position: absolute; top: 3.75rem; left: .75rem; right: .75rem; bottom: 1rem; }
@media (min-width: 48rem) { .lb-stage { left: 5.5rem; right: 5.5rem; } }

.lb-img {
  position: fixed; z-index: 1;
  max-width: none;
  border-radius: 2px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .45);
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
  will-change: transform;
}

.lb-btn {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .1); color: #fff;
  cursor: pointer;
  transition: background-color .15s;
}
.lb-btn:hover { background: rgb(255 255 255 / .22); }
.lb-btn svg { width: 22px; height: 22px; }
.lb :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.lb-nav { position: absolute; top: 50%; z-index: 2; width: 3.25rem; height: 3.25rem; margin-top: -1.625rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
@media (hover: none) and (pointer: coarse) { .lb-nav { display: none; } }

.lb-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: .75rem 1rem 1rem; text-align: center; }
.lb-caption { max-width: 60ch; margin: 0 auto .75rem; font-size: .9375rem; color: rgb(255 255 255 / .88); }
.lb-thumbs { display: flex; gap: .5rem; width: fit-content; max-width: 100%; margin: 0 auto; padding: 3px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumb {
  flex: none;
  width: 4rem; height: 3rem; padding: 0;
  overflow: hidden;
  background: #000; border: 0; border-radius: 6px;
  opacity: .45; cursor: pointer;
  transition: opacity .2s;
}
.lb-thumb:hover { opacity: .8; }
.lb-thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }

.lb.is-single .lb-counter, .lb.is-single .lb-nav, .lb.is-single .lb-thumbs { display: none; }

.lb-spinner {
  position: fixed; left: 50%; top: 50%; z-index: 3;
  width: 2.5rem; height: 2.5rem; margin: -1.25rem 0 0 -1.25rem;
  border: 3px solid rgb(255 255 255 / .25); border-top-color: #fff; border-radius: 50%;
  opacity: 0; pointer-events: none;
}
.lb.is-loading .lb-spinner { opacity: 1; animation: lb-gira .8s linear infinite; }
@keyframes lb-gira { to { transform: rotate(360deg); } }

.powered { display: inline-flex; flex: none; align-items: center; gap: .4rem; white-space: nowrap; color: inherit; text-decoration: none; }
.site-footer .powered { color: rgb(223 232 225 / .8); }
.powered img { display: block; height: 14px; width: auto; }

/* Elenco dell'albo nella sua pagina */
.albo-page .notices { max-width: 52rem; }

/* Colonne create con TinyMCE (.cms-cols > .cms-col): affiancate, su telefono una sotto l'altra */
.prose:has(.cms-cols) { max-width: none; }
.prose .cms-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem clamp(2rem, 4vw, 4rem);
  align-items: start;
}
.prose .cms-col { min-width: 0; }
.prose .cms-col > * + * { margin-top: 1.1em; }
.prose .cms-col > :first-child { margin-top: 0; }
.prose .cms-col p:has(> img:only-child) { margin-bottom: 0; }
.prose .cms-col img { width: 100%; border-radius: 10px; }

/* PDF nelle pagine: due pulsanti sopra e anteprima larga quanto la pagina */
.prose-page:has(.pdf) { max-width: none; }
.prose .pdf { width: 100%; margin: 1.5rem 0 0; }
.pdf-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.btn-small { min-height: 2.375rem; padding: .4rem 1.1rem; font-size: .9375rem; }
.pdf-frame { display: block; width: 100%; height: min(85vh, 64rem); border: 1px solid var(--line); border-radius: 12px; background: #e9ece8; }
@media (max-width: 39.99rem) {
  .pdf-actions .btn { flex: 1 1 auto; }
  .pdf-frame { height: calc(100svh - var(--header-h) - 1.5rem); min-height: 28rem; }
}

.btn-send:hover { background: #234433; }

/* Intestazione semplice delle pagine interne (come Contatti) */
.page-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.page-head + .section { padding-top: clamp(2rem, 4vw, 3rem); }
.page-head .crumbs ol { margin-bottom: 1.25rem; }
.page-head .crumbs li + li::before { color: var(--muted); }
.page-head .crumbs a { color: var(--muted); }
.page-head .crumbs a:hover { color: var(--blu); }
.page-head h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); line-height: 1.05; }
.page-head .page-date { margin: .75rem 0 0; font-weight: 400; color: var(--muted); }
.page-head .page-lead { max-width: none; margin-top: .9rem; font-family: var(--sans); font-size: 1.125rem; line-height: 1.6; color: var(--muted); text-wrap: pretty; }

/* Ricordi: elenco come l'albo, con immagine al posto della data */
.notices-media .notice, .notices-media .notice.no-date { grid-template-columns: 8.5rem 1fr; align-items: start; }
.notice-thumb { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: #e3e7e1; }
.notice-thumb img { width: 100%; height: 100%; object-fit: cover; }
.notice-thumb.is-empty {
  background: #e3e7e1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3ada5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center / 2rem no-repeat;
}
@media (max-width: 39.99rem) {
  .notices-media .notice, .notices-media .notice.no-date { grid-template-columns: 5.5rem 1fr; gap: 0 1rem; }
}

/* Galleria creata con TinyMCE (.cms-gallery > img): griglia di miniature, al clic si apre la lightbox */
.prose .cms-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: .625rem;
}
.prose .cms-gallery img {
  width: 100%; height: 100%;
  aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  transition: filter .2s;
}
.prose .cms-gallery img:hover { filter: brightness(1.06); }
@media (max-width: 39.99rem) {
  .prose .cms-gallery { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
}

/* Condividi */
.share { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.share-title { margin-bottom: .75rem; font-weight: 600; }
.share-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 2.5rem; padding: .4rem 1rem;
  border: 1.5px solid #c9d1c7; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 600 .9375rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.share-btn:hover { border-color: var(--ink); color: var(--ink); }
.share-btn svg { flex: none; }
.share-wa svg { color: #1f9d55; }
.share-fb svg { color: #1877f2; }
.share-btn.is-done { border-color: var(--bosco); color: var(--bosco); }
.share + .page-back { margin-top: 1.5rem; padding-top: 0; border-top: 0; }

/* Torna su: fisso in basso a destra, compare dopo aver scorso la pagina */
.to-top {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 40;
  display: grid; place-items: center;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background: var(--bosco); color: #fff;
  box-shadow: 0 6px 20px rgb(12 24 17 / .3);
  opacity: 0; visibility: hidden; transform: translateY(.75rem);
  transition: opacity .25s, transform .25s, visibility .25s, background-color .15s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--blu); color: #fff; }

/* Contatti: intestazione semplice e mappa */
.contact-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.contact-head h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); line-height: 1.05; }
.contact-head p { margin-top: .9rem; font-size: 1.125rem; color: var(--muted); }
.contact.section { padding-top: clamp(2rem, 4vw, 3rem); }
.map { padding-bottom: var(--section); }
.section .map h2, .map h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-bottom: 1.25rem; }
.map iframe { display: block; width: 100%; height: clamp(20rem, 50vh, 28rem); border: 0; border-radius: 14px; background: #e6ebe4; }

/* Pagine senza foto: il titolo è un normale titolo di pagina, sullo stesso grigio del contenuto */
.page-head, .contact-head { padding-bottom: 0; }
.page-head + .section, .contact-head + .section { padding-top: clamp(1.5rem, 3vw, 2rem); }

/* Link e parole molto lunghe vanno a capo invece di allargare la pagina (soprattutto su telefono) */
.prose, .notice-desc, .post-excerpt, .page-lead { overflow-wrap: anywhere; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }



/* Avviso importante (pagina "alert" del CMS): fascia blu dello stemma, a tutta larghezza */
.site-alert { background: var(--blu); color: #fff; }
.site-alert-box { padding-block: 1.1rem 1.2rem; }
.site-alert h2 { font-size: 1.1875rem; line-height: 1.25; color: #fff; }
.site-alert-text { margin-top: .3rem; color: rgb(255 255 255 / .92); overflow-wrap: anywhere; }
.site-alert-text > * + * { margin-top: .5em; }
.site-alert-text a { font-weight: 600; color: #fff; text-decoration-color: rgb(255 255 255 / .6); }
.site-alert-text a:hover { color: #fff; text-decoration-color: #fff; }
.site-alert :focus-visible { outline-color: #fff; }

/* ── Stampa ───────────────────────────────────────────── */
@media print {
  .to-top, .map { display: none !important; }
  .site-header { position: static; }
  .menu-toggle, .site-nav, .hero-controls, .hero .btn, .skip, .scroll-cue, .contact-form, .pagination, .lb { display: none !important; }
  .page-hero { min-height: 0; color: var(--ink); }
  .page-hero-img, .page-hero::after { display: none; }
  .hero { min-height: 0; color: var(--ink); }
  .hero-slides, .hero::after { display: none; }
  .section-albo { border: 0; }
  body { background: #fff; }
}
