/*
 * learning-embed.css — styling for the Learning section: the /learning hub's
 * guide grid and the guide pages under /learning/<slug>. It is the fourth
 * sibling of sample-embed.css / student-diagrams.css / teacher-diagrams.css
 * and keeps the same contract:
 *
 *  1. Never declare `display` on the BARE `.learning-embed` selector. The
 *     sheet is unlayered, site-tailwind.css puts every utility in
 *     `@layer utilities`, and an unlayered declaration outranks `.hidden`
 *     regardless of specificity (the wizard-page bug sample-embed.css
 *     documents). Descendant rules are safe.
 *  2. For the same layering reason these rules beat Tailwind utilities on the
 *     same element, so content inside `.learning-embed` is written in the
 *     component vocabulary below, never in raw Tailwind utilities.
 *  3. Tokens are declared on `.learning-embed`, never on `:root`, so nothing
 *     leaks into the surrounding page. Colors come only from the palette
 *     already used by sample-embed.css / semantic-colors.ts; the bar fills
 *     mirror SEMANTIC_BAR_FILL. Never hand-pick a new color here.
 *  4. No JavaScript-independent surprises: no fixed or sticky positioning,
 *     z-index at or below 10, and nothing that scrolls the page body (wide
 *     content scrolls inside its own .table-scroll).
 *
 * Companion script: learning-embed.js. Its widgets are data-attribute driven
 * with a `data-lrn-*` vocabulary that is deliberately DISJOINT from
 * sample-embed's `data-toggle` / `data-hl-*`, so the two sheets' guard tests
 * can never trip over each other's markup. No-JS contract: every pane ships
 * visible (with .pane-label captions), controls stay CSS-hidden until the
 * script stamps [data-lrn-js] on <html>, and highlight/checklist triggers ship
 * as plain elements that only become interactive once JS runs.
 */

/* ── Scoped design tokens ── */
.learning-embed {
  --brand-blue: #3b82f6;
  --brand-navy: #1f2937;
  --surface: #ffffff;
  --border: rgba(31, 41, 55, .12);
  --text-primary: #1f2937;
  --text-secondary: rgba(31, 41, 55, .78);
  --text-tertiary: rgba(31, 41, 55, .62);
  --text-quaternary: rgba(31, 41, 55, .42);
  --shadow-warm-sm: 0 1px 3px rgba(31, 41, 55, .05), 0 1px 2px rgba(31, 41, 55, .04);
  --shadow-warm-md: 0 4px 14px rgba(31, 41, 55, .06), 0 2px 4px rgba(31, 41, 55, .04);
  color: var(--text-primary);
}

/* ══ Guide-page header: breadcrumb, title, subtitle ═════════════════════
   A reference library opens quietly. There is no colored hero here: the
   flat blue bar above carries the brand, and the article starts with the
   same breadcrumb trail the BreadcrumbList JSON-LD has always described. */

.learning-embed .guide-header { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.learning-embed .crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  color: var(--text-tertiary); font-size: .8rem; font-weight: 600;
}
.learning-embed .crumbs a { color: var(--text-tertiary); }
.learning-embed .crumbs a:hover { color: var(--brand-blue); text-decoration: underline; }
.learning-embed .crumb-sep { color: var(--text-quaternary); }
.learning-embed .crumbs [aria-current="page"] { color: var(--text-secondary); }
.learning-embed .guide-header .eyebrow { display: block; margin-top: 1.1rem; }
.learning-embed .guide-h1 {
  color: var(--brand-navy); font-size: clamp(1.9rem, 1.55rem + 1.6vw, 2.75rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -.025em;
  max-width: 46rem; margin-top: .45rem;
}
.learning-embed .guide-header .updated { margin-top: 1rem; }

/* ══ Table of contents ══════════════════════════════════════════════════
   Only the SKIN lives here. The rail is positioned by the page shell (a
   Tailwind `lg:sticky` <aside> that sits OUTSIDE this scope), because rule
   4 of the sibling sheets forbids fixed/sticky in this file. Below 1024px
   the same markup reads as a plain card above the article. */

.learning-embed .toc {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: .9rem 1rem;
}
.learning-embed .toc-title {
  color: var(--text-tertiary); font-size: .7rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.learning-embed .toc-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.learning-embed .toc-link {
  display: block; padding: .3rem 0; color: var(--text-secondary);
  font-size: .85rem; font-weight: 600; line-height: 1.45;
}
.learning-embed .toc-link:hover { color: var(--brand-blue); }
.learning-embed .toc-link.is-active { color: var(--brand-blue); font-weight: 700; }
.learning-embed .toc-link:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 6px; }
.learning-embed .toc-sub { list-style: none; margin: 0 0 .2rem; padding: 0 0 0 .9rem; }
.learning-embed .toc-sublink {
  display: block; padding: .22rem 0; color: var(--text-tertiary);
  font-size: .8rem; font-weight: 600; line-height: 1.4;
}
.learning-embed .toc-sublink:hover { color: var(--brand-blue); }
.learning-embed .toc-sublink:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 6px; }

