/* ============================================================
   TC Group · LARROC — PDF Replica Deck
   Aspecto fiel al folleto impreso (16:9, 1920x1080)
   ============================================================ */

:root {
  --bg: #2F3533;
  --sage: #6F9A8F;
  --sage-dark: #4E7369;
  --yellow: #E8E040;
  --ink: #0A0A0A;
  --light: #F5F5F2;
  --ratio: calc(16 / 9);
}

/* Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--light);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Stage: full viewport, slide centered + scaled to fit -------*/
.stage {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 0;
}

/* Each slide: 16:9, fits viewport (shorter axis caps it) ----- */
.slide {
  position: relative;
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
/* dvh fallback for older browsers */
@supports not (height: 100dvh) {
  .slide {
    width: min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw * 9 / 16));
  }
}
.slide[hidden] { display: none; }

.slide__bg {
  position: absolute; inset: 0;
  display: block;
  pointer-events: none;
}
.slide__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Clickable hit-zones overlaid on slide bg ------------------- */
.hit {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  background: transparent;
  outline: 0;
}
.hit:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}
.hit:hover {
  background: transparent;
  box-shadow: none;
}
.hit--video:hover {
  background: transparent;
}

/* Slide transitions ----------------------------------------- */
.slide {
  animation: fade .35s ease both;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(6px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

/* Navigation arrows ----------------------------------------- */
.nav-arrow {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(15,15,15,.55);
  color: var(--yellow);
  border-radius: 999px;
  cursor: pointer;
  z-index: 20;
  transition: background .2s ease, transform .2s ease, border-color .2s ease, opacity .2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-arrow:hover {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
  transform: translateY(-50%) scale(1.05);
}
.nav-arrow svg { width: 26px; height: 26px; }
.nav-arrow--prev { left: 20px; }
.nav-arrow--next { right: 20px; }
.nav-arrow:disabled { opacity: .25; cursor: not-allowed; }
.nav-arrow:disabled:hover { background: rgba(15,15,15,.55); color: var(--yellow); transform: translateY(-50%); }
@media (max-width: 640px) {
  .nav-arrow { width: 44px; height: 44px; }
  .nav-arrow--prev { left: 8px; }
  .nav-arrow--next { right: 8px; }
}

/* Dot navigation -------------------------------------------- */
.dots {
  position: fixed;
  bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: .5rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  background: rgba(15,15,15,.55);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
}
.dots button {
  width: 9px; height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  padding: 0;
  transition: background .2s ease, transform .2s ease;
}
.dots button:hover { background: rgba(255,255,255,.6); transform: scale(1.2); }
.dots button[aria-current="true"] {
  background: var(--yellow);
  width: 22px;
}

/* Slide counter --------------------------------------------- */
.counter {
  position: fixed;
  bottom: 22px; right: 22px;
  font-size: .85rem; font-weight: 500;
  color: rgba(255,255,255,.7);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  z-index: 20;
  padding: .35rem .6rem;
  background: rgba(15,15,15,.45);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}
@media (max-width: 640px) {
  .counter { bottom: 64px; right: 12px; font-size: .75rem; }
}

/* Video cover slide ----------------------------------------- */
.slide--video {
  background: #000;
}
.cover-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.cover-video[hidden] { display: none; }
.cover-video::-webkit-media-controls-panel { display: none !important; }
.cover-video::-webkit-media-controls { display: none !important; }
.slide--video:not(.is-playing) .cover-video {
  pointer-events: none;
}
.slide--video:not(.is-playing) .cover-video::-internal-media-controls-overlay-cast-button { display: none; }

.cover-video__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(56px, 9vmin, 130px);
  height: clamp(56px, 9vmin, 130px);
  border: 0; padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  transition: transform .25s ease, opacity .25s ease;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.55));
}
.cover-video__play svg { width: 100%; height: 100%; display: block; }
.cover-video__play:hover { transform: translate(-50%, -50%) scale(1.06); }
.cover-video__caption {
  position: absolute;
  left: 50%; bottom: clamp(2rem, 8vh, 5rem);
  transform: translateX(-50%);
  margin: 0;
  color: #fff;
  font-weight: 600;
  letter-spacing: .25em;
  font-size: clamp(.75rem, 1.2vw, 1rem);
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0,0,0,.7);
  z-index: 3;
  pointer-events: none;
}
.slide--video.is-playing .cover-video__play,
.slide--video.is-playing .cover-video__caption { opacity: 0; pointer-events: none; }
.slide--video.is-playing .cover-video { pointer-events: auto; }

