/* ==========================================================================
   Diamogli una Zampa · CdL ODV — design system
   Direzione: editoriale caldo, “carta + lago”. Foto al centro, tipografia
   con carattere, zenzero della mascotte come unico colore forte.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f0e4;
  --paper-2: #ede4d0;
  --card: #fffaf0;
  --ink: #15303a;
  --ink-soft: #3f565d;
  --lake: #d8e6e2;
  --lake-deep: #2b6a69;
  --ginger: #e4702a;
  --ginger-ink: #a5440c;
  --ginger-soft: #f8d9bf;
  --line: rgb(21 48 58 / 0.16);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 28px;
  --radius-sm: 16px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  min-height: 100dvh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
}

/* leggera grana carta, sempre sotto ai contenuti */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: 0; font-variation-settings: "opsz" 120, "SOFT" 100; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.4rem + 5.6vw, 5.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.6rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.75rem); line-height: 1.15; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 500; color: var(--ginger-ink); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
a:not([class]) { text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--ginger); }
a:not([class]):hover { color: var(--ginger-ink); }

:focus-visible { outline: 3px solid var(--ginger); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ginger); color: #fff; }

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

.skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 18px; background: var(--ink); color: var(--paper); border-radius: 12px; transform: translateY(-200%); text-decoration: none; }
.skip:focus { transform: none; }

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

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  margin: 0 0 1.1rem;
  font: 600 0.78rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ginger-ink);
}
.eyebrow::before { content: ""; width: 1.6em; height: 2px; background: currentColor; border-radius: 2px; }

.lead { font-size: clamp(1.12rem, 1rem + 0.55vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); max-width: 36em; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 52px; padding: 0.85em 1.5em;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font: 600 1rem/1.1 var(--sans);
  text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-3px) rotate(-0.6deg); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn.ginger { --bg: var(--ginger); --fg: #1d0f05; }
.btn.ghost { --bg: transparent; --fg: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.light { --bg: var(--paper); --fg: var(--ink); }
.btn.light.ghost { --bg: transparent; --fg: var(--paper); border-color: var(--paper); }
.btn.light.ghost:hover { background: var(--paper); color: var(--ink); }
.btn.small { min-height: 44px; padding: 0.6em 1.1em; font-size: 0.92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; align-items: center; }

.text-link { display: inline-flex; gap: 0.4em; font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ginger); padding-bottom: 2px; }
.text-link:hover { color: var(--ginger-ink); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--line); transition: transform 0.5s var(--ease); }
.brand:hover img { transform: rotate(-12deg) scale(1.05); }
.brand b { display: block; font: 600 1.2rem/1 var(--display); letter-spacing: -0.02em; font-variation-settings: "opsz" 48, "SOFT" 100; }
.brand small { display: block; margin-top: 4px; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }

.menu-button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 18px;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 999px;
  font: 600 0.95rem var(--sans); cursor: pointer;
}
.menu-button i { width: 18px; height: 10px; display: block; border-block: 2px solid currentColor; position: relative; }
.menu-button i::after { content: ""; position: absolute; inset: 2px 0; margin-block: auto; height: 2px; background: currentColor; top: 50%; translate: 0 -1px; }

#navigation { font-weight: 500; }
#navigation a { text-decoration: none; }
#navigation a:not(.btn) { position: relative; padding: 8px 2px; font-size: 0.98rem; }
#navigation a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--ginger); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
#navigation a:not(.btn):hover::after,
#navigation a[aria-current="page"]::after { transform: scaleX(1); }

/* mobile: pannello popover nativo */
@media (max-width: 959px) {
  #navigation {
    position: fixed; inset: var(--header-h) 0 auto 0;
    width: 100%; max-height: calc(100dvh - var(--header-h));
    margin: 0; padding: 12px var(--gutter) 28px;
    border: 0; border-bottom: 1px solid var(--line);
    background: var(--paper); color: var(--ink);
    overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 0;
  }
  #navigation:popover-open { display: flex; animation: menu-in 0.35s var(--ease); }
  #navigation a:not(.btn) { padding: 16px 0; font: 600 1.7rem/1.1 var(--display); letter-spacing: -0.02em; border-bottom: 1px solid var(--line); }
  #navigation a:not(.btn)::after { display: none; }
  #navigation .btn { margin-top: 20px; min-height: 58px; font-size: 1.1rem; }
}
@keyframes menu-in { from { opacity: 0; translate: 0 -12px; } }

