@import url("fonts.css");

/* Token */
:root {
  --forest: #2e4b38;
  --forest-deep: #16281d;
  --forest-soft: #e7efe9;
  --ruby: #9b2743;
  --ruby-soft: #f8e9ed;
  --lavender: #6c5ca4;
  --amber: #b4721a;
  --teal: #2f6b80;

  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-alt: #f2efe9;
  --ink: #15201a;
  --ink-soft: #3c4a41;
  --ink-muted: #6b7a70;
  --line: #e3dfd5;

  --shadow-sm: 0 1px 2px rgba(21, 32, 26, .05), 0 2px 6px rgba(21, 32, 26, .04);
  --shadow-md: 0 6px 18px rgba(21, 32, 26, .09), 0 2px 6px rgba(21, 32, 26, .05);
  --shadow-lg: 0 18px 50px rgba(21, 32, 26, .16), 0 6px 14px rgba(21, 32, 26, .07);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 26px;
  --r-pill: 999px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;

  --wrap: 1220px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --forest: #8cc19b;
    --forest-deep: #c6e2ce;
    --forest-soft: #1d2a22;
    --ruby: #ef9fb1;
    --ruby-soft: #2c191f;
    --lavender: #b9ace4;
    --amber: #e3ad55;
    --teal: #86bdd0;

    --bg: #0f140f;
    --surface: #18201a;
    --surface-alt: #1f291f;
    --ink: #eaf0e8;
    --ink-soft: #c2cec4;
    --ink-muted: #96a49a;
    --line: #2c3a2e;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .55);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --forest: #8cc19b;
  --forest-deep: #c6e2ce;
  --forest-soft: #1d2a22;
  --ruby: #ef9fb1;
  --ruby-soft: #2c191f;
  --lavender: #b9ace4;
  --amber: #e3ad55;
  --teal: #86bdd0;

  --bg: #0f140f;
  --surface: #18201a;
  --surface-alt: #1f291f;
  --ink: #eaf0e8;
  --ink-soft: #c2cec4;
  --ink-muted: #96a49a;
  --line: #2c3a2e;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }

a { color: var(--forest); text-underline-offset: 3px; }
a:hover { color: var(--ruby); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -.018em;
}

h1 { font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4.1rem); }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.55rem); }

p { margin: 0 0 1rem; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--forest-deep); color: #fff;
  padding: .85rem 1.3rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 760px; }

.section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.section--alt { background: var(--surface-alt); }
.section--tight { padding-block: clamp(2rem, 1.4rem + 2vw, 3.5rem); }

.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ruby); margin: 0 0 .7rem;
}

.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); color: var(--ink-soft); max-width: 62ch; }
.muted { color: var(--ink-muted); }

/* Comparsa allo scorrimento */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Intestazione */
.site-header {
  position: sticky; top: 0; z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.site-header--over {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
}

.site-header--over .brand,
.site-header--over .nav > a,
.site-header--over .icon-btn { color: #fff; }

.site-header--over .icon-btn {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
}

.site-header--over .brand__mark {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
}

.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 74px; }

.brand {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; flex-shrink: 0;
  letter-spacing: -.02em;
}

.brand__mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(145deg, var(--forest), var(--forest-deep));
  color: #fff; display: grid; place-items: center;
  font-size: .95rem; font-weight: 800; flex-shrink: 0;
}

:root[data-theme="dark"] .brand__mark { color: #0f140f; }

.nav { display: flex; align-items: center; gap: .1rem; margin-left: auto; flex-wrap: wrap; }

.nav > a {
  position: relative;
  padding: .55rem .8rem; border-radius: var(--r-pill);
  font-size: .93rem; font-weight: 500; color: var(--ink);
  text-decoration: none; white-space: nowrap;
  transition: color .2s;
}

.nav > a::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .32rem;
  height: 2px; border-radius: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease);
}

.nav > a:hover::after,
.nav > a[aria-current="page"]::after { transform: scaleX(1); }

.nav > a[aria-current="page"] { color: var(--ruby); font-weight: 600; }
.site-header--over .nav > a[aria-current="page"] { color: #fff; }

.nav__tools { display: flex; align-items: center; gap: .4rem; margin-left: .6rem; }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: .95rem; font-weight: 600; text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}

