/* portal.css */
/* Página «El portal»: escena 3D en el encabezado, carrusel coverflow, un día en tres momentos y cierre.
   Curva única: --ease-out. Entradas de marketing 500-800 ms; salidas bajo 300 ms. Sin ease-in. */
.po-hero { padding-bottom: clamp(1rem, 3vw, 2rem) !important; }

/* ---------- Ventana con marco (escena, carrusel y modal) ---------- */
.po-win { display: block; position: relative; overflow: hidden; border-radius: 14px; background: var(--c-claro);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 0 0 5px rgba(30, 42, 58, .05), 0 28px 50px -26px rgba(30, 42, 58, .55); }
.po-win::before { content: ""; display: block; height: 2.1rem; border-bottom: 1px solid rgba(30, 42, 58, .1);
  background:
    radial-gradient(circle at 1.15rem 50%, rgba(30, 42, 58, .22) 0 .27rem, transparent calc(.27rem + 1px)),
    radial-gradient(circle at 1.9rem 50%, rgba(30, 42, 58, .22) 0 .27rem, transparent calc(.27rem + 1px)),
    radial-gradient(circle at 2.65rem 50%, rgba(30, 42, 58, .22) 0 .27rem, transparent calc(.27rem + 1px)),
    linear-gradient(180deg, #fff, color-mix(in srgb, var(--c-arena) 45%, var(--c-claro))); }
.po-win img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; max-width: none;
  border-radius: 0 !important; box-shadow: none !important; outline: 0 !important; -webkit-user-drag: none; user-select: none; }

/* ---------- Escena del encabezado ---------- */
.po-escena { padding: 0 clamp(1rem, 4vw, 3rem) clamp(3rem, 7vw, 6rem); }
.po-escena__in { max-width: 74rem; margin-inline: auto; perspective: 2400px; }
.po-pers { position: relative; width: 100%; transform-style: preserve-3d; transform-origin: 50% 70%;
  transform: rotateX(var(--rx, 7deg)) rotateY(var(--ry, -12deg)) rotateZ(.8deg);
  transition: transform 700ms var(--ease-out); animation: po-sube 900ms var(--ease-out) 300ms backwards; }
.po-main { width: 90%; }
.po-win--grande { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 0 0 6px rgba(30, 42, 58, .05), 0 50px 80px -36px rgba(30, 42, 58, .6), 0 12px 24px -14px rgba(30, 42, 58, .35); }
.po-phone { position: absolute; right: 0; bottom: -7%; width: clamp(5.25rem, 19%, 12.5rem); aspect-ratio: 9 / 18.5; --bz: .38rem; padding: 0; border-radius: 1.7rem;
  background: var(--c-carbon); transform: translateZ(90px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 40px 60px -22px rgba(18, 23, 31, .7); }
.po-phone__in { position: absolute; inset: var(--bz); overflow: hidden; border-radius: 1.35rem; background: var(--c-claro); }
.po-phone__in img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; -webkit-user-drag: none; }
@keyframes po-sube { from { opacity: 0; transform: translateY(46px) rotateX(20deg) rotateY(-20deg) rotateZ(2deg); } }
@media (max-width: 720px) {
  .po-pers { --rx: 4deg; --ry: -6deg; } .po-main { width: 92%; }
  /* Más grande, con marco fino y una sombra corta que no se sale de la escena. */
  .po-phone { right: 0; bottom: -5%; width: clamp(6.5rem, 31%, 9.5rem); --bz: .3rem; border-radius: 1.3rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 22px -12px rgba(18, 23, 31, .5); }
  .po-phone__in { border-radius: 1rem; }
  .po-escena { padding-bottom: clamp(3.5rem, 12vw, 5rem); }
}

/* ---------- Carrusel ---------- */
.po-tour .inner > h2 { max-width: 42rem; }
.po-tour__app { margin-top: clamp(2rem, 4vw, 3rem); }
.po-track { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem; }
.po-item { margin: 0; }
.po-slide { display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: zoom-in; border-radius: 14px; text-align: left; }
.po-txt h3 { margin: 1rem 0 .4rem; }
.po-txt p { color: var(--c-arena); margin: 0; max-width: 40rem; }
.po-tour .po-win { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 0 0 5px rgba(255, 255, 255, .07), 0 40px 60px -30px rgba(0, 0, 0, .75); }

.po-js .po-stage { position: relative; perspective: 1900px; aspect-ratio: 16 / 7.7; outline-offset: 6px; touch-action: pan-y; }
.po-js .po-track { display: block; position: relative; height: 100%; transform-style: preserve-3d; }
.po-js .po-txt { display: none; }
.po-js .po-item { position: absolute; left: 50%; top: 2%; width: 62%; z-index: calc(10 - var(--a, 0));
  transform: translateX(-50%) translate3d(calc(var(--o, 0) * 54%), 0, calc(var(--a, 0) * -230px)) rotateY(calc(var(--o, 0) * -24deg)) scale(calc(1 - var(--a, 0) * .05));
  opacity: calc(1 - var(--a, 0) * .18); transition: transform 700ms var(--ease-out), opacity 700ms var(--ease-out); will-change: transform; }
.po-js .po-item.is-hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: transform 700ms var(--ease-out), opacity 700ms var(--ease-out), visibility 0s 700ms; }
.po-js .po-slide { position: relative; }
.po-js .po-slide::after { content: ""; position: absolute; inset: 0; border-radius: 14px; background: var(--c-carbon); opacity: .5; pointer-events: none; transition: opacity 700ms var(--ease-out); }
.po-js .is-active .po-slide::after { opacity: 0; }
.po-js .po-item:not(.is-active) .po-slide { cursor: pointer; }
.po-slide .po-win { transition: transform 500ms var(--ease-out); }
.po-slide:active .po-win { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .po-js .is-active .po-slide:hover .po-win { transform: translateY(-5px); } .po-js .is-active .po-slide:active .po-win { transform: scale(.985); } }