@media (min-width: 960px) {
  .menu-button { display: none; }
  #navigation[popover] {
    display: flex; position: static; inset: auto; width: auto; height: auto; max-height: none;
    margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible;
    align-items: center; gap: clamp(16px, 2vw, 30px);
  }
}
@media (min-width: 960px) and (max-width: 1100px) { .brand small { display: none; } }

/* ---------- Main + page transitions ---------- */
main { flex: 1; outline: none; padding-bottom: clamp(56px, 9vw, 120px); }
main:focus { outline: none; }
.page { padding-top: clamp(32px, 6vw, 72px); }
.page > * + .section { margin-top: clamp(64px, 10vw, 140px); }
.section-top { display: grid; gap: 20px 56px; align-items: end; margin-bottom: clamp(28px, 4vw, 52px); }
@media (min-width: 860px) { .section-top { grid-template-columns: 1.1fr 1fr; } }
.section-top p { margin: 0; color: var(--ink-soft); }

::view-transition-old(root) { animation: vt-out 0.22s ease both; }
::view-transition-new(root) { animation: vt-in 0.45s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; translate: 0 -8px; } }
@keyframes vt-in { from { opacity: 0; translate: 0 18px; } }

/* intro di pagina */
.page-intro { max-width: 980px; margin-bottom: clamp(36px, 6vw, 72px); }
.page-intro h1 { margin-bottom: 0.35em; }

/* ---------- Home: hero ---------- */
.hero { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.08fr 0.92fr; } }
.hero h1 { margin-bottom: 0.3em; }
.hero-media { position: relative; justify-self: center; width: min(100%, 520px); }
.hero-arch {
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden;
  background: var(--lake);
  box-shadow: 0 30px 60px -30px rgb(21 48 58 / 0.55);
  rotate: 1.5deg;
}
.hero-arch img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; scale: 1.02; }
.hero-note {
  position: absolute; left: -6%; bottom: 8%; max-width: 15em;
  padding: 14px 18px; background: var(--card);
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  font: 500 1.05rem/1.25 var(--display); font-variation-settings: "opsz" 24, "SOFT" 100;
  box-shadow: 6px 6px 0 var(--ink);
  rotate: -3deg;
}
.hero-note small { display: block; margin-top: 4px; font: 500 0.78rem/1.3 var(--sans); color: var(--ink-soft); }
.sticker { position: absolute; right: -4%; top: 2%; width: clamp(104px, 18vw, 148px); aspect-ratio: 1; }
.sticker svg { width: 100%; height: 100%; }
.sticker .disc { fill: var(--ginger); }
.sticker text { font: 700 11.2px var(--sans); letter-spacing: 0.17em; fill: #1d0f05; text-transform: uppercase; }
.sticker .ring { transform-origin: center; animation: spin 26s linear infinite; }
.sticker .paw { fill: #1d0f05; }
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Marquee ---------- */
.marquee { margin-top: clamp(56px, 8vw, 100px); background: var(--ink); color: var(--paper); overflow: hidden; border-block: 2px solid var(--ink); rotate: -1deg; width: 104%; margin-left: -2%; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee span { display: inline-flex; align-items: center; gap: 1.4rem; padding: 16px 0.7rem; font: 500 clamp(1.3rem, 1rem + 1.4vw, 2rem)/1 var(--display); font-style: italic; font-variation-settings: "opsz" 72, "SOFT" 100; white-space: nowrap; }
.marquee span::after { content: "✦"; font-style: normal; color: var(--ginger); }
@keyframes marquee { to { translate: -50% 0; } }

/* ---------- Principles ---------- */
.principles { display: grid; gap: 0; margin-top: clamp(56px, 8vw, 100px); border-top: 2px solid var(--ink); }
.principle { display: grid; grid-template-columns: auto 1fr; gap: 6px 28px; align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line); }
.principle .num { grid-row: span 2; font: 500 clamp(2.6rem, 2rem + 3vw, 4.4rem)/0.9 var(--display); font-style: italic; color: var(--ginger); font-variation-settings: "opsz" 144, "SOFT" 100; min-width: 1.4em; }
.principle h3 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); }
.principle p { margin: 0; color: var(--ink-soft); }
@media (min-width: 860px) {
  .principles { grid-template-columns: repeat(3, 1fr); border-top: 0; gap: 0 clamp(24px, 4vw, 56px); }
  .principle { grid-template-columns: 1fr; border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 24px; }
  .principle .num { grid-row: auto; }
}

