/* Fondazione La Quercia — foglio di stile del sito (direzione grafica D, «Quercia, linea rinnovata»).
   Principi: tipografia e composizione al posto di riquadri e ombre; separatori da 1 px;
   angoli vivi; colore usato con parsimonia, a partire dal logo. */

:root {
  --ink: #262622;
  --ink-soft: #3d3c35;
  --muted: #5c5b52;
  --green-dark: #24301a;
  --green: #2f3a22;
  --green-link: #3e5a16;
  --lime: #98ce00;
  --underline: #7fa21c;
  --pale: #f1f6e2;
  --pale-line: #dde4c6;
  --sage: #d7e2ae;
  --sage-line: #a8b67a;
  --taupe: #7a6d55;
  --line: #e4e2d8;
  --paper: #ffffff;
  --danger: #a3341f;
  --timeline: #16a34a;

  --serif: 'Baskervville', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --wrap: 1120px;
  --gutter: 40px;
  --header-h: 88px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 88px;
  --ease: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.68 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.18; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
b, strong { font-weight: 600; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--underline); text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color var(--ease), text-decoration-thickness var(--ease); }
a:hover { color: var(--green-link); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--green-link); outline-offset: 3px; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }

/* ───────── Testata ───────── */

.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); height: var(--header-h); }
.site-header__logo { display: block; flex: none; }
.site-header__logo img { width: 68px; height: 68px; }
.site-header__tools { display: flex; align-items: center; gap: 4px; }

.mainnav > ul { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.mainnav__item { position: relative; display: flex; align-items: center; }
.mainnav__link { display: inline-flex; align-items: center; height: 44px; color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: .01em; text-decoration: none; }
.mainnav__link:hover { color: var(--green-link); }
.mainnav__item.is-active > .mainnav__link { box-shadow: inset 0 -2px 0 var(--lime); }
.mainnav__toggle { width: 22px; height: 44px; margin-left: 2px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.mainnav__toggle svg { transition: transform var(--ease); }
.mainnav__sub { position: absolute; top: calc(100% + 1px); left: -18px; min-width: 250px; list-style: none; margin: 0; padding: 10px 0; background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--lime); visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity var(--ease), transform var(--ease), visibility var(--ease); }
.mainnav__sub a { display: block; padding: 9px 18px; font-size: 15px; text-decoration: none; color: var(--ink-soft); }
.mainnav__sub a:hover, .mainnav__sub a[aria-current="page"] { color: var(--green-link); background: var(--pale); }
.mainnav__item:hover > .mainnav__sub, .mainnav__item:focus-within > .mainnav__sub, .mainnav__item.is-open > .mainnav__sub { visibility: visible; opacity: 1; transform: none; }
.mainnav__item.is-open > .mainnav__toggle svg { transform: rotate(180deg); }

.usermenu { position: relative; }
.usermenu > summary { list-style: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary img { width: 26px; height: 26px; border-radius: 50%; opacity: .75; }
.usermenu[open] > summary img, .usermenu > summary:hover img { opacity: 1; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; background: var(--paper); border: 1px solid var(--line); padding: 6px 0; z-index: 60; }
.usermenu__panel a, .usermenu__panel button { display: block; width: 100%; padding: 9px 16px; text-align: left; font-size: 15px; text-decoration: none; color: var(--ink); background: none; border: 0; cursor: pointer; }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--pale); }
.usermenu__panel form { margin: 0; border-top: 1px solid var(--line); }