.po-panel { max-width: 40rem; margin: clamp(1.5rem, 3vw, 2.25rem) auto 0; text-align: center; transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.po-panel.is-out { opacity: 0; transition-duration: 180ms; }
.po-panel__n { margin: 0 0 .6rem; font-family: var(--mono); font-size: var(--wp--preset--font-size--xs); letter-spacing: .12em; text-transform: uppercase; color: var(--c-arena); }
.po-panel__t { margin: 0 0 .6rem; font-size: var(--wp--preset--font-size--xl); line-height: 1.15; }
.po-panel__d { margin: 0 auto; color: var(--c-arena); max-width: 34rem; }
.po-panel__a { margin: .9rem 0 0; }
.po-ctrl { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.25rem; }
.po-btn { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; padding: 0; border-radius: 999px; cursor: pointer; color: var(--c-papel);
  background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(243, 238, 227, .45); transition: background-color 300ms var(--ease-out), transform 160ms var(--ease-out), opacity 300ms var(--ease-out); }
.po-btn:active { transform: scale(.97); }
.po-btn[disabled] { opacity: .3; cursor: default; }
@media (hover: hover) and (pointer: fine) { .po-btn:not([disabled]):hover { background: rgba(255, 255, 255, .16); } }
.po-dots { display: flex; align-items: center; }
.po-dot { width: 1.6rem; height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.po-dot::before { content: ""; width: .55rem; height: .55rem; border-radius: 999px; background: rgba(243, 238, 227, .38); transition: width 500ms var(--ease-out), background-color 500ms var(--ease-out); }
.po-dot[aria-current="true"]::before { width: 1.5rem; background: var(--c-papel); }

/* Enlace de texto con subrayado que avanza despacio */
.po-link { padding: .6rem .1rem; min-height: 2.75rem; border: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; position: relative;
  background: linear-gradient(currentColor, currentColor) left calc(100% - .55rem) / 100% 1px no-repeat; transition: transform 160ms var(--ease-out); }
.po-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: .5rem; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .po-link:hover::after { transform: scaleX(1); } }
.po-link:active { transform: scale(.97); }
.po-dia__l .po-link + .po-link { margin-left: 1.25rem; }

@media (max-width: 720px) {
  .po-js .po-stage { aspect-ratio: 16 / 10.8; overflow-x: clip; }
  .po-js .po-item { width: 90%; top: 1%; transform: translateX(-50%) translate3d(calc(var(--o, 0) * 108%), 0, 0); opacity: 1; }
  .po-js .po-item:not(.is-active) { opacity: 0; }
}

/* ---------- Un día, en tres momentos ---------- */
.po-dia__lista { list-style: none; margin: clamp(1.5rem, 3vw, 2.5rem) 0 0; padding: 0; }
.po-dia__f { position: relative; display: grid; grid-template-columns: clamp(3.5rem, 10vw, 7.5rem) minmax(0, 1fr); gap: 1rem clamp(1rem, 3vw, 2.5rem); padding-block: clamp(1.75rem, 3.5vw, 2.75rem); border-top: 1px solid rgba(30, 42, 58, .16); }
.po-dia__f:last-child { border-bottom: 1px solid rgba(30, 42, 58, .16); }
.po-dia__n { font-family: var(--serif); font-style: italic; font-size: clamp(3.25rem, 9vw, 6.5rem); line-height: .85; color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--c-tinta) 45%, transparent); transition: color 600ms var(--ease-out); }
.po-dia__f h3 { margin: 0 0 .5rem; font-size: var(--wp--preset--font-size--xl); line-height: 1.15; max-width: 34rem; }
.po-dia__f p { margin: 0; max-width: 38rem; color: var(--c-grafito); }
.po-dia__f .po-dia__l { margin-top: .6rem; }
.po-dia__l .po-link { color: var(--c-tinta); }
.po-js .po-dia__f::before { content: ""; position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--c-tinta); transform: scaleX(0); transform-origin: left; transition: transform 800ms var(--ease-out); }
.po-js .po-dia__f.is-in::before { transform: scaleX(1); }
.po-js .po-dia__f > * { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease-out) 150ms, transform 700ms var(--ease-out) 150ms; }
.po-js .po-dia__f.is-in > * { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .po-dia__f:hover .po-dia__n { color: var(--c-tinta); } }

