/**
 * campus-spaces.css — Detailed per-service sections (#espacios-detalle)
 * ---------------------------------------------------------------------
 * Additive: nothing here overrides styles.css or campus.css.
 * All rules are scoped under #espacios-detalle.
 */

#espacios-detalle {
  --svc-gap: clamp(32px, 5vw, 72px);
  background: var(--white);
}

#espacios-detalle .svc-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* ═══════════════════════════════════════════
 * Shared media frame — poster <img> under <video>.
 * The video fades in only while .playing, so the
 * frozen first frame is what sits there at rest.
 * ═══════════════════════════════════════════ */
#espacios-detalle .svc-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--gray-light);
  box-shadow: var(--shadow-md);
}

#espacios-detalle .svc-media img,
#espacios-detalle .svc-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#espacios-detalle .svc-media video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

#espacios-detalle .svc-media.playing video { opacity: 1; }

/* Hover affordance. Sin prefijo: el marco del tour vive en #contacto. */
.svc-cue {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--white);
  background: rgba(13, 17, 23, 0.55);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.playing > .svc-cue { opacity: 0; }

/* Placeholder para espacios sin footage todavía. Ocupa el mismo
   marco que .svc-media / .svc-tour-frame. */
.svc-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 12px, transparent 12px 24px),
    var(--dark-card);
}

.svc-ph svg {
  width: 34px;
  height: 34px;
  stroke: var(--green);
  opacity: 0.7;
}

.svc-ph span {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.svc-media .svc-ph { border-radius: inherit; }

/* ═══════════════════════════════════════════
 * TEMPORAL — Andamio de iteración.
 * Oculta el bento de tarjetas y la sección de
 * "Vista 360 / Recorrido / Vista Aérea" para ver
 * la página nueva sin ruido. Se quita borrando
 * este bloque; el markup legacy sigue intacto.
 * ═══════════════════════════════════════════ */
#espacios,
#recorrido,
#beneficios,
#ubicacion,
#hero .hero-badge,
a[href="#recorrido"],
a[href="#beneficios"],
a[href="#ubicacion"] {
  display: none;
}

/* ═══════════════════════════════════════════
 * Ubicación al pie del formulario, dentro de la
 * misma columna, para no romper las dos columnas.
 * Reutiliza .campus-address / .campus-info-actions /
 * .btn-ubi, que no tienen reglas @media propias.
 * ═══════════════════════════════════════════ */
#contacto .contacto-lugar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#contacto .contacto-lugar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
}

#contacto .contacto-mapa {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
}

#contacto .contacto-mapa iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  filter: grayscale(0.3) brightness(0.85);
  transition: filter 0.3s ease;
}

#contacto .contacto-mapa iframe:hover { filter: none; }

/* ═══════════════════════════════════════════
 * 1. Hero — la fachada se reproduce una vez y
 * congela sobre la imagen, que hace de poster.
 * ═══════════════════════════════════════════ */
.campus-hero .hero-media .campus-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.campus-hero .hero-media.playing .campus-hero-video { opacity: 1; }

/* ═══════════════════════════════════════════
 * 2. Service row — media + copy, alternating
 * ═══════════════════════════════════════════ */
#espacios-detalle .svc {
  padding: clamp(32px, 4vw, 60px) 0;
}

#espacios-detalle .svc .svc-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--svc-gap);
  align-items: center;
}

#espacios-detalle .svc--rev .svc-inner > .svc-media { order: 2; }

#espacios-detalle .svc-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

#espacios-detalle .svc-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

#espacios-detalle .svc-title strong { color: var(--green); font-weight: 800; }

/* Anclas de servicio (selector de sucursal del home): dejan aire bajo el nav */
#espacios-detalle .svc-title[id] { scroll-margin-top: 96px; }

#espacios-detalle .svc-desc {
  margin-top: 18px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 46ch;
}

#espacios-detalle .svc-price {
  display: block;
  margin-top: 24px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

#espacios-detalle .svc-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  background: var(--green);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

#espacios-detalle .svc-cta:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
 * 3. Room selector (Salas de Juntas)
 * ═══════════════════════════════════════════ */
#espacios-detalle .svc-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

#espacios-detalle .svc-room {
  padding: 10px 18px;
  border: 1.5px solid var(--gray-light);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

#espacios-detalle .svc-room:hover { border-color: var(--green); color: var(--green); }

#espacios-detalle .svc-room.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* ═══════════════════════════════════════════
 * 4. Scroll-scrubbed sections
 * The track is tall; the sticky pane holds the
 * viewport while currentTime follows scroll.
 * ═══════════════════════════════════════════ */
#espacios-detalle .svc-scrub-track {
  position: relative;
  height: 260vh;
}

#espacios-detalle .svc-scrub-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--dark);
}

#espacios-detalle .svc-scrub-sticky img,
#espacios-detalle .svc-scrub-sticky video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#espacios-detalle .svc-scrub-sticky video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#espacios-detalle .svc-scrub.playing .svc-scrub-sticky video { opacity: 1; }

#espacios-detalle .svc-scrub-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, rgba(13, 17, 23, 0.78), rgba(13, 17, 23, 0.15) 60%);
}

#espacios-detalle .svc-scrub-copy .svc-title,
#espacios-detalle .svc-scrub-copy .svc-price { color: var(--white); }

#espacios-detalle .svc-scrub-copy .svc-desc { color: rgba(255, 255, 255, 0.75); }

#espacios-detalle .svc-scrub-copy .svc-inner { width: 100%; }

#espacios-detalle .svc-scrub-copy .svc-scrub-text { max-width: 46ch; }

/* ═══════════════════════════════════════════
 * 5. Tour frame — same footprint as the hero image (3:2, 20px radius).
 * Vive dentro de #contacto, bajo "Agenda tu tour gratuito".
 * Placeholder para el recorrido interactivo.
 * ═══════════════════════════════════════════ */
.svc-tour-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 36px 0 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  background: var(--dark);
}

.svc-tour-frame img,
.svc-tour-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.svc-tour-frame video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.svc-tour-frame.playing video { opacity: 1; }

/* ═══════════════════════════════════════════
 * Responsive
 * ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  #espacios-detalle .svc .svc-inner { grid-template-columns: 1fr; }
  #espacios-detalle .svc--rev .svc-inner > .svc-media { order: 0; }
  #espacios-detalle .svc-open { aspect-ratio: 4 / 3; }
  #espacios-detalle .svc-scrub-copy { background: linear-gradient(to top, rgba(13, 17, 23, 0.85), rgba(13, 17, 23, 0.2)); }
}


@media (prefers-reduced-motion: reduce) {
  #espacios-detalle .svc-scrub-track { height: auto; }
  #espacios-detalle .svc-scrub-sticky { position: static; height: auto; aspect-ratio: 16 / 9; }
  #espacios-detalle video { display: none; }
  .svc-cue { display: none; }
}