.icon-btn:hover { transform: translateY(-2px); border-color: var(--forest); color: var(--forest); }

.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle { display: grid; }

  .nav {
    position: fixed; inset: 74px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .6rem 1.25rem 1.25rem; box-shadow: var(--shadow-lg);
    max-height: calc(100dvh - 74px); overflow-y: auto;
  }

  .nav[hidden] { display: none; }
  .nav > a { padding: .9rem .6rem; border-radius: var(--r-sm); color: var(--ink) !important; }
  .nav > a::after { display: none; }
  .nav > a[aria-current="page"] { background: var(--forest-soft); }
  .nav__tools { margin: .7rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); }
  .site-header--over .icon-btn { color: var(--ink); border-color: var(--line); background: var(--surface); }
}

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 50px; padding: .75rem 1.6rem; border-radius: var(--r-pill);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .96rem;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--forest); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--forest-deep); color: #fff; box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .btn--primary,
:root[data-theme="dark"] .btn--primary:hover { color: #0f140f; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--forest); color: var(--forest); }

.btn--ruby { background: var(--ruby); color: #fff; }
.btn--ruby:hover { filter: brightness(1.1); color: #fff; }
:root[data-theme="dark"] .btn--ruby { color: #0f140f; }

.btn--light { background: #fff; color: var(--forest-deep); }
.btn--light:hover { background: #fff; color: var(--forest-deep); box-shadow: var(--shadow-lg); }

.btn--outline-light {
  background: rgba(255, 255, 255, .1); color: #fff;
  border-color: rgba(255, 255, 255, .45); backdrop-filter: blur(6px);
}
.btn--outline-light:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.btn--sm { min-height: 42px; padding: .45rem 1.1rem; font-size: .88rem; }
.btn--block { width: 100%; }

/* Hero */
.hero {
  position: relative; min-height: min(92vh, 780px);
  display: grid; align-items: end; color: #fff;
  overflow: hidden; isolation: isolate;
  margin-top: -74px; padding-top: 74px;
}

.hero__media { position: absolute; inset: 0; z-index: -2; }

.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  animation: heroZoom 22s var(--ease) forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.1); }
  to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__media img { animation: none; }
}

.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(10, 18, 12, .95) 0%, rgba(10, 18, 12, .5) 42%, rgba(10, 18, 12, .28) 70%, rgba(10, 18, 12, .45) 100%);
}

.hero__inner { padding-block: 3rem 3.5rem; }

.hero h1 {
  color: #fff; max-width: 15ch; margin-bottom: .6rem;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .3);
}

.hero__lead {
  color: rgba(255, 255, 255, .92);
  font-size: clamp(1.05rem, 1rem + .45vw, 1.28rem);
  max-width: 54ch; margin-bottom: 1.8rem;
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
  color: #fff; padding: .4rem 1rem; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 1.2rem;
  backdrop-filter: blur(6px);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero__credit {
  position: absolute; right: .8rem; bottom: .5rem;
  font-size: .68rem; color: rgba(255, 255, 255, .6); z-index: 1;
}
.hero__credit a { color: inherit; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  color: rgba(255, 255, 255, .75); font-size: 1.4rem;
  animation: bob 2.4s ease-in-out infinite; z-index: 1;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

@media (prefers-reduced-motion: reduce) { .hero__scroll { animation: none; } }

/* Numeri in evidenza */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-lg);
  position: relative; z-index: 5; margin-top: -3.5rem;
}

.stats__item { background: var(--surface); padding: 1.5rem 1rem; text-align: center; }

.stats__n {
  font-family: var(--serif); font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.6rem);
  font-weight: 700; color: var(--forest); line-height: 1;
}

.stats__l {
  font-size: .76rem; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .1em; margin-top: .4rem;
}

/* Intestazione di sezione */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.2rem;
}

.section-head h2 { margin-bottom: .3rem; }
.section-head--center { justify-content: center; text-align: center; }
.section-head--center .lead { margin-inline: auto; }

/* Griglie */
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }

/* Mosaico: la prima scheda occupa due colonne */
.mosaic { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

@media (min-width: 900px) {
  .mosaic > *:first-child { grid-column: span 2; grid-row: span 2; }
  .mosaic > *:first-child .card__media { aspect-ratio: 16 / 13; }
  .mosaic > *:first-child .card__title { font-size: 1.6rem; }
}

/* Schede */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--forest) 35%, var(--line));
}

.card__media { aspect-ratio: 16 / 10; background: var(--surface-alt); position: relative; overflow: hidden; }

.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}

.card:hover .card__media img { transform: scale(1.07); }

.card__media--empty {
  display: grid; place-items: center; font-size: 2.6rem;
  color: color-mix(in srgb, var(--forest) 40%, transparent);
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--forest) 16%, transparent), transparent 60%),
    linear-gradient(140deg, var(--forest-soft), var(--surface-alt));
}

.card__body { padding: 1.25rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }

.card__title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0; line-height: 1.25; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }

.card__text {
  font-size: .93rem; color: var(--ink-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.card__meta {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  font-size: .84rem; color: var(--ink-muted); margin-top: auto; padding-top: .5rem;
}

.card__meta span { display: inline-flex; align-items: center; gap: .3rem; }

/* Etichette */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .26rem .7rem; border-radius: var(--r-pill);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  background: var(--forest-soft); color: var(--forest);
  width: fit-content; text-transform: uppercase;
}

.badge--ruby { background: var(--ruby-soft); color: var(--ruby); }
.badge--lavender { background: color-mix(in srgb, var(--lavender) 15%, transparent); color: var(--lavender); }
.badge--facile { background: #e2f1e5; color: #276230; }
.badge--media { background: #fbf0dc; color: #8a5a10; }
.badge--difficile { background: #fbe5e5; color: #9c2626; }
.badge--molto_difficile { background: #f2e1f1; color: #7a2170; }

:root[data-theme="dark"] .badge--facile { background: #1c2f20; color: #96d5a2; }
:root[data-theme="dark"] .badge--media { background: #322917; color: #e3bd72; }
:root[data-theme="dark"] .badge--difficile { background: #34201f; color: #e8a0a0; }
:root[data-theme="dark"] .badge--molto_difficile { background: #2d1e2c; color: #dda7d6; }

.badge--floating {
  position: absolute; top: .85rem; left: .85rem; z-index: 2;
  background: rgba(255, 255, 255, .95); color: var(--forest-deep);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(4px);
}

:root[data-theme="dark"] .badge--floating { background: rgba(24, 32, 26, .92); color: var(--forest); }

/* Filtri */
.filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.8rem; }

.filterbar {
  position: sticky; top: 74px; z-index: 40;
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  backdrop-filter: blur(12px);
  padding-block: 1rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 42px; padding: .45rem 1.05rem;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: .89rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s;
}

.chip:hover { transform: translateY(-2px); border-color: var(--forest); color: var(--forest); }

.chip[aria-pressed="true"], .chip--on {
  background: var(--forest); border-color: var(--forest); color: #fff;
}

:root[data-theme="dark"] .chip--on,
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: #0f140f; }

.chip__n { font-size: .76rem; opacity: .72; }

/* Moduli */
.field { display: block; margin-bottom: 1.2rem; }
.field > label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; }
.field .hint { display: block; font-size: .82rem; color: var(--ink-muted); margin-top: .35rem; }

input[type="text"], input[type="email"], input[type="search"],
input[type="password"], select, textarea {
  width: 100%; min-height: 50px; padding: .75rem 1rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

textarea { min-height: 150px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--forest) 18%, transparent);
  outline: none;
}

.field--check { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1.2rem; }

.field--check input {
  width: 22px; height: 22px; min-height: 0; margin-top: 3px;
  flex-shrink: 0; accent-color: var(--forest);
}

.field--check label { font-weight: 400; font-size: .92rem; margin: 0; }

.error-text { color: var(--ruby); font-size: .86rem; margin-top: .3rem; font-weight: 500; }

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

/* Ricerca */
.searchbar { display: flex; gap: .6rem; max-width: 620px; }
.searchbar input { flex: 1; }

/* Avvisi */
.alert { padding: 1.1rem 1.25rem; border-radius: var(--r-md); border: 1px solid; margin-bottom: 1.5rem; }
.alert--ok { background: #e7f3e9; border-color: #b7dcbf; color: #1f5b2a; }
.alert--warn { background: #fdf2e0; border-color: #ecd4a6; color: #7d5411; }

:root[data-theme="dark"] .alert--ok { background: #1a2c1e; border-color: #2f5238; color: #a4dcaf; }
:root[data-theme="dark"] .alert--warn { background: #2d2416; border-color: #514227; color: #e5c079; }

/* Dettaglio */
.detail-hero {
  display: grid; gap: 2.5rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 900px) { .detail-hero { grid-template-columns: 1fr; } }

.detail-hero__media {
  border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--surface-alt); box-shadow: var(--shadow-md);
}

.detail-hero__media img { width: 100%; height: 100%; object-fit: cover; }

.info-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.info-list li {
  display: flex; gap: 1rem; padding: .85rem 0;
  border-bottom: 1px solid var(--line); font-size: .95rem;
}

.info-list .k { flex: 0 0 9rem; color: var(--ink-muted); font-weight: 500; }
.info-list .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; margin: 1.8rem 0;
}

.facts__i { background: var(--surface); padding: 1.1rem .8rem; text-align: center; }
.facts__n { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; color: var(--forest); }
.facts__l { font-size: .74rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .07em; }

/* Galleria */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.gallery figure { margin: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-alt); }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform .6s var(--ease); }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { font-size: .74rem; color: var(--ink-muted); padding: .45rem .55rem .6rem; }

/* Mappa */
.map-box {
  height: clamp(360px, 58vh, 640px);
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); z-index: 1;
}

.map-box--sm { height: 300px; }
.leaflet-container { font: inherit; background: var(--surface-alt); }
.leaflet-popup-content-wrapper { border-radius: var(--r-sm); }
.leaflet-popup-content { margin: .85rem 1rem; font-size: .9rem; }
.map-approx { font-size: .82rem; color: var(--ink-muted); margin-top: .6rem; }

/* Tabelle */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--surface-alt); white-space: nowrap; }

/* Contatti utili */
.emergency-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem; margin-top: 2rem;
}

.emergency-card {
  display: flex; flex-direction: column; gap: .15rem;
  padding: 1.4rem 1.5rem; border-radius: var(--r-md);
  background: var(--ruby); color: #fff; text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.emergency-card:hover { transform: translateY(-4px); color: #fff; box-shadow: var(--shadow-lg); }

.emergency-card--soft { background: var(--forest); }
:root[data-theme="dark"] .emergency-card { color: #0f140f; }
:root[data-theme="dark"] .emergency-card:hover { color: #0f140f; }

.emergency-card__n { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.emergency-card__l { font-weight: 700; font-size: 1rem; }
.emergency-card__s { font-size: .82rem; opacity: .85; }

.org-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1.8rem;
}

.org-card h2 { font-size: 1.45rem; margin: .6rem 0 1.2rem; }

.org-card__tag {
  display: inline-block; padding: .26rem .7rem; border-radius: var(--r-pill);
  background: var(--forest-soft); color: var(--forest);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}

.org-card__tag--ruby { background: var(--ruby-soft); color: var(--ruby); }

.numbers-head {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.35rem; margin: 2.5rem 0 1.1rem;
}

.numbers-head span { font-size: 1.1rem; opacity: .7; }

.phone-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.25rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  text-decoration: none; color: inherit;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}

.phone-card:hover { transform: translateY(-3px); border-color: var(--forest); color: inherit; box-shadow: var(--shadow-sm); }
.phone-card--emergency { border-color: color-mix(in srgb, var(--ruby) 40%, var(--line)); background: var(--ruby-soft); }

.phone-card__n {
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem;
  color: var(--forest); white-space: nowrap; margin-left: auto;
}

.phone-card--emergency .phone-card__n { color: var(--ruby); }
.phone-card__name { font-weight: 600; display: block; }
.phone-card__sub { font-size: .85rem; color: var(--ink-muted); display: block; }

/* Scheda di chi cura il sito */
.owner-card {
  background: linear-gradient(160deg, var(--forest), var(--forest-deep));
  color: #fff; border-radius: var(--r-lg); padding: 2rem;
  box-shadow: var(--shadow-md);
}

:root[data-theme="dark"] .owner-card { color: #0f140f; }

.owner-card h2 { color: inherit; font-size: 1.5rem; margin: .8rem 0 .2rem; }
.owner-card__role { font-size: .9rem; opacity: .82; margin-bottom: 1.3rem; }

.owner-card__badge {
  width: 54px; height: 54px; border-radius: 15px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
}

.owner-card__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; font-size: .93rem; }
.owner-card__list li { display: flex; gap: .7rem; align-items: flex-start; }
.owner-card__list a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.owner-card__list a:hover { color: inherit; opacity: .8; }

.side-note {
  margin-top: 1.2rem; padding: 1.3rem 1.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}

.side-note h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.side-note p { font-size: .9rem; color: var(--ink-muted); margin-bottom: .9rem; }
.side-note--warn { border-color: color-mix(in srgb, var(--ruby) 35%, var(--line)); background: var(--ruby-soft); }

/* Briciole */
.crumbs { font-size: .85rem; color: var(--ink-muted); padding-block: 1.2rem 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-left: .4rem; opacity: .45; }
.crumbs li:last-child::after { content: ""; }

/* Impaginazione */
.pagination {
  display: flex; gap: .4rem; justify-content: center;
  list-style: none; padding: 0; margin: 2.5rem 0 0; flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: grid; place-items: center; min-width: 46px; min-height: 46px;
  padding: 0 .7rem; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: var(--ink); font-size: .9rem;
}

.pagination a:hover { border-color: var(--forest); color: var(--forest); }
.pagination .is-active span { background: var(--forest); border-color: var(--forest); color: #fff; }
:root[data-theme="dark"] .pagination .is-active span { color: #0f140f; }
.pagination .is-disabled span { opacity: .4; }

/* Stato vuoto */
.empty { text-align: center; padding: 4rem 1rem; color: var(--ink-muted); }
.empty__icon { font-size: 2.8rem; margin-bottom: .6rem; opacity: .6; }

/* Testo lungo */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.7rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .45rem; }
.prose table { margin: 1.6rem 0; }
.prose td, .prose th { font-size: .9rem; }

/* Riquadro a tutta larghezza con immagine */
.feature {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  min-height: 420px; display: grid; align-items: end; color: #fff;
  isolation: isolate;
}

.feature__media { position: absolute; inset: 0; z-index: -2; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.05); }

.feature::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(10, 18, 12, .9), rgba(10, 18, 12, .25) 60%, transparent);
}

.feature__body { padding: 2.2rem; max-width: 60ch; }
.feature__body h2 { color: #fff; margin-bottom: .5rem; }
.feature__body p { color: rgba(255, 255, 255, .9); }

/* Carosello orizzontale */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 330px);
  gap: 1.4rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: .3rem .3rem 1.4rem; margin-inline: -.3rem;
  scrollbar-width: thin;
}

.rail > * { scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

/* Piè di pagina */
.site-footer {
  background: var(--forest-deep); color: rgba(255, 255, 255, .8);
  padding-block: 4rem 1.8rem; margin-top: 5rem;
}

:root[data-theme="dark"] .site-footer { background: #0a0f0b; border-top: 1px solid var(--line); }

.site-footer h3 {
  color: #fff; font-size: .82rem; font-family: var(--sans); font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; margin-bottom: 1rem;
}

.site-footer a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .92rem; }

.footer-bottom {
  margin-top: 3rem; padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; font-size: .84rem;
}

/* Crediti fotografici */
.credit-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 0;
}

.credit-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

.credit-card figcaption {
  padding: .85rem 1rem 1rem;
  font-size: .85rem;
  line-height: 1.55;
  color: var(--muted);
}

.credit-card figcaption strong { color: var(--ink); }

/* Banner in cima alle pagine di comune */
.page-banner {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 21 / 8;
  margin-top: .5rem;
  box-shadow: var(--shadow-md);
}

.page-banner img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 720px) {
  .page-banner { aspect-ratio: 16 / 9; }
}

@media print {
  .site-header, .site-footer, .nav, .btn, .map-box, .hero__scroll { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