/* ---------- Modal de pantalla ampliada ---------- */
body.po-lock { overflow: hidden; }
.po-lb { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: clamp(.75rem, 3vw, 2rem); background: rgba(18, 23, 31, .86);
  opacity: 0; transition: opacity 250ms var(--ease-out); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.po-lb.is-in { opacity: 1; }
.po-lb.is-out { opacity: 0; transition-duration: 180ms; }
.po-lb__box { display: flex; flex-direction: column; align-items: center; gap: .9rem; max-width: min(96vw, 1400px); transform: scale(.96); transition: transform 300ms var(--ease-out); }
.po-lb.is-in .po-lb__box { transform: none; }
.po-lb.is-out .po-lb__box { transform: scale(.98); transition-duration: 180ms; }
.po-lb__img { display: block; width: auto; max-width: 100%; max-height: 78vh; height: auto; border-radius: 12px; box-shadow: 0 40px 80px -30px #000; transition: opacity 250ms var(--ease-out); background: var(--c-claro); }
.po-lb__img.is-swap { opacity: 0; }
.po-lb__cap { margin: 0; color: var(--c-papel); text-align: center; max-width: 40rem; }
.po-lb__cap strong { display: block; font-size: var(--wp--preset--font-size--lg); }
.po-lb__cap span { color: var(--c-arena); font-size: var(--wp--preset--font-size--sm); }
.po-lb__x, .po-lb__p, .po-lb__s { position: absolute; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; padding: 0; border-radius: 999px; cursor: pointer; color: var(--c-papel);
  background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(243, 238, 227, .5); transition: background-color 300ms var(--ease-out), transform 160ms var(--ease-out), opacity 300ms var(--ease-out); }
.po-lb__x { top: clamp(.75rem, 2vw, 1.25rem); right: clamp(.75rem, 2vw, 1.25rem); }
.admin-bar .po-lb__x { top: calc(32px + .75rem); }
.po-lb__p { left: clamp(.5rem, 2vw, 1.25rem); top: 50%; margin-top: -1.45rem; }
.po-lb__s { right: clamp(.5rem, 2vw, 1.25rem); top: 50%; margin-top: -1.45rem; }
.po-lb :is(.po-lb__x, .po-lb__p, .po-lb__s):active { transform: scale(.97); }
.po-lb :is(.po-lb__p, .po-lb__s)[disabled] { opacity: .3; cursor: default; }
@media (hover: hover) and (pointer: fine) { .po-lb :is(.po-lb__x, .po-lb__p, .po-lb__s):not([disabled]):hover { background: rgba(255, 255, 255, .22); } }
.po-lb button:focus-visible { outline: 3px solid var(--c-papel); outline-offset: 3px; }
@media (max-width: 720px) { .po-lb__p, .po-lb__s { top: auto; bottom: 1rem; margin-top: 0; } .po-lb__img { max-height: 62vh; } }

/* ---------- Carrusel que cabe en una pantalla ----------
   Alto útil = ventana - encabezado fijo (~5rem). Escritorio: escenario a la izquierda, panel y controles a la derecha.
   Móvil: todo apilado y compacto. */
.po-tour { padding-block: clamp(1.25rem, 3.2dvh, 2.25rem) !important; }
.po-tour .inner > h2 { max-width: 52rem; font-size: clamp(1.45rem, 2.5vw, 2.15rem); line-height: 1.12; margin-bottom: .35rem; }
.po-tour .inner > .lead { color: var(--c-arena); font-size: var(--wp--preset--font-size--sm); margin: 0; max-width: 40rem; }
.po-tour__app { --sh: clamp(15rem, calc(100dvh - 17rem), 40rem); margin-top: clamp(.75rem, 2dvh, 1.5rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.po-js .po-stage { aspect-ratio: 16 / 8.6; height: auto; max-height: var(--sh); }
.po-js .po-item { top: 0; width: min(66%, calc((var(--sh) - 2.5rem) * 1.6)); }
.po-panel { margin: .5rem auto 0; }
.po-panel__t { font-size: clamp(1.2rem, 1.9vw, 1.6rem); }
.po-panel__d { font-size: var(--wp--preset--font-size--sm); }
.po-panel__a { margin-top: .35rem; }
.po-ctrl { margin-top: .25rem; }
@media (min-width: 1000px) {
  .po-tour__app { grid-template-columns: minmax(0, 1fr) clamp(17rem, 24vw, 22rem); grid-template-areas: "stage panel" "stage ctrl"; column-gap: clamp(1rem, 3vw, 2.5rem); align-items: center; }
  .po-js .po-stage { grid-area: stage; overflow-x: clip; overflow-y: visible; }
  .po-panel { grid-area: panel; text-align: left; margin: 0; align-self: end; }
  .po-panel__d { margin: 0; }
  .po-ctrl { grid-area: ctrl; justify-content: flex-start; margin-top: .75rem; align-self: start; }
  .po-js .po-item { width: min(80%, calc((var(--sh) - 2.5rem) * 1.6)); transform: translateX(-50%) translate3d(calc(var(--o, 0) * 42%), 0, calc(var(--a, 0) * -230px)) rotateY(calc(var(--o, 0) * -24deg)) scale(calc(1 - var(--a, 0) * .05)); }
}
@media (max-width: 720px) {
  .po-tour .inner > .lead { display: none; }
  .po-tour__app { --sh: min(calc(100vw * .5), calc(100dvh - 27rem)); }
  .po-tour__app { container-type: inline-size; }
  .po-js .po-stage { aspect-ratio: auto; height: calc(57.5cqw + 2.1rem + 6px); max-height: none; }   /* alto de la ventana (92 % del ancho, 16:10, más su barra) para que el contador no se monte sobre la imagen */
  .po-js .po-item { width: 92%; top: 0; }
  .po-panel__d { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .po-panel__n { margin-bottom: .3rem; }
}

/* ---------- Movimiento reducido: sin 3D ni desplazamientos, solo opacidad ---------- */
@media (prefers-reduced-motion: reduce) {
  .po-pers { animation: none; transform: none; transition: none; }
  .po-phone { transform: none; }
  .po-js .po-item, .po-js .po-item.is-hidden { transform: translateX(-50%); opacity: 0; transition: opacity 250ms linear, visibility 0s 250ms; }
  .po-js .po-item.is-active { opacity: 1; visibility: visible; transition: opacity 250ms linear; }
  .po-js .po-slide::after { display: none; }
  .po-panel, .po-panel.is-out { transform: none; transition: opacity 200ms linear; }
  .po-js .po-dia__f > * { transform: none; transition: opacity 250ms linear; }
  .po-js .po-dia__f::before { transform: none; transition: none; }
  .po-lb__box, .po-lb.is-in .po-lb__box { transform: none; transition: none; }
  .po-link::after { transition: none; }
}

/* Zona fija del texto: título (2 líneas) y descripción (4 en escritorio, 3 en móvil) siempre ocupan el mismo alto,
   así que ni el texto ni las flechas saltan al cambiar de pantalla. */
.po-panel { transform: none !important; }
.po-panel__n { line-height: 1.2; min-height: 1.2em; }
.po-panel__t { line-height: 1.15; min-height: 2.3em; display: flex; align-items: flex-start; }
.po-panel__d { line-height: 1.55; min-height: calc(4 * 1.55em); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.po-panel__a { min-height: 1.75rem; }
@media (min-width: 1000px) { .po-panel { align-self: start; } .po-panel__t { align-items: flex-end; } }
@media (max-width: 720px) { .po-panel__d { min-height: calc(3 * 1.55em); -webkit-line-clamp: 3; } .po-panel__t { text-align: center; justify-content: center; align-items: center; } }
@media (min-width: 721px) and (max-width: 999px) { .po-panel__t { justify-content: center; align-items: center; } .po-panel__d { -webkit-line-clamp: 3; min-height: calc(3 * 1.55em); } }

/* En celular el botón de Ayuda se aparta mientras las flechas del carrusel están a la vista. */
@media (max-width: 720px) { body.po-ctrl-visible .ayuda { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 200ms var(--ease-out), visibility 0s 200ms; } }
