/* Deck CSS — complements Tailwind utilities with stable class hooks */

:root {
  --deck-bg-from: #fafafa;
  --deck-bg-to: #f5f5f5;
  --deck-text: #0a0a0a;
  --deck-muted: #525252;
  --deck-border: #e5e5e5;
}

/* Stage: enforce 16:9 area that scales to viewport */
#slides {
  width: min(100vw, calc(177.78vh)); /* 16:9 => width = 16/9 * height = 1.7778 * h */
  height: min(100vh, calc(56.25vw)); /* height = 9/16 * width = 0.5625 * w */
  position: relative;
}

/* Slide base (fill stage) */
.slide {
  min-height: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-left: clamp(1rem, 3vw, 5rem);
  padding-right: clamp(1rem, 3vw, 5rem);
  /* Prevent text caret from appearing on click */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  caret-color: transparent;
}

/* Also apply caret/selection rules to slide content */
.slide * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  caret-color: transparent;
}

.slide__inner {
  max-width: 72rem; /* ~1152px */
  width: 100%;
}

.slide__header { margin-bottom: clamp(1rem, 3vw, 2rem); }
.slide__title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.slide__subtitle {
  margin-top: 0.5rem;
  font-size: clamp(1.1rem, 2.2vw, 1.25rem);
  color: var(--deck-muted);
}

.slide__bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: clamp(0.6rem, 1.6vw, 1.1rem);
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
  line-height: 1.6;
}
.slide__bullet { position: relative; padding-left: 1.25rem; }
.slide__dot {
  position: absolute; left: 0; top: 0.2rem; color: #a3a3a3; /* neutral-400 */
}

.slide__rich { margin-top: 1.5rem; }

.slide__figure { margin-top: 1.25rem; }
.slide__image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--deck-border);
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.slide__image--cover {
  max-height: none;
  height: 70vh;
  object-fit: cover;
  object-position: 50% 50%;
}
.slide__caption { margin-top: 0.5rem; font-size: 0.875rem; color: var(--deck-muted); }
.slide__footnote { margin-top: 2rem; font-size: 0.875rem; color: #d4d4d4; }

/* Section slide */
.slide-section {
  background: linear-gradient(to bottom, var(--deck-bg-from), var(--deck-bg-to));
  text-align: center;
}
.slide-section__inner { max-width: 72rem; width: 100%; }
.slide-section__title {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.slide-section__subtitle {
  margin-top: 0.75rem;
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
  color: var(--deck-muted);
}

/* Title slide */
.slide-title {
  background: linear-gradient(to bottom right, #1a202c, #2d3748); /* Dark gradient */
  color: #ffffff; /* White text */
  text-align: center;
}
.slide-title .slide__title {
  font-size: clamp(3rem, 8vw, 6rem); /* Even larger title */
  font-weight: 800; /* Extra bold */
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.slide-title .slide__subtitle {
  color: #cbd5e0; /* Lighter grey for subtitle */
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 1rem;
}

/* Footer controls (progress + small arrows) */
#progressBar { height: 0.25rem; border-radius: 9999px; background: #e5e5e5; overflow: hidden; }
#progressInner { height: 100%; background: #171717; transition: width 200ms ease; }
#counter { font-size: 0.875rem; color: #525252; }

#prevBtn, #nextBtn {
  padding: 0.5rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--deck-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  backdrop-filter: blur(2px);
}
#prevBtn svg, #nextBtn svg { width: 1rem; height: 1rem; color: #404040; }


/* Fixed footer bar for nav + progress */
.deck-footer {
  position: fixed;
  left: 0; right: 0; bottom: 1rem;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  z-index: 35;
  pointer-events: none; /* allow clicks to pass unless on children */
}
.deck-footer > * { pointer-events: auto; }

/* Hide progress + counter on section slides to reduce clutter */
#deck.is-section #progressBar,
#deck.is-section #counter {
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0; /* left side */
  height: 100vh;
  width: clamp(220px, 22vw, 320px);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border-right: 1px solid var(--deck-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transform: translateX(-100%);
  transition: transform 200ms ease;
  z-index: 30;
  pointer-events: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar__inner { height: 100%; display: flex; flex-direction: column; }
.sidebar__header { padding: 1rem 1rem 0.5rem 1rem; }
.sidebar__title { font-weight: 600; letter-spacing: -0.01em; }
.sidebar__list { padding: 0.25rem 0.5rem 1rem 0.5rem; overflow-y: auto; height: 100%; }
.sidebar__item { display: block; }
.sidebar__button {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: 0.5rem; border: 1px solid transparent;
  color: var(--deck-text);
}
.sidebar__button:hover { background: #f5f5f5; border-color: var(--deck-border); }
.sidebar__bullet { width: 6px; height: 6px; border-radius: 9999px; background: #d4d4d4; }
.sidebar__label { font-size: 0.95rem; }
.sidebar__item--active .sidebar__button { background: #111827; color: white; border-color: #111827; }
.sidebar__item--active .sidebar__bullet { background: white; }

/* Section arrow and sublist */
.sidebar__chev {
  margin-left: auto;
  width: 0.875rem; height: 0.875rem; color: #6b7280; /* neutral-500 */
  transition: transform 150ms ease;
}
.sidebar__item--open .sidebar__chev { transform: rotate(90deg); }

.sidebar__sublist { display: none; padding: 0.25rem 0.25rem 0.25rem 1.5rem; }
.sidebar__item--open .sidebar__sublist { display: block; }
.sidebar__subitem { margin: 0; }
.sidebar__sublink {
  width: 100%; text-align: left; display: block;
  padding: 0.4rem 0.6rem; border-radius: 0.375rem; font-size: 0.9rem;
  color: #374151; /* neutral-700 */
}
.sidebar__sublink:hover { background: #f3f4f6; }
.sidebar__subitem--active .sidebar__sublink {
  background: #e5e7eb; color: #111827; font-weight: 600;
}

/* Sidebar Toggle */
.sidebar-toggle {
  position: fixed; bottom: 1rem; left: 1rem; z-index: 40;
  padding: 0.5rem; border-radius: 0.5rem;
  background: rgba(156,163,175,0.5); /* neutral-400 @ 50% */
  border: 1px solid rgba(156,163,175,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  backdrop-filter: blur(6px);
}
.sidebar-toggle:hover { background: rgba(156,163,175,0.72); border-color: rgba(156,163,175,0.8); }
.sidebar-toggle svg { color: #ffffff; }

/* Disable deck click-to-advance when sidebar open */
#deck.has-sidebar-open { cursor: default; }

/* Shift stage when sidebar open so content isn't covered */
#deck.has-sidebar-open #slides {
  transform: translateX(clamp(220px, 22vw, 320px));
  transition: transform 200ms ease;
}
