/* the home page's one-video answer (AutoMontage) — MKTB-Frontend/src/index.css, the montage block (lines 181–270, 787–791) as it is */

/* the montage: one player over the top answers */
.montage {
  margin: 4px 0 26px; padding: 14px;
  background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.montage.skeleton { height: 420px; }
/* on a wide screen the box (and its video) stays small, at the start of the column */
@media (min-width: 900px) {
  .montage { max-width: 560px; }
  .montage.skeleton { height: 400px; }
}
.montage-more { display: block; margin-top: 10px; font-size: 0.9rem; }
.montage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.montage-head h2 { font-size: 1.15rem; margin: 0; }
.montage-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.montage-stage .player, .montage-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play.big { width: 68px; height: 68px; }
.montage-shield { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; }
.lower-third {
  position: absolute; inset-inline-start: 0; bottom: 0; max-width: 85%;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  margin: 0 0 14px; padding: 8px 16px 8px 14px;
  background: rgb(0 0 0 / 0.72); color: #fff; border-start-end-radius: 8px; border-end-end-radius: 8px;
  border-inline-start: 4px solid var(--brand);
  opacity: 0; pointer-events: none;
  animation: lower-third 2.8s ease both;
}
@keyframes lower-third {
  0% { opacity: 0; transform: translateX(12px); }
  12%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .lower-third { animation-name: lower-third-fade; } }
@keyframes lower-third-fade { 0%, 100% { opacity: 0; } 10%, 88% { opacity: 1; } }
/* the words over the montage as they're said (the export's "line" style): white, the word being said in yellow */
.montage-cc {
  position: absolute; inset-inline: 0; bottom: 18%; padding: 0 6%;
  text-align: center; pointer-events: none;
}
.montage-cc > span {
  display: inline; padding: 2px 10px; border-radius: 6px; line-height: 1.7;
  background: rgb(0 0 0 / 0.6); color: #fff; font-weight: 700; font-size: clamp(0.95rem, 3.2vw, 1.35rem);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.montage-cc .on { color: #ffd700; }
.mb-cc {
  border: 1px solid var(--line); background: none; color: var(--ink-muted);
  border-radius: 6px; padding: 2px 6px; font-size: 0.75rem; font-weight: 700; line-height: 1.2;
}
.mb-cc.on { color: var(--ink); border-color: var(--ink-muted); }
.lt-n { font-size: 0.8rem; opacity: 0.8; }
.lt-ep { font-weight: 600; }
.lt-ch { font-size: 0.85rem; opacity: 0.8; }
.montage-end {
  position: absolute; inset: 0; margin: auto; width: max-content; height: max-content;
  border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 600;
  background: var(--brand); color: #fff;
}
.montage-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.mb-btn {
  width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0;
  background: var(--brand); color: #fff; font-size: 0.85rem;
}
.mb-time { font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; flex: none; }
/* taller than it looks (padding) so a finger can grab it; no page scroll while dragging */
.timeline { flex: 1; display: flex; gap: 4px; height: 22px; padding-block: 6px; box-sizing: border-box; cursor: pointer; touch-action: none; }
.timeline:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.timeline.dragging .seg span { transition: none; }
.seg { flex-basis: 0; min-width: 12px; padding: 0; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; position: relative; }
.seg span { position: absolute; inset-block: 0; left: 0; background: var(--brand); border-radius: inherit; }
.seg:hover { background: var(--ink-muted); }
.chapters { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.chapters button {
  width: 100%; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border: 0; background: none; text-align: start; padding: 6px 8px; border-radius: 8px;
}
.chapters button:hover { background: var(--surface); }
.chapters li.on button { background: var(--brand-tint); }
.ch-n {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px;
  background: var(--brand-tint); color: var(--brand); font-weight: 600; font-size: 0.8rem;
}
.chapters li.on .ch-n { background: var(--brand); color: #fff; }
.ch-ep { font-weight: 600; }
.ch-meta { color: var(--ink-muted); font-size: 0.85rem; }
.montage-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 0.88rem; }
.link { border: 0; background: none; padding: 0; color: var(--brand); }
.link:hover { text-decoration: underline; }
.montage-text { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.95rem; }

.montage-start { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; font-size: 0.9rem; }
.montage-start .error { color: #d33; }
.chapters .ch-why { display: block; flex-basis: 100%; font-size: 0.8rem; opacity: 0.7; margin-top: 2px; }
/* the montage's back player: loads the next clip out of sight */
.montage-stage .player.standby { opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
  .montage { padding: 10px; margin-inline: -6px; }
  .montage.skeleton { height: 260px; }
  /* the episode name over the picture covers too much of a small video */
  .lower-third { display: none; }
}

/* ── additions for this copy ─────────────────────────────────────────────── */
/* the box sits over the result cards, a little apart from them */
#montage-slot { margin-bottom: 4px; }
/* the full width of the page column, like the cards under it (the original
   keeps the box at 560px on a wide screen) */
#montage-slot .montage { max-width: none; margin-inline: 0; }/* "the rest is below": a line across with a pill in the middle, between the montage and the cards */
.montage-below {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin: -12px 0 18px; padding: 0; border: 0; background: none;
  color: var(--ink-soft); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.montage-below::before, .montage-below::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.montage-below span { order: 0; }
.montage-below svg { order: 1; margin-inline-start: -6px; animation: below-nudge 1.6s ease-in-out 3; }
.montage-below::after { order: 2; }
.montage-below:hover { color: var(--brand); }
@keyframes below-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .montage-below svg { animation: none; } }

/* hide YouTube's own overlays, as player.css does for the chunk player: the
   iframe is three times the stage's height, so its title bar, logo and pause
   shelf fall outside the stage and are cut off */
.montage-stage iframe { inset: auto 0; top: -100%; height: 300%; }