/* Tap-to-zoom hint on image slides --------------------------- */
.slide {
  cursor: zoom-in;
}
.slide::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px auto;
  width: 38px; height: 38px;
  background: rgba(15,15,15,.55) no-repeat center / 20px 20px
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E8E040' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/><line x1='11' y1='8' x2='11' y2='14'/><line x1='8' y1='11' x2='14' y2='11'/></svg>");
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  backdrop-filter: blur(6px);
}
@media (hover: hover) {
  .slide:not(.slide--video):hover::after { opacity: 1; }
}
@media (hover: none) {
  /* Touch: always show the hint briefly */
  .slide:not(.slide--video)::after { opacity: .9; }
}

/* Fullscreen handling --------------------------------------- */
.slide:fullscreen,
.slide:-webkit-full-screen {
  width: 100vw; height: 100vh;
  max-width: none; max-height: none;
  aspect-ratio: auto;
}
.slide:fullscreen .slide__bg img,
.slide:-webkit-full-screen .slide__bg img {
  object-fit: contain;
  background: #000;
}
.slide:fullscreen::after,
.slide:-webkit-full-screen::after { display: none; }

/* When the whole document is fullscreen (so nav arrows stay visible),
   make the active slide fill the viewport with letterboxed bg image. */
html:fullscreen,
html:-webkit-full-screen { background: #000; }
html:fullscreen .slide:not([hidden]),
html:-webkit-full-screen .slide:not([hidden]) {
  width: 100vw; height: 100vh;
  max-width: none; max-height: none;
  aspect-ratio: auto;
  box-shadow: none;
}
html:fullscreen .slide__bg img,
html:-webkit-full-screen .slide__bg img {
  object-fit: contain;
  background: #000;
}
html:fullscreen .slide:not(.slide--video)::after,
html:-webkit-full-screen .slide:not(.slide--video)::after { display: none; }
html:fullscreen .slide:not(.slide--video),
html:-webkit-full-screen .slide:not(.slide--video) { cursor: zoom-out; }

/* Portrait orientation hint (mobile) ------------------------ */
.rotate-hint {
  display: none;
  position: fixed;
  inset: auto 0 calc(env(safe-area-inset-bottom, 0px) + 6rem) 0;
  z-index: 30;
  pointer-events: none;
  text-align: center;
}
.rotate-hint__chip {
  display: inline-flex; align-items: center; gap: .6em;
  background: rgba(15,15,15,.75);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--light);
  padding: .55em 1em;
  border-radius: 999px;
  font-size: .8rem;
  letter-spacing: .04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  animation: hintPulse 2.4s ease-in-out infinite;
}
.rotate-hint__chip svg {
  width: 18px; height: 18px;
  color: var(--yellow);
}
@keyframes hintPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
/* Show only on narrow portrait viewports */
@media (max-width: 768px) and (orientation: portrait) {
  .rotate-hint { display: block; }
  .dots { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .counter { bottom: calc(env(safe-area-inset-bottom, 0px) + 60px); }
}
/* Hide when in fullscreen */
body:has(:fullscreen) .rotate-hint,
body:has(:-webkit-full-screen) .rotate-hint { display: none !important; }

/* Safe area padding for nav UI ------------------------------ */
.nav-arrow--prev { left: max(20px, env(safe-area-inset-left)); }
.nav-arrow--next { right: max(20px, env(safe-area-inset-right)); }

/* Motion safety --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  * { transition-duration: .01ms !important; }
  .rotate-hint__chip { animation: none; }
}