/* ---------- Carousel mici ---------- */
.strip { margin-top: clamp(80px, 11vw, 150px); }
.strip-scroller {
  display: flex; gap: clamp(14px, 2vw, 24px);
  padding: 18px var(--gutter) 34px;
  margin-inline: calc(50% - 50vw);
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--ink) transparent;
  list-style: none;
}
.strip-scroller > li { flex: none; width: clamp(220px, 62vw, 290px); scroll-snap-align: center; }
.polaroid { display: block; text-decoration: none; padding: 12px 12px 16px; background: var(--card); border-radius: 10px; box-shadow: 0 14px 30px -18px rgb(21 48 58 / 0.55), 0 0 0 1px var(--line); transition: transform 0.4s var(--ease), box-shadow 0.4s; }
.strip-scroller > li:nth-child(odd) .polaroid { rotate: -1.8deg; }
.strip-scroller > li:nth-child(even) .polaroid { rotate: 1.6deg; margin-top: 18px; }
.polaroid:hover { transform: translateY(-8px) rotate(0.5deg); box-shadow: 0 24px 40px -20px rgb(21 48 58 / 0.6), 0 0 0 1px var(--line); }
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; background: var(--lake); }
.polaroid b { display: block; margin-top: 12px; font: 600 1.45rem/1 var(--display); font-variation-settings: "opsz" 48, "SOFT" 100; }
.polaroid small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 0.88rem; }
.strip-foot { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }

/* ---------- Bande colorate ---------- */
.band { border-radius: var(--radius); padding: clamp(28px, 6vw, 80px); position: relative; overflow: hidden; }
.band.dark { background: var(--ink); color: var(--paper); }
.band.dark .eyebrow { color: var(--ginger); }
.band.dark h2 em { color: var(--ginger); }
.band.dark p { color: rgb(246 240 228 / 0.82); }
.band.lake { background: var(--lake); }
.band.ginger { background: var(--ginger-soft); }
.band-grid { display: grid; gap: 32px 56px; align-items: center; position: relative; }
@media (min-width: 860px) { .band-grid { grid-template-columns: 1.4fr 1fr; } }
.band h2 { margin-bottom: 0.4em; }
.band .actions { margin-top: 0; }
.social-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 860px) { .social-actions { flex-direction: column; align-items: stretch; } }
.band.dark::before { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgb(228 112 42 / 0.5); animation: spin 60s linear infinite; }

.home-support { display: grid; gap: 0 40px; align-items: end; }
@media (min-width: 860px) { .home-support { grid-template-columns: 1.3fr 0.7fr; } }
.home-support .copy { padding-bottom: clamp(0px, 2vw, 24px); }
.home-mascot { width: min(100%, 360px); justify-self: center; margin-bottom: calc(-1 * clamp(28px, 6vw, 80px)); rotate: 4deg; transition: rotate 0.5s var(--ease), translate 0.5s var(--ease); filter: drop-shadow(0 18px 18px rgb(21 48 58 / 0.25)); }
.home-mascot:hover { rotate: -3deg; translate: 0 -10px; }
@media (max-width: 859px) { .home-mascot { width: 220px; margin-top: 12px; margin-bottom: calc(-1 * clamp(28px, 6vw, 80px)); } }

.game { display: grid; gap: 28px 48px; align-items: center; padding: clamp(24px, 5vw, 64px); border-radius: var(--radius); background: var(--lake); border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
@media (min-width: 860px) { .game { grid-template-columns: 1.3fr 1fr; } }
.game h2 { margin-bottom: 0.4em; }
.game p { color: var(--ink-soft); }
.game-mark { display: grid; place-items: center; text-align: center; aspect-ratio: 5/3; border-radius: var(--radius-sm); background: var(--paper); background-image: radial-gradient(circle at 20% 30%, var(--ginger-soft) 0 18%, transparent 19%), radial-gradient(circle at 85% 75%, var(--lake) 0 22%, transparent 23%); border: 1.5px dashed var(--ink); }
.game-mark span { font: 600 clamp(1.7rem, 1.2rem + 2vw, 2.7rem)/1 var(--display); font-variation-settings: "opsz" 144, "SOFT" 100; }
.game-mark small { display: block; margin-top: 8px; font: 600 0.8rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ginger-ink); }

