/* ==========================================================================
   MyHome Bari — foglio di stile unico (nessuna dipendenza esterna)
   ========================================================================== */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --ink: #1d2a33;
  --muted: #5d6871;
  --line: #e7dfd3;
  --accent: #b9552f;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3d9;
  --sea: #1d5f7b;
  --sea-soft: #dcecf3;
  --good: #2f7d4f;
  --shadow: 0 1px 2px rgba(29, 42, 51, .06), 0 8px 24px rgba(29, 42, 51, .08);
  --shadow-lg: 0 20px 50px rgba(29, 42, 51, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 68px;
  --maxw: 1180px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11171b;
    --surface: #182128;
    --surface-2: #1f2a31;
    --ink: #edf1f3;
    --muted: #a3afb8;
    --line: #2b3740;
    --accent: #e28a62;
    --accent-ink: #1a1208;
    --accent-soft: #3a2a22;
    --sea: #74b6d2;
    --sea-soft: #1d3440;
    --good: #6cc391;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 64px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sea); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
mark { background: var(--accent-soft); color: inherit; padding: 0 .15em; border-radius: 3px; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: .6em 1em; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.container { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--surface-2); }
.eyebrow { display: inline-block; font: 600 .78rem/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .9rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.section-head { margin-bottom: 2.25rem; }
.section-head--center { text-align: center; }
.section-head--center .lead { margin-inline: auto; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .85em 1.35em; border-radius: 999px; border: 1px solid transparent;
  font: 600 .98rem/1 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(185, 85, 47, .3); }
.btn--primary:hover { color: var(--accent-ink); filter: brightness(1.05); }
.btn--ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(6px); }
.btn--ghost:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font: 600 1.3rem/1 var(--font-serif); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.brand__mark .icon { width: 20px; height: 20px; }
.brand small { display: block; font: 500 .7rem/1.2 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.main-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: .55em .9em; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.search-trigger {
  display: inline-flex; align-items: center; gap: .55rem; height: 40px; padding: 0 .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted);
  font: 500 .9rem var(--font-sans); cursor: pointer;
}
.search-trigger:hover { border-color: var(--accent); color: var(--ink); }
.search-trigger kbd { font: 600 .72rem var(--font-sans); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; color: var(--muted); }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang-switch a { padding: .45em .7em; font: 600 .8rem/1 var(--font-sans); color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--bg); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 40px; padding: 0; justify-content: center; }
  .menu-toggle { display: inline-grid; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: .75rem 16px 1.25rem; display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: .85em 1em; font-size: 1.05rem; }
}
@media (max-width: 420px) { .brand small { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(86vh, 760px); display: grid; align-items: end; color: #fff; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 20, 28, .15) 0%, rgba(10, 20, 28, .25) 40%, rgba(10, 20, 28, .78) 100%); }
.hero__content { padding: 120px 0 64px; }
.hero h1 { color: #fff; margin-bottom: .2em; text-shadow: 0 2px 20px rgba(0, 0, 0, .25); }
.hero .eyebrow { color: #ffd9c6; }
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 54ch; opacity: .95; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.hero__caption { position: absolute; right: 16px; bottom: 16px; font-size: .8rem; opacity: .8; }
.hero--compact { min-height: 52vh; }

.rating-badge { display: flex; width: fit-content; align-items: center; gap: .6rem; padding: .45rem .9rem .45rem .45rem; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); margin-bottom: 1.2rem; font-size: .92rem; }
.rating-badge strong { display: grid; place-items: center; min-width: 40px; height: 32px; padding: 0 .4rem; border-radius: 8px 8px 8px 2px; background: var(--sea); color: #fff; font-size: 1rem; }

/* ---------- Fatti rapidi ---------- */
.facts { position: relative; z-index: 2; margin-top: -40px; }
.facts ul { list-style: none; margin: 0; padding: 1rem; display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.facts li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; padding: .6rem .4rem; font-size: .9rem; font-weight: 500; }
.facts .icon { width: 28px; height: 28px; color: var(--accent); }
@media (max-width: 900px) { .facts ul { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .facts ul { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Sotto-navigazione di pagina ---------- */
.page-nav { position: sticky; top: var(--header-h); z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin-top: 2rem; }
.page-nav ul { display: flex; gap: .35rem; list-style: none; margin: 0 auto; padding: .6rem 0; overflow-x: auto; scrollbar-width: none; }
.page-nav ul::-webkit-scrollbar { display: none; }
.page-nav a { display: block; white-space: nowrap; padding: .45em .95em; border-radius: 999px; color: var(--muted); text-decoration: none; font: 500 .92rem var(--font-sans); border: 1px solid transparent; }
.page-nav a:hover { color: var(--ink); background: var(--surface-2); }
.page-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

/* ---------- Posizione ---------- */
.location { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: start; }
.info-list { display: grid; gap: 1rem; }
.info-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.info-card__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); }
.info-card__icon .icon { width: 24px; height: 24px; }
.info-card h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; margin-bottom: .3rem; }
.info-card p { margin: 0; color: var(--muted); font-size: .96rem; }
.info-card .pill { display: inline-block; margin-top: .6rem; font-size: .8rem; font-weight: 600; color: var(--sea); background: var(--sea-soft); padding: .2em .7em; border-radius: 999px; }
.location__side { display: grid; gap: 1rem; position: sticky; top: calc(var(--header-h) + 72px); }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 4 / 3; }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.photo-card { margin: 0; border-radius: var(--radius); overflow: hidden; position: relative; }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem 1rem .8rem; color: #fff; font-size: .9rem; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
@media (max-width: 900px) { .location { grid-template-columns: 1fr; } .location__side { position: static; } }

/* ---------- Appartamento ---------- */
.apartment-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.amenities { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem 1.2rem; }
.amenities li { display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 500; font-size: .95rem; }
.amenities .icon { color: var(--good); }
@media (max-width: 900px) { .apartment-intro { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .amenities { grid-template-columns: 1fr; } }

/* ---------- Galleria ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.chip { display: inline-flex; align-items: center; gap: .4em; padding: .5em 1em; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 .92rem var(--font-sans); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-size: .78rem; opacity: .7; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-rows: 200px; grid-auto-flow: dense; gap: .75rem; }
.gallery__item { position: relative; margin: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.gallery__item.is-wide { grid-column: span 2; }
.gallery__item.is-tall { grid-row: span 2; }
.gallery__item[hidden] { display: none; }
.gallery__item button { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item figcaption { position: absolute; left: .6rem; bottom: .6rem; padding: .25em .7em; border-radius: 999px; font-size: .78rem; font-weight: 600; background: rgba(255, 255, 255, .9); color: #1d2a33; pointer-events: none; }
.gallery__item button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (max-width: 520px) { .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; } .gallery__item.is-wide { grid-column: span 2; } }

/* ---------- Lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8, 12, 16, .94); color: #fff; }
.lightbox::backdrop { background: rgba(8, 12, 16, .7); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: .92rem; }
.lightbox__stage { display: grid; place-items: center; min-height: 0; padding: 0 64px; position: relative; }
.lightbox__stage img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; user-select: none; }
.lightbox__nav { position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox__nav:hover { background: rgba(255, 255, 255, .25); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__caption { text-align: center; padding: 12px 16px 18px; opacity: .85; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .12); border: 0; color: #fff; }
@media (max-width: 600px) { .lightbox__stage { padding: 0 8px; } .lightbox__nav { top: auto; bottom: -4px; translate: none; } }

/* ---------- Recensioni ---------- */
.reviews { display: grid; grid-template-columns: 340px 1fr; gap: 2rem; align-items: start; }
.score-card { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: sticky; top: calc(var(--header-h) + 72px); }
.score-card__top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.score-card__value { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px 14px 14px 4px; background: var(--sea); color: #fff; font: 700 1.6rem var(--font-sans); }
.score-card__label { font-weight: 700; font-size: 1.15rem; }
.score-card__count { color: var(--muted); font-size: .9rem; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; font-size: .9rem; }
.bars .bar { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bars .bar span { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.review-list { display: grid; gap: 1rem; }
.review { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.review__head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.avatar { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.review__who { font-weight: 600; line-height: 1.3; }
.review__meta { color: var(--muted); font-size: .85rem; }
.stars { display: flex; gap: 2px; color: #e2a43b; margin-left: auto; }
.stars .icon { width: 16px; height: 16px; }
.review h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.review p { color: var(--muted); margin: 0; }
.review.is-clamped p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.link-btn { all: unset; cursor: pointer; color: var(--sea); font-weight: 600; font-size: .92rem; margin-top: .6rem; display: inline-block; }
.link-btn:hover { color: var(--accent); }
.link-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 900px) { .reviews { grid-template-columns: 1fr; } .score-card { position: static; } }

/* ---------- CTA ---------- */
.cta { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 8px); padding: clamp(32px, 6vw, 64px); background: linear-gradient(135deg, var(--sea) 0%, #123e52 100%); color: #fff; display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; }
.cta h2 { color: #fff; }
.cta p { opacity: .9; }
.cta__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }
@media (prefers-color-scheme: dark) { .cta { background: linear-gradient(135deg, #1e4b5f 0%, #10303e 100%); } }
@media (max-width: 800px) { .cta { grid-template-columns: 1fr; } .cta__actions { justify-content: flex-start; } }

/* ---------- Cosa vedere ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.toolbar .chips { margin: 0; }
.search-field { position: relative; flex: 1 1 280px; max-width: 420px; }
.search-field .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search-field input { width: 100%; height: 46px; padding: 0 1rem 0 2.75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 1rem var(--font-sans); }
.search-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.result-count { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }
.places { display: grid; gap: 1.5rem; }
.place { display: grid; grid-template-columns: 420px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.place[hidden] { display: none; }
.place:nth-child(even) { grid-template-columns: 1fr 420px; }
.place:nth-child(even) .place__media { order: 2; }
.place__media { margin: 0; min-height: 280px; }
.place__media img { width: 100%; height: 100%; object-fit: cover; }
.place__body { padding: clamp(20px, 3vw, 36px); }
.place__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.tag { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .3em .75em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.place__text { color: var(--muted); }
.place__text.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.place__text p:last-child { margin-bottom: 0; }
.place__actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; }
.place__actions a { font-weight: 600; font-size: .92rem; text-decoration: none; display: inline-flex; gap: .35em; align-items: center; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
@media (max-width: 900px) {
  .place, .place:nth-child(even) { grid-template-columns: 1fr; }
  .place:nth-child(even) .place__media { order: 0; }
  .place__media { min-height: 0; aspect-ratio: 16 / 10; }
}

/* ---------- Contatti ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2rem; align-items: start; }
.contact__aside { display: grid; gap: 1rem; }
.form-card { padding: clamp(20px, 4vw, 36px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: .8rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: 400 1rem var(--font-sans);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field .hint { font-size: .8rem; color: var(--muted); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #c0392b; }
.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.25rem; }
.form-note { font-size: .85rem; color: var(--muted); margin: 0; }
.form-status { margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--sea-soft); color: var(--ink); font-size: .95rem; }
.form-status[hidden] { display: none; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Ricerca globale ---------- */
.search-dialog { width: min(680px, calc(100vw - 24px)); max-height: min(78vh, 640px); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-dialog::backdrop { background: rgba(10, 18, 24, .45); backdrop-filter: blur(3px); }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog__head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.search-dialog__head .icon { color: var(--muted); }
.search-dialog__head input { flex: 1; border: 0; background: transparent; color: var(--ink); font: 400 1.1rem var(--font-sans); outline: none; min-width: 0; }
.search-dialog__head kbd { font: 600 .72rem var(--font-sans); border: 1px solid var(--line); border-radius: 6px; padding: .15em .45em; color: var(--muted); }
.search-results { list-style: none; margin: 0; padding: .5rem; overflow-y: auto; }
.search-results a { display: block; padding: .75rem .9rem; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--surface-2); }
.search-results .r-page { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.search-results .r-title { font-weight: 600; display: block; margin: .1rem 0; }
.search-results .r-snippet { font-size: .9rem; color: var(--muted); display: block; }
.search-empty { padding: 1.5rem 1rem; color: var(--muted); text-align: center; }
.search-hints { display: flex; flex-wrap: wrap; gap: .5rem; padding: .25rem .9rem 1rem; }
.search-hints .chip { font-size: .85rem; padding: .4em .85em; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; padding: 56px 0 28px; background: #142028; color: #c9d3da; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #ffc7ad; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { font-size: 1.05rem; font-family: var(--font-sans); font-weight: 600; color: #fff; margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.site-footer .brand { color: #fff; margin-bottom: .8rem; }
.site-footer .brand small { color: #9fb0bb; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .88rem; }
.footer-bottom nav { display: flex; gap: 1.25rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Pagina 404 ---------- */
.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; }

/* ---------- Comparsa animata ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
