/* Recorrido virtual en 3D (recorrido.aspx, WEB-005). */
:root { --noche: #071226; --vidrio: rgba(9, 20, 44, .93); --borde: rgba(255, 255, 255, .18); --oro: #F6D77A; --suave: rgba(255, 255, 255, .78); }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--noche); color: #fff; font-family: "Instrument Sans", system-ui, sans-serif; }
html.en-ruta { scroll-snap-type: y mandatory; scrollbar-width: none; }
html.en-ruta::-webkit-scrollbar { display: none; }
html:not(.en-ruta), html:not(.en-ruta) body { height: 100%; overflow: hidden; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.paso { height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }
[hidden] { display: none !important; }
#marca { position: fixed; z-index: 5; top: 20px; left: clamp(18px, 4vw, 48px); font-weight: 700; letter-spacing: 2px; font-size: 13px; color: var(--oro); text-decoration: none; }
#salir { position: fixed; z-index: 6; top: 12px; right: clamp(14px, 3vw, 40px); min-height: 40px; padding: 0 16px; border: 1px solid var(--borde); border-radius: 999px; background: var(--vidrio); color: #fff; font-weight: 600; }
#inicio { position: fixed; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; background: radial-gradient(ellipse at center, rgba(7, 14, 34, .72) 0, rgba(7, 14, 34, .3) 58%, transparent 82%); transition: opacity .6s; }
#inicio.fuera { opacity: 0; pointer-events: none; }
#inicio > div { width: min(640px, 100%); }
h1 { margin: 0 0 22px; font-family: Fraunces, Georgia, serif; font-size: clamp(38px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -1px; text-shadow: 0 3px 30px rgba(0, 0, 0, .6); }
#caja { position: relative; text-align: left; }
#buscar { width: 100%; height: 60px; padding: 0 24px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 999px; background: rgba(7, 18, 38, .84); color: #fff; font-size: 19px; }
#buscar::placeholder { color: var(--suave); }
#opciones { position: absolute; z-index: 2; left: 0; right: 0; top: 68px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; border: 1px solid var(--borde); border-radius: 18px; background: rgba(7, 18, 38, .97); }
#opciones button { width: 100%; padding: 12px 16px; border: 0; border-radius: 12px; background: none; color: #fff; text-align: left; }
#opciones button:hover, #opciones button:focus-visible { background: var(--oro); color: var(--noche); }
#inicioAcciones { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 22px; margin-top: 14px; }
#mirar, #inicioAcciones a { padding: 10px 6px; border: 0; background: none; color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 5px; text-shadow: 0 1px 10px #000; }
.sin-js { position: fixed; z-index: 30; inset: auto 16px 16px; padding: 14px; border-radius: 12px; background: var(--oro); color: var(--noche); text-align: center; }
#ficha { position: fixed; z-index: 3; left: clamp(16px, 4vw, 48px); top: 50%; width: min(400px, calc(100% - 32px)); border: 1px solid var(--borde); border-radius: 22px; overflow: hidden; background: var(--vidrio); opacity: 0; pointer-events: none; transform: translateY(-46%) scale(.96); transition: opacity .35s, transform .35s; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
#ficha.ver { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
#foto { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #12274D; }
#fichaTexto { padding: 18px 20px 20px; }
#num { margin: 0 0 6px; color: var(--oro); font-size: 13px; font-weight: 700; }
#ficha h2 { margin: 0 0 8px; font-family: Fraunces, Georgia, serif; font-size: 27px; line-height: 1.08; }
#desc { margin: 0 0 14px; color: var(--suave); font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.oro { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--oro); color: var(--noche); font-weight: 700; text-decoration: none; }
.oro:hover { background: #fff; }
#pista { position: fixed; z-index: 3; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 9px 18px; border-radius: 999px; background: var(--vidrio); font-size: 14px; font-weight: 600; pointer-events: none; animation: flota 1.8s ease-in-out infinite; white-space: nowrap; }
@keyframes flota { 50% { transform: translate(-50%, 6px); } }
#fin { position: fixed; z-index: 3; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .5s; }
#fin.ver { opacity: 1; }
#fin > div { width: min(540px, 100%); padding: 30px 26px; border: 1px solid var(--borde); border-radius: 24px; background: var(--vidrio); }
#fin.ver > div { pointer-events: auto; }
#sede { position: fixed; z-index: 8; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; background: rgba(7, 18, 38, .55); }
#sede > div { width: min(540px, 100%); padding: 30px 26px; border: 1px solid var(--borde); border-radius: 24px; background: var(--vidrio); }
#sede h2 { margin: 0 0 10px; font-family: Fraunces, Georgia, serif; font-size: clamp(28px, 4vw, 38px); line-height: 1.06; }
#sede p { margin: 0 0 20px; color: var(--suave); line-height: 1.4; }
#sedeAcciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
a.sec { display: inline-flex; align-items: center; text-decoration: none; }
#fin h2 { margin: 0 0 10px; font-family: Fraunces, Georgia, serif; font-size: clamp(30px, 4vw, 42px); line-height: 1.05; }
#fin p { margin: 0 0 20px; color: var(--suave); }
#finAcciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#finAcciones .sec { display: inline-flex; align-items: center; text-decoration: none; }
.sec { min-height: 46px; padding: 0 22px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; background: none; color: #fff; font-weight: 700; }
#visor { position: fixed; z-index: 10; inset: 0; display: flex; flex-direction: column; background: #000; }
#visor iframe { flex: 1; width: 100%; min-height: 0; border: 0; }
#cerrarVisor { flex-shrink: 0; min-height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--oro); color: var(--noche); font-weight: 700; }
#aviso { position: fixed; z-index: 7; left: 50%; top: 66px; width: min(520px, calc(100% - 28px)); transform: translateX(-50%); padding: 12px 16px; border-radius: 14px; background: var(--oro); color: var(--noche); font-weight: 600; font-size: 14.5px; text-align: center; }
#sin3d { position: fixed; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--noche); text-align: center; }
html.explorando canvas { cursor: grab; touch-action: none; }
html.explorando canvas:active { cursor: grabbing; }
#inicioAcciones .oro { min-height: 44px; padding: 0 22px; color: var(--noche); text-decoration: none; text-shadow: none; }
#pines { position: fixed; z-index: 2; inset: 0; overflow: hidden; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 0; background: none; color: #fff; pointer-events: auto; cursor: pointer; will-change: transform; }
.pin::before { content: ""; position: absolute; left: 9px; top: 9px; width: 12px; height: 12px; border: 2px solid var(--noche); border-radius: 50%; background: var(--oro); box-shadow: 0 1px 5px rgba(0, 0, 0, .6); transition: transform .15s; }
.pin:hover::before, .pin:focus-visible::before { transform: scale(1.45); background: #fff; }
.pin.activo { z-index: 3; }
.pin.activo::before { transform: scale(1.7); background: #fff; }
.pin span { position: absolute; left: 50%; bottom: 30px; display: none; max-width: 240px; padding: 6px 10px; border-radius: 8px; background: var(--vidrio); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: translateX(-50%); pointer-events: none; }
.pin:hover, .pin:focus-visible { z-index: 4; }
.pin:hover span, .pin:focus-visible span, .pin.rotulo span { display: block; }
#filtrosExp { position: fixed; z-index: 4; left: 50%; top: 12px; display: flex; gap: 6px; max-width: calc(100% - 380px); overflow-x: auto; scrollbar-width: none; transform: translateX(-50%); }
#filtrosExp::-webkit-scrollbar { display: none; }
#filtrosExp button { flex-shrink: 0; min-height: 40px; padding: 0 14px; border: 1px solid var(--borde); border-radius: 999px; background: var(--vidrio); color: #fff; font-size: 13.5px; font-weight: 600; }
#filtrosExp small { margin-left: 3px; opacity: .75; }
#filtrosExp button[aria-pressed="true"] { background: var(--oro); border-color: var(--oro); color: var(--noche); }
#mandos { position: fixed; z-index: 4; right: clamp(14px, 3vw, 40px); bottom: 24px; display: flex; flex-direction: column; gap: 6px; }
#mandos button { width: 44px; height: 44px; padding: 0; border: 1px solid var(--borde); border-radius: 50%; background: var(--vidrio); color: #fff; font-size: 20px; line-height: 1; }
#mandos button:hover, #mandos button:focus-visible { background: var(--oro); color: var(--noche); }
#cerrarFicha { position: absolute; z-index: 2; top: 8px; right: 8px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(9, 20, 44, .86); color: #fff; font-size: 20px; line-height: 1; }
#cerrarFicha:hover, #cerrarFicha:focus-visible { background: var(--oro); color: var(--noche); }
@media (max-width: 760px) {
	#filtrosExp { left: 10px; right: 10px; top: 58px; max-width: none; transform: none; }
	html.con-ficha #mandos { display: none; }
	#mandos { bottom: 16px; }
	#ficha { left: 10px; right: 10px; top: auto; bottom: 60px; width: auto; transform: translateY(12px); display: grid; grid-template-columns: 112px 1fr; }
	#ficha.ver { transform: none; }
	#foto { height: 100%; min-height: 132px; aspect-ratio: auto; }
	#ficha.sin-foto { grid-template-columns: 1fr; }
	#fichaTexto { padding: 12px 14px; }
	#ficha h2 { font-size: 20px; margin-bottom: 4px; }
	#desc { font-size: 13.5px; margin-bottom: 8px; -webkit-line-clamp: 2; }
	.oro#entrar { min-height: 40px; padding: 0 20px; }
	#pista { bottom: 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { #pista { animation: none; } }

/* Celular en horizontal: la ficha va compacta para que Entrar siempre quede a la vista. */
@media (max-height: 520px) and (orientation: landscape) {
	#ficha { left: 10px; right: auto; top: auto; bottom: 10px; display: grid; grid-template-columns: 130px 1fr; width: min(470px, calc(100% - 84px)); max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; transform: translateY(12px); }
	#ficha.ver { transform: none; }
	#ficha.sin-foto { grid-template-columns: 1fr; }
	#foto { height: 100%; min-height: 118px; aspect-ratio: auto; }
	#fichaTexto { padding: 10px 14px; }
	#num { margin-bottom: 2px; font-size: 12px; }
	#ficha h2 { margin-bottom: 3px; font-size: 19px; }
	#desc { margin-bottom: 7px; font-size: 13px; -webkit-line-clamp: 2; }
	.oro#entrar { min-height: 38px; padding: 0 20px; }
	#cerrarFicha { width: 32px; height: 32px; }
	#pista { left: auto; right: 14px; bottom: 12px; transform: none; animation: none; }
	#mandos { bottom: 10px; flex-direction: row; }
	#fin > div, #sede > div { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; padding: 14px 20px; }
	#fin h2, #sede h2 { margin-bottom: 6px; font-size: 26px; }
	#fin p, #sede p { margin-bottom: 10px; }
	#finAcciones .oro, #finAcciones .sec, #sedeAcciones .oro, #sedeAcciones .sec { min-height: 40px; }
}

/* Enlaces de la tarjeta de /campus, en la ficha y debajo del visor */
#fichaEnlaces { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
#fichaEnlaces a, #visorBarra a { color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
#fichaEnlaces a { padding: 3px 0; }
#visorBarra { display: flex; flex-shrink: 0; align-items: center; gap: 8px 16px; min-height: 62px; padding: 9px 14px; background: var(--noche); color: #fff; }
#visorNombre { flex: 1; min-width: 0; overflow: hidden; font-family: Fraunces, Georgia, serif; font-size: 18px; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 760px) {
	#fichaEnlaces { gap: 2px 12px; margin-top: 6px; }
	#fichaEnlaces a { font-size: 12.5px; }
	#visorBarra { flex-wrap: wrap; }
	#visorNombre { flex-basis: calc(100% - 120px); font-size: 16px; }
}
@media (max-height: 520px) and (orientation: landscape) {
	#fichaEnlaces { margin-top: 4px; }
	#fichaEnlaces a { padding: 1px 0; font-size: 12px; }
	#visorBarra { flex-wrap: nowrap; min-height: 48px; padding: 4px 10px; }
	#visorNombre { flex-basis: 0; }
	#cerrarVisor { min-height: 38px; }
}