/* ---------- Aggiornamenti ---------- */
.updates-grid { display: grid; gap: 20px; margin-bottom: 8px; }
@media (min-width: 760px) { .updates-grid { grid-template-columns: repeat(2, 1fr); } }
.update-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.update-card .post-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; }
.update-card .eyebrow { margin-bottom: 4px; }
.preserve-lines { white-space: pre-line; }
.empty-updates { padding: 28px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); }

/* ---------- Pagina: due colonne ---------- */
.two-col { display: grid; gap: clamp(28px, 5vw, 72px); align-items: center; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } .two-col.flip > :first-child { order: 2; } }
.lake-photo { margin: 0; }
.lake-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: 12px 12px 0 var(--lake-deep); }
.lake-photo figcaption { margin-top: 20px; font-size: 0.8rem; color: var(--ink-soft); }
.reading h2 { margin-bottom: 0.5em; }
.reading p { color: var(--ink-soft); }
.source-note { font-size: 0.9rem; margin-top: 1.4rem; }

.story-quote { margin: clamp(64px, 10vw, 140px) 0 0; padding: 0; font: 500 clamp(2rem, 1rem + 4.6vw, 4.8rem)/1.05 var(--display); font-style: italic; letter-spacing: -0.01em; font-variation-settings: "opsz" 120, "SOFT" 100; text-wrap: balance; max-width: 18em; }
.story-quote::before { content: "“"; display: block; font-size: 1.5em; line-height: 0.6; color: var(--ginger); }

.values { display: grid; gap: 20px; margin-top: clamp(48px, 7vw, 90px); }
@media (min-width: 860px) { .values { grid-template-columns: repeat(3, 1fr); } }
.value { padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.value:nth-child(2) { background: var(--lake); }
.value:nth-child(3) { background: var(--ginger-soft); }
.value .num { display: block; margin-bottom: 28px; font: 700 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ginger-ink); }
.value h3 { margin-bottom: 0.5em; }
.value p { margin: 0; color: var(--ink-soft); }

/* ---------- Pagina mici ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.chip { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 600 0.98rem var(--sans); cursor: pointer; transition: background-color 0.2s, color 0.2s, transform 0.25s var(--ease); }
.chip:hover { transform: translateY(-2px); }
.chip span { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; border-radius: 99px; background: var(--ink); color: var(--paper); font-size: 0.78rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] span { background: var(--ginger); color: #1d0f05; }
.cats-count { margin: -16px 0 28px; color: var(--ink-soft); font-size: 0.95rem; }

.cat-grid { display: grid; gap: clamp(16px, 2.4vw, 32px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cat-card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s; }
.cat-card:hover { transform: translateY(-6px); box-shadow: 0 26px 40px -28px rgb(21 48 58 / 0.6); }
.cat-card[hidden] { display: none; }
.cat-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--lake); }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s var(--ease); }
.cat-card:hover .cat-photo img { scale: 1.05; }
.badge { position: absolute; left: 14px; top: 14px; padding: 7px 13px; border-radius: 999px; background: var(--paper); font: 700 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.badge.listro { background: var(--ginger); color: #1d0f05; }
.cat-copy { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px 28px; }
.cat-copy h3 { font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem); }
.cat-tag { margin: 0; font: italic 500 1.08rem/1.3 var(--display); color: var(--ginger-ink); font-variation-settings: "opsz" 24, "SOFT" 100; }
.cat-copy p:last-child { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.98rem; }

.gallery { display: grid; gap: clamp(14px, 2vw, 24px); }
@media (min-width: 760px) { .gallery { grid-template-columns: 1fr 1fr 1.3fr; align-items: end; } .gallery figure:nth-child(2) { margin-bottom: 44px; } }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.gallery .wide img { aspect-ratio: 4 / 5; object-position: 40% 50%; }
.gallery figcaption { margin-top: 12px; font: italic 500 1.15rem/1.2 var(--display); font-variation-settings: "opsz" 36, "SOFT" 100; }
.album-note { margin-top: 28px; font-size: 0.92rem; color: var(--ink-soft); max-width: 52em; }

.subtle-box { padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); background: var(--lake); }
.subtle-box h3 { margin-bottom: 0.4em; }
.subtle-box p { color: var(--ink-soft); }

/* ---------- Sostienici ---------- */
.support-hero { display: grid; gap: 16px; max-width: 980px; margin-bottom: clamp(36px, 6vw, 72px); }
.support-hero h1 span { display: block; font-style: italic; font-weight: 500; color: var(--ginger-ink); }
.support-caption { font: 600 0.9rem var(--sans); letter-spacing: 0.06em; color: var(--ink-soft); }

