/* =========================================================================
   Home v4 — la farmacia in 3D come sfondo, si cammina scorrendo.
   Telefono: il 3D sta nella metà alta dello schermo, le schede salgono
   dal basso. Da 960px: schede a sinistra, menu delle tappe a destra,
   il 3D nello spazio in mezzo.
   ========================================================================= */

.sv { position: relative; }

/* --- sfondo 3D fisso ------------------------------------------------------ */
.sv__bg {
  position: fixed; inset: 0; height: 100lvh; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(80% 60% at 60% 35%, #fffdf8 0%, rgba(255, 253, 248, 0) 70%),
    linear-gradient(180deg, #f4f1ea 0%, var(--bg) 45%, var(--surface) 100%);
}
.sv__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s var(--ease); }
.sv__bg.is-ready .sv__canvas { opacity: 1; }
.sv--no3d .sv__bg { background: linear-gradient(180deg, var(--bg), var(--surface)); }

.sv__pin {
  position: absolute; left: 0; top: 0; z-index: 1; margin-top: -8px;
  display: inline-flex; align-items: center; gap: .45rem; padding: 3px .8rem 3px 3px; border-radius: 999px;
  background: var(--accent); color: #fff; white-space: nowrap; font: 600 .8rem/1 var(--font-sans);
  box-shadow: 0 1px 2px rgba(43, 40, 37, .12), 0 6px 16px rgba(43, 40, 37, .18);
  transition: opacity .3s;
}
.sv__pin[hidden] { display: none; }
.sv__pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; translate: -50% 0; rotate: 45deg; border-radius: 2px; z-index: -1; }
.sv__pin-num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #fff; color: var(--accent); font: 600 .74rem/1 var(--font-label); }

/* --- schede ------------------------------------------------------------------ */
.sv__content { position: relative; z-index: 1; padding: 0 12px; }
.sv__sec { position: relative; }

