/* /learn/pmp tutorial — public pages. Token-based so it follows the site theme.
   The task page mirrors the in-app "guideline" pattern: a sticky sidebar (here a
   progress tracker) beside the reading column. */

.learn-hero { padding: var(--space-8) 0 var(--space-4); }
.learn-hero .section-eyebrow { margin-bottom: var(--space-2); }
.learn-hero h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin: 0 0 var(--space-3); text-wrap: balance; }
.learn-intro { max-width: 46rem; }

/* Task pages run wider than the default 1120px marketing container so the wide
   screenshots render at a useful size in the reading column. */
.learn-wide { max-width: 1460px; }

/* ── Learning Centre shell: master rail (tracks) + the selected track's area ─────
   Two-tier navigation: a narrow rail of learning tracks on the far left, and the
   selected track's own content/submenu to its right. Scales to Finance/HR/docs. */
.lc-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  padding: var(--space-6) 0 var(--space-10);
}
.lc-rail { position: sticky; top: var(--space-6); display: flex; flex-direction: column; gap: 2px; }
.lc-rail-title {
  font-size: var(--fs-label); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--color-text-muted); text-decoration: none;
  padding: 0 var(--space-3) var(--space-2);
}
.lc-rail-title:hover { color: var(--color-text-heading); }
.lc-track {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 8px var(--space-3); border-radius: var(--radius-md);
  text-decoration: none; color: var(--color-text-body); font-size: var(--fs-body-sm); font-weight: 500;
}
.lc-track:hover { background: var(--color-surface-raised); color: var(--color-text-heading); text-decoration: none; }
.lc-track.is-current { background: color-mix(in srgb, var(--color-primary) 12%, transparent); color: var(--color-text-heading); font-weight: 600; }
.lc-track.is-soon { color: var(--color-text-muted); opacity: .6; cursor: default; }
.lc-track-label { min-width: 0; }
.lc-soon {
  flex: 0 0 auto; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted); border: 1px solid var(--color-border);
  border-radius: var(--radius-full); padding: 1px 7px;
}

/* Learn PMP track: submenu + reading column, nested inside the shell's content cell */
.lc-pmp { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.lc-track-nav {
  position: sticky; top: var(--space-6);
  max-height: calc(100vh - var(--space-8)); overflow-y: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  background: var(--color-surface-card); padding: var(--space-4);
}
.lc-content { min-width: 0; }

/* Hub landing (the /learn/ portal content pane) */
.lc-hub { padding-top: var(--space-2); }
.lc-hub h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: var(--space-2) 0 var(--space-3); text-wrap: balance; }
.lc-hub-lead { max-width: 42rem; color: var(--color-text-muted); margin: 0 0 var(--space-6); }
.lc-track-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.lc-track-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  background: var(--color-surface-card); padding: var(--space-5);
  text-decoration: none; color: var(--color-text-heading);
  transition: border-color .15s ease, transform .15s ease;
}
.lc-track-card:hover { border-color: var(--color-border-strong); transform: translateY(-2px); text-decoration: none; }
.lc-track-card.is-soon { opacity: .66; }
.lc-track-card-title { font-weight: 700; font-size: 1.1rem; }
.lc-track-card-desc { font-size: var(--fs-body-sm); color: var(--color-text-muted); flex: 1; }
.lc-track-card-cta { font-size: var(--fs-body-sm); font-weight: 600; color: var(--color-primary); }
.lc-soon-badge {
  align-self: flex-start; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted); border: 1px solid var(--color-border);
  border-radius: var(--radius-full); padding: 2px 8px;
}

/* Responsive: the PMP submenu drops below the reading column, then the whole shell
   collapses to a single column with the rail as a horizontal strip (drill-down feel). */
@media (max-width: 1024px) {
  .lc-pmp { grid-template-columns: 1fr; gap: var(--space-5); }
  .lc-track-nav { position: static; max-height: none; order: 2; }
  .lc-content { order: 1; }
}
@media (max-width: 860px) {
  .lc-shell { grid-template-columns: 1fr; gap: var(--space-4); }
  .lc-rail { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-3); }
  .lc-rail-title { width: 100%; padding: 0 0 var(--space-1); }
}