.donation { padding: clamp(22px, 4.5vw, 56px); background: var(--lake); border-radius: var(--radius); border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.donation-heading { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; margin-bottom: 36px; }
.donation-heading h2 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); }
.pill { padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1.5px solid var(--ink); font: 600 0.78rem var(--sans); letter-spacing: 0.06em; }

.methods { display: grid; gap: clamp(10px, 2vw, 22px); grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 104px; }
.method-card { position: relative; isolation: isolate; }
.mascot-peek { position: absolute; z-index: 0; left: 50%; bottom: calc(100% - 30px); width: clamp(88px, 13vw, 124px); translate: -50% 100%; opacity: 0; transition: translate 0.55s var(--ease), opacity 0.2s; pointer-events: none; }
.method-card.peeking .mascot-peek { translate: -50% 0; opacity: 1; }
.method-card.wiggle .mascot-peek { animation: wiggle 0.9s var(--ease); }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 20% { rotate: -9deg; } 45% { rotate: 7deg; } 70% { rotate: -4deg; } }
.method { position: relative; z-index: 1; width: 100%; min-height: 168px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 22px; font: 600 clamp(1rem, 0.9rem + 0.6vw, 1.3rem) var(--display); font-variation-settings: "opsz" 48, "SOFT" 100; cursor: pointer; transition: background-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s; }
.method:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--ink); }
.method[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.method small { font: 500 0.78rem/1.3 var(--sans); opacity: 0.75; }
.method-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border-radius: 50%; background: var(--ginger-soft); color: var(--ink); }
.method[aria-pressed="true"] .method-icon { background: var(--ginger); }
.method-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.method-icon img { width: 30px; height: 30px; }
.method-icon.tax { font: 700 1.2rem/1 var(--display); letter-spacing: 0; }
.peek-bubble { position: absolute; z-index: 3; top: -64px; left: calc(50% + 34px); translate: 0 6px; padding: 7px 12px; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 14px; font: 600 0.8rem/1 var(--sans); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.25s, translate 0.35s var(--ease); }
.method-card.peeking .peek-bubble { opacity: 1; translate: 0 0; transition-delay: 0.2s; }
.peek-status { margin: 22px 0 0; text-align: center; font-size: 0.92rem; color: var(--ink-soft); min-height: 1.6em; }

.donation-panel { margin-top: 28px; padding: clamp(22px, 4vw, 40px); background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); animation: panel-in 0.45s var(--ease); }
.donation-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; translate: 0 14px; } }
.donation-panel h3 { margin-bottom: 0.5em; }
.donation-panel p { color: var(--ink-soft); max-width: 44em; }
.beneficiary { margin-bottom: 1.2em !important; font-size: 0.95rem; }
.copy-row { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 640px) { .copy-row { grid-template-columns: 1fr auto; align-items: end; } }
.copy-row label { display: block; font: 700 0.74rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ginger-ink); }
.copy-row input { display: block; width: 100%; margin-top: 8px; padding: 14px 16px; border: 2px dashed var(--ink); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font: 600 clamp(0.95rem, 0.8rem + 0.9vw, 1.3rem) ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.02em; text-overflow: ellipsis; }
.donation-status { min-height: 1.6em; margin: 20px 0 0; font-weight: 600; color: var(--lake-deep); }
.payment-note { margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.fine-print { font-size: 0.85rem; color: var(--ink-soft); }

@media (max-width: 560px) {
  .methods { padding-top: 78px; gap: 8px; }
  .method { min-height: 142px; padding-inline: 4px; border-radius: 18px; }
  .method-icon { width: 42px; height: 42px; }
  .method-icon img { width: 24px; height: 24px; }
  .method-icon svg { width: 22px; height: 22px; }
  .peek-bubble { display: none; }
}

/* ---------- Contatti ---------- */
.contact-grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1.2fr 1fr; } }
.contact-card { padding: clamp(26px, 4vw, 48px); border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.contact-card.social { background: var(--ginger-soft); }
.contact-card h2 { margin-bottom: 0.4em; }
.email-address { display: inline-block; margin: 0.2em 0 0.8em; font: 600 clamp(1.1rem, 0.6rem + 2.2vw, 2rem)/1.15 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--ginger); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.email-address:hover { color: var(--ginger-ink); }
.social-handle { margin: 20px 0 0; font: italic 600 1.2rem var(--display); }
.contact-bottom { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; padding: 28px 0; border-block: 2px solid var(--ink); }
.contact-bottom h3 { font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); }
.contact-bottom .eyebrow { margin-bottom: 8px; }

