/* Mecánica compartida de los tres prototipos. La estética va en cada HTML. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { display: inline-block; flex: none; }

/* fotos que rotan con el mouse */
.scrub-marco { position: relative; overflow: hidden; }
.scrub-fotos { position: absolute; inset: 0; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.scrub-fotos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.scrub-fotos img.activa { opacity: 1; }
.scrub-barras { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; gap: 4px; z-index: 2; }
.scrub-barras i { flex: 1; height: 2px; background: rgba(255, 255, 255, .4); transition: background .2s; }
.scrub-barras i.activa { background: #fff; }

/* galería deslizable */
.c-pista { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; outline-offset: 4px; }
.c-pista::-webkit-scrollbar { display: none; }
.c-pista > * { flex: none; scroll-snap-align: start; }
.c-pista.arrastrando { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.c-pista img { user-select: none; -webkit-user-drag: none; }
[data-zoom] { cursor: zoom-in; }
.c-pista.arrastrando [data-zoom] { cursor: grabbing; }
.c-avance { height: 1px; background: currentColor; transform-origin: left; transform: scaleX(.05); transition: transform .2s; }

/* imagen flotante */
.flota { position: fixed; left: 0; top: 0; width: 280px; aspect-ratio: 4 / 5; pointer-events: none; z-index: 60; opacity: 0;
  overflow: hidden; transition: opacity .25s; will-change: transform; }
.flota.visible { opacity: 1; }
.flota img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.flota img.activa { opacity: 1; }

/* visor a pantalla completa */
.visor { position: fixed; inset: 0; z-index: 2000; background: rgba(8, 9, 12, .94); display: none; align-items: center; justify-content: center; color: #fff; }
.visor.abierto { display: flex; }
.visor figure { margin: 0; text-align: center; }
.visor img { max-width: 86vw; max-height: 80vh; object-fit: contain; margin: 0 auto; }
.visor figcaption { margin-top: 14px; font-size: 13px; letter-spacing: .04em; opacity: .8; white-space: pre; }
.visor button { position: absolute; background: none; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; width: 52px; height: 52px; display: grid; place-items: center; }
.visor button:hover, .visor button:focus-visible { border-color: #fff; }
.visor-x { top: 22px; right: 22px; }
.visor-a { left: 22px; top: 50%; translate: 0 -50%; }
.visor-s { right: 22px; top: 50%; translate: 0 -50%; }

/* mapa de zona */
.mz-caja { position: relative; overflow: hidden; }
.mz-lienzo { position: absolute; inset: 0; }
.mz-tapa { position: absolute; inset: 0; z-index: 800; display: grid; place-items: center; background: transparent; border: 0; }
.mz-tapa span { padding: 12px 22px; font-size: 13px; letter-spacing: .03em; }
.mz-sin { display: grid; place-items: center; height: 100%; margin: 0; padding: 20px; text-align: center; }
.mz-proyecto { width: 0 !important; height: 0 !important; }
.mz-proyecto span { position: absolute; left: 0; bottom: 8px; transform: translateX(-50%); white-space: nowrap; padding: 7px 12px; font-size: 12px; }
.mz-proyecto span::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg); background: inherit; }
.mz-poi { display: grid !important; place-items: center; border-radius: 50%; }
.mz-poi .ico { width: 17px; height: 17px; }
.leaflet-popup-content { font-size: 13px; }

/* mapa de Mapbox con Leaflet (al abrir el archivo con doble clic) */
.mb-l { background: none; border: 0; }
.mz-caja, .mb-caja { isolation: isolate; }
.mz-caja .mz-tapa { z-index: 1001; }
/* las teselas grises de Mapbox llevadas a los azules de CYR */
.mb-teselas { filter: sepia(.3) hue-rotate(178deg) saturate(1.5) brightness(1.03); }
.mb-ancla > * { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); }
.mb-l .mb-pin { display: block; position: relative; }
.leaflet-popup-content-wrapper { padding: 0; border-radius: 12px; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: auto !important; }
.leaflet-container a.mb-pop { color: inherit; }

/* mapa de RD */
.rd { width: 100%; height: auto; display: block; overflow: hidden; }
.rd-pin { cursor: pointer; outline: none; }
.rd-halo { transform-box: fill-box; transform-origin: center; transition: transform .3s, opacity .3s; }
.rd-pin .rd-halo { opacity: 0; transform: scale(.6); }
.rd-pin.activo .rd-halo, .rd-pin:focus-visible .rd-halo { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}