/* ── Layout: sticky sidebar + reading column ─────────────────────────────────── */
.learn-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
  padding: var(--space-6) 0 var(--space-10);
}
.learn-sidebar {
  position: sticky; top: var(--space-6);
  max-height: calc(100vh - var(--space-8));
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-card);
  padding: var(--space-4);
}
.learn-side-home { display: inline-block; font-size: var(--fs-body-sm); color: var(--color-text-muted); text-decoration: none; margin-bottom: var(--space-3); }
.learn-side-home:hover { color: var(--color-text-heading); }

/* Progress bar + sign-in prompt */
.learn-progress { margin-bottom: var(--space-4); }
.learn-progress-track { height: 8px; border-radius: var(--radius-full); background: var(--color-surface-raised); overflow: hidden; }
.learn-progress-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width .25s ease; }
.learn-progress-label { font-size: var(--fs-label); color: var(--color-text-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.learn-signin { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); background: var(--color-surface-raised); border-radius: var(--radius-md); }
.learn-signin a { color: var(--color-primary); font-weight: 600; }

.learn-side-group { margin-bottom: var(--space-3); }
.learn-side-domain { font-size: var(--fs-label); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted); margin: var(--space-2) 0 var(--space-1); }
.learn-side-task {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px var(--space-2); border-radius: var(--radius-md);
  text-decoration: none; color: var(--color-text-body); font-size: var(--fs-body-sm);
}
.learn-side-task:hover { background: var(--color-surface-raised); }
.learn-side-task.is-current { background: color-mix(in srgb, var(--color-primary) 12%, transparent); color: var(--color-text-heading); font-weight: 600; }
.learn-side-eco { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--color-text-muted); min-width: 26px; }
.learn-side-title { flex: 1; min-width: 0; }

/* Tick button (logged-in only) */
.learn-tick {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--color-border-strong); background: var(--color-input-bg);
  color: transparent; font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.learn-tick.is-done { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.learn-tick:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ── Reading column ──────────────────────────────────────────────────────────── */
.learn-main { min-width: 0; }
.learn-task-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.learn-eco-badge { font-weight: 700; font-size: var(--fs-label); color: #fff; background: var(--color-primary); border-radius: var(--radius-full); padding: 2px 10px; }
.learn-weight { font-size: var(--fs-label); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.learn-main h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 0 0 var(--space-2); text-wrap: balance; }
.learn-inapp { font-size: var(--fs-body-sm); color: var(--color-text-muted); margin: 0 0 var(--space-4); }
.learn-inapp code { background: var(--color-surface-raised); padding: 2px 8px; border-radius: var(--radius-md); color: var(--color-text-heading); }

.learn-body img { max-width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin: var(--space-4) 0; }
.learn-body table { display: block; overflow-x: auto; }

/* Screenshots — a lone block image is wrapped in <figure class="learn-figure"> (see
   content._rewrite), so every shot gets uniform framing + an alt-text caption, on both
   the PMP (.learn-body) and the finance/HR series (.learn-main) pages. */
.learn-figure { margin: var(--space-5) 0; }
.learn-figure img {
  display: block; max-width: 100%; height: auto; margin: 0;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.learn-figure figcaption {
  margin-top: var(--space-2); font-size: var(--fs-body-sm);
  color: var(--color-text-muted); text-align: center; line-height: 1.45;
}

/* Ordinary links stay legible (underlined); tutorial cross-links become a clearly
   clickable "go to lesson" chip so they stand out inside dense table cells. */
.learn-body a:not(.learn-xref) { text-decoration: underline; text-underline-offset: 2px; }
.learn-body a.learn-xref {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 9px; border-radius: var(--radius-full);
  font-size: 0.85em; font-weight: 700; line-height: 1.7; white-space: nowrap;
  text-decoration: none;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 32%, transparent);
}
.learn-body a.learn-xref::after { content: "\2192"; font-weight: 700; }   /* → */
.learn-body a.learn-xref:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--color-primary) 24%, transparent);
  border-color: var(--color-primary);
}

.learn-actions { margin: var(--space-6) 0 var(--space-4); }