.menu-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; align-items: center; justify-content: center; color: var(--ink); }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Menu mobile: pannello a tutta altezza sotto la testata, voci a fisarmonica */
.mobile-menu { display: none; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu .mobile-menu__list { padding: 6px var(--gutter) 32px; }
.mobile-menu__link, .mgroup > summary { display: flex; align-items: center; justify-content: space-between; min-height: 56px; border-bottom: 1px solid var(--line); font: 400 22px/1.2 var(--serif); color: var(--ink); text-decoration: none; }
.mgroup > summary { list-style: none; cursor: pointer; }
.mgroup > summary::-webkit-details-marker { display: none; }
.mgroup > summary a { color: inherit; text-decoration: none; flex: 1; align-self: stretch; display: flex; align-items: center; }
.mgroup__sign { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-end; color: var(--taupe); }
.mgroup__sign svg { transition: transform var(--ease); }
.mgroup[open] > summary { border-bottom-color: transparent; }
.mgroup[open] .mgroup__sign svg { transform: rotate(45deg); }
.mgroup__list { border-left: 2px solid var(--lime); margin: 0 0 12px 2px !important; padding: 2px 0 8px 16px !important; border-bottom: 1px solid var(--line); }
.mgroup__list a { display: flex; align-items: center; min-height: 44px; font-size: 17px; color: var(--ink-soft); text-decoration: none; }
.mgroup__list .level-2 a { padding-left: 14px; font-size: 16px; }
.mgroup__list a[aria-current="page"], .mobile-menu__link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.mobile-menu__link.is-secondary { font: 500 17px var(--sans); color: var(--muted); border-bottom: 0; margin-top: 12px; }

/* ───────── Barra secondaria (titolo a percorso e sottomenu) ───────── */

.subbar { background: var(--pale); border-bottom: 1px solid var(--pale-line); }
.subbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 32px; min-height: 56px; }
.subbar__title { margin: 0; padding: 14px 0; font-size: 15px; color: var(--muted); white-space: pre-wrap; }
.subnav ul { display: flex; flex-wrap: wrap; gap: 0 26px; list-style: none; margin: 0; padding: 0; }
.subnav a { display: inline-flex; align-items: center; min-height: 52px; font-size: 15px; color: var(--ink-soft); text-decoration: none; }
.subnav a:hover { color: var(--green-link); }
.subnav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--lime); }

/* ───────── Contenuti delle pagine ───────── */

.page__body { padding-bottom: var(--s6); }
.prose { max-width: 720px; }
.prose--body { width: 100%; max-width: calc(720px + 2 * var(--gutter)); margin: 0 auto 0 max(0px, calc((100% - var(--wrap)) / 2 - var(--gutter))); padding: var(--s5) var(--gutter) 0; }
.prose h1 { font-size: 46px; line-height: 1.08; color: var(--green-dark); margin-bottom: .55em; }
.prose h2 { font-size: 28px; font-weight: 600; margin: 1.7em 0 .5em; }
.prose h3 { font-size: 21px; font-weight: 600; margin: 1.6em 0 .4em; }
.prose > :first-child, .prose > div > :first-child { margin-top: 0; }
.prose ul { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--taupe); }
.prose video { margin: var(--s3) 0; width: 100%; background: #000; }

/* Introduzione con fotografia (come l'apertura della home) */
.intro { display: grid; grid-template-columns: 58fr 42fr; min-height: 460px; }
.intro__text { background: var(--pale); padding: var(--s5) var(--s5) var(--s5) max(var(--gutter), calc((100vw - var(--wrap)) / 2)); display: flex; flex-direction: column; justify-content: center; }
.intro__text h1 { font-size: 46px; line-height: 1.08; color: var(--green-dark); margin-bottom: .5em; max-width: 14em; }
.intro__text p { max-width: 36em; color: var(--ink-soft); }
.intro__text ul { margin: 0; padding-left: 1.2em; max-width: 36em; }
.intro__text li::marker { color: var(--taupe); }
.intro__img { width: 100%; height: 100%; min-height: 460px; object-fit: cover; }

/* Paragrafo introduttivo senza fotografia */
.lead > h1 + p, .lead > p:first-of-type { font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--green); }

/* Fotografia a tutta larghezza con il titolo nel pannello verde che sale sulla foto */
.hero { position: relative; }
.hero__img { width: 100%; height: 440px; object-fit: cover; }
.hero__title, .prose--panel, .panel { width: min(680px, calc(100% - 2 * var(--gutter))); margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); background: var(--pale); }
.hero__title { position: relative; margin-top: -120px; margin-bottom: 0; padding: var(--s4) 56px var(--s3); font-size: 52px; line-height: 1.05; color: var(--green-dark); }
.prose--panel, .panel { padding: 0 56px var(--s4); }
.panel { width: min(1040px, calc(100% - 2 * var(--gutter))); }
.page--la_direzione .hero__title { width: min(1040px, calc(100% - 2 * var(--gutter))); }