/* ---------- Ricordi ---------- */
.memory-grid { display: grid; gap: 28px; margin-bottom: 56px; }
.memory-card { display: grid; gap: 28px; align-items: center; padding: clamp(20px, 4vw, 40px); background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
@media (min-width: 760px) { .memory-card { grid-template-columns: minmax(220px, 340px) 1fr; } }
.memory-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-sm); filter: grayscale(0.35) sepia(0.15); }
.memory-card h2 { margin-bottom: 0.4em; }
.memory-card p:last-child { color: var(--ink-soft); }

/* ---------- Documenti ---------- */
.document { max-width: 860px; }
.document h2 { margin: 2.2em 0 0.5em; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); }
.document p { color: var(--ink-soft); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); padding-top: clamp(48px, 7vw, 96px); }
.footer a { text-decoration: none; }
.footer-top { display: grid; gap: 36px; padding-bottom: clamp(36px, 5vw, 64px); }
@media (min-width: 860px) { .footer-top { grid-template-columns: 1.3fr 1fr; align-items: end; } }
.footer .brand { color: var(--paper); margin-bottom: 28px; }
.footer .brand small { color: rgb(246 240 228 / 0.7); }
.footer .tagline { margin: 0; font: 500 clamp(2rem, 1.2rem + 3.6vw, 4rem)/1.05 var(--display); letter-spacing: -0.005em; font-variation-settings: "opsz" 144, "SOFT" 100; }
.footer .tagline em { color: var(--ginger); }
.footer-links { display: grid; gap: 4px; }
.footer-links a { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid rgb(246 240 228 / 0.2); font: 600 1.1rem var(--sans); transition: padding 0.3s var(--ease), color 0.2s; }
.footer-links a::after { content: "→"; color: var(--ginger); }
.footer-links a:hover { padding-left: 10px; color: var(--ginger); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; padding: 22px 0 30px; font-size: 0.85rem; color: rgb(246 240 228 / 0.7); }
.footer-bottom nav { display: flex; gap: 20px; }
.footer-bottom a:hover { color: var(--ginger); }