.learn-prevnext { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; border-top: 1px solid var(--color-border); padding-top: var(--space-4); margin-top: var(--space-6); }
.learn-prevnext a { color: var(--color-primary); text-decoration: none; font-weight: 600; font-size: var(--fs-body-sm); max-width: 48%; }
.learn-prevnext a:hover { text-decoration: underline; }

/* ── Embedded lesson video ───────────────────────────────────────────────────
   Emitted by content._video() from a markdown paragraph holding only a YouTube
   link. Tokens only — a hardcoded #fff or rgba(255..) here would survive the
   dark-mode flip and glow. */
.learn-video { margin: var(--space-5) 0; }
.learn-video iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0;
  border-radius: var(--radius-lg); background: var(--color-surface-raised);
}
/* A 9:16 Short at full column width would be taller than the viewport, so cap it
   and centre it. The cap is a width because the aspect ratio derives the height. */
.learn-video--vertical iframe { aspect-ratio: 9 / 16; max-width: 320px; margin-inline: auto; }
.learn-video figcaption {
  margin-top: var(--space-2); font-size: var(--fs-body-sm);
  color: var(--color-text-muted); text-align: center;
}

/* ── Index page task grid ────────────────────────────────────────────────────── */
.learn-index-progress { max-width: 46rem; margin: 0 0 var(--space-6); }
.learn-domain { font-size: 1.1rem; margin: var(--space-6) 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); }
.learn-domain span { color: var(--color-text-muted); font-weight: 400; font-size: var(--fs-body-sm); }
.learn-task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.learn-task-card {
  display: flex; align-items: center; gap: var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface-card); padding: var(--space-3) var(--space-4);
  text-decoration: none; color: var(--color-text-heading); transition: border-color .15s ease, transform .15s ease;
}
.learn-task-card:hover { border-color: var(--color-border-strong); transform: translateY(-1px); }
.learn-card-eco { flex: 0 0 auto; font-weight: 700; font-size: var(--fs-label); color: var(--color-primary); min-width: 34px; }
.learn-card-title { flex: 1; min-width: 0; font-size: var(--fs-body-sm); font-weight: 500; }
.learn-card-check { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--color-surface-raised); color: transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.learn-card-check.is-done { background: var(--color-primary); color: #fff; }

@media (max-width: 860px) {
  .learn-layout { grid-template-columns: 1fr; }
  .learn-sidebar { position: static; max-height: none; order: 2; }
  .learn-main { order: 1; }
}

/* ── ITTO process explorer (itto-explained) ─────────────────────────────────
   All 40 processes in one navigable card: a domain-grouped dropdown, prev/next,
   and #id deep-links from the cheat sheet. Styled with the design-system tokens. */
.itto-explorer { scroll-margin-top: var(--space-6); margin: var(--space-5) 0 var(--space-8); }
.itto-ex-bar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.itto-ex-bar label {
  font-size: var(--fs-label); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--color-text-muted);
}
.itto-ex-select {
  flex: 1; min-width: 220px; max-width: 460px;
  padding: 9px var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface-card);
  color: var(--color-text-heading); font-size: var(--fs-body-sm); font-weight: 600;
}
.itto-ex-count { margin-left: auto; font-size: var(--fs-caption); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

.itto-ex-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface-card); padding: var(--space-5);
}
.itto-ex-eyebrow { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-1); }
.itto-ex-domain {
  font-size: var(--fs-caption); font-weight: 700; letter-spacing: .03em;
  color: var(--color-primary); text-transform: uppercase;
}
.itto-ex-group {
  font-size: var(--fs-caption); color: var(--color-text-muted);
  border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 0 8px;
}
.itto-ex-card h3 { margin: 0 0 var(--space-3); font-size: var(--fs-h3, 1.4rem); }
.itto-ex-line { margin: 0 0 var(--space-2); font-size: var(--fs-body-sm); line-height: 1.55; color: var(--color-text-body); }
.itto-ex-line b { color: var(--color-text-heading); }