/* Righe alternate immagine / testo */
.rows { padding-top: var(--s4); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: center; width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter); border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.row__text h1 { font-size: 42px; line-height: 1.1; color: var(--green-dark); }
.row__text h2, .row > h2 { font-size: 28px; font-weight: 600; }
.row__text p { color: var(--ink-soft); }

/* Persone */
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5) var(--s4); width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter) 0; }
.person { border-top: 1px solid var(--ink); padding-top: var(--s3); }
.person img { width: 160px; height: 160px; object-fit: cover; margin-bottom: var(--s2); background: var(--pale); }
.person h2 { font-size: 22px; font-weight: 600; margin-bottom: .35em; }
.person p { margin: 0 0 .25em; }
.people--portraits { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--s3) 0 0; gap: var(--s4) var(--s3); }
.people--portraits .person img { width: 100%; height: auto; aspect-ratio: 1; }
.people--portraits .person b p { font-family: var(--serif); font-size: 19px; margin: 0; }
.people--portraits .person div div { color: var(--muted); font-size: 16px; }

/* Figure e blocchi */
.wide-figure { margin: var(--s5) auto 0; padding: 0 var(--gutter); max-width: calc(1000px + 2 * var(--gutter)); }
.wide-figure img { width: 100%; }
.block { border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s4); }
.block:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.accounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin: var(--s3) 0 var(--s4); max-width: none; }
.accounts > div { border-left: 2px solid var(--lime); padding-left: var(--s2); font-size: 16px; }
.accounts h3 { margin-top: 0; font-size: 19px; }
.prose--body:has(.accounts) { max-width: calc(1000px + 2 * var(--gutter)); }

/* ───────── Home ───────── */

.testmode { background: #fef08a; color: #000; padding: 8px 16px; text-align: center; font-size: 15px; }
.home-hero { display: grid; grid-template-columns: 44fr 56fr; min-height: 600px; }
.home-hero__panel { background: var(--pale); display: flex; align-items: center; }
.home-hero__inner { width: 100%; max-width: 720px; padding: var(--s5) var(--s5) var(--s5) max(var(--gutter), calc((100vw - var(--wrap)) / 2)); }
.home-hero__welcome { font: 600 26px/1.2 var(--serif); color: var(--green); margin: 0 0 6px; }
.home-hero__title { font-size: 52px; line-height: 1.05; color: var(--green-dark); margin: 0 0 28px; letter-spacing: -.01em; }
.home-hero__title strong { font-weight: 400; }
.home-hero__links { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid #c9d3a9; }
.home-hero__links li { border-top: 1px solid #c9d3a9; }
.home-hero__links a { display: flex; align-items: center; min-height: 56px; padding: 8px 0; font: 400 21px/1.3 var(--serif); }
.home-hero__img { width: 100%; height: 100%; min-height: 600px; object-fit: cover; object-position: 42% center; }
.latest { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s3); align-items: center; margin-top: var(--s4); }
.latest img { width: 120px; height: 90px; object-fit: cover; }
.latest__label { font: 600 14px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--taupe); margin: 0 0 4px; }
.latest__title { font-size: 22px; margin: 0 0 4px; }
.latest p { margin: 0; font-size: 16px; }

/* Fascia eventi imminenti: editoriale, colonne separate da filetti, nessun riquadro */
.upcoming { background: var(--paper); border-bottom: 1px solid var(--line); }
.upcoming .wrap { padding-top: 72px; padding-bottom: 80px; }
.upcoming__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.upcoming__head h2 { font-size: 32px; font-weight: 600; margin: 0; }
.upcoming__head a { flex: none; font-size: 16px; font-weight: 600; }
.upcoming__list { list-style: none; margin: 0 -32px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upcoming__item { padding: 32px 32px 0; }
.upcoming__item + .upcoming__item { border-left: 1px solid var(--line); }
.upcoming__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 20px; background: var(--pale); }
.upcoming__img--empty { display: block; border: 1px solid var(--pale-line); }
.upcoming__date { margin: 0 0 10px; }
.upcoming__date time { display: flex; align-items: baseline; gap: 10px; }
.upcoming__day { font: 400 44px/1 var(--serif); color: var(--green-dark); }
.upcoming__month { font: 600 13px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--taupe); }
.upcoming__title { font-size: 23px; line-height: 1.25; margin: 0 0 6px; }
.upcoming__title a { text-decoration: none; }
.upcoming__title a:hover { text-decoration: underline; text-decoration-color: var(--underline); }
.upcoming__text { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }

.meta { display: block; font: 500 14px var(--sans); color: var(--muted); letter-spacing: .02em; margin-bottom: 6px; }

.quote { background: var(--taupe); color: #fff; text-align: center; }
.quote .wrap { padding-top: var(--s6); padding-bottom: 84px; }
.quote p { font: 400 33px/1.38 var(--serif); max-width: 23em; margin: 0 auto; }
.quote__author { display: inline-block; font-style: italic; font-size: 18px; color: #f1ede4; margin: 18px 0 22px; }
.quote a { color: #fff; text-decoration-color: var(--sage); font: 500 16px var(--sans); }

.hours { padding: var(--s6) 0; }
.hours__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: center; }
.hours__col { padding: 0 var(--s4); }
.hours__col + .hours__col { border-left: 1px solid var(--line); }
.hours h2 { font-size: 32px; font-weight: 600; margin-bottom: 10px; }
.hours h3 { font: 600 17px/1.3 var(--serif); margin: 18px 0 2px; }
.hours p { margin: 0; font-size: 17px; }
.hours__figure { margin: var(--s5) 0 0; }
.hours__figure img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: center 60%; }

.map { position: relative; height: 460px; background: var(--pale); border-top: 1px solid var(--line); }
.map__layer { position: absolute; inset: 0; }
.map__layer--satellite { clip-path: polygon(0 0, 100% 0, 0 100%, 0 50%); z-index: 1; }

/* ───────── Eventi e attività ───────── */

.feature { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s5); align-items: center; width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter); border-bottom: 1px solid var(--line); }
.feature h1 { font-size: 44px; line-height: 1.08; color: var(--green-dark); margin-bottom: .3em; }
.feature img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature p { color: var(--ink-soft); }
/* Timeline come nell'originale (EventItem): colonna centrata di 768 px, linea verde di 4 px su un solo lato,
   punti di 16 px centrati sulla linea, 40 px di rientro e 32 px fra un evento e l'altro (green-600 di Tailwind). */
.timeline { width: 100%; max-width: calc(768px + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter) 0; }
.timeline h2 { font-size: 32px; font-weight: 600; }
.timeline__item { position: relative; padding-left: 40px; border-left: 4px solid var(--timeline); margin-bottom: 32px; }
.timeline__item::before { content: ''; position: absolute; left: -10px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--timeline); }
.timeline__item h3 { font-size: 23px; margin: 0 0 .3em; }
.timeline__item p { margin: 0 0 .4em; color: var(--ink-soft); }
.timeline__item .meta { margin: 0 0 4px; }
.timeline__details > summary { display: flex; align-items: center; gap: 14px; padding: 4px 0; list-style: none; cursor: pointer; }
.timeline__details > summary::-webkit-details-marker { display: none; }
.timeline__details > summary h3 { flex: 1; margin: 0; }
.timeline__details > summary:hover h3 { text-decoration: underline; text-decoration-color: var(--underline); }
.timeline__details > summary::after { content: ''; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--green-link); border-bottom: 2px solid var(--green-link); transform: translateY(-3px) rotate(45deg); transition: transform var(--ease); }
.timeline__details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.timeline__details[open] > summary { margin-bottom: .3em; }
.timeline__img { display: block; width: 100%; max-width: 480px; aspect-ratio: 3 / 2; object-fit: cover; margin: 8px 0 .4em; background: var(--pale); }

