/* iMedia Quick Bite podcast player + topic mind map (shared by topic pages). */

/* ─── Podcast player ───────────────────────────────────────────────────────── */
.qb-player {
  --qb-bg: #1b2420; --qb-bg-2: #26332c; --qb-ink: #f4f7f1; --qb-muted: #a9b6ad;
  --qb-accent: var(--course, #e5f570); --qb-accent-ink: #202322;
  display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center;
  padding: 18px; border-radius: 14px; margin: 6px 0 12px;
  background: linear-gradient(160deg, var(--qb-bg-2), var(--qb-bg) 70%);
  color: var(--qb-ink); box-shadow: 0 10px 28px rgba(20, 30, 24, 0.22);
}
.qb-cover {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--qb-accent); color: var(--qb-accent-ink);
  display: flex; flex-direction: column; justify-content: space-between; padding: 11px 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.qb-cover::after {
  content: ""; position: absolute; right: -22px; bottom: -22px; width: 86px; height: 86px;
  border-radius: 50%; border: 12px solid rgba(32, 35, 34, 0.12);
}
.qb-cover-brand { font: 700 11px/1.15 'Space Grotesk', system-ui, sans-serif; text-transform: uppercase; }
.qb-cover-ep { font: 700 46px/0.9 'Space Grotesk', system-ui, sans-serif; position: relative; z-index: 1; }
.qb-cover-topic { font: 600 11px/1.2 'DM Sans', system-ui, sans-serif; position: relative; z-index: 1; }
.qb-meta { min-width: 0; }
.qb-kicker { margin: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--qb-accent); }
.studio-topic .topic-section .qb-title { margin: 3px 0 2px; font: 700 20px/1.2 'Space Grotesk', system-ui, sans-serif; color: var(--qb-ink); }
.studio-topic .topic-section p.qb-hosts { margin: 0 0 10px; font-size: 13px; color: var(--qb-muted); }
.qb-controls { display: flex; align-items: center; gap: 10px; }
.qb-btn {
  display: inline-grid; place-items: center; border: 0; cursor: pointer; color: var(--qb-ink);
  background: transparent; border-radius: 50%; width: 38px; height: 38px;
  transition: transform .15s, background .15s;
}
.qb-btn:hover { background: rgba(255, 255, 255, 0.1); }
.qb-btn svg { width: 22px; height: 22px; }
.qb-skip { position: relative; }
.qb-skip span { position: absolute; font-size: 8px; font-weight: 700; top: 50%; left: 50%; transform: translate(-50%, -35%); }
.qb-play { width: 50px; height: 50px; background: var(--qb-accent); color: var(--qb-accent-ink); }
.qb-play:hover { background: var(--qb-accent); transform: scale(1.06); }
.qb-play svg { width: 24px; height: 24px; }
.qb-speed {
  margin-left: auto; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: var(--qb-ink);
  border-radius: 999px; padding: 4px 10px; font: 700 12px/1.4 'DM Sans', system-ui, sans-serif; cursor: pointer; min-width: 52px;
}
.qb-speed:hover { border-color: var(--qb-accent); color: var(--qb-accent); }
.qb-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--qb-muted); font-variant-numeric: tabular-nums; }
.qb-seek {
  --pct: 0%; flex: 1; height: 18px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.qb-seek::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(to right, var(--qb-accent) var(--pct), rgba(255,255,255,0.18) var(--pct)); }