/* Inputs → Tools → Outputs, as a flow that shows the chain shape at a glance */
.itto-ex-itto {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2);
  margin: var(--space-4) 0; position: relative;
}
.itto-ex-col {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-3); background: var(--color-surface-raised);
}
.itto-ex-col.is-in  { border-left: 3px solid var(--color-info-text, #2563eb); }
.itto-ex-col.is-tt  { border-left: 3px solid var(--color-text-muted); }
.itto-ex-col.is-out { border-left: 3px solid var(--color-success-text, #16a34a); }
.itto-ex-lbl {
  display: block; font-size: var(--fs-label); font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 4px;
}
.itto-ex-col span:last-child { font-size: var(--fs-body-sm); color: var(--color-text-body); line-height: 1.5; }
@media (max-width: 680px) { .itto-ex-itto { grid-template-columns: 1fr; } }

.itto-ex-hook {
  margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border-radius: var(--radius-md); font-size: var(--fs-body-sm); line-height: 1.55;
  color: var(--color-text-body); font-style: italic;
}
.itto-ex-where { margin: 0; font-size: var(--fs-body-sm); color: var(--color-text-body); }
.itto-ex-where a { color: var(--color-primary); font-weight: 600; white-space: nowrap; }

.itto-ex-nav { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-3); }
.itto-ex-btn {
  padding: 8px var(--space-4); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface-card);
  color: var(--color-text-heading); font-size: var(--fs-body-sm); font-weight: 600; cursor: pointer;
}
.itto-ex-btn:hover:not(:disabled) { background: var(--color-surface-raised); border-color: var(--color-primary); }
.itto-ex-btn:disabled { opacity: .4; cursor: default; }

/* ── ITTO-explained tabs (The processes · What is ITTO) ─────────────────────── */
.itto-tabs {
  display: flex; gap: var(--space-1); margin: var(--space-4) 0 var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.itto-tab-btn {
  appearance: none; background: none; border: none; cursor: pointer;
  padding: var(--space-2) var(--space-3); margin-bottom: -1px;
  font-family: inherit; font-size: var(--fs-body); font-weight: 600;
  color: var(--color-text-muted); border-bottom: 2px solid transparent;
}
.itto-tab-btn:hover { color: var(--color-text-heading); }
.itto-tab-btn.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.itto-tabpanel { animation: itto-fade .18s ease; }
.itto-tabpanel > :first-child { margin-top: 0; }    /* no double gap under the tab bar */
@keyframes itto-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .itto-tabpanel { animation: none; } }

/* ── Tools & techniques explorer (reuses .itto-ex-* card; adds the field layout) ── */
.itto-tt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: var(--space-3) 0; }
@media (max-width: 680px) { .itto-tt-grid { grid-template-columns: 1fr; } }
.itto-tt-field { border-top: 1px solid var(--color-border); padding-top: var(--space-2); }
.itto-tt-field .itto-ex-lbl { margin-bottom: 4px; }
.itto-tt-field span:last-child, .itto-tt-best { font-size: var(--fs-body-sm); color: var(--color-text-body); line-height: 1.55; }
.itto-tt-bestwrap { margin: var(--space-3) 0; }
.itto-tt-best { margin: 0; padding-left: 1.1em; }
.itto-tt-best li { margin-bottom: 3px; }
.itto-tt-overkill { font-style: normal; }
.itto-tt-overkill b { color: var(--color-text-heading); }

/* ── Clickable tool chips in a process card + the tool pop-up ─────────────────── */
[x-cloak] { display: none !important; }
.itto-tt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.itto-tt-chip {
  appearance: none; cursor: pointer; font: inherit; font-size: var(--fs-body-sm);
  padding: 2px 10px; border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
}
.itto-tt-chip:hover { background: color-mix(in srgb, var(--color-primary) 16%, transparent); border-color: var(--color-primary); }
.itto-tt-plain { font-size: var(--fs-body-sm); color: var(--color-text-muted); padding: 2px 4px; }

.itto-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); background: color-mix(in srgb, #000 55%, transparent);
}
.itto-modal-card {
  position: relative; max-width: 620px; width: 100%; max-height: 85vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.itto-modal-close {
  position: absolute; top: var(--space-3); right: var(--space-3); appearance: none; cursor: pointer;
  width: 30px; height: 30px; line-height: 1; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-surface-raised);
  color: var(--color-text-muted); font-size: 20px;
}
.itto-modal-close:hover { color: var(--color-text-heading); border-color: var(--color-primary); }
