/* Course-platform styles layered on top of styles.css design tokens.
   Loaded on every generated page after styles.css; nothing here overrides
   the marketing classes, it only adds the catalog/course/chapter surfaces. */

/* --- Compact hero (homepage) --- */

.hero-compact {
  padding-bottom: 24px;
}

.hero-compact .hero-summary {
  max-width: 640px;
}

/* --- Breadcrumb --- */

.breadcrumb {
  padding: 28px 24px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.breadcrumb a {
  color: var(--amber);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* --- Course catalog grid (homepage) --- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.course-card:hover,
.course-card:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.course-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--amber);
}

.course-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.course-card-blurb {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.course-card-continue {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--amber);
}

.course-card-continue::before {
  content: "▶ ";
}

/* --- Chapter lists (course pages + standalone section) --- */

.chapter-list {
  list-style: none;
  margin: 0 auto;
  padding: 0 24px;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-row a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 14px 18px;
  font-size: 0.9rem;
  transition: border-color 0.15s ease;
}

.chapter-row a:hover,
.chapter-row a:focus-visible {
  border-color: var(--border-strong);
}

.chapter-row-title {
  flex: 1;
}

.chapter-duration {
  color: var(--soft);
  font-size: 0.78rem;
  white-space: nowrap;
}

.chapter-watched {
  color: var(--amber);
  font-weight: 700;
}

.chapter-row.is-watched .chapter-row-title {
  color: var(--muted);
}

/* --- Course header --- */

.course-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 26px 24px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
}

.course-blurb {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.course-continue {
  align-self: flex-start;
}

/* --- Chapter page --- */

.chapter-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 24px 8px;
}

.chapter-header h1 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.3;
}

.resume-chip {
  margin: 10px 0 0;
  font-size: 0.8rem;
}

.resume-chip button {
  font: inherit;
  color: var(--amber);
  background: transparent;
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  cursor: pointer;
}

.resume-chip button:hover {
  background: rgba(255, 176, 0, 0.12);
}

.player-shell {
  position: relative;
  /* Above the fixed CRT scanline overlay (z 3): style lines must never
     stripe the video picture. Requires .site-main to have z-index auto. */
  z-index: 4;
  max-width: var(--max-width);
  margin: 14px auto 0;
  padding: 0 24px;
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.player-frame iframe,
.player-frame > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Thumbnail facade: shown until the first play gesture so page navigation
   never pays for the multi-MB YouTube embed stack up front. */

.player-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  display: block;
}

.player-facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.player-facade:hover img,
.player-facade:focus-visible img {
  opacity: 1;
}

.player-facade-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 58px;
  background: rgba(11, 12, 9, 0.85);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-facade-btn::after {
  content: "";
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--amber);
}

.player-facade:hover .player-facade-btn,
.player-facade:focus-visible .player-facade-btn {
  background: rgba(255, 176, 0, 0.25);
}

/* Up-next overlay sits on the player at video end */

.upnext-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(11, 12, 9, 0.92);
  text-align: center;
  padding: 20px;
  z-index: 3;
}

.upnext-overlay h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--amber);
}

.upnext-overlay p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.upnext-overlay .upnext-actions {
  display: flex;
  gap: 12px;
}

.upnext-overlay button {
  font: inherit;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
}

.upnext-overlay button.upnext-go {
  background: var(--amber);
  color: #0B0C09;
  font-weight: 700;
}

/* --- Chapter prev/next nav --- */

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px 0;
  font-size: 0.8rem;
}

.chapter-nav-link {
  color: var(--amber);
  max-width: 48%;
}

.chapter-nav-link:hover {
  text-decoration: underline;
}

.chapter-nav-next {
  margin-left: auto;
  text-align: right;
}

/* --- Outline --- */

.outline-section,
.transcript-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 0;
}

.outline-section h2,
.transcript-section h2 {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 14px;
}

.outline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px 20px;
}

.seek-link {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.5;
}

.seek-link:hover .seek-time,
.seek-link:focus-visible .seek-time {
  text-decoration: underline;
}

.seek-time {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* --- Transcript --- */

.transcript-body {
  max-width: 780px;
}

.transcript-body p {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--muted);
  /* Long transcripts: skip layout/paint for offscreen paragraphs. */
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

.transcript-time {
  color: var(--amber);
  font-size: 0.78rem;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}

/* --- Course complete panel --- */

.course-complete {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .course-grid {
    grid-template-columns: 1fr;
  }

  .chapter-row a {
    flex-wrap: wrap;
  }

  .chapter-nav {
    flex-direction: column;
  }

  .chapter-nav-link {
    max-width: 100%;
  }

  .chapter-nav-next {
    margin-left: 0;
    text-align: left;
  }
}
