/* =========================================================================
   Nusadaya Academy theme — loaded LAST on every page.

   Brings the Innovesia PMO design language (shadcn tokens, Geist, primary
   #0044C0, rounded-xl controls, hairline-ring cards with a soft drop shadow)
   and LearnHouse's course UI (chapter accordions, activity rows, lesson
   pages) on top of the existing component library without rewriting it.
   ========================================================================= */

body { font-family: var(--font-sans); font-feature-settings: "ss01", "cv11"; letter-spacing: -0.005em; }
h1, h2, h3, h4 { letter-spacing: -0.02em; }

/* ---------- Buttons (PMO: rounded-xl, h-9/h-10, flat primary) ---------- */
.b-btn, .btn {
  border-radius: var(--radius-lg);
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.b-btn-primary, .btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px rgba(0, 68, 192, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: none;
}
.b-btn-primary:hover, .btn-primary:hover:not(:disabled) { background: var(--primary-hover); filter: none; }
.b-btn-primary:focus-visible, .btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.b-btn-outline, .btn-secondary {
  background: #fff; color: var(--ink-900);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-soft);
}
.b-btn-outline:hover, .btn-secondary:hover:not(:disabled) { background: var(--ink-50); border-color: var(--border-strong); color: var(--ink-900); }
.b-btn[disabled], .b-btn:disabled { opacity: 0.5; box-shadow: none; }
.btn-gold { background: var(--ink-900); color: #fff; }

/* ---------- Cards (LearnHouse: white + hairline outline + soft shadow) ---------- */
.b-card, .g-card, .card, .pd-hero {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.b-card__title { color: var(--ink-500); font-weight: 600; letter-spacing: 0.04em; }
.g-card__title { font-weight: 700; }
.g-eyebrow, .b-runner__eyebrow { color: var(--primary); font-weight: 700; }
.ne__chip { border-color: var(--border-default); box-shadow: var(--shadow-soft); }

/* ---------- Status pills: softer, PMO badge shape ---------- */
.b-status { border-radius: var(--radius-pill); font-weight: 600; }

/* ---------- Activity runner ---------- */
.b-runner__topbar { background: color-mix(in srgb, #fff 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.b-runner__close { border-radius: var(--radius-lg); }
.b-runner__progress-seg { height: 6px; border-radius: var(--radius-pill); }
.b-runner__progress-seg.is-materi > span { background: var(--brand-sky); }
.b-runner__progress-seg.is-praktik > span { background: var(--primary); }
.b-runner__group-pill.is-materi { background: #E3F5FD; color: #0074A8; }
.b-runner__group-pill.is-praktik { background: var(--blue-50); color: var(--primary); }
.b-runner__transition-ico.materi { background: #E3F5FD; color: #0074A8; }
.b-runner__title { font-weight: 700; letter-spacing: -0.025em; }
.b-runner__ctabar { background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.b-video-wrap { border-radius: var(--radius-xl); box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 20px 50px -20px rgba(15, 23, 42, 0.45); }
.b-video-wrap__play { color: var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.b-video-source { text-align: center; font-size: 14px; color: var(--ink-500); margin-top: 10px; }
.b-disc-option { border-radius: var(--radius-lg); }

/* =========================================================================
   READING — LearnHouse-style lesson page
   ========================================================================= */
.rd { text-align: left; }
.rd .b-runner__eyebrow { justify-content: flex-start; }
.rd .b-runner__title { text-align: left; font-size: 30px; line-height: 1.2; }
.rd .b-runner__instruction { text-align: left; margin-left: 0; max-width: none; font-size: 16px; color: var(--ink-500); margin-bottom: 10px; }
.rd-meta { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-400); padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--border-default); }
.rd-toc { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.rd-toc__title { grid-column: 1 / -1; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 6px; }
.rd-toc a { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 14px; color: var(--ink-700); }
.rd-toc a:hover { background: var(--blue-50); color: var(--primary); }
.rd-toc a span { font-family: var(--font-mono); font-size: 14px; color: var(--ink-400); min-width: 16px; }
.rd-body { font-size: 16px; line-height: 1.75; color: var(--ink-700); }
.rd-body > * + * { margin-top: 16px; }
.rd-h { font-size: 21px; font-weight: 700; color: var(--ink-900); margin-top: 34px !important; scroll-margin-top: 90px; letter-spacing: -0.02em; }
.rd-h:first-child { margin-top: 0 !important; }
.rd-p strong, .rd-list strong, .rd-table strong { color: var(--ink-900); font-weight: 600; }
.rd-list { padding-left: 4px; display: flex; flex-direction: column; gap: 8px; }
.rd-list li { position: relative; padding-left: 26px; }
.rd-list--bullet li::before { content: ""; position: absolute; left: 8px; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.rd-list--num { counter-reset: rd; }
.rd-list--num li { counter-increment: rd; }
.rd-list--num li::before { content: counter(rd); position: absolute; left: 0; top: 0.22em; width: 19px; height: 19px; border-radius: 6px; background: var(--blue-50); color: var(--primary); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.rd-callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); font-size: 14.5px; line-height: 1.6; }
.rd-callout strong { display: block; color: inherit; margin-bottom: 2px; font-weight: 700; }
.rd-callout p { color: var(--ink-700); }
.rd-callout__icon { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.75); }
.rd-callout--info { background: var(--blue-50); color: var(--primary); }
.rd-callout--tip { background: #E8F7FD; color: #00699A; }
.rd-callout--warning { background: var(--gold-100); color: var(--gold-600); }
.rd-callout--success { background: var(--green-100); color: var(--green-600); }
.rd-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); background: #fff; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.rd-table th { text-align: left; background: var(--ink-50); color: var(--ink-900); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border-default); white-space: nowrap; }
.rd-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-default); vertical-align: top; }
.rd-table tr:last-child td { border-bottom: none; }
.rd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.rd-fact { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 14px 16px; }
.rd-fact__value { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; line-height: 1.15; }
.rd-fact__label { font-size: 14px; color: var(--ink-500); margin-top: 4px; line-height: 1.4; }
.rd-timeline { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 4px; }
.rd-timeline::before { content: ""; position: absolute; left: 47px; top: 8px; bottom: 8px; width: 2px; background: var(--blue-100); border-radius: 2px; }
.rd-timeline li { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.rd-timeline__year { flex-shrink: 0; width: 88px; font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--primary); background: var(--blue-50); padding: 3px 8px; border-radius: var(--radius-pill); text-align: center; position: relative; z-index: 1; margin-left: -1px; }
.rd-timeline li > div { font-size: 14.5px; line-height: 1.6; }
.rd-timeline strong { color: var(--ink-900); display: block; }
.rd-quote { margin: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--primary); font-size: 17px; font-style: italic; color: var(--ink-900); }
.rd-quote cite { display: block; font-style: normal; font-size: 14px; color: var(--ink-500); margin-top: 6px; }
.rd-figure { margin: 0; }
.rd-figure img { width: 100%; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); aspect-ratio: 16 / 9; object-fit: cover; }
.rd-figure figcaption { font-size: 14px; color: var(--ink-500); margin-top: 8px; text-align: center; }

/* =========================================================================
   QUIZ-NUMERIC
   ========================================================================= */
.b-calc-ctx { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 18px; }
.b-calc-ctx__title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); margin-bottom: 8px; }
.b-calc-ctx dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.b-calc-ctx dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border-default); font-size: 14px; }
.b-calc-ctx dt { color: var(--ink-500); }
.b-calc-ctx dd { margin: 0; font-weight: 600; color: var(--ink-900); font-family: var(--font-mono); font-size: 14px; text-align: right; }
.b-calc { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.b-calc__input { flex: 1; font-size: 20px; font-weight: 600; font-family: var(--font-mono); padding: 12px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: #fff; color: var(--ink-900); outline: none; box-shadow: var(--shadow-soft); }
.b-calc__input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.b-calc__input.is-correct { border-color: var(--green-600); background: var(--green-100); }
.b-calc__input.is-wrong { border-color: var(--red-600); background: var(--red-100); }
.b-calc__unit { font-size: 14px; font-weight: 600; color: var(--ink-500); min-width: 48px; }
.b-calc__hint-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--primary); font-size: 14px; font-weight: 600; padding: 4px 0; }
.b-calc__hint { font-size: 14px; color: var(--ink-700); background: var(--ink-50); border-radius: var(--radius-md); padding: 10px 12px; margin-top: 6px; }