/* Only the section you are reading opens its sub-list. With no JS running
   nothing is ever "active", so every sub-item ships visible instead. */
html[data-lrn-js] .learning-embed .toc-item:not(.is-active) .toc-sub { display: none; }

@media (min-width: 1024px) {
  /* At rail width the card chrome drops away and the list becomes the
     familiar docs spine: one hairline, a blue marker on the active stop. */
  .learning-embed .toc {
    border: 0; border-radius: 0; padding: 0; background: transparent;
    max-height: calc(100vh - 4rem); overflow-y: auto;
  }
  .learning-embed .toc-list { border-left: 1px solid var(--border); }
  .learning-embed .toc-link { padding: .3rem 0 .3rem .85rem; margin-left: -1px; border-left: 2px solid transparent; }
  .learning-embed .toc-link.is-active { border-left-color: var(--brand-blue); }
  .learning-embed .toc-sub { padding-left: 1.7rem; }
}

/* ══ Guide-page shell: typography for the article body ══════════════════ */

.learning-embed .guide-stack { display: flex; flex-direction: column; gap: 1.1rem; }
.learning-embed .guide-stack > * { min-width: 0; }
/* Anchor jumps from the contents list land clear of the heading they aim at,
   whether that is a whole section or one sub-head inside it. */
.learning-embed [id] { scroll-margin-top: 2rem; }