/* ---------- Animazioni all'ingresso ---------- */
@media (prefers-reduced-motion: no-preference) {
  .page-in > * { animation: rise 0.8s var(--ease) both; }
  .page-in > *:nth-child(2) { animation-delay: 0.08s; }
  .page-in > *:nth-child(3) { animation-delay: 0.16s; }
  .hero > * { animation: rise 0.9s var(--ease) both; }
  .hero-media { animation-delay: 0.12s; }
  @keyframes rise { from { opacity: 0; translate: 0 24px; } }

  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes reveal { from { opacity: 0; translate: 0 40px; scale: 0.98; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .marquee-track { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* quando l'utente chiede alto contrasto / stampa */
@media print {
  .header, .footer, .marquee, .sticker { display: none; }
  body { background: #fff; }
}

/* ---------- Area amministratori ---------- */
.admin-link { padding: 0; background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; opacity: 0.8; cursor: pointer; }
.admin-link:hover { opacity: 1; }
.admin-link[hidden] { display: none; }

body.has-admin-bar { padding-bottom: 170px; }
.admin-bar { position: fixed; z-index: 60; left: 50%; bottom: 14px; translate: -50% 0; width: min(920px, calc(100% - 24px)); padding: 14px 18px 16px; background: var(--ink); color: var(--paper); border-radius: 22px; box-shadow: 0 14px 40px rgb(21 48 58 / 0.4); display: grid; gap: 8px; }
.admin-bar-head { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; }
.admin-bar-head strong { font: 600 1.05rem var(--display); }
#admin-status { font: 600 0.85rem var(--sans); min-height: 1.2em; color: var(--ginger-soft); }
#admin-status[data-kind="ok"] { color: #b9e8c4; }
#admin-status[data-kind="error"] { color: #ffb4a2; }
.admin-hint { margin: 0; font-size: 0.85rem; opacity: 0.8; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tools button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid rgb(246 240 228 / 0.5); background: transparent; color: var(--paper); font: 600 0.88rem var(--sans); cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.admin-tools button:hover { background: var(--paper); color: var(--ink); }
.admin-tools button[data-logout] { margin-left: auto; border-color: var(--ginger); color: var(--ginger-soft); }
.admin-tools button[aria-pressed="true"] { background: var(--ginger); border-color: var(--ginger); color: #1d0f05; }

/* modifica sul posto */
body.editing [data-edit][data-key] { outline: 2px dashed transparent; outline-offset: 4px; border-radius: 6px; transition: outline-color 0.2s; }
body.editing [data-edit][data-key]:hover { outline-color: rgb(228 112 42 / 0.7); }
body.editing [data-edit][data-key]:focus { outline: 2px solid var(--ginger); background: rgb(228 112 42 / 0.08); }
body.editing img[data-edit][data-key] { cursor: pointer; }
body.editing img[data-edit][data-key]:hover { outline: 3px solid var(--ginger); outline-offset: -3px; filter: brightness(0.92); }

/* finestre */
.admin-dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.admin-dialog.wide { width: min(760px, calc(100% - 24px)); }
.admin-dialog::backdrop { background: rgb(21 48 58 / 0.55); }
.admin-form { display: grid; gap: 14px; padding: clamp(20px, 4vw, 32px); }
.admin-form h2 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.admin-form h3 { margin: 6px 0 0; font-size: 1.1rem; }
.admin-form label, .admin-form .lbl { display: grid; gap: 6px; font: 600 0.88rem var(--sans); }
.admin-form input:not([type="checkbox"]), .admin-form textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); color: var(--ink); font: 500 1rem var(--sans); }
.admin-form textarea { resize: vertical; line-height: 1.5; }
.admin-form .check { display: flex; align-items: center; gap: 10px; }
.admin-form .check input { width: 20px; height: 20px; accent-color: var(--ginger); }
.admin-error { margin: 0; min-height: 1.2em; color: #a3260f; font: 600 0.9rem var(--sans); }
.admin-row { display: flex; gap: 10px; justify-content: flex-end; }
.admin-row.wrap { flex-wrap: wrap; }
.admin-photo-preview img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; border: 2px solid var(--ink); }

.editor { max-height: calc(100dvh - 28px); overflow-y: auto; }
.editor-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.editor-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; position: sticky; bottom: calc(-1 * clamp(20px, 4vw, 32px)); padding: 12px 0; margin-bottom: -12px; background: var(--paper); border-top: 1px solid var(--line); }
.ed-list { display: grid; gap: 10px; }
.ed-empty { margin: 0; padding: 18px; text-align: center; border: 2px dashed var(--line); border-radius: 16px; }
.ed-item { border: 2px solid var(--ink); border-radius: 18px; background: var(--card); }
.ed-item summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; }
.ed-item summary::-webkit-details-marker { display: none; }
.ed-item .thumb { flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--paper-2); overflow: hidden; }
.ed-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ed-item .t { flex: 1; min-width: 0; display: grid; }
.ed-item .t b { font: 600 1.05rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-item .t small { color: var(--ink-soft); }
.ed-item .acts { display: flex; gap: 4px; }
.ed-item .acts button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font-size: 1rem; cursor: pointer; }
.ed-item .acts button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.ed-item .acts button:disabled { opacity: 0.3; cursor: default; }
.ed-fields { display: grid; gap: 12px; padding: 4px 14px 16px; }
.ed-fields.flat { padding: 0; }
.ed-photo { display: grid; gap: 6px; }
.ed-photo-row { display: flex; align-items: center; gap: 12px; }
.ed-photo-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 14px; border: 2px solid var(--ink); }
.admin-users { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-users li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); font-weight: 600; }
@media (max-width: 560px) {
  .admin-bar { bottom: 8px; padding: 12px; }
  .admin-hint { display: none; }
  body.has-admin-bar { padding-bottom: 130px; }
}