.gallery-section { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter) 0; }
.gallery-section h2 { font-size: 32px; font-weight: 600; margin-bottom: var(--s4); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5) var(--s4); list-style: none; margin: 0; padding: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--pale); }
.gallery h3 { font-size: 22px; margin: 14px 0 2px; }
.gallery p { margin: 0; color: var(--muted); font-size: 16px; }

/* ───────── Pagine speciali ───────── */

.single { width: 100%; max-width: calc(960px + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter) var(--s6); }
.single h1 { font-size: 40px; color: var(--green-dark); }
.single video { width: 100%; background: #000; }
.single__footer { margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }

.login { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: var(--s5) var(--gutter); background: var(--pale); }
.login form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
.field label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #b9b6a8; border-radius: 0; background: #fff; font: 400 17px var(--sans); color: var(--ink); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--green-link); outline-offset: 0; border-color: var(--green-link); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 16px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--pale); color: var(--ink); }
.btn--danger { background: transparent; color: var(--danger); border-color: #e2b8ae; }
.btn--danger:hover { background: #fbebe6; color: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: progress; }
.form-message { margin: 0; padding: 12px 14px; border-left: 3px solid var(--danger); background: #fbebe6; color: #7a2716; font-size: 16px; }

.error-page { padding: var(--s6) var(--gutter); text-align: center; }
.error-page h1 { font-size: 72px; margin: 0; color: var(--green-dark); }
.error-page p { color: var(--muted); }

/* ───────── Piè di pagina ───────── */

.site-footer { background: var(--sage); font-size: 16px; line-height: 1.7; }
.site-footer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); padding-top: var(--s5); padding-bottom: var(--s4); }
.site-footer h2 { font: 600 24px var(--serif); margin: 0 0 14px; }
.site-footer p { margin: 0; }
.site-footer .gap { height: 14px; }
.site-footer__bottom { border-top: 1px solid var(--sage-line); padding: 16px 0 22px; font-size: 14px; color: var(--ink-soft); }

/* ───────── Area riservata ───────── */

.admin { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s4) var(--gutter) var(--s6); }
.admin h2 { font-size: 30px; font-weight: 600; margin: 0 0 var(--s2); }
.admin-section { padding: var(--s4) 0; border-top: 1px solid var(--ink); }
.admin-section:first-of-type { border-top: 0; }
.admin-section--separate { margin-top: var(--s5); border-top-width: 3px; }
.notice { margin: 0 0 var(--s3); padding: 12px 16px; font-size: 16px; border-left: 3px solid var(--lime); background: var(--pale); }
.notice--error { border-left-color: var(--danger); background: #fbebe6; color: #7a2716; }
.notice ul { margin: 0; padding-left: 1.2em; }
.page-notice { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s5) var(--gutter) 0; }
.notice--unavailable { border-left-color: var(--taupe); background: #f4f1ea; color: var(--ink-soft); }
.upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: var(--s2); }
.upload-form input[type="file"] { font-size: 15px; max-width: 100%; }
.file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.file-list__actions { display: flex; gap: 6px; align-items: center; }
.btn--small { padding: 0 14px; font-size: 15px; }
/* Storico dei documenti: dall'operazione più recente */
.doc-active { margin: 0 0 var(--s3); padding: var(--s2) 20px; background: var(--pale); border-left: 3px solid var(--lime); }
.doc-active__label { margin: 0 0 4px; font: 600 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--taupe); }
.doc-active .file-list { border-top: 0; }
.doc-active .file-list li { border-bottom: 0; padding: 0; flex-wrap: nowrap; align-items: flex-start; }
.doc-active__file, .doc-active__empty { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-active__name { font: 600 19px/1.35 var(--serif); overflow-wrap: anywhere; }
.doc-active__meta, .doc-active__home { font-size: 15px; color: var(--muted); }
.doc-active__home { color: var(--green-link); }
.doc-section:has(.doc-active__empty) .doc-active { background: #f4f1ea; border-left-color: var(--taupe); }
.doc-section:target .doc-active { box-shadow: 0 0 0 2px var(--sage-line); }
.upload-form__note { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--muted); }
.upload-form__error { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--danger); font-weight: 600; }
.history-title { margin: var(--s3) 0 var(--s1); font-size: 18px; }
.history { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.history__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history__meta, .history__file { grid-column: 1; margin: 0; min-width: 0; }
.history__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 15px; color: var(--muted); }
.history__meta strong { color: var(--ink); }
.history__file { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.history__name { overflow-wrap: anywhere; }
.history__details { font-size: 14px; color: var(--muted); }
.history__details abbr { text-decoration: none; }
.history__actions { grid-column: 2; grid-row: 1 / span 2; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) {
  .history__item { grid-template-columns: minmax(0, 1fr); }
  .history__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; background: none; cursor: pointer; color: var(--green-link); }
.icon-btn:hover { border-color: var(--line); background: var(--pale); }
.icon-btn--danger { color: var(--danger); }
.icon-btn form, .inline-form { display: inline; margin: 0; }
.entries { border-top: 1px solid var(--line); }
.entry { display: grid; grid-template-columns: minmax(0, 2fr) 170px minmax(0, 2fr) auto auto; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry .field label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.entry .field input { min-height: 44px; font-size: 16px; }
.entry__show { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; white-space: nowrap; }
.entry__show input { width: 20px; height: 20px; accent-color: var(--green-link); }
.entry__thumb { width: 64px; height: 44px; object-fit: cover; background: var(--pale); }
.entry-new { margin-top: var(--s3); padding: var(--s3); background: var(--pale); }
.entry-new h3 { font: 600 20px var(--serif); margin: 0 0 12px; }
.entry-new .entry { border-bottom: 0; padding: 0; }
.admin-actions { display: flex; gap: 12px; align-items: center; margin-top: var(--s3); flex-wrap: wrap; }
.status { font-size: 15px; color: var(--muted); }

/* Pannello eventi */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.admin-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s2); }
.admin-section__head h2 { margin: 0; }
.admin-subtitle { font: 600 13px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--taupe); margin: var(--s4) 0 8px; }
.table-wrap { overflow-x: auto; }
.events-table { width: 100%; border-collapse: collapse; font-size: 16px; table-layout: fixed; }
.events-table th:nth-child(1) { width: 130px; }
.events-table th:nth-child(3) { width: 300px; }
.events-table th:nth-child(4) { width: 100px; }
.events-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--ink); }
.events-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.events-table__title { display: flex; align-items: center; gap: 12px; }
.events-table__title img { width: 64px; height: 44px; object-fit: cover; flex: none; background: var(--pale); }
.events-table tr.is-draft td { color: var(--muted); }
.events-table tr.is-draft .events-table__title img { opacity: .5; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; padding: 1px 8px; font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge--on { color: var(--green-link); border-color: var(--pale-line); background: var(--pale); }
.badge--off { color: var(--danger); border-color: #ecc9c0; }
.badge--home { color: var(--ink); border-color: var(--sage-line); background: var(--sage); }
.admin--narrow { max-width: calc(760px + 2 * var(--gutter)); }
.admin-back { margin: 0 0 var(--s2); font-size: 15px; }
.admin-back a::before { content: '← '; }
.admin-title { font-size: 38px; color: var(--green-dark); margin: 0 0 var(--s3); }
.event-form { display: flex; flex-direction: column; gap: 22px; }
.event-form textarea { resize: vertical; line-height: 1.5; }
.field--date input { max-width: 220px; }
.event-form__image { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.event-form__image legend { font-size: 15px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.event-form__image label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 6px 0 -4px; }
.event-form__preview img { width: 100%; max-width: 360px; aspect-ratio: 3 / 2; object-fit: cover; background: var(--pale); }
.event-form__flags { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green-link); }
.event-form__delete { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* ───────── Tablet ───────── */

@media (max-width: 1080px) {
  :root { --gutter: 32px; }
  .mainnav > ul { gap: 18px; }
  .mainnav__link { font-size: 14px; }
  .people--portraits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero__title { font-size: 48px; }
}

/* ───────── Menu compatto (tablet verticale e smartphone) ───────── */

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .site-header__logo img { width: 52px; height: 52px; }
  .mainnav { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-menu.is-open, .no-js .mobile-menu { display: block; position: fixed; inset: var(--header-h) 0 0; overflow-y: auto; background: var(--paper); z-index: 49; border-top: 1px solid var(--line); }
  .no-js .mobile-menu { position: static; }
  body.menu-open { overflow: hidden; }

  .intro, .home-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .intro__img, .home-hero__img { order: -1; min-height: 0; height: 260px; }
  .intro__text { padding: var(--s4) var(--gutter); }
  .home-hero__inner { max-width: none; padding: var(--s4) var(--gutter); }
  .row { grid-template-columns: minmax(0, 1fr); gap: var(--s3); padding-top: var(--s4); padding-bottom: var(--s4); }
  .row__img { order: -1; }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .feature img { order: -1; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upcoming__list { grid-template-columns: minmax(0, 1fr); margin: 0; }
  .upcoming__item, .upcoming__item + .upcoming__item { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 20px; align-items: start; padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .upcoming__item:last-child { border-bottom: 0; padding-bottom: 0; }
  .upcoming__img { order: 2; margin: 0; aspect-ratio: 4 / 3; }
  .accounts { grid-template-columns: minmax(0, 1fr); }
  .entry { grid-template-columns: minmax(0, 1fr) 170px; }
}

/* ───────── Smartphone ───────── */

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  /* Area riservata: aree di tocco di almeno 44 px senza cambiare l'impaginazione */
  .events-table td:nth-child(4) a, .admin-back a { display: inline-block; padding: 11px 0; margin: -11px 0; }
  .upload-form input[type="file"] { padding: 10px 0; }
  body { font-size: 17px; line-height: 1.65; }
  .subbar__inner { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 4px; padding-bottom: 8px; }
  .subbar__title { padding: 10px 0 2px; }
  .subnav ul { gap: 0 18px; }
  .subnav a { min-height: 44px; }
  .prose h1, .intro__text h1, .feature h1, .row__text h1 { font-size: 34px; }
  .prose h2, .row__text h2 { font-size: 24px; }
  .prose--body { padding-top: var(--s4); }
  .hero__img { height: 220px; }
  .hero__title { width: auto; margin: -48px 12px 0; padding: 24px 20px 14px; font-size: 38px; }
  .prose--panel, .panel { width: auto; margin: 0 12px; padding: 0 20px 28px; }
  .people, .people--portraits { grid-template-columns: minmax(0, 1fr); }
  .people--portraits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s2); }
  .gallery { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .home-hero__img { height: 230px; }
  .home-hero__welcome { font-size: 20px; }
  .home-hero__title { font-size: 38px; }
  .home-hero__links a { font-size: 19px; min-height: 52px; }
  .quote p { font-size: 24px; line-height: 1.42; }
  .hours__grid { grid-template-columns: minmax(0, 1fr); }
  .hours__col { padding: 0 0 var(--s4); }
  .hours__col + .hours__col { border-left: 0; border-top: 1px solid var(--line); padding-top: var(--s4); }
  .hours h2 { font-size: 27px; }
  .hours__figure { margin-top: var(--s3); }
  .hours__figure img { aspect-ratio: 3 / 2; }
  .map { height: 340px; }
  .upcoming .wrap { padding-top: 48px; padding-bottom: 48px; }
  .upcoming__head { flex-direction: column; gap: 6px; }
  .upcoming__head h2 { font-size: 26px; }
  .upcoming__item, .upcoming__item + .upcoming__item { grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; }
  .upcoming__day { font-size: 36px; }
  .upcoming__title { font-size: 21px; }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .events-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .events-table, .events-table tbody, .events-table tr, .events-table td { display: block; }
  .events-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .events-table td { border: 0; padding: 0; }
  .events-table td:nth-child(1) { grid-column: 1; font-size: 14px; color: var(--muted); }
  .events-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .events-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  .events-table td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .admin-title { font-size: 30px; }
  .error-page h1 { font-size: 56px; }
}

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

@media print {
  .site-header, .subbar, .map, .site-footer { display: none; }
  body { font-size: 12pt; }
}
