/*
 * Learning paths.
 *
 * Built on the theme variables so dark mode needs no second set of rules.
 * Each path carries its own accent, passed in as --pa on the element, so one
 * stylesheet serves all six without a class per path.
 */

/* ── the grid of paths ───────────────────────────────────────────────────── */

.lp-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
/* h1 on /paths where it is the page's own title, h2 where the band sits on a
   page that already has one. Same look either way. */
.lp-head h1,
.lp-head h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 4.2vw, 2.5rem); margin: 0 0 12px; }
.lp-head p { color: var(--text-muted); font-size: 1.02rem; line-height: 1.65; margin: 0; }

.lp-sec-title {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  margin: 34px 0 6px; display: flex; align-items: center; gap: 10px;
}
.lp-sec-note { color: var(--text-muted); font-size: .9rem; margin: 0 0 18px; }

.lp-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.lp-card {
  /* min-width:0 or a long course title stops the column shrinking and pushes
     the whole page sideways on a phone. */
  min-width: 0;
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; text-decoration: none; color: inherit;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.lp-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.09); border-color: var(--pa, var(--link-ink)); }
.lp-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  border-radius: 16px 16px 0 0; background: var(--pa, var(--link-ink));
}

.lp-card-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.2rem; color: #fff; background: var(--pa, var(--link-ink)); margin-bottom: 14px;
}
.lp-card h3 { font-family: var(--font-display); font-size: 1.18rem; margin: 0 0 6px; }
.lp-card .lp-tagline { color: var(--text-muted); font-size: .9rem; margin: 0 0 14px; line-height: 1.5; }

.lp-facts { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--text-muted); margin-top: auto; }
.lp-facts span { display: inline-flex; align-items: center; gap: 6px; }
.lp-facts i { color: var(--pa, var(--link-ink)); }

.lp-badge {
  position: absolute; top: 18px; right: 18px;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 4px 10px; border-radius: 20px; background: rgba(22,163,74,.12); color: #166534;
}
/*
 * The dark variant, in the two places the theme uses.
 *
 * :root:not([data-theme="light"]) MUST sit inside the media query. Written
 * outside it, as it was, it matches on a light screen too, and the badge
 * rendered dark-mode green on white. Caught by sampling the computed colour,
 * not by reading this file.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lp-badge { background: rgba(34,197,94,.18); color: #4ade80; }
}
:root[data-theme="dark"] .lp-badge { background: rgba(34,197,94,.18); color: #4ade80; }

/* The thin progress line on a card the viewer has already joined. */
.lp-card-bar { height: 5px; border-radius: 4px; background: var(--surface-alt); margin: 14px 0 0; overflow: hidden; }
.lp-card-bar i { display: block; height: 100%; background: var(--pa, var(--link-ink)); border-radius: 4px; }
.lp-card-prog { font-size: .78rem; color: var(--text-muted); margin-top: 7px; }

/* ── one path ────────────────────────────────────────────────────────────── */

.lp-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 4px solid var(--pa, var(--link-ink));
  border-radius: 16px; padding: 26px; margin-bottom: 24px;
}
.lp-hero-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lp-hero-icon {
  width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center;
  font-size: 1.5rem; color: #fff; background: var(--pa, var(--link-ink)); flex: none;
}
.lp-hero-text { flex: 1 1 260px; min-width: 0; }
.lp-hero h1 { font-family: var(--font-display); font-size: clamp(1.45rem, 3.6vw, 2.1rem); margin: 0 0 6px; }
.lp-hero .lp-tagline { color: var(--text-muted); margin: 0 0 12px; font-size: .96rem; }
.lp-summary { line-height: 1.7; margin: 16px 0 0; color: var(--text); }

.lp-outcome {
  margin-top: 16px; padding: 14px 16px; border-radius: 11px;
  background: var(--surface-alt); border-left: 3px solid var(--pa, var(--link-ink));
  font-size: .92rem; line-height: 1.6;
}
.lp-outcome strong { display: block; margin-bottom: 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }

/* "You are here" */
.lp-you {
  margin-top: 18px; padding: 16px; border-radius: 12px;
  background: var(--surface-alt); border: 1px solid var(--border);
}
.lp-you-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 9px; }
.lp-you-step { font-weight: 700; font-size: .95rem; }
.lp-you-pct { font-size: .85rem; color: var(--text-muted); }
.lp-bar { height: 9px; border-radius: 5px; background: var(--border); overflow: hidden; }
.lp-bar i { display: block; height: 100%; background: var(--pa, var(--link-ink)); border-radius: 5px; transition: width .3s; }
.lp-you-next { margin-top: 12px; font-size: .9rem; color: var(--text-muted); }
.lp-you-next strong { color: var(--text); }

.lp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.lp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--pa, var(--link-ink));
  background: var(--pa, var(--link-ink)); color: #fff; font-weight: 600; font-size: .92rem;
  text-decoration: none; cursor: pointer; font-family: inherit;
  /* 44px of height so it is a real target on a phone. */
  min-height: 44px;
}
.lp-btn:hover { filter: brightness(1.08); }
.lp-btn-ghost { background: transparent; color: var(--pa, var(--link-ink)); }
.lp-btn-ghost:hover { background: color-mix(in srgb, var(--pa, #0891b2) 10%, transparent); filter: none; }
.lp-btn[disabled] { opacity: .55; cursor: default; }

/* ── the syllabus ────────────────────────────────────────────────────────── */

.lp-steps { list-style: none; padding: 0; margin: 0; }

.lp-step {
  position: relative; display: flex; gap: 15px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.lp-step:last-child { border-bottom: 0; }

/* The spine joining the numbers. Drawn on the marker, not the row, so it
   stops cleanly at the last step instead of hanging off the end. */
.lp-step-mark { position: relative; flex: none; width: 38px; display: flex; justify-content: center; }
.lp-step-mark::after {
  content: ''; position: absolute; top: 38px; bottom: -16px; left: 50%;
  width: 2px; margin-left: -1px; background: var(--border);
}
.lp-step:last-child .lp-step-mark::after { display: none; }

.lp-num {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .88rem; position: relative; z-index: 1;
  background: var(--surface); border: 2px solid var(--border); color: var(--text-muted);
}
.lp-step.is-done .lp-num { background: var(--pa, var(--link-ink)); border-color: var(--pa, var(--link-ink)); color: #fff; }
.lp-step.is-now  .lp-num { border-color: var(--pa, var(--link-ink)); color: var(--pa, var(--link-ink)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pa, #0891b2) 16%, transparent); }
.lp-step.is-skip .lp-num { background: var(--surface-alt); border-style: dashed; }

.lp-step-body { flex: 1 1 auto; min-width: 0; }
.lp-step-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.lp-step-title a { font-weight: 650; color: var(--text); text-decoration: none; font-size: 1rem; }
.lp-step-title a:hover { color: var(--link-ink); text-decoration: underline; }

.lp-chip {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 20px; background: var(--surface-alt); color: var(--text-muted);
  /* A one-word chip inherits the body's 1.65 line-height and becomes 38px
     tall. This is the fix, and it has to stay. */
  line-height: 1.2; white-space: nowrap;
}
/* #166534, not #15803d. Measured on the real page the lighter one came out
   4.39:1 against its own tinted background, and this chip is 11px text, which
   needs 4.5. */
.lp-chip-free { background: rgba(22,163,74,.12); color: #166534; }
.lp-chip-cap  { background: color-mix(in srgb, var(--pa, #0891b2) 15%, transparent); color: var(--pa, var(--link-ink)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lp-chip-free { background: rgba(34,197,94,.18); color: #4ade80; }
}
:root[data-theme="dark"] .lp-chip-free { background: rgba(34,197,94,.18); color: #4ade80; }

.lp-step-meta { font-size: .83rem; color: var(--text-muted); display: flex; gap: 13px; flex-wrap: wrap; }
.lp-step-meta span { display: inline-flex; align-items: center; gap: 5px; }

.lp-step-prog { margin-top: 8px; display: flex; align-items: center; gap: 9px; }
.lp-step-prog .lp-bar { flex: 1 1 auto; height: 6px; max-width: 220px; }
.lp-step-prog small { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }

.lp-step-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lp-go {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 14px; border-radius: 9px; font-size: .84rem; font-weight: 600;
  text-decoration: none; min-height: 38px;
  background: var(--pa, var(--link-ink)); color: #fff; border: 1px solid var(--pa, var(--link-ink));
}
.lp-go-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.lp-go-ghost:hover { color: var(--pa, var(--link-ink)); border-color: var(--pa, var(--link-ink)); }

/*
 * "I already know this".
 *
 * min-height here rather than only in a pointer: coarse query. Measured at
 * 390px wide it came out 28px tall, because the coarse-pointer rule below is
 * the only thing that was padding it and a plain narrow viewport does not
 * report a coarse pointer. A real phone would have been fine; everything that
 * measures the page, including me, would have kept calling it too small. A
 * control this easy to mis-tap is not worth making conditional.
 */
.lp-know {
  background: none; border: 0; padding: 4px 2px; cursor: pointer; font: inherit;
  font-size: .76rem; color: var(--text-muted); text-decoration: underline; white-space: nowrap;
  min-height: 34px; display: inline-flex; align-items: center;
}
.lp-know:hover { color: var(--link-ink); }

.lp-crowd-step { font-size: .76rem; color: var(--text-muted); margin-top: 6px; }

/* ── the pool ────────────────────────────────────────────────────────────── */

.lp-pool {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 22px;
}
.lp-pool h3 { font-family: var(--font-display); font-size: 1.02rem; margin: 0 0 12px; display: flex; align-items: center; gap: 9px; }
.lp-pool-stat { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; }
.lp-pool-stat b { font-size: 1.6rem; font-family: var(--font-display); color: var(--pa, var(--link-ink)); }
.lp-pool-stat span { color: var(--text-muted); font-size: .9rem; }
.lp-pool p { color: var(--text-muted); font-size: .88rem; line-height: 1.6; margin: 10px 0 14px; }

/* ── the strip on a course page ──────────────────────────────────────────── */

/* --surface, not --surface-alt: the course page drops this into a section that
   is already --surface-alt, and a panel the same colour as its background is
   not a panel. */
.lp-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--pa, var(--link-ink));
  border-radius: 12px; padding: 13px 17px; margin-bottom: 20px;
}
.lp-strip-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--pa, var(--link-ink)); color: #fff; flex: none; }
.lp-strip-text { flex: 1 1 200px; min-width: 0; font-size: .9rem; }
.lp-strip-text b { display: block; }
.lp-strip-text small { color: var(--text-muted); }
.lp-strip a.lp-go { flex: none; }

/* ── the hub ─────────────────────────────────────────────────────────────── */

.lp-resume {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 4px solid var(--pa, var(--link-ink));
  border-radius: 16px; padding: 24px; margin-bottom: 24px;
}
.lp-resume h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 4px; }
.lp-resume .lp-tagline { color: var(--text-muted); font-size: .92rem; margin: 0 0 16px; }

.lp-empty {
  background: var(--surface); border: 1px dashed var(--border); border-radius: 16px;
  padding: 44px 24px; text-align: center; color: var(--text-muted);
}
.lp-empty i { font-size: 2.3rem; color: var(--border); display: block; margin-bottom: 14px; }
.lp-empty h2 { font-family: var(--font-display); color: var(--text); font-size: 1.2rem; margin: 0 0 8px; }

/* ── phones ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .lp-grid { grid-template-columns: 1fr; }
  .lp-step { gap: 11px; }
  .lp-step-mark { width: 32px; }
  .lp-num { width: 32px; height: 32px; font-size: .8rem; }
  .lp-step-mark::after { top: 32px; }
  /* The button drops under the text rather than squeezing the title into a
     four-character column. */
  .lp-step { flex-wrap: wrap; }
  .lp-step-side { flex-direction: row; align-items: center; width: 100%; padding-left: 43px; gap: 14px; }
  .lp-hero, .lp-pool, .lp-resume { padding: 18px; }
}

/* Only where a finger is the pointer, and only on narrow screens, or this
   inflates the same controls on a desktop with a touch screen. */
@media (max-width: 900px) and (pointer: coarse) {
  .lp-know { padding: 9px 2px; }
}
