/* HEAL recaps inside the module pages: chips on the objectives, cards at the end of sections, the Recaps library and the pop-up player.
   Pairs with recaps-embed.js. Colours follow the module pages (teal #0B7B6B, dark #042A25, red #CC0033). */
:root { --rcx-teal: #0B7B6B; --rcx-dark: #042A25; --rcx-soft: #E6F3F0; --rcx-line: #CFE3DF; --rcx-mute: #5B6B6F; }

/* buttons start from nothing so the page's own button rules don't leak in (kept at low specificity, so the rules below win) */
.rcx-chip, .rcx-thumb, .rcx-btn, .rcx-link, .rcx-row, :where(.rcx-ov) button {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; text-indent: 0;
  -webkit-tap-highlight-color: transparent; line-height: 1.2; text-transform: none; letter-spacing: normal;
}
.rcx-chip svg, .rcx-btn svg, .rcx-tplay svg, .rcx-ov svg, .rcx-dot svg { fill: currentColor; display: block; }
.rcx-chip:focus-visible, .rcx-thumb:focus-visible, .rcx-btn:focus-visible,
.rcx-link:focus-visible, .rcx-row:focus-visible, .rcx-ov button:focus-visible, .rcx-bar:focus-visible { outline: 2px solid #CC0033; outline-offset: 2px; }

/* ---------- A. Objectives: a play chip on each learning objective a recap covers ---------- */
.rcx-chip {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: 1px; margin-left: 8px; padding: 4px 11px 4px 7px;
  border-radius: 999px; background: var(--rcx-soft); color: var(--rcx-teal); font-size: 12.5px; font-weight: 700; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(11,123,107,0.28); transition: background .15s, color .15s;
}
.rcx-chip svg { width: 13px; height: 13px; }
.rcx-chip:hover { background: var(--rcx-teal); color: #fff; }
.rcx-chip.rcx-seen span::after { content: ' ✓'; }
.lo-numbered li .rcx-chip { margin-left: 6px; }

/* ---------- B. Section cards, and the cards in the library ---------- */
.rcx-cards { display: grid; gap: 12px; margin: 26px 0 30px; }
.rcx-gtitle { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rcx-teal); margin-bottom: -2px; }   /* the title of a group placed after a box */
.rcx-card {
  display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 14px;
  background: #F4FAF8; box-shadow: inset 0 0 0 1px var(--rcx-line);
}
.rcx-thumb {
  position: relative; flex: none; width: 128px; aspect-ratio: 432 / 408; border-radius: 10px; overflow: hidden; background: var(--rcx-dark);
  box-shadow: 0 2px 8px rgba(4,42,37,0.18);
}
.rcx-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.rcx-thumb:hover img { transform: scale(1.04); }
.rcx-tplay {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,0.92); color: var(--rcx-teal); box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.rcx-tplay svg { width: 22px; height: 22px; margin-left: 2px; }
.rcx-tdur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(4,42,37,0.82); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rcx-tseen { display: none; position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--rcx-teal); place-items: center; }
.rcx-tseen svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rcx-seen .rcx-tseen { display: grid; }
.rcx-cbody { flex: 1; min-width: 0; }
.rcx-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--rcx-teal); }
.rcx-ctitle { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--rcx-dark); margin: 3px 0 4px; }
.rcx-card p.rcx-csum { font-size: 14.5px; line-height: 1.5; color: var(--rcx-mute); margin: 0 0 9px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rcx-cact { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; }
.rcx-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px 8px 11px; border-radius: 999px;
  background: var(--rcx-teal); color: #fff; font-size: 13.5px; font-weight: 700; transition: background .15s;
}
.rcx-btn svg { width: 16px; height: 16px; }
.rcx-btn:hover { background: #096A5C; }
.rcx-link { color: var(--rcx-teal); font-size: 13.5px; font-weight: 700; padding: 8px 2px; text-decoration: none; }
.rcx-link:hover { text-decoration: underline; }
.rcx-compact .rcx-thumb { width: 104px; }
.rcx-compact .rcx-ctitle { font-size: 15.5px; }
@media (max-width: 560px) {
  .rcx-card { gap: 12px; padding: 10px; align-items: flex-start; }
  .rcx-thumb, .rcx-compact .rcx-thumb { width: 92px; }
  .rcx-ctitle { font-size: 15.5px; }
  .rcx-card p.rcx-csum { -webkit-line-clamp: 2; font-size: 14px; }
  .rcx-btn { padding: 7px 13px 7px 9px; }
}

/* ---------- hover preview (mouse only) ---------- */
.rcx-tip {
  position: fixed; z-index: 9000; width: 330px; display: flex; gap: 12px; align-items: center; padding: 10px;
  border-radius: 14px; background: var(--rcx-dark); color: #fff; box-shadow: 0 12px 32px rgba(4,42,37,0.35);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.rcx-tip.show { opacity: 1; transform: none; }
.rcx-tip img { width: 96px; height: 91px; border-radius: 8px; object-fit: cover; flex: none; }
.rcx-tip .rcx-kicker { color: #7FD3C3; }
.rcx-tip .rcx-ttl { font-size: 15px; font-weight: 700; line-height: 1.3; margin: 3px 0 4px; }
.rcx-tip .rcx-thint { font-size: 12px; opacity: .65; }

/* ---------- the heading the reader is sent back to ---------- */
.rcx-flash { animation: rcxFlash 2.2s ease; border-radius: 6px; }
@keyframes rcxFlash { 0%, 35% { background: rgba(11,123,107,0.16); box-shadow: 0 0 0 8px rgba(11,123,107,0.16); } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }

/* ---------- the Recaps library page ---------- */
.rcx-lib .rcx-lib-intro { color: var(--rcx-mute); font-size: 15.5px; margin-bottom: 8px; }
.rcx-lib h2 { margin-top: 30px; }
.rcx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.rcx-grid .rcx-card { align-items: flex-start; }
.rcx-grid .rcx-cact { margin-top: 8px; }
@media (max-width: 560px) { .rcx-grid { grid-template-columns: 1fr; } }
.rcx-les { margin: 10px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--rcx-line); background: #fff; overflow: hidden; }
.rcx-les summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 700; color: var(--rcx-dark); font-size: 15.5px; }
.rcx-les summary::-webkit-details-marker { display: none; }
.rcx-les summary::before { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--rcx-teal); border-bottom: 2px solid var(--rcx-teal); transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
.rcx-les[open] summary::before { transform: rotate(45deg); }
.rcx-les summary span:first-of-type { flex: 1; }
.rcx-n { flex: none; font-size: 12px; font-weight: 700; color: var(--rcx-teal); background: var(--rcx-soft); padding: 2px 9px; border-radius: 999px; }
.rcx-rows { padding: 0 8px 6px; }
.rcx-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 7px 8px; border-radius: 10px; transition: background .15s; }
.rcx-row:hover { background: #F2F8F7; }
.rcx-row img { width: 58px; height: 55px; border-radius: 7px; object-fit: cover; flex: none; background: var(--rcx-dark); }
.rcx-rt { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--rcx-dark); line-height: 1.35; }
.rcx-rt small { display: block; font-size: 12px; font-weight: 400; color: var(--rcx-mute); margin-top: 2px; }
.rcx-rd { flex: none; font-size: 13px; font-weight: 700; color: var(--rcx-teal); font-variant-numeric: tabular-nums; }
.rcx-row.rcx-seen .rcx-rd::before { content: '✓ '; }
.rcx-open { display: inline-block; margin: 2px 16px 14px; font-size: 13.5px; font-weight: 700; color: var(--rcx-teal); text-decoration: none; }
.rcx-open:hover { text-decoration: underline; }

/* the sidebar item */
.rcx-nav .rcx-dot svg { width: 10px; height: 10px; margin-left: 1px; }
.rcx-navn { margin-left: auto; font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.14); padding: 1px 8px; border-radius: 999px; }