.learning-embed .eyebrow { color: var(--brand-blue); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.learning-embed .updated { color: var(--text-tertiary); font-size: .85rem; font-weight: 600; margin-top: .5rem; }
.learning-embed .updated i { color: var(--brand-blue); margin-right: .35rem; }
.learning-embed .lede { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.75; max-width: 46rem; margin-top: .9rem; }
@media (min-width: 768px) {
  .learning-embed .lede { font-size: 1.15rem; }
}

.learning-embed h2 { color: var(--brand-navy); font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; margin-top: 2.2rem; }
.learning-embed h3 { color: var(--brand-navy); font-size: 1.08rem; font-weight: 700; margin-top: 1.4rem; }
.learning-embed p { line-height: 1.75; color: var(--text-secondary); margin-top: .8rem; }
.learning-embed ul { margin: .8rem 0 0 1.2rem; color: var(--text-secondary); line-height: 1.7; list-style: disc; }
.learning-embed ol { margin: .8rem 0 0 1.2rem; color: var(--text-secondary); line-height: 1.7; list-style: decimal; }
.learning-embed li { margin-bottom: .35rem; }
.learning-embed .text-link { color: var(--brand-blue); font-weight: 600; }
.learning-embed .text-link:hover { text-decoration: underline; }
.learning-embed strong { color: var(--brand-navy); font-weight: 700; }

/* Callouts: the blue note and the amber caution, same palette as the sample
   pages' .sample-note / .caution boxes. */
.learning-embed .note {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 14px; padding: 1rem 1.25rem;
  color: #1e3a8a; font-size: .92rem; line-height: 1.65; margin-top: 1rem;
}
.learning-embed .caution {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; padding: 1rem 1.25rem;
  color: #92400e; font-size: .92rem; line-height: 1.65; margin-top: 1rem;
}

.learning-embed .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-warm-sm); padding: 1.6rem 1.5rem; margin-top: 1.2rem;
}
.learning-embed .card h2 { margin-top: .3rem; font-size: 1.3rem; }
.learning-embed .muted { color: var(--text-tertiary); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 1rem; }
.learning-embed .chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .2rem; }
.learning-embed .chip { background: #eff6ff; color: #1d4ed8; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }

/* Wide tables scroll inside their own card, never the page body. */
.learning-embed .table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: .7rem; }
.learning-embed table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.learning-embed th { text-align: left; background: #f1f5f9; padding: .4rem .6rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #475569; white-space: nowrap; }
.learning-embed td { border-top: 1px solid #e5e7eb; padding: .4rem .6rem; vertical-align: top; color: var(--text-secondary); }

/* Buttons for the service tie-in card and hub links. Hover dims via opacity,
   the same affordance the flat blue header bar uses, so no off-palette hover
   hex is ever introduced. */
.learning-embed .lrn-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--brand-blue); color: #fff; font-weight: 700; font-size: .95rem;
  padding: .65rem 1.3rem; border-radius: 12px;
}
.learning-embed .lrn-btn:hover { opacity: .92; }
.learning-embed .lrn-btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; color: var(--brand-navy); font-weight: 700; font-size: .95rem;
  padding: .65rem 1.3rem; border-radius: 12px; border: 1px solid var(--border);
}
.learning-embed .lrn-btn-ghost:hover { border-color: #bfdbfe; color: #1d4ed8; }
.learning-embed .btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* ══ Interactive widgets (companion: learning-embed.js) ═════════════════ */

/* Controls appear only once JS is running. */
html:not([data-lrn-js]) .learning-embed [role="tablist"],
html:not([data-lrn-js]) .learning-embed .lrn-switch,
html:not([data-lrn-js]) .learning-embed .check-hint { display: none; }

/* Tiny captions that title each stacked pane for no-JS readers. */
html[data-lrn-js] .learning-embed .pane-label { display: none; }
.learning-embed .pane-label { color: var(--text-tertiary); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 1rem 0 .2rem; }

/* Segmented control shared by tab strips and toggle switches. */
.learning-embed .lrn-tabs,
.learning-embed .lrn-switch { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0; }
.learning-embed .seg-btn {
  cursor: pointer; border: 1px solid var(--border); background: #fff; color: #374151;
  font-size: .82rem; font-weight: 700; padding: .42rem .9rem; border-radius: 999px;
}
.learning-embed .seg-btn[aria-selected="true"],
.learning-embed .seg-btn[aria-pressed="true"] {
  background: var(--brand-blue); color: #fff; border-color: var(--brand-blue);
}
.learning-embed .seg-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
@media (hover: hover) {
  .learning-embed .seg-btn:not([aria-selected="true"]):not([aria-pressed="true"]):hover {
    background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe;
  }
}

/* Tab panes: JS toggles `hidden`; no-JS shows them all stacked. */
.learning-embed [role="tabpanel"][hidden] { display: none; }
.learning-embed [role="tabpanel"]:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 12px; }

/* Toggle panes, driven by the group's data-lrn-state. One rule per state per
   named widget; panes may sit in several states via the space-separated
   data-lrn-show list (~= match). Ships all-visible until JS stamps the flag. */
