/* ---------- Dove siamo ----------
   Same system as Chi siamo / Contatti: dark panels, thin lines, the violet -> cyan gradient only as accent. */
.sede {
  position: relative;
  padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(72px, 12vh, 140px);
  background: var(--bg);
}
.sede:focus { outline: none; }
.sede .works__title { max-width: 13ch; }

.sede__intro { margin-top: clamp(28px, 4vw, 44px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line); }
.sede__intro p {
  margin: 0; max-width: 56ch;
  font-size: clamp(1.08rem, 1.45vw, 1.35rem); line-height: 1.55; color: rgba(236, 235, 245, .82);
}

.sede__grid {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(20px, 2.6vw, 40px); align-items: start;
}

/* ---------- Gallery: one large photo, two smaller side by side ---------- */
.sede__gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px);
}
.shot--main { grid-column: 1 / -1; }
.shot figure { margin: 0; }
.shot__zoom {
  position: relative; display: block; width: 100%; padding: 0; cursor: zoom-in;
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: 24px;
  border: 1px solid var(--line); background: #13131b;
  transition: border-color .5s var(--ease-out);
}
.shot--main .shot__zoom { aspect-ratio: 16 / 9; border-radius: 28px; }
.shot__zoom picture, .shot__zoom img { display: block; width: 100%; height: 100%; }
.shot__zoom img { object-fit: cover; transform: scale(1.001); transition: transform 1.2s var(--ease-out); }
/* soft vignette so the photos sit in the dark page instead of glowing out of it */
.shot__zoom::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 10, 15, .35));
  transition: opacity .6s var(--ease-out);
}
.shot__zoom:hover, .shot__zoom:focus-visible { border-color: rgba(34, 211, 238, .45); }
.shot__zoom:hover img, .shot__zoom:focus-visible img { transform: scale(1.04); }
.shot__zoom:hover::after { opacity: .4; }
.shot__zoom:focus-visible { outline-offset: 4px; }
.shot figcaption {
  margin-top: 12px; padding-left: 2px;
  font-size: .95rem; line-height: 1.45; color: var(--ink-dim);
}

