/* Immobiliare 5 Stelle — design system
   Ibrido: eleganza Lionard (serif, navy + oro, foto grandi, angoli quasi squadrati)
   + usabilità Tecnocasa (ricerca in evidenza, chip a pillola, CTA chiare, ombre morbide).
   Regole HIG: corpo 16px, target ≥ 44px, contrasto AA, focus visibile, movimento ridotto rispettato. */

@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-latin-wght.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --navy-950: #081627; --navy-900: #0b1f35; --navy-800: #0e2a47; --navy-700: #15395f; --navy-100: #e8eef5; --navy-50: #f3f6fa;
  --gold-500: #b8924a; --gold-400: #c9a764; --gold-100: #f6eedf;
  --paper: #f7f5f0; --surface: #ffffff;
  --ink: #1b222b; --ink-2: #3a4350; --muted: #5b6470; --line: #e4dfd5; --line-2: #d6d0c4;
  --link: #1f4fd1; --success: #14733a; --success-bg: #e7f4ec; --danger: #b42318; --danger-bg: #fdecea; --warning-bg: #fff6e0;

  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px; /* HIG: bottoni/campi 8, card 12 */
  --sh-1: 0 1px 2px rgb(11 31 53 / 6%), 0 2px 10px rgb(11 31 53 / 6%);
  --sh-2: 0 14px 40px rgb(11 31 53 / 14%);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --container: 1200px; --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::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 1rem/1.6 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { color: var(--navy-800); }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; border-radius: 2px; }
/* Il titolo riceve il focus dopo ogni navigazione (screen reader), ma non è un controllo: niente cornice. */
h1:focus, main:focus { outline: none; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; color: var(--navy-900); line-height: 1.15; margin: 0 0 var(--s-4); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; font-family: var(--f-body); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 var(--s-4); text-wrap: pretty; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.eyebrow { font: 600 .78rem/1.2 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-500); margin-bottom: var(--s-3); }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-alt { background: var(--surface); }
.section-dark { background: var(--navy-900); color: #dfe6ee; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.section-head h2 { margin: 0; }
.stack > * + * { margin-top: var(--s-4); }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 28px; height: 28px; flex: none; }