.sv__card {
  position: relative; max-width: 560px;
  background: rgba(251, 248, 241, .93); border: 1px solid rgba(228, 215, 195, .9); border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 2px 6px rgba(43, 40, 37, .05), 0 18px 40px rgba(43, 40, 37, .1);
  padding: 1.6rem 1.4rem 1.7rem;
}
/* telefono: niente sfocatura dietro le schede (lo sfondo 3D si ridisegna mentre si scorre) */
@media (max-width: 959px) { .sv__card { background: rgba(251, 248, 241, .97); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-reduced-transparency: reduce) { .sv__card { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.sv__card .eyebrow { margin-bottom: .7rem; }

/* telefono: il 3D resta visibile nella metà alta */
.sv__sec--welcome { padding-top: 50svh; display: grid; gap: 38svh; padding-bottom: 30svh; }
.sv__sec--zone { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 52svh 0 6svh; }
.sv__sec--visit { min-height: 100svh; padding: 52svh 0 8svh; }

.sv__hero-title { font-family: var(--font-logo); font-weight: 500; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.05; color: var(--heading); margin: 0 0 .4rem; }
.sv__hero-title .script { font-family: var(--font-script); text-transform: none; color: var(--accent); font-weight: 400; letter-spacing: 0; }
.sv__claim { font: 400 clamp(1.15rem, 2.6vw, 1.45rem)/1.35 var(--font-serif); color: var(--heading); margin: 0 0 .8rem; }
.sv__title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; margin: 0 0 .7rem; }
.sv__lead { color: var(--muted); margin: 0 0 1.1rem; }
.sv__sub { font: 600 .68rem/1.4 var(--font-label); letter-spacing: .2em; text-transform: uppercase; color: var(--brown); margin: 1.4rem 0 .7rem; }
.sv__note { font-size: .9rem; color: var(--muted); margin: .4rem 0 1rem; }
.sv__facts { list-style: none; margin: 0 0 1.3rem; padding: 0; display: grid; gap: .45rem; }
.sv__facts li { display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.sv__facts svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.sv__facts .status-dot { margin: 0 3px; }
.sv__facts a { color: var(--heading); }

.sv__scroll { display: flex; align-items: center; gap: .7rem; margin: 1.5rem 0 0; font: 600 .66rem/1.4 var(--font-label); letter-spacing: .2em; text-transform: uppercase; color: var(--brown); }
.sv__scroll span { position: relative; width: 22px; height: 34px; border: 2px solid var(--brown-line); border-radius: 12px; flex: none; }
.sv__scroll span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; border-radius: 2px; background: var(--accent); translate: -50% 0; animation: sv-wheel 1.8s var(--ease) infinite; }
@keyframes sv-wheel { 60% { translate: -50% 10px; opacity: 0; } 61% { translate: -50% 0; opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sv__scroll span::after { animation: none; } .sv__canvas { transition: none; } }

.sv__timeline { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 1.3rem; }
.sv__timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start; }
.sv__timeline h3 { font-size: 1.1rem; line-height: 1.3; margin: .1rem 0 .3rem; }
.sv__timeline p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.6; }
.sv__tl-year { font: 600 .7rem/1.4 var(--font-label) !important; letter-spacing: .22em; color: var(--accent) !important; text-transform: uppercase; }
.sv__tl-photo { margin: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.sv__tl-photo img { width: 100%; height: 100%; object-fit: cover; }
.sv__tl-photo.is-vintage img { filter: sepia(.35) saturate(.85); }

.sv__team { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.sv__team li { display: grid; justify-items: start; gap: .2rem; padding: .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sv__team small { color: var(--muted); }
.sv__avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: .3rem; }
.sv__avatar svg { width: 20px; height: 20px; }
.sv__hint { display: flex; gap: .5rem; align-items: center; margin: 1.3rem 0 0; font-size: .9rem; color: var(--accent-strong); font-weight: 600; }
.sv__hint svg { width: 18px; height: 18px; rotate: 90deg; flex: none; }

.sv__svc { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .55rem; }
.sv__svc li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .7rem .7rem .7rem .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sv__svc-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.sv__svc-ico svg { width: 20px; height: 20px; }
.sv__svc strong { display: block; font-weight: 600; line-height: 1.3; }
.sv__svc small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.sv__hours { margin: 0; }

/* --- tappe (telefono: chip in alto, sotto l'header) ------------------------- */
.sv__rail {
  position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; margin: 8px 12px 0; height: 0; overflow: visible;
}
.sv__rail-list {
  list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: rgba(251, 248, 241, .9); border: 1px solid rgba(228, 215, 195, .9); border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(43, 40, 37, .1);
}
.sv__rail-list::-webkit-scrollbar { display: none; }
.sv__rail-list a {
  display: flex; align-items: center; gap: .5rem; min-height: 40px; padding: 3px .85rem 3px 3px; border-radius: 999px;
  color: var(--text); text-decoration: none; white-space: nowrap; font: 500 .82rem/1.2 var(--font-sans);
}
.sv__rail-num { display: inline-grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--brown-line); color: var(--brown); font: 600 .7rem/1 var(--font-label); }
.sv__rail-num svg { width: 13px; height: 13px; }
.sv__rail-list a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.sv__rail-list a[aria-current] { background: var(--accent); color: #fff; }
.sv__rail-list a[aria-current] .sv__rail-num { background: #fff; border-color: #fff; color: var(--accent); }

/* il footer copre lo sfondo */
.sv ~ .site-footer { position: relative; z-index: 2; }

/* --- da 960px ------------------------------------------------------------------ */
@media (min-width: 960px) {
  .sv__content { padding: 0 0 0 max(24px, calc((100vw - 1400px) / 2 + 24px)); }
  .sv__card { width: min(480px, 40vw); padding: 2.1rem 2rem 2rem; }
  .sv__sec--welcome { padding-top: 14vh; gap: 70vh; padding-bottom: 40vh; }
  .sv__sec--welcome .sv__card--hero { min-height: 0; }
  .sv__sec--zone, .sv__sec--visit { min-height: 125vh; justify-content: center; display: flex; flex-direction: column; padding: 15vh 0; }

  .sv__rail { position: fixed; top: calc(var(--header-h) + 24px); right: 24px; margin: 0; height: auto; }
  .sv__rail-list { flex-direction: column; border-radius: var(--radius); padding: .6rem .5rem; overflow: visible; gap: 1px; }
  .sv__rail-list a { min-height: 36px; padding: 3px .6rem 3px 3px; border-radius: 12px; }
  .sv__rail-label { max-width: 0; overflow: hidden; opacity: 0; transition: max-width .3s var(--ease), opacity .2s; }
  .sv__rail:hover .sv__rail-label, .sv__rail:focus-within .sv__rail-label { max-width: 220px; opacity: 1; }
}