/* =========================================================================
   COURSE PAGE — LearnHouse layout
   ========================================================================= */
.lh-page { max-width: 1180px; }
.lh-crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-500); margin-bottom: 14px; }
.lh-crumbs a:hover { color: var(--primary); }
.lh-crumbs strong { color: var(--ink-900); font-weight: 600; }
.lh-crumbs span { color: var(--ink-400); }
.lh-head { margin-bottom: 20px; max-width: 820px; }
.lh-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 10px 0 8px; color: var(--ink-900); }
.lh-head p { font-size: 16px; line-height: 1.6; color: var(--ink-500); }
.lh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.lh-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lh-media { position: relative; aspect-ratio: 16 / 8; border-radius: var(--radius-xl); overflow: hidden; background: #0B1B3F; box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 24px 48px -24px rgba(15,23,42,0.45); }
.lh-media img, .lh-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.lh-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10,10,10,0.55)); pointer-events: none; }
.lh-media:has(iframe)::after { display: none; }
.lh-media__play { position: absolute; left: 18px; bottom: 18px; z-index: 2; display: inline-flex; align-items: center; gap: 10px; border: none; border-radius: var(--radius-pill); background: rgba(255,255,255,0.95); color: var(--ink-900); font-weight: 600; font-size: 14px; padding: 8px 18px 8px 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); transition: transform var(--dur-fast) var(--ease); }
.lh-media__play:hover { transform: translateY(-1px); }
.lh-media__play svg { width: 34px; height: 34px; padding: 9px; border-radius: 50%; background: var(--primary); color: #fff; }
.lh-desc { font-size: 15.5px; line-height: 1.7; color: var(--ink-700); }
.lh-card { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: 20px 22px; }
.lh-card__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--ink-900); }
.lh-card--sticky { position: sticky; top: calc(var(--header-height) + 18px); }
.lh-outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; }
.lh-outcomes li { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-700); }
.lh-outcomes svg { flex-shrink: 0; margin-top: 3px; color: var(--green-600); }
.lh-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.lh-section-head h2 { font-size: 20px; font-weight: 700; color: var(--ink-900); }
.lh-section-head span { font-size: 14px; color: var(--ink-500); }
.lh-link { margin-left: auto; border: none; background: none; color: var(--primary); font-size: 14px; font-weight: 600; padding: 4px 6px; border-radius: 6px; }
.lh-link:hover { background: var(--blue-50); }
.lh-chapters { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); overflow: hidden; }
.lh-chapter + .lh-chapter { border-top: 1px solid var(--border-default); }
.lh-chapter__head { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; background: #fff; transition: background var(--dur-fast) var(--ease); }
.lh-chapter__head::-webkit-details-marker { display: none; }
.lh-chapter__head:hover { background: var(--ink-50); }
.lh-chapter[open] > .lh-chapter__head { background: var(--ink-50); }
.lh-chapter__num { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--blue-50); color: var(--primary); font-family: var(--font-mono); }
.lh-chapter__num.is-done { background: var(--green-100); color: var(--green-600); }
.lh-chapter__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lh-chapter__eyebrow { font-size: 14px; font-weight: 600; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-chapter__title { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.lh-chapter__meta { font-size: 14px; color: var(--ink-500); font-family: var(--font-mono); white-space: nowrap; }
.lh-chapter__chev { color: var(--ink-400); transition: transform var(--dur-base) var(--ease); }
.lh-chapter[open] .lh-chapter__chev { transform: rotate(180deg); }
.lh-chapter__body { padding: 4px 18px 16px 64px; display: flex; flex-direction: column; gap: 12px; }
.lh-chapter__desc { font-size: 14px; color: var(--ink-700); line-height: 1.6; }
.lh-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-400); }
.lh-chapter__objectives ul { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.lh-chapter__objectives li { display: flex; gap: 8px; font-size: 14px; color: var(--ink-700); line-height: 1.5; }
.lh-chapter__objectives svg { flex-shrink: 0; margin-top: 3px; color: var(--primary); }
.lh-chapter__methods { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lh-chapter__methods .lh-label { margin-right: 4px; }
.lh-chip { font-size: 14px; font-weight: 500; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--ink-100); color: var(--ink-700); }
.lh-acts { display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 1px solid var(--border-default); overflow: hidden; }
.lh-acts li + li { border-top: 1px solid var(--border-default); }
.lh-act { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; transition: background var(--dur-fast) var(--ease); }
a.lh-act:hover { background: var(--blue-50); }
a.lh-act:hover .lh-act__title { color: var(--primary); }
.lh-act.is-locked { opacity: 0.75; }
.lh-act__icon { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.lh-act__icon--learn { background: #E3F5FD; color: #0074A8; }
.lh-act__icon--practice { background: var(--blue-50); color: var(--primary); }
.lh-act__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lh-act__title { font-size: 14px; font-weight: 500; color: var(--ink-900); }
.lh-act__type { font-size: 14px; color: var(--ink-500); }
.lh-act__state { color: var(--ink-400); display: flex; }
.lh-done { width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); color: #fff; display: flex; align-items: center; justify-content: center; }
.lh-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lh-progress strong { display: block; color: var(--ink-900); font-size: 15px; margin-top: 2px; }
.lh-progress__sub { display: flex; align-items: center; gap: 5px; font-size: 14px; color: var(--ink-500); margin-top: 4px; }
.lh-bar { margin-bottom: 14px; }
.lh-bar__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-500); margin-bottom: 6px; }
.lh-bar__row strong { color: var(--ink-900); font-family: var(--font-mono); font-weight: 500; }
.lh-bar__track { height: 6px; border-radius: var(--radius-pill); background: var(--ink-100); overflow: hidden; }
.lh-bar__track span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.lh-facts { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border-default); display: flex; flex-direction: column; gap: 10px; }
.lh-facts > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.lh-facts dt { display: flex; align-items: center; gap: 7px; color: var(--ink-500); }
.lh-facts dd { margin: 0; font-weight: 600; color: var(--ink-900); text-align: right; }

@media (max-width: 1024px) {
  .lh-grid { grid-template-columns: 1fr; }
  .lh-card--sticky { position: static; }
  .lh-side { order: -1; }
}
@media (max-width: 640px) {
  .lh-head h1 { font-size: 26px; }
  .lh-outcomes { grid-template-columns: 1fr; }
  .lh-chapter__head { padding: 12px 14px; gap: 10px; }
  .lh-chapter__body { padding: 4px 14px 14px; }
  .lh-media { aspect-ratio: 16 / 10; }
  .rd .b-runner__title { font-size: 24px; }
  .rd-toc { grid-template-columns: 1fr; }
  .rd-body { font-size: 15px; }
  .rd-timeline::before { left: 39px; }
  .rd-timeline__year { width: 74px; }
  .b-calc-ctx dl { grid-template-columns: 1fr; }
}

/* Long lesson pages read top-down instead of being vertically centred. */
.b-runner__stage:has(.rd) { justify-content: flex-start; padding-top: 36px; }