html[data-lrn-js] .learning-embed [data-lrn-toggle="grade"][data-lrn-state="g9"] [data-lrn-show]:not([data-lrn-show~="g9"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="grade"][data-lrn-state="g10"] [data-lrn-show]:not([data-lrn-show~="g10"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="grade"][data-lrn-state="g11"] [data-lrn-show]:not([data-lrn-show~="g11"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="grade"][data-lrn-state="g12"] [data-lrn-show]:not([data-lrn-show~="g12"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="revision"][data-lrn-state="before"] [data-lrn-show]:not([data-lrn-show~="before"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="revision"][data-lrn-state="after"] [data-lrn-show]:not([data-lrn-show~="after"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="aidform"][data-lrn-state="fafsa"] [data-lrn-show]:not([data-lrn-show~="fafsa"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="aidform"][data-lrn-state="cssprofile"] [data-lrn-show]:not([data-lrn-show~="cssprofile"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="satplan"][data-lrn-state="w4"] [data-lrn-show]:not([data-lrn-show~="w4"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="satplan"][data-lrn-state="w8"] [data-lrn-show]:not([data-lrn-show~="w8"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="satplan"][data-lrn-state="w12"] [data-lrn-show]:not([data-lrn-show~="w12"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="activities"][data-lrn-state="before"] [data-lrn-show]:not([data-lrn-show~="before"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="activities"][data-lrn-state="after"] [data-lrn-show]:not([data-lrn-show~="after"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="curriculum"][data-lrn-state="ib"] [data-lrn-show]:not([data-lrn-show~="ib"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="curriculum"][data-lrn-state="alevel"] [data-lrn-show]:not([data-lrn-show~="alevel"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="merit"][data-lrn-state="automatic"] [data-lrn-show]:not([data-lrn-show~="automatic"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="merit"][data-lrn-state="competitive"] [data-lrn-show]:not([data-lrn-show~="competitive"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="merit"][data-lrn-state="regional"] [data-lrn-show]:not([data-lrn-show~="regional"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="brag"][data-lrn-state="thin"] [data-lrn-show]:not([data-lrn-show~="thin"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="brag"][data-lrn-state="useful"] [data-lrn-show]:not([data-lrn-show~="useful"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="waitlist"][data-lrn-state="deferred"] [data-lrn-show]:not([data-lrn-show~="deferred"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="waitlist"][data-lrn-state="waitlisted"] [data-lrn-show]:not([data-lrn-show~="waitlisted"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="waitlist"][data-lrn-state="withdrawn"] [data-lrn-show]:not([data-lrn-show~="withdrawn"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="major"][data-lrn-state="university"] [data-lrn-show]:not([data-lrn-show~="university"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="major"][data-lrn-state="college"] [data-lrn-show]:not([data-lrn-show~="college"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="major"][data-lrn-state="direct"] [data-lrn-show]:not([data-lrn-show~="direct"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="credit"][data-lrn-state="ap"] [data-lrn-show]:not([data-lrn-show~="ap"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="credit"][data-lrn-state="dual"] [data-lrn-show]:not([data-lrn-show~="dual"]),
html[data-lrn-js] .learning-embed [data-lrn-toggle="credit"][data-lrn-state="placement"] [data-lrn-show]:not([data-lrn-show~="placement"]) {
  display: none;
}

/* Highlight-linking: chips light matching sentences. Triggers are upgraded to
   buttons by JS; the plain markup carries no roles for no-JS visitors. */
html[data-lrn-js] .learning-embed [data-lrn-hl-key] { cursor: pointer; }
.learning-embed [data-lrn-hl-key]:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; border-radius: 6px; }
.learning-embed [data-lrn-hl-for] { border-radius: 3px; }
.learning-embed [data-lrn-hl-for].is-hl { background: #fef3c7; }
.learning-embed .chip.is-active { background: var(--brand-blue); color: #fff; }

/* The annotated excerpt reads as prose, so it gets the serif treatment the
   letter sample established for quoted long-form writing. */
.learning-embed .excerpt {
  font-family: Georgia, 'Times New Roman', serif; font-size: .98rem;
  color: var(--text-primary); line-height: 1.85;
  border: 1px solid var(--border); border-radius: 12px; background: #f9fafb;
  padding: 1rem 1.2rem; margin-top: .8rem;
}

/* ── Semantic pills and bar fills: hand-mirrors of SEMANTIC_HEX and
      SEMANTIC_BAR_FILL in src/lib/shared/semantic-colors.ts. ── */
.learning-embed .pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: .16rem .5rem; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap;
}
.learning-embed .pill i { font-size: .62rem; }
.learning-embed .pill-danger  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.learning-embed .pill-caution { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.learning-embed .pill-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.learning-embed .pill-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.learning-embed .pill-neutral { background: #f9fafb; border-color: #e5e7eb; color: #4b5563; }

.learning-embed .bar-danger  { background: #ef4444; }
.learning-embed .bar-caution { background: #f59e0b; }
.learning-embed .bar-success { background: #10b981; }
.learning-embed .bar-info    { background: #3b82f6; }
.learning-embed .bar-neutral { background: #d1d5db; }

.learning-embed .meter-track {
  display: flex; width: 100%; height: .62rem; border-radius: 999px;
  background: #f1f5f9; overflow: hidden;
}
.learning-embed .meter-fill { height: 100%; }
.learning-embed .meter-fill + .meter-fill { border-left: 2px solid #fff; }
.learning-embed .meter-legend {
  display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .55rem;
  font-size: .78rem; font-weight: 600; color: var(--text-tertiary);
}
.learning-embed .legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.learning-embed .legend-dot { width: .6rem; height: .6rem; border-radius: 999px; flex-shrink: 0; }
.learning-embed .meter-title { color: var(--brand-navy); font-weight: 700; font-size: .92rem; margin-bottom: .5rem; }

/* ── Rail: an ordered run of stops (season plans, prep phases). Stacked on
      mobile, a row at desktop widths; four stops need the 1024px threshold. ── */
.learning-embed .rail { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.learning-embed .rail-node {
  flex: 1 1 0; border: 1px solid var(--border); border-radius: 12px;
  background: #f9fafb; padding: .8rem .9rem;
}
.learning-embed .rail-when { color: var(--brand-blue); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.learning-embed .rail-what { color: var(--brand-navy); font-weight: 700; font-size: .92rem; margin-top: .25rem; }
.learning-embed .rail-node p { font-size: .84rem; margin-top: .3rem; line-height: 1.55; }
.learning-embed .rail-edge { display: flex; align-items: center; justify-content: center; color: var(--brand-blue); font-size: .8rem; }
.learning-embed .rail-marker {
  display: flex; align-items: flex-start; gap: .5rem; margin-top: .7rem;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: .6rem .8rem; color: #92400e; font-size: .86rem; line-height: 1.55;
}
.learning-embed .rail-marker i { color: #b45309; margin-top: .18rem; flex-shrink: 0; }
@media (min-width: 1024px) {
  .learning-embed .rail { flex-direction: row; align-items: stretch; }
  .learning-embed .rail-edge i { transform: rotate(-90deg); }
}

/* ── Check-off checklist, remembered per visitor in localStorage. Rows ship
      as plain divs; JS upgrades them to role="checkbox" and drives
      aria-checked, so a no-JS visitor reads a printed checklist. ── */
.learning-embed .check-list { display: flex; flex-direction: column; gap: .45rem; margin-top: .9rem; }
.learning-embed .check-row {
  display: flex; align-items: flex-start; gap: .6rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  padding: .55rem .75rem;
}
html[data-lrn-js] .learning-embed .check-row { cursor: pointer; }
.learning-embed .check-row:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.learning-embed .check-box {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 1.15rem; height: 1.15rem; margin-top: .12rem;
  border: 2px solid #d1d5db; border-radius: 6px; background: #fff;
  color: #fff; font-size: .6rem;
}
.learning-embed .check-box i { visibility: hidden; }
.learning-embed .check-row[aria-checked="true"] .check-box { background: var(--brand-blue); border-color: var(--brand-blue); }
.learning-embed .check-row[aria-checked="true"] .check-box i { visibility: visible; }
.learning-embed .check-text { color: var(--text-secondary); font-size: .9rem; line-height: 1.5; }
.learning-embed .check-row[aria-checked="true"] .check-text { color: var(--text-tertiary); text-decoration: line-through; }
.learning-embed .check-hint { color: var(--text-tertiary); font-size: .8rem; margin-top: .5rem; }
.learning-embed .check-hint i { color: var(--brand-blue); margin-right: .35rem; }

/* ── Key terms: the glossary each guide closes its teaching with, before
      the service card. A <dl>, so a screen reader reads term and definition
      as the pair they are. ── */
.learning-embed .terms { margin-top: 1rem; }
.learning-embed .term-name { color: var(--brand-navy); font-weight: 700; font-size: .95rem; }
.learning-embed .term-def { color: var(--text-secondary); font-size: .92rem; line-height: 1.7; margin: .25rem 0 0; }
.learning-embed .term-def + .term-name { margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--border); }

/* ── Foldable FAQ: native <details>, same look as the service pages' FAQ but
      scoped here so guide pages need no page-local FAQ styles. ── */
.learning-embed .faq-panel {
  border: 1px solid var(--border); border-radius: 18px; background: #fff;
  box-shadow: var(--shadow-warm-sm); padding: .4rem 1.25rem; margin-top: 1rem;
}
.learning-embed .faq-item { padding: .9rem 0; }
.learning-embed .faq-item + .faq-item { border-top: 1px solid var(--border); }
.learning-embed .faq-summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  cursor: pointer; list-style: none;
}
.learning-embed .faq-summary::-webkit-details-marker { display: none; }
.learning-embed .faq-summary h3 { margin: 0; font-size: 1rem; color: var(--brand-navy); font-weight: 700; }
.learning-embed .faq-summary:hover h3 { color: var(--brand-blue); }
.learning-embed .faq-summary:focus-visible { outline: 2px solid #3b82f6; outline-offset: 4px; border-radius: .5rem; }
.learning-embed .faq-chevron { flex-shrink: 0; margin-top: .2rem; font-size: .85rem; color: #9ca3af; }
.learning-embed .faq-item[open] .faq-chevron { transform: rotate(180deg); }
.learning-embed .faq-body { color: var(--text-secondary); line-height: 1.7; margin-top: .6rem; font-size: .95rem; }

/* ── Related guides: compact link rows at the foot of each guide. ── */
.learning-embed .related { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.learning-embed .related-link {
  display: flex; align-items: center; gap: .6rem;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  padding: .7rem .9rem; color: var(--brand-navy); font-weight: 700; font-size: .92rem;
}
.learning-embed .related-link i { color: var(--brand-blue); flex-shrink: 0; }
.learning-embed .related-link:hover { border-color: #bfdbfe; color: #1d4ed8; }

/* ══ Hub guide grid (/learning) ═════════════════════════════════════════ */

/* The hub groups its guides into named collections rather than one flat
   wall, so each row needs its own heading. Sized at the shared card-title
   step so a collection reads as a peer of the section cards below it. */
.learning-embed .collection-heading {
  color: var(--brand-navy); font-size: clamp(1.45rem, 1.3rem + .9vw, 1.75rem);
  font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin-top: .4rem;
}
/* The wall centers its text, and the heading above is full width, so this
   capped-width paragraph has to center its own BOX or its lines sit left of
   the heading they belong to. Declare all four margins in one shorthand:
   Tailwind's preflight zeroes margin in @layer base, and an unlayered rule
   only wins on the properties it actually names, so a lone margin-top leaves
   the sides at 0. Same shape as .trust-caption/.trust-note in hub-chrome.css. */
.learning-embed .collection-intro {
  color: var(--text-secondary); font-size: .95rem; line-height: 1.7;
  max-width: 46rem; margin: .5rem auto 0;
}

.learning-embed .guide-grid { display: grid; gap: 1rem; margin-top: 1.4rem; }
@media (min-width: 640px) { .learning-embed .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .learning-embed .guide-grid { grid-template-columns: 1fr 1fr 1fr; } }
.learning-embed .guide-card {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-warm-sm); padding: 1.3rem 1.25rem; text-decoration: none;
}
.learning-embed .guide-card:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.learning-embed .guide-cat { color: var(--brand-blue); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.learning-embed .guide-title { color: var(--brand-navy); font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.learning-embed .guide-blurb { color: var(--text-tertiary); font-size: .88rem; line-height: 1.6; }
.learning-embed .guide-meta { margin-top: auto; padding-top: .5rem; color: var(--text-tertiary); font-size: .78rem; font-weight: 600; }
.learning-embed .guide-meta i { color: var(--brand-blue); margin-right: .3rem; }
@media (hover: hover) {
  .learning-embed .guide-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-warm-md); }
  .learning-embed .guide-card:hover .guide-title { color: #1d4ed8; }
}

/* Motion is opt-in: every transition sits behind prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .learning-embed .seg-btn { transition: background .15s ease, color .15s ease, border-color .15s ease; }
  .learning-embed [data-lrn-hl-for] { transition: background .18s ease; }
  .learning-embed .guide-card { transition: border-color .15s ease, box-shadow .15s ease; }
  .learning-embed .toc-link { transition: color .15s ease, border-color .15s ease; }
  .learning-embed .toc-sublink { transition: color .15s ease; }
  .learning-embed .related-link { transition: border-color .15s ease, color .15s ease; }
  .learning-embed .faq-chevron { transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1); }
  .learning-embed .check-box { transition: background .15s ease, border-color .15s ease; }
}
