/* Demos una a una (pages/galleryplay.js, public/galleryplay.js): escenario oscuro a pantalla completa, una demo por pantalla en un marco
   redondeado, su ficha abajo (sobre un degradado) y los botones de anterior y siguiente a la derecha. Colores de la paleta (oscuro). */
:root {
  --stage: var(--pal-night);
  --fg: var(--pal-night-fg);
  --muted: var(--pal-night-muted);
  --raised: var(--pal-night-raised);
  --cta: var(--pal-cta);
  --ink: var(--pal-ink);
  --top: 72px;
  --gap: 12px;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--stage); color: var(--fg); font: 500 16px/1.45 "Figtree", var(--display); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; border-radius: 10px; }

/* Arriba, la misma cabecera que el resto de páginas (.top de site.css, fija): la marca, las categorías (en el móvil se deslizan de
   lado) y cerrar, que vuelve a la Gallery */
.pl-top { position: fixed; z-index: 5; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: var(--top); padding-block: 0; }
.pl-cats { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pl-cats::-webkit-scrollbar { display: none; }
.pl-cats .cat { flex: none; height: 36px; padding: 0 15px; font-size: 14px; }
.pl-round { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--raised); color: var(--fg); cursor: pointer; text-decoration: none; }
.pl-round svg { width: 22px; height: 22px; }
.pl-round:hover { background: color-mix(in srgb, var(--fg) 18%, var(--raised)); }
.pl-round:disabled { opacity: .4; cursor: default; }

/* El carrusel: una ficha por pantalla, encajando */
.pl-feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; outline: none; }
.pl-feed::-webkit-scrollbar { display: none; }
body.live .pl-feed { overflow: hidden; } /* probando una: el carrusel no se mueve */
.pl-slide { height: 100%; padding: calc(var(--top) + env(safe-area-inset-top, 0px)) max(var(--gutter), 76px) max(var(--gap), env(safe-area-inset-bottom, 0px)); scroll-snap-align: start; scroll-snap-stop: always; }
.pl-frame { position: relative; overflow: hidden; height: 100%; max-width: calc(var(--wrap) - 2 * var(--gutter)); margin: 0 auto; /* alineado con la cabecera */ border-radius: 28px; background: var(--raised); isolation: isolate; }
.pl-frame iframe { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; background: #fff; opacity: 0; transition: opacity .3s; }
.pl-slide.loaded iframe { opacity: 1; }
.pl-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; filter: saturate(.9); }

/* Deslizando: una capa por encima de la demo recoge los toques (se desliza el carrusel) y al tocarla se prueba */
.pl-try { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: center; padding: 18px; border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.pl-try span { padding: 9px 16px; border-radius: 999px; background: color-mix(in srgb, #fff 92%, transparent); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5); font-weight: 700; font-size: 14px; opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
.pl-slide.loaded .pl-try span { opacity: 1; transform: none; }
.pl-slide.live .pl-try { display: none; }

/* Ficha de la demo, abajo sobre un degradado */
.pl-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; gap: 6px; padding: 80px 24px 22px; background: linear-gradient(to top, rgba(10, 8, 20, .88), rgba(10, 8, 20, .55) 55%, transparent); color: #fff; pointer-events: none; transition: opacity .2s, transform .2s; }
.pl-info > * { pointer-events: auto; max-width: 60ch; }
.pl-slide.live .pl-info { opacity: 0; transform: translateY(12px); pointer-events: none; }
.pl-slide.live .pl-info > * { pointer-events: none; }
.pl-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.pl-cat .spark { width: 12px; height: 12px; fill: var(--cta); }
.pl-info h2 { margin: 0; font: 800 clamp(26px, 3.4vw, 40px)/1.05 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.pl-info p { margin: 0; font-size: 16px; opacity: .88; text-wrap: pretty; }
.pl-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pl-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; backdrop-filter: blur(6px); }
.pl-btn svg { width: 16px; height: 16px; }
.pl-btn:hover { background: rgba(255, 255, 255, .26); }
.pl-use { margin: 0; }
.pl-btn.pl-make { border: 0; background: var(--cta); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.pl-btn.pl-make:hover { background: var(--pal-cta-hover); }

/* Probando: botón para volver a deslizar */
.pl-exit { position: absolute; z-index: 4; left: 50%; bottom: 16px; display: none; align-items: center; gap: 2px; height: 42px; padding: 0 16px 0 10px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 700 14px/1 "Figtree", var(--display); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); transform: translateX(-50%); cursor: pointer; }
.pl-exit svg { width: 16px; height: 16px; }
.pl-exit svg + svg { margin: 0 6px 0 -6px; }
.pl-slide.live .pl-exit { display: inline-flex; }

/* Anterior y siguiente, a la derecha */
.pl-side { position: fixed; z-index: 5; right: 16px; top: 50%; display: grid; gap: 10px; transform: translateY(-50%); }
body.live .pl-side { opacity: .35; }
.pl-empty { padding: 120px 24px; text-align: center; }

@media (max-width: 760px) {
  :root { --top: 66px; --gap: 8px; }
  .pl-top { --top-gap: 10px; }
  .pl-slide { padding-inline: var(--gutter); }
  .pl-frame { border-radius: 22px; }
  .pl-side { display: none; } /* en el móvil se desliza con el dedo */
  .pl-info { padding: 70px 18px 18px; }
  .pl-info p { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .pl-frame iframe, .pl-info, .pl-try span { transition: none; } }
