/* theme-coastal — "Mediterraneo editoriale" (opt-in via product.theme = "coastal").
   Light-first: teal profondo su neutro sabbia, corallo SOLO come accento (badge/CTA),
   rapporto 60/30/10 — sole ed editoriale, mai neon-resort. Caricato DOPO main.css:
   override di variabili + pochi componenti costieri. Gli altri prodotti non lo caricano. */

:root {
  --fg: #3a3733;
  --muted: #6f6a60;
  --bg: #fbf3e1;
  --bg-soft: #f5e9cf;
  --surface: #ffffff;
  --accent: #297685;
  --accent-strong: #1d5a66;
  --accent-soft: #dcebee;
  --coral: #ff6f61;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* notte sul mare: teal spento su blu-inchiostro caldo */
    --fg: #e9e4d8;
    --muted: #a49d8e;
    --bg: #101b1f;
    --bg-soft: #16242a;
    --surface: #1c2d34;
    --accent: #6fb5c4;
    --accent-strong: #8fcbd8;
    --accent-soft: #1d3a42;
  }
}

/* Display serif (Fraunces, già nel base) con più presenza */
.hero h1,
main > h1 {
  letter-spacing: 0.01em;
  font-weight: 600;
}

.hero {
  position: relative;
  overflow: hidden;
}

/* Onde decorative in fondo all'hero: pura geometria CSS, niente asset.
   Tre archi sovrapposti a opacità decrescente. Decorativo, statico. */
.hero::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -1.6rem;
  height: 3.2rem;
  pointer-events: none;
  opacity: 0.35;
  background:
    radial-gradient(60% 100% at 20% 100%, transparent 62%, var(--accent) 63%, var(--accent) 66%, transparent 67%),
    radial-gradient(60% 100% at 55% 100%, transparent 60%, var(--accent) 61%, var(--accent) 64%, transparent 65%),
    radial-gradient(60% 100% at 88% 100%, transparent 64%, var(--accent) 65%, var(--accent) 68%, transparent 69%);
}

/* Badge tipo/accesso come pill-chip; il badge "libera/pubblico" usa il corallo
   (unico posto dove il corallo è pieno — regola 60/30/10). */
.badge-tipo {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 0;
  padding: 0.16rem 0.65rem;
  font-size: 0.78rem;
}
.badge-tipo.t-spiaggia-libera,
.badge-accesso {
  background: var(--coral);
  color: #fff;
}
.badge-accesso {
  border-radius: 999px;
  padding: 0.16rem 0.65rem;
  font-size: 0.78rem;
  display: inline-block;
}

/* Card fotografiche: scrim per leggibilità dei badge sopra foto chiare
   (lezione AllTrails: icone/badge su foto senza scrim = invisibili). */
.card-photo .ph {
  aspect-ratio: 4 / 3;
}
.card-photo .card-body {
  position: relative;
}
.card-photo a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, 0.45));
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  border-radius: inherit;
}
.card-photo:hover a::before {
  opacity: 1;
}

/* Card senza foto (la maggioranza delle spiagge libere): riga pulita con
   marcatore-onda al posto del pallino generico. */
.card-lines li a::before {
  content: '〜';
  color: var(--accent);
  margin-right: 0.45rem;
  font-weight: 700;
}

/* Search-first: la barra di ricerca in hero è protagonista */
.hero .search-box input,
.search-box input {
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
}
.search-box input:focus {
  outline: 3px solid var(--accent-soft);
}

/* Bottone mappa sticky su mobile */
@media (max-width: 720px) {
  .map-toggle-sticky {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

/* Il theme-switcher (html[data-theme]) ha specificità maggiore delle regole
   @media: senza questi override il tema coastal perderebbe contro main.css. */
:root[data-theme='dark'] {
  --fg: #e9e4d8;
  --muted: #a49d8e;
  --bg: #101b1f;
  --bg-soft: #16242a;
  --surface: #1c2d34;
  --accent: #6fb5c4;
  --accent-strong: #8fcbd8;
  --accent-soft: #1d3a42;
}

:root[data-theme='light'] {
  --fg: #3a3733;
  --muted: #6f6a60;
  --bg: #fbf3e1;
  --bg-soft: #f5e9cf;
  --surface: #ffffff;
  --accent: #297685;
  --accent-strong: #1d5a66;
  --accent-soft: #dcebee;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --fg: #e9e4d8;
    --muted: #a49d8e;
    --bg: #101b1f;
    --bg-soft: #16242a;
    --surface: #1c2d34;
    --accent: #6fb5c4;
    --accent-strong: #8fcbd8;
    --accent-soft: #1d3a42;
  }
}

.btn-save[aria-pressed='true'] {
  color: var(--coral);
  border-color: var(--coral);
}

/* --- Homepage map-first (overlay layout del tema) ----------------------- */
/* Full-bleed: esce dal .container di baseof */
.coastal-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: min(64vh, 620px);
}
.coastal-map {
  position: absolute;
  inset: 0;
  background: var(--bg-soft);
  z-index: 0;
}
.coastal-overlay {
  position: absolute;
  z-index: 500; /* sopra i pane Leaflet (400) */
  top: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 560px);
  text-align: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 1.1rem 1.3rem 1rem;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}
.coastal-overlay h1 { margin: 0 0 0.2rem; font-size: clamp(1.4rem, 3.4vw, 2rem); }
.coastal-tag { color: var(--muted); margin: 0 0 0.7rem; font-size: 0.92rem; }
.coastal-stats { color: var(--muted); font-size: 0.85rem; margin: 0.6rem 0 0; }

/* Strip orizzontale di card fotografiche che "monta" sulla mappa */
.coastal-strip-wrap { margin-top: -3.2rem; position: relative; z-index: 600; }
.coastal-strip-title { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--muted); }
.coastal-strip {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding: 0.2rem 0.2rem 0.9rem;
  margin: 0;
  list-style: none;
  scroll-snap-type: x mandatory;
}
.coastal-strip .card-photo {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--surface);
}
.coastal-strip .ph { aspect-ratio: 4 / 3; }

/* Regioni come chip navigabili */
.region-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0.6rem 0 0; list-style: none; }
.region-chips .chip {
  display: inline-block;
  border: 1.5px solid var(--accent);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  text-decoration: none;
  font-size: 0.9rem;
  background: var(--surface);
}
.region-chips .chip:hover { background: var(--accent); color: #fff; }
.region-chips .chip-n { opacity: 0.65; font-size: 0.8rem; margin-left: 0.15rem; }

.coastal-regions, .coastal-all { margin-top: 2rem; }
.coastal-more { margin-top: 1rem; }

@media (max-width: 720px) {
  .coastal-hero { height: 70vh; }
  .coastal-overlay { top: 1rem; padding: 0.9rem 1rem 0.85rem; }
  .coastal-strip .card-photo { flex-basis: 200px; }
}
