/* =====================================================================
   Facility Scene — #instalaciones as a full-viewport (100vh) photo of the
   real pool with interactive spec hotspots. The photo is the backdrop;
   numbered pins reveal each technical fact on hover/focus — the reveal is
   CSS-only, so it works with zero JS (tap focuses the button → card shows).
   Mirrors the full-viewport pattern of hero-photo.css.
   Layer stack (back → front): photo(0) · scrim(1) · intro copy(2) · pins(3)
   ===================================================================== */

/* ---- Section shell: full viewport ---- */
.facility {
  position: relative;
  min-height: 150vh;
  min-height: 150svh;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #0a1830; /* abyss fallback while the photo loads */
}

/* ---- Backdrop photo (100vw × 100vh, cover) ---- */
.facility__photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ---- Legibility scrim: navy, stronger top-left behind the copy ---- */
.facility__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      118deg,
      rgba(7, 18, 36, 0.8) 0%,
      rgba(7, 18, 36, 0.46) 32%,
      rgba(7, 18, 36, 0.12) 58%,
      transparent 76%
    ),
    linear-gradient(
      to bottom,
      rgba(7, 18, 36, 0.34) 0%,
      transparent 26%,
      transparent 62%,
      rgba(7, 18, 36, 0.46) 100%
    );
}

/* ---- Content wrapper (centered container, copy pinned left) ---- */
.facility__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  min-height: 112vh;
  min-height: 112svh;
  padding: 120px var(--gutter) 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Intro copy (white over scrim) ---- */
.facility__intro {
  max-width: 560px;
  color: #fff;
}
.facility__eyebrow {
  color: #8fe0e6; /* light cyan, like the hero eyebrow (not the cyan-deep token) */
}
.facility__title {
  color: #fff;
  margin: 14px 0 16px;
}
.facility__lead {
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(15px, 1.3vw, 17.5px);
  line-height: 1.6;
  max-width: 46ch;
  margin-bottom: 22px;
}

/* amenity chips — translucent white over the photo */
.facility__amen {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.facility__amen .pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.facility__amen .pill svg {
  color: #8fe0e6;
  margin-right: 2px;
}

/* ---- Hotspots layer (over the photo) ---- */
.facility__pins {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none; /* only the pins/cards catch the pointer */
}

/* each hotspot is a 0×0 anchor point at (--x,--y) */
.hot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
}

/* the pin button */
.hot__pin {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--action-cornflower);
  color: #fff;
  font-family: var(--display-font), "Fraunces", serif;
  font-variation-settings: "wght" 600, "opsz" 40;
  font-size: 16px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(4, 14, 30, 0.45);
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s,
    color 0.25s;
}
.hot__pin:hover,
.hot:focus-within .hot__pin {
  transform: translate(-50%, -50%) scale(1.14);
  background: var(--accent-mustard);
  color: var(--ink-navy);
}
.hot__pin:focus-visible {
  outline: 3px solid #8fe0e6;
  outline-offset: 3px;
}

/* pulsing ring — the animated centerpiece (off when reduced-motion) */
.hot__pin::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hot__pin::after {
    animation: hotPulse 2.6s ease-out infinite;
  }
}
@keyframes hotPulse {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  70%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* the spec card (glass navy) — hidden until hover/focus */
.hot__card {
  position: absolute;
  left: 0;
  bottom: 28px; /* above the pin point */
  transform: translate(-50%, 8px);
  width: max-content;
  max-width: 270px;
  padding: 15px 17px;
  border-radius: 16px;
  background: rgba(13, 36, 64, 0.84);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 44px rgba(4, 14, 30, 0.5);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.hot:hover .hot__card,
.hot:focus-within .hot__card {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.hot__card h3 {
  margin: 0 0 6px;
  font-family: var(--display-font), "Fraunces", serif;
  font-variation-settings: "wght" 600, "opsz" 40;
  font-size: 18px;
  color: #fff;
}
.hot__card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}
/* pointer triangle under the card, aimed at the pin */
.hot__card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(13, 36, 64, 0.84);
}

/* right-edge pins (--cl): card opens up-left so it never overflows */
.hot--cl .hot__card {
  left: auto;
  right: -16px;
  transform: translate(0, 8px);
}
.hot--cl:hover .hot__card,
.hot--cl:focus-within .hot__card {
  transform: translate(0, 0);
}
.hot--cl .hot__card::after {
  left: auto;
  right: 28px;
  transform: none;
}

/* ---- Responsive: ≤980px → photo as backdrop, specs as a stacked list ---- */
@media (max-width: 980px) {
  .facility {
    min-height: auto;
  }
  .facility__inner {
    min-height: auto;
    padding-top: 104px;
    padding-bottom: 28px;
  }
  /* pins layer flows in as a normal stacked list under the intro */
  .facility__pins {
    position: static;
    z-index: 2;
    pointer-events: auto;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter) 56px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .hot {
    position: static;
    width: auto;
    height: auto;
    display: flex;
    align-items: flex-start;
    gap: 13px;
  }
  .hot__pin {
    position: static;
    transform: none;
    flex: none;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  .hot__pin:hover,
  .hot:focus-within .hot__pin {
    transform: none;
  }
  .hot__pin::after {
    display: none; /* no pulse in the list */
  }
  .hot__card,
  .hot--cl .hot__card {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: auto;
    max-width: none;
    flex: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .hot__card::after {
    display: none; /* no triangle in the list */
  }
}