/* ---------- the player ---------- */
.rcx-ov {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(2,22,19,0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease; font-family: 'Open Sans', 'Segoe UI', system-ui, -apple-system, sans-serif; overscroll-behavior: contain;
}
.rcx-ov.in { opacity: 1; }
.rcx-dlg {
  position: relative; display: flex; height: min(88vh, 860px); border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45); transform: scale(.97); transition: transform .2s ease;
}
.rcx-ov.in .rcx-dlg { transform: none; }
.rcx-vid { position: relative; flex: none; height: 100%; aspect-ratio: 9 / 16; background: #042A25; overflow: hidden; user-select: none; -webkit-user-select: none; }
.rcx-host { position: absolute; inset: 0; overflow: hidden; }
.rcx-hit { position: absolute; inset: 0 0 56px 0; }
.rcx-spin {
  position: absolute; left: 50%; top: 45%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18); border-top-color: #7FD3C3; animation: rcxSpin .8s linear infinite;
}
@keyframes rcxSpin { to { transform: rotate(360deg); } }
.rcx-ready .rcx-spin { display: none; }
.rcx-failed .rcx-spin { animation: none; border: 0; width: 76%; height: auto; margin: 0; left: 12%; color: #fff; text-align: center; font-size: 15px; line-height: 1.5; }
.rcx-big {
  position: absolute; left: 50%; top: 45%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%; display: none; place-items: center;
  background: rgba(255,255,255,0.92); color: var(--rcx-teal); box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.rcx-big svg { width: 38px; height: 38px; margin-left: 4px; }
.rcx-ready.rcx-paused:not(.rcx-ended) .rcx-big { display: grid; }
.rcx-host { transition: filter .25s; }
.rcx-ended .rcx-host { filter: brightness(.32) blur(3px); }   /* the last frame dims behind Replay and Next */
.rcx-end { position: absolute; left: 10%; right: 10%; top: 40%; display: none; flex-direction: column; align-items: center; gap: 10px; }
.rcx-ended .rcx-end { display: flex; }
.rcx-end button { padding: 11px 20px; border-radius: 999px; background: #fff; color: var(--rcx-dark); font-weight: 700; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,0.3); max-width: 100%; }
.rcx-end .rcx-next { background: var(--rcx-teal); color: #fff; }
.rcx-ctl {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 18px 10px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.5)); color: #fff;
}
.rcx-ctl > button { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.rcx-ctl > button:hover { background: rgba(255,255,255,0.12); }
.rcx-ctl svg { width: 22px; height: 22px; }
.rcx-snd .ln { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rcx-silent .rcx-snd { display: none; }   /* a recap not narrated yet plays with captions only */
.rcx-bar { position: relative; flex: 1; height: 26px; cursor: pointer; touch-action: none; }
.rcx-bar i, .rcx-bar b { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; }
.rcx-bar i { right: 0; background: rgba(255,255,255,0.3); }
.rcx-bar b { width: 0; background: #fff; }
.rcx-bar b::after { content: ''; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.rcx-time { flex: none; font-size: 12.5px; font-variant-numeric: tabular-nums; opacity: .92; min-width: 74px; text-align: center; }
.rcx-ctl > .rcx-nb { display: none; width: auto; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5); height: 32px; }
.rcx-x { position: absolute; top: 12px; right: 12px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--rcx-dark); background: rgba(4,42,37,0.06); }
.rcx-x:hover { background: rgba(4,42,37,0.12); }
.rcx-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.rcx-side { width: 380px; flex: none; display: flex; flex-direction: column; padding: 28px 28px 22px; overflow-y: auto; color: #2D3436; }
.rcx-grab { display: none; }
.rcx-side h2 { font-size: 23px; line-height: 1.3; font-weight: 700; color: var(--rcx-dark); margin: 6px 44px 14px 0; }
.rcx-notes p { font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.rcx-notes .rcx-loading { color: var(--rcx-mute); }
.rcx-notes h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rcx-teal); margin: 16px 0 8px; }
.rcx-notes ul { margin: 0 0 4px 18px; padding: 0; }
.rcx-notes li { font-size: 14.5px; line-height: 1.55; margin: 0 0 8px; }
.rcx-acts { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.rcx-acts .rcx-link { display: block; text-align: left; padding: 11px 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--rcx-line); line-height: 1.35; }
.rcx-acts .rcx-link:hover { background: #F2F8F7; text-decoration: none; }

/* phones, small windows and landscape phones: the recap fills the screen, notes come up as a sheet */
@media (max-width: 899px), (max-height: 559px) {
  .rcx-ov { background: #021613; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .rcx-dlg { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; background: #042A25; box-shadow: none; transform: none; }
  .rcx-vid { width: 100%; aspect-ratio: auto; }
  .rcx-ctl { padding: 22px 8px calc(10px + env(safe-area-inset-bottom)); }
  .rcx-hit { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .rcx-ctl > .rcx-nb { display: block; }
  .rcx-x { top: calc(10px + env(safe-area-inset-top)); right: 10px; color: #fff; background: rgba(0,0,0,0.38); }
  .rcx-x:hover { background: rgba(0,0,0,0.5); }
  .rcx-side {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; width: auto; max-height: 72%; background: #fff; border-radius: 18px 18px 0 0;
    padding: 10px 22px calc(18px + env(safe-area-inset-bottom)); transform: translateY(102%); transition: transform .25s ease; box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
  }
  .rcx-notes-open .rcx-side { transform: none; }
  .rcx-grab { display: block; flex: none; width: 44px; height: 5px; border-radius: 3px; background: #CBD5D3; margin: 0 auto 14px; cursor: pointer; position: relative; }
  .rcx-grab::before { content: ''; position: absolute; inset: -12px -40px; }
  .rcx-side h2 { font-size: 20px; margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .rcx-ov, .rcx-dlg, .rcx-side, .rcx-tip, .rcx-thumb img { transition: none; } .rcx-flash { animation: none; } }
