/* ==========================================================================
   TOPIC PAGER — one video per page within a subtopic
   Uses design tokens from _design_tokens.css.
   The page pill + segmented dots keep the mock's dark fill intentionally
   (approved as-is) instead of the app's teal accents.
   ========================================================================== */

.tp-screen {
  padding: clamp(1rem, 2.5vw, 2rem) 0 var(--space-2xl);
  font-family: var(--font-sans);
}

/* Hide the global footer on mobile — keeps the focused, native-app feel of
   the pager screen on small viewports */
@media (max-width: 640px) {
  body:has(.tp-screen) #footer {
    display: none;
  }
}

.tp-container {
  max-width: 720px;
}

/* --------------------------------------------------------------------------
   HEADER: back arrow / page pill + dots / outline pin
   -------------------------------------------------------------------------- */

.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.tp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: white;
  color: var(--sl-charcoal);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.tp-icon-btn:hover {
  border-color: var(--sl-teal);
  color: var(--sl-teal);
}

/* Page pill + segmented dots — ported from the mock, dark fill kept as-is */

.tp-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
}

.tp-page-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sl-charcoal);
  white-space: nowrap;
}

.tp-dots {
  display: flex;
  gap: 0.25rem;
}

.tp-dot {
  width: 1.25rem;
  height: 0.3125rem;
  border-radius: 9999px;
  background: #e0e0e0;
}

.tp-dot--active {
  background: #1a1a1a;
}

/* --------------------------------------------------------------------------
   TITLE, DESCRIPTION, TAGS
   -------------------------------------------------------------------------- */

.tp-title {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  line-height: 1.2;
  color: var(--sl-charcoal);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.tp-desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--sl-gray);
  margin: 0 0 var(--space-sm);
  max-width: 64ch;
}

.tp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: var(--space-md);
}

.tp-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.1875rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
  background: white;
  color: var(--sl-gray);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   VIDEO CARD
   -------------------------------------------------------------------------- */

.tp-video-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

.tp-video-card:hover {
  box-shadow: var(--shadow-md);
}

.tp-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--sl-charcoal);
}

.tp-video-wrapper .embed-responsive-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.tp-video-body {
  padding: 0.875rem 1.25rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.tp-video-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sl-charcoal);
  margin: 0 0 0.25rem;
}

.tp-video-desc {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--sl-gray);
  margin: 0 0 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tp-video-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.tp-yt-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sl-teal-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.tp-yt-link:hover {
  color: var(--sl-teal);
}

.tp-share-btn {
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   PREV/NEXT NAV
   -------------------------------------------------------------------------- */

/* Action bar — same shape as .tw-footer-row on the topics wizard (outlined
   Back pill, coral Continue pill filling the rest), in-flow after the video card */
.tp-nav {
  display: flex;
  flex-direction: row-reverse;
  align-items: stretch;
  gap: 0.625rem;
  width: 100%;
  max-width: 640px;
  margin: var(--space-lg) auto 0;
}

/* Previous — outlined pill, same as .tw-footer-back */
.tp-btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.9375rem 1.25rem;
  flex-shrink: 0;
  background: white;
  color: var(--sl-charcoal);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.tp-btn-back:hover {
  border-color: var(--sl-teal);
  color: var(--sl-teal);
  text-decoration: none;
}

/* Next / Finish topic — coral gradient button, same as .topics-submit */
.tp-btn-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  min-height: 44px;
  padding: 0.9375rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: linear-gradient(135deg, var(--sl-coral) 0%, var(--sl-coral-dark) 100%);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(224, 122, 95, 0.3);
  transition: all var(--transition-normal);
}

.tp-btn-next:hover {
  color: white;
  background: linear-gradient(135deg, var(--sl-coral-dark) 0%, #B55D47 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(224, 122, 95, 0.4);
}

/* --------------------------------------------------------------------------
   REDUCED MOTION
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .tp-icon-btn,
  .tp-video-card,
  .tp-yt-link,
  .tp-btn-back,
  .tp-btn-next {
    transition: none;
  }

  .tp-btn-next:hover {
    transform: none;
  }
}