/* ---------- Bottoni e chip ---------- */
.btn { --bg: var(--navy-800); --fg: #fff; --bd: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 22px; border-radius: var(--r-sm); border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 600 1rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); white-space: nowrap; }
.btn:hover { --bg: var(--navy-700); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-gold { --bg: var(--gold-500); --fg: var(--navy-950); }
.btn-gold:hover { --bg: var(--gold-400); }
.btn-outline { --bg: transparent; --fg: var(--navy-800); --bd: var(--line-2); }
.btn-outline:hover { --bg: var(--navy-50); --bd: var(--navy-800); }
.btn-ghost { --bg: transparent; --fg: var(--navy-800); --bd: transparent; padding: 0 12px; }
.btn-ghost:hover { --bg: var(--navy-50); }
.btn-light { --bg: #fff; --fg: var(--navy-900); --bd: #fff; }
.btn-danger { --bg: var(--danger); --fg: #fff; }
.btn-danger:hover { --bg: #8f1c13; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .94rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; }
.btn-whatsapp { --bg: #1f8f4e; --fg: #fff; }
.btn-whatsapp:hover { --bg: #187340; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font: 500 .92rem/1 var(--f-body); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--navy-800); color: var(--navy-800); }
.chip[aria-current="true"], .chip.is-active, .chip:has(input:checked) { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: var(--r-xs); font: 600 .72rem/1.2 var(--f-body); letter-spacing: .06em; text-transform: uppercase; }
.badge-gold { background: var(--gold-500); color: var(--navy-950); }
.badge-navy { background: var(--navy-800); color: #fff; }
.badge-new { background: var(--success); color: #fff; }
.badge-light { background: rgb(255 255 255 / 92%); color: var(--navy-900); }
.badge-sold { background: var(--danger); color: #fff; }

/* ---------- Header ---------- */
/* Niente backdrop-filter: renderebbe l'header il contenitore del menu mobile (position: fixed) e lo schiaccerebbe a 0px. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: var(--s-5); height: var(--header-h); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { width: 220px; height: auto; }
.nav-main { display: flex; gap: var(--s-1); margin-left: auto; }
.nav-main a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav-main a:hover, .nav-main a.active, .nav-main a[aria-current="page"] { color: var(--navy-900); background: var(--navy-50); }
.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.nav-mobile { display: none; margin-left: auto; }
.nav-mobile > summary { list-style: none; }
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile[open] .nav-sheet { display: block; }
.nav-sheet { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: var(--surface); padding: var(--s-5) var(--gutter); overflow-y: auto; border-top: 1px solid var(--line); }
.nav-sheet a { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; border-bottom: 1px solid var(--line); color: var(--navy-900); text-decoration: none; font: 600 1.15rem/1 var(--f-body); }
.nav-sheet .btn { margin-top: var(--s-5); }
.nav-mobile[open] .i-open, .nav-mobile:not([open]) .i-close { display: none; }
@media (max-width: 960px) {
  .nav-main, .header-actions .hide-mobile { display: none; }
  .nav-mobile { display: block; }
  .brand img { width: 180px; }
  body:has(.nav-mobile[open]) { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; color: #fff; background: var(--navy-900); }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(8 22 39 / 88%) 0%, rgb(8 22 39 / 70%) 45%, rgb(8 22 39 / 25%) 100%), linear-gradient(0deg, rgb(8 22 39 / 70%) 0%, transparent 40%); }
@media (max-width: 760px) { .hero-media::after { background: rgb(8 22 39 / 62%); } }
/* Movimento ridotto: resta la foto (il video è solo decorativo). */
@media (prefers-reduced-motion: reduce) { .hero-media video { display: none; } }
.hero .container { padding-top: clamp(64px, 12vw, 140px); padding-bottom: clamp(40px, 7vw, 72px); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: #e6ecf3; max-width: 52ch; }
.hero .eyebrow { color: var(--gold-400); }

.search-panel { margin-top: var(--s-6); background: var(--surface); color: var(--ink); border-radius: var(--r-md); box-shadow: var(--sh-2); padding: var(--s-4); }
.search-tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-3); }
.search-tabs label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); font-weight: 600; color: var(--muted); cursor: pointer; }
.search-tabs label:has(input:checked) { background: var(--navy-800); color: #fff; }
.search-tabs input { position: absolute; opacity: 0; }
.search-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr auto; gap: var(--s-3); align-items: end; }
@media (max-width: 860px) { .search-row { grid-template-columns: 1fr 1fr; } .search-row .btn { grid-column: 1 / -1; } }
@media (max-width: 520px) { .search-row { grid-template-columns: 1fr; } }

.trust { display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); margin-top: var(--s-6); color: #dfe6ee; }
.trust strong { display: block; font: 600 1.6rem/1.1 var(--f-display); color: #fff; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font: 600 .85rem/1.3 var(--f-body); color: var(--ink-2); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 10px 14px; font: 400 1rem/1.4 var(--f-body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 140px; resize: vertical; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6470' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy-800); box-shadow: 0 0 0 3px rgb(14 42 71 / 15%); }
.input[aria-invalid="true"], .invalid { border-color: var(--danger); }
.validation-message, .field-error { color: var(--danger); font-size: .85rem; }
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: 44px; padding-top: 10px; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy-800); flex: none; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; } /* honeypot antispam */

.alert { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-sm); border: 1px solid; margin-bottom: var(--s-4); }
.alert-success { background: var(--success-bg); border-color: #b9dfc8; color: #0d4f28; }
.alert-error { background: var(--danger-bg); border-color: #f4c3bd; color: #7a1a12; }
.alert-info { background: var(--navy-50); border-color: var(--navy-100); color: var(--navy-900); }
.alert-warning { background: var(--warning-bg); border-color: #f1dca4; color: #6b4e00; }

/* ---------- Card immobile ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.pcard:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.pcard-media { position: relative; aspect-ratio: 4 / 3; background: var(--navy-100); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.pcard:hover .pcard-media img { transform: scale(1.04); }
.pcard-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard-fav { position: absolute; top: 8px; right: 8px; }
.pcard-fav button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / 92%); color: var(--navy-900); display: grid; place-items: center; cursor: pointer; }
.pcard-fav button[aria-pressed="true"] { color: var(--danger); }
.pcard-fav button[aria-pressed="true"] .icon { fill: currentColor; }
.pcard-body { display: flex; flex-direction: column; gap: 6px; padding: var(--s-4) var(--s-4) var(--s-5); flex: 1; }
.pcard-price { font: 700 1.3rem/1.2 var(--f-body); color: var(--navy-900); font-variant-numeric: tabular-nums; }
.pcard-title { font: 600 1.05rem/1.35 var(--f-body); color: var(--ink); margin: 0; }
.pcard-title a { color: inherit; text-decoration: none; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; } /* tutta la card cliccabile */
.pcard-place { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; }
.pcard-facts { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.pcard-facts span { display: inline-flex; align-items: center; gap: 6px; }
.pcard-fav, .pcard-fav * { z-index: 2; }

/* ---------- Ricerca ---------- */
.search-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); }
.filters fieldset { border: 0; padding: 0; margin: 0 0 var(--s-5); }
.filters legend { font: 600 .85rem/1.2 var(--f-body); color: var(--ink-2); margin-bottom: var(--s-2); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.results-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin-bottom: var(--s-5); }
.filters-toggle { display: none; }
@media (max-width: 960px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters-toggle { display: block; }
  .filters-toggle > summary { list-style: none; }
  .filters-toggle > summary::-webkit-details-marker { display: none; }
  .filters { position: static; display: none; max-height: none; }
  .filters-toggle[open] + .filters, .filters.is-open { display: block; }
}
.empty { text-align: center; padding: var(--s-8) var(--s-4); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-top: var(--s-7); }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--navy-800); color: var(--navy-800); }
.pager [aria-current="page"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ---------- Scheda immobile ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--muted); margin: var(--s-5) 0 var(--s-4); padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb a { color: var(--muted); }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; height: clamp(320px, 52vw, 560px); border-radius: var(--r-md); overflow: hidden; }
.gallery button { all: unset; position: relative; cursor: zoom-in; overflow: hidden; background: var(--navy-100); }
.gallery button:focus-visible { outline: 3px solid var(--gold-500); outline-offset: -3px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery button:hover img { transform: scale(1.03); }
.gallery button:first-child { grid-row: 1 / 3; }
.gallery .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(8 22 39 / 55%); color: #fff; font-weight: 600; }
.gallery[data-count="1"] { grid-template-columns: 1fr; }
.gallery[data-count="1"] button:first-child { grid-row: auto; }
.gallery[data-count="2"] { grid-template-columns: 2fr 1fr; }
.gallery[data-count="2"] button:nth-child(2) { grid-row: 1 / 3; }
@media (max-width: 760px) {
  .gallery { display: flex; height: auto; aspect-ratio: 4/3; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 0; margin: 0 calc(-1 * var(--gutter)); }
  .gallery button { flex: 0 0 100%; scroll-snap-align: center; }
  .gallery .more { display: none; }
}
.gallery-count { margin-top: var(--s-2); color: var(--muted); font-size: .88rem; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-7); margin-top: var(--s-6); align-items: start; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
.detail-head { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-start; justify-content: space-between; }
.detail-price { font: 700 clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem)/1.1 var(--f-body); color: var(--navy-900); font-variant-numeric: tabular-nums; }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--s-3); margin: var(--s-5) 0; padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.keyfacts div { display: flex; flex-direction: column; gap: 2px; }
.keyfacts dt { font-size: .8rem; color: var(--muted); }
.keyfacts dd { margin: 0; font-weight: 600; color: var(--navy-900); }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 var(--s-6); margin: 0; }
.specs div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }
.features-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-3); padding: 0; list-style: none; }
.features-list li { display: flex; align-items: center; gap: var(--s-2); }
.features-list .icon { color: var(--success); }
.prose { max-width: 70ch; white-space: pre-line; color: var(--ink-2); }
.energy { display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 10px; border-radius: var(--r-sm); color: #fff; font-weight: 700; }
.energy[data-c^="A"] { background: #1a7f37; } .energy[data-c="B"] { background: #4c9a2a; } .energy[data-c="C"] { background: #a3b823; color: var(--ink); }
.energy[data-c="D"] { background: #e3c11a; color: var(--ink); } .energy[data-c="E"] { background: #ef9a1a; color: var(--ink); } .energy[data-c="F"] { background: #e2621b; } .energy[data-c="G"] { background: #c8261c; }
.energy[data-c="Esente"], .energy[data-c="In attesa"], .energy[data-c=""] { background: var(--navy-100); color: var(--ink); }
.nearby { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.nearby-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-4); }
.nearby-group h3 { display: flex; align-items: center; gap: var(--s-2); font: 600 1rem/1.3 var(--f-body); margin-bottom: var(--s-2); }
.nearby-group h3 .icon { color: var(--gold-500); }
.nearby-group ul { list-style: none; padding: 0; margin: 0; }
.nearby-group li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.nearby-group li span:last-child { white-space: nowrap; font-size: .85rem; }
.map { height: 380px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--navy-100); z-index: 0; }
/* Come .filters, il riquadro sticky non supera l'altezza dello schermo: se il contenuto non entra scorre al suo interno,
   altrimenti la parte bassa (il pulsante d'invio) comparirebbe solo a fine pagina. */
.contact-card { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--sh-1); }
.contact-card h3 { font-size: 1.2rem; }
.contact-quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-bottom: var(--s-4); }
.notice { padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--navy-900); color: #fff; margin: var(--s-4) 0; }
.mobile-cta { display: none; }
@media (max-width: 1000px) {
  .contact-card { position: static; max-height: none; }
  .mobile-cta { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-2); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(11 31 53 / 8%); }
  .mobile-cta .btn { padding: 0 8px; }
  body:has(.mobile-cta) .site-footer { padding-bottom: 96px; }
}

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(8 22 39 / 96%); color: #fff; }
.lightbox::backdrop { background: transparent; }
.lightbox-stage { position: absolute; inset: 56px 64px; display: grid; place-items: center; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-bar { position: absolute; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s-4); }
.lightbox .nav-btn { position: absolute; top: 50%; translate: 0 -50%; }
.lightbox .prev { left: 8px; } .lightbox .next { right: 8px; }
.lightbox .btn-icon { --bg: rgb(255 255 255 / 12%); --bd: transparent; --fg: #fff; }
@media (max-width: 760px) { .lightbox-stage { inset: 56px 0; } }

/* ---------- Blocchi contenuto ---------- */
.section-tight { padding: var(--s-6) 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--s-3); }
.tile { display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--navy-900); text-decoration: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.tile:hover { border-color: var(--gold-500); box-shadow: var(--sh-1); transform: translateY(-2px); color: var(--navy-900); }
.tile .icon-lg { color: var(--gold-500); margin-bottom: var(--s-2); }
.tile-name { font-weight: 600; }
.tile-count { font-size: .875rem; color: var(--muted); }
.tile-accent { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.tile-accent:hover { color: #fff; }
.tile-accent .tile-count { color: #c9d3de; }
.sell-photo { margin: 0; justify-self: center; position: relative; }
.sell-photo figcaption { position: absolute; left: var(--s-4); right: var(--s-4); bottom: var(--s-4); display: flex; flex-direction: column; padding: var(--s-3) var(--s-4); background: rgb(255 255 255 / 94%); border-radius: var(--r-sm); box-shadow: var(--sh-1); }
.sell-photo figcaption span { font-size: .875rem; color: var(--muted); }
.steps-compact { grid-template-columns: 1fr; gap: var(--s-4); margin: var(--s-5) 0; }
.steps-compact li { display: grid; grid-template-columns: 48px 1fr; column-gap: var(--s-3); padding-top: var(--s-3); }
.steps-compact li::before { grid-row: span 2; font-size: 1.6rem; margin: 0; }
.steps-compact h4, .steps-compact p { margin: 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.feature { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.feature .icon-lg { color: var(--gold-500); }
.feature h3 { margin: 0; }
.steps { counter-reset: step; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); padding: 0; list-style: none; }
.steps li { counter-increment: step; padding-top: var(--s-5); border-top: 2px solid var(--gold-500); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 600 2rem/1 var(--f-display); color: var(--gold-500); margin-bottom: var(--s-3); }
.cta-band { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-6); align-items: center; padding: clamp(32px, 5vw, 56px); border-radius: var(--r-md); background: var(--navy-900); color: #dfe6ee; }
.cta-band h2 { color: #fff; margin-bottom: var(--s-3); }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: flex-end; }
@media (max-width: 800px) { .cta-band { grid-template-columns: 1fr; } .cta-band .actions { justify-content: flex-start; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.portrait { border-radius: var(--r-md); aspect-ratio: 4/5; object-fit: cover; width: 100%; max-width: 440px; box-shadow: var(--sh-2); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 56px; cursor: pointer; font-weight: 600; color: var(--navy-900); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.5rem/1 var(--f-body); color: var(--gold-500); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); padding-bottom: var(--s-4); }
.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head p { color: var(--muted); max-width: 62ch; font-size: 1.1rem; margin: 0; }
.legal { max-width: 78ch; }
.legal h2 { font-size: 1.4rem; margin-top: var(--s-6); }
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); margin-bottom: var(--s-5); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--navy-900); border-color: var(--gold-500); }
.auth { max-width: 460px; margin: clamp(32px, 6vw, 72px) auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: clamp(24px, 4vw, 40px); box-shadow: var(--sh-1); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: #b9c4d0; padding: var(--s-8) 0 var(--s-5); margin-top: 0; }
.site-footer a { color: #dfe6ee; text-decoration: none; }
.site-footer a:hover { color: var(--gold-400); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: var(--s-6); }
.footer-grid h4 { color: #fff; font-family: var(--f-body); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: var(--s-4); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
/* Logo a colori su fondo bianco: sul blu del footer il testo blu del logo non si leggerebbe. */
.footer-logo { display: inline-flex; padding: 12px 16px; background: #fff; border-radius: var(--r-sm); }
.site-footer a.footer-logo:hover { text-decoration: none; }
.footer-logo img { width: 240px; height: auto; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid rgb(255 255 255 / 10%); font-size: .85rem; }
.social { display: flex; gap: var(--s-2); }
.social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(255 255 255 / 18%); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .contact-card, .mobile-cta, .gallery-count, .btn { display: none !important; }
  body { background: #fff; }
}