.qb-seek::-moz-range-track { height: 5px; border-radius: 999px; background: linear-gradient(to right, var(--qb-accent) var(--pct), rgba(255,255,255,0.18) var(--pct)); }
.qb-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #fff; border: 0; }
.qb-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.qb-seek:focus-visible { outline: 2px solid var(--qb-accent); outline-offset: 2px; }
.qb-transcript { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 10px; }
.qb-transcript summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--qb-ink); }
.qb-transcript summary:hover { color: var(--qb-accent); }
.qb-transcript ol { list-style: none; margin: 10px 0 0; padding: 0 6px 0 0; max-height: 260px; overflow-y: auto; }
.studio-topic .topic-section .qb-transcript li { color: var(--qb-muted); font-size: 13px; line-height: 1.5; margin-bottom: 7px; }
.studio-topic .topic-section .qb-transcript li b { color: var(--qb-accent); font-weight: 700; }
.qb-player.is-playing .qb-cover { animation: qb-pulse 2.4s ease-in-out infinite; }
@keyframes qb-pulse { 50% { transform: scale(1.025); } }
@media (max-width: 520px) {
  .qb-player { grid-template-columns: 92px 1fr; gap: 14px; padding: 14px; }
  .qb-cover-ep { font-size: 32px; }
  .qb-cover-topic { display: none; }
  .qb-btn.qb-skip { display: none; }
}
@media (prefers-reduced-motion: reduce) { .qb-player.is-playing .qb-cover { animation: none; } }

/* ─── Mind map ─────────────────────────────────────────────────────────────── */
.qb-mm-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 16px; }
.qb-mm-toggle {
  border: 1px solid #202322; background: #fff; color: #202322; border-radius: 5px;
  padding: 8px 14px; font: 700 13px/1.4 'DM Sans', system-ui, sans-serif; cursor: pointer;
}
.qb-mm-toggle[aria-pressed="true"], .qb-mm-toggle:hover { background: var(--course, #e5f570); }
.qb-mm-hint { font-size: 13px; color: var(--muted, #58625e); }
.qb-mm {
  position: relative; display: grid; gap: 18px 56px;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 210px) minmax(0, 1fr);
}
.qb-mm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.qb-mm-lines path { fill: none; stroke-width: 3; stroke-linecap: round; opacity: .55; }
.qb-mm-centre {
  grid-column: 2; grid-row: 1 / span var(--rows, 4); align-self: center; position: relative; z-index: 1;
  background: #202322; color: #fff; border-radius: 50%; aspect-ratio: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 18px;
  box-shadow: 0 0 0 8px var(--course, #e5f570);
}
.qb-mm-centre span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--course, #e5f570); }
.qb-mm-centre strong { font: 700 22px/1.1 'Space Grotesk', system-ui, sans-serif; margin: 4px 0; color: #fff !important; }
.qb-mm-centre small { font-size: 12px; color: #c9d2cc; line-height: 1.35; }
.qb-mm-branches { display: contents; }
.qb-mm-branch {
  --c: #386b51; position: relative; z-index: 1; list-style: none; background: #fff;
  border: 1px solid var(--line, #d6dcd5); border-left: 6px solid var(--c); border-radius: 10px; padding: 12px 14px;
}
/* Each branch carries --col (1 = left, 3 = right) and --row; the centre spans --rows. */
.qb-mm-branch { grid-column: var(--col, 1); grid-row: var(--row, auto); }
.studio-topic .topic-section .qb-mm-branch h3 { margin: 0 0 6px; font-size: 17px; color: #202322; display: flex; align-items: center; gap: 8px; }
.qb-mm-branch h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.studio-topic .topic-section p.qb-mm-k { margin: 6px 0 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--c); }
.qb-mm-leaves { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.studio-topic .topic-section .qb-mm-leaves li {
  margin: 0; font-size: 13px; line-height: 1.35; color: #202322; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff);
  transition: filter .2s, background .2s;
}
/* Self-test mode: leaves are blurred until clicked. */
.qb-mm.is-testing .qb-mm-leaves li { cursor: pointer; filter: blur(5px); user-select: none; }
.qb-mm.is-testing .qb-mm-leaves li.is-revealed { filter: none; }
@media (max-width: 860px) {
  .qb-mm { grid-template-columns: 1fr; gap: 12px; }
  .qb-mm-lines { display: none; }
  .qb-mm-centre { grid-column: 1; grid-row: auto; aspect-ratio: auto; border-radius: 12px; padding: 16px; box-shadow: 0 0 0 5px var(--course, #e5f570); margin-bottom: 8px; }
  .qb-mm-branch { grid-column: 1; grid-row: auto; }
}
@media print {
  .qb-mm-tools { display: none; }
  .qb-mm.is-testing .qb-mm-leaves li { filter: none; }
}
