/*
 * slides.css — self-contained deck layout + navigation UI.
 * Pair with slides.js. Uses CSS variables from the host page
 * (--bg, --text, --muted, --surface-2, --accent).
 */

.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  padding: 64px 80px 120px;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.slide.prev {
  transform: translateX(-40px);
}

.nav {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--surface-2);
  z-index: 100;
  max-width: calc(100vw - 24px);
  user-select: none;
  -webkit-user-select: none;
}

.nav button {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav button:hover:not(:disabled) {
  background: var(--surface-2);
}

.nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav .nav-home {
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav .nav-home:hover {
  background: var(--surface-2);
}

.dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

.counter {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}

.hint {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 20px;
  z-index: 100;
  color: var(--muted);
  font-size: 13px;
  background: rgba(30, 41, 59, 0.7);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--surface-2);
  pointer-events: none;
}

/* Touch devices don't have arrow keys — swap the hint for a swipe/tap cue. */
@media (hover: none) and (pointer: coarse) {
  .hint[data-touch-hint]::before { content: attr(data-touch-hint); }
  .hint[data-touch-hint] > * { display: none; }
}

@media (max-width: 900px) {
  .slide { padding: 48px 24px 104px; }
  .nav { gap: 10px; padding: 8px 14px; }
  .nav button,
  .nav .nav-home { width: 40px; height: 40px; font-size: 22px; }
  .nav .nav-home { font-size: 18px; }
  .dots { gap: 6px; }
  .dot { width: 7px; height: 7px; }
  .counter { font-size: 13px; min-width: 36px; }
  .hint { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; font-size: 12px; padding: 5px 11px; }
}

@media (max-width: 520px) {
  .slide { padding: 40px 18px 96px; }
  .nav { gap: 8px; padding: 6px 10px; }
  .nav button,
  .nav .nav-home { width: 38px; height: 38px; }
  /* Many dots can't fit on narrow screens — hide them; the counter still shows position. */
  .dots { display: none; }
  .counter { min-width: 44px; font-size: 13px; }
}