/* ---------- Visit card ---------- */
.visit {
  position: sticky; top: calc(var(--header-h) + 24px);
  padding: clamp(24px, 2.6vw, 36px); border-radius: 28px;
  border: 1px solid var(--line);
  background: radial-gradient(90% 70% at 100% 0%, rgba(124, 58, 237, .14), transparent 65%), linear-gradient(160deg, #13131b 0%, #0c0c12 100%);
}
.visit__title { margin: 0 0 6px; font: 500 clamp(1.4rem, 1.9vw, 1.8rem)/1.1 var(--display); letter-spacing: -0.02em; }
.visit__label { margin: 26px 0 10px; font: 500 12px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); }
.visit__address { font: 500 clamp(1.15rem, 1.5vw, 1.35rem)/1.4 var(--display); font-style: normal; letter-spacing: -0.005em; }
.visit__badge {
  display: inline-flex; align-items: center; gap: 10px; margin: 18px 0 0;
  padding: 8px 14px; border-radius: 999px;
  font: 500 13.5px/1.2 var(--sans); color: var(--ink);
  border: 1px solid rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .06);
}
.visit__badge span { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--cyan); box-shadow: 0 0 10px rgba(34, 211, 238, .8); }
.visit__phones { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.visit__phones a {
  display: inline-block; padding: 6px 0;
  font: 500 clamp(1.15rem, 1.5vw, 1.35rem)/1.2 var(--display); font-variant-numeric: tabular-nums; text-decoration: none;
  background: linear-gradient(90deg, var(--violet), var(--cyan)) 0 100% / 0 1px no-repeat;
  transition: background-size .6s var(--ease-out);
}
.visit__phones a:hover { background-size: 100% 1px; }
.visit__ctas { margin-top: 30px; display: flex; flex-direction: column; gap: 10px; }
.visit__ctas .btn { width: 100%; }
.visit__dir { gap: 8px; }
.visit__dir svg { flex: none; transition: transform .4s var(--ease-out); }
.visit__dir:hover svg { transform: translate(2px, -2px); }

/* ---------- Map: stylised placeholder, Google iframe only after a click ---------- */
.map {
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: clamp(20px, 2.6vw, 40px);
  aspect-ratio: 21 / 7; min-height: 300px; border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #13131b 0%, #0c0c12 100%);
}
.map__art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.map__pin {
  position: absolute; left: 50%; top: 71.4%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 0 4px rgba(10, 10, 15, .9), 0 0 28px rgba(124, 58, 237, .9);
}
.map__pin i {
  position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(34, 211, 238, .6);
  animation: map-ping 2.6s var(--ease-out) infinite;
}
@keyframes map-ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

.map__panel {
  position: absolute; left: clamp(16px, 2.4vw, 32px); top: clamp(16px, 2.4vw, 32px);
  max-width: 340px; padding: 20px 22px; border-radius: 20px;
  background: rgba(10, 10, 15, .72); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.map__place { margin: 0 0 14px; font: 500 1.1rem/1.2 var(--display); letter-spacing: -0.01em; }
.map__load { min-height: 46px; padding: 0 22px; cursor: pointer; font-size: 14.5px; }
.map__note { margin: 12px 0 0; font-size: .85rem; line-height: 1.5; color: var(--ink-dim); }
.map__note a { color: inherit; text-underline-offset: 3px; }

.map iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  /* dark map that matches the page: invert + rotate hues back, then calm it down */
  filter: invert(.92) hue-rotate(180deg) saturate(.7) brightness(.95);
  opacity: 0; transition: opacity .8s var(--ease-out);
}
.map.is-loaded iframe.is-ready { opacity: 1; }
.map.is-loaded .map__panel, .map.is-loaded .map__pin { display: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: calc(var(--header-h) + 8px) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  border: 0; background: transparent; color: var(--ink);
  overflow: hidden; overscroll-behavior: contain;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(6, 6, 10, .9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox__figure { margin: 0; display: grid; justify-items: center; gap: 14px; max-width: 100%; max-height: 100%; min-height: 0; }
.lightbox__figure picture { display: contents; }
.lightbox__figure img {
  display: block; max-width: 100%; max-height: calc(100dvh - var(--header-h) - 110px); width: auto; height: auto;
  border-radius: 20px; border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 60px -30px rgba(124, 58, 237, .5);
}
.lightbox__figure figcaption { font-size: .98rem; color: var(--ink-dim); text-align: center; }
.lightbox__close {
  position: fixed; right: var(--gutter); top: calc(14px + env(safe-area-inset-top));
  height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 14px/1 var(--sans); color: var(--ink);
  background: rgba(10, 10, 15, .5); border: 1px solid var(--line);
  transition: border-color .3s;
}
.lightbox__close:hover { border-color: rgba(236, 235, 245, .35); }
.lightbox__close svg { flex: none; }
.lightbox[open] .lightbox__figure { animation: lb-in .6s var(--ease-out); }
@keyframes lb-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sede__grid { grid-template-columns: minmax(0, 1fr); }
  .visit { position: static; }
  .visit__ctas { flex-direction: row; flex-wrap: wrap; }
  .visit__ctas .btn { width: auto; }
  .map { aspect-ratio: 16 / 8; }
}
@media (max-width: 600px) {
  .sede .works__title { font-size: clamp(2.5rem, 12vw, 3.2rem); }
  .sede__gallery { grid-template-columns: minmax(0, 1fr); }
  .shot__zoom, .shot--main .shot__zoom { border-radius: 20px; }
  .visit { padding: 22px; border-radius: 22px; }
  .visit__ctas { flex-direction: column; }
  .visit__ctas .btn { width: 100%; }
  .map { aspect-ratio: auto; height: 440px; border-radius: 22px; }
  .map__panel { left: 12px; right: 12px; top: 12px; max-width: none; }
  .map__load { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .map__pin i, .lightbox[open] .lightbox__figure { animation: none; }
  .shot__zoom img, .map iframe { transition: none; }
}
.reduced .map__pin i, .reduced .lightbox[open] .lightbox__figure { animation: none; }
