/* ============================================================================
   Learn — stage page
   ----------------------------------------------------------------------------
   One stage (Foundations, Shipping it) on a page of its own: header, its courses
   as cards, and the recommended order underneath.

   Everything here is prefixed .ls-. The hub's own styles are .lh-* and live in
   learn.html's inline block; keeping the two apart means restyling a stage page
   cannot quietly move the hub, which is the page every visitor lands on.

   --lh-a is the per-course accent the hub already sets via accentVars(), so a
   card here is the same colour as the same course on the hub.
   ========================================================================= */

:root {
  --ls-ink:   var(--phoenix-emphasis-color, #16203a);
  --ls-muted: var(--phoenix-secondary-color, #6e7891);
  --ls-line:  var(--phoenix-border-color, #e6e8f0);
  --ls-card:  var(--phoenix-card-bg, #fff);
  --ls-violet: #6d5ae6;
}
[data-bs-theme="dark"] {
  --ls-card: #171c2c;
  --ls-line: #2b3247;
}

/* ---- breadcrumb ---------------------------------------------------------- */
.ls-crumb { display: flex; align-items: center; gap: .1rem; font-size: .82rem; margin-bottom: .9rem; }
.ls-crumb a { color: var(--ls-muted); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.ls-crumb a:hover { color: var(--ls-violet); }
.ls-crumb .sep { color: var(--ls-muted); opacity: .55; margin: 0 .5rem; }
.ls-crumb .here { color: var(--ls-violet); font-weight: 700; }

/* ---- header -------------------------------------------------------------- */
.ls-head {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.6rem 1.8rem; margin-bottom: 1.4rem;
  border: 1px solid var(--ls-line); border-radius: 1.3rem;
  /* Lavender wash rather than a saturated block: this sits above a grid of white cards, and a
     strong colour here would make the cards look like an afterthought. */
  background: linear-gradient(120deg, #f4f2ff 0%, #f8f7ff 55%, #ffffff 100%);
}
[data-bs-theme="dark"] .ls-head { background: linear-gradient(120deg, #1c1b3a, #171c2c); }
.ls-head-txt { flex: 1 1 auto; min-width: 0; }

.ls-title { display: flex; align-items: center; gap: .9rem; }
.ls-n {
  flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #7c6cf3, #4f46e5);
  box-shadow: 0 .35rem .9rem rgba(99, 102, 241, .35);
}
.ls-head h1 {
  margin: 0; font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800;
  letter-spacing: -.03em; color: var(--ls-ink);
}
.ls-sub { margin: .3rem 0 0 3.9rem; font-size: .95rem; color: var(--ls-muted); }

.ls-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.1rem 0 0 3.9rem; }
.ls-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .85rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--ls-card); border: 1px solid var(--ls-line); color: var(--ls-ink);
  box-shadow: 0 1px 2px rgba(22, 20, 58, .04);
}
.ls-chip .fa-solid { color: var(--ls-violet); font-size: .82rem; }

.ls-head-art { flex: 0 0 auto; width: min(13rem, 26vw); }
.ls-head-art svg { display: block; width: 100%; height: auto; }
@media (max-width: 767.98px) {
  .ls-head { flex-direction: column; align-items: flex-start; gap: .8rem; padding: 1.2rem 1.1rem; }
  .ls-head-art { display: none; }
  /* The 3.9rem indent lines the subtitle up under the title, past the number badge. On a phone
     that indent costs more than the alignment is worth. */
  .ls-sub, .ls-chips { margin-left: 0; }
}

/* ---- course cards -------------------------------------------------------- */
.ls-grid {
  display: grid; gap: 1rem; margin-bottom: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}
.ls-card {
  position: relative; display: flex; flex-direction: column; gap: .6rem;
  padding: 1.15rem 1.2rem 0; text-decoration: none;
  background: var(--ls-card); border: 1px solid var(--ls-line); border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(22, 20, 58, .04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ls-card:hover {
  transform: translateY(-2px); border-color: var(--lh-a, var(--ls-violet));
  box-shadow: 0 .6rem 1.4rem rgba(22, 20, 58, .10);
}
/* The course you are part-way through. Bordered in its own accent so it is findable in a grid of
   five without reading any of them. */
.ls-card.is-current { border-color: var(--lh-a, var(--ls-violet)); box-shadow: 0 0 0 1px var(--lh-a, var(--ls-violet)); }

.ls-ribbon {
  position: absolute; top: -.6rem; left: 1rem;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem; border-radius: 999px;
  font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, #7c6cf3, #4f46e5);
}
/* Amber, matching the site's "this costs money" colour, so a separately-sold course is never
   mistaken for one a PRO subscription already covers. */
.ls-ribbon.paid { background: linear-gradient(135deg, #e5780b, #fbbf24); color: #3d2801; }

.ls-card-top { display: flex; align-items: center; gap: .7rem; }
/* Holds the course emoji, same as the hub. No `color`: the OS draws these in its own
   palette, so the tint is the whole colour signal. */
.ls-ico {
  flex: 0 0 auto; width: 2.7rem; height: 2.7rem; border-radius: .5rem;
  display: grid; place-items: center; font-size: 1.3rem;
  background: color-mix(in srgb, var(--lh-a, #6d5ae6) 12%, transparent);
}
.ls-name { font-size: 1.02rem; font-weight: 750; color: var(--ls-ink); min-width: 0; }

.ls-pill {
  margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
}
.ls-pill.n { background: color-mix(in srgb, var(--lh-a, #6d5ae6) 12%, transparent);
  color: var(--lh-a, var(--ls-violet)); }
.ls-pill.go { background: rgba(22, 163, 74, .1); color: #15803d; border: 1px solid rgba(22, 163, 74, .25); }
.ls-pill.go i { width: .45rem; height: .45rem; border-radius: 50%; background: #16a34a; }
.ls-pill.done { background: rgba(22, 163, 74, .12); color: #15803d; }

.ls-blurb { font-size: .84rem; line-height: 1.55; color: var(--ls-muted); }

.ls-prog { display: flex; align-items: center; gap: .75rem; margin-top: auto; padding-top: .3rem; }
.ls-bar { flex: 1 1 auto; height: .3rem; border-radius: 999px; background: var(--ls-line); overflow: hidden; }
.ls-bar i { display: block; height: 100%; border-radius: 999px; background: var(--lh-a, var(--ls-violet)); }
.ls-prog-n { flex: 0 0 auto; font-size: .74rem; font-weight: 650; color: var(--ls-muted); }

.ls-foot {
  display: flex; align-items: center; gap: 1.2rem;
  margin: .3rem -1.2rem 0; padding: .7rem 1.2rem;
  border-top: 1px solid var(--ls-line); font-size: .76rem; color: var(--ls-muted);
}
.ls-foot > span { display: inline-flex; align-items: center; gap: .4rem; }

/* ---- learning path ------------------------------------------------------- */
.ls-path {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem;
  padding: 1.15rem 1.3rem; border: 1px solid var(--ls-line); border-radius: 1.1rem;
  background: var(--ls-card);
}
.ls-path-txt { display: flex; align-items: flex-start; gap: .75rem; flex: 0 0 auto; max-width: 16rem; }
.ls-path-ico {
  flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: .5rem;
  display: grid; place-items: center; font-size: 1.15rem;
  background: rgba(109, 90, 230, .12);
}
.ls-path-txt b { display: block; font-size: .88rem; font-weight: 750; color: var(--ls-ink); }
.ls-path-txt i { display: block; font-style: normal; font-size: .76rem; line-height: 1.45; color: var(--ls-muted); }

.ls-path-steps {
  display: flex; align-items: center; flex-wrap: wrap; gap: .4rem;
  list-style: none; margin: 0; padding: 0; flex: 1 1 16rem;
}
/* The arrow between steps is drawn on the item, not inserted as markup, so the sequence reads as
   one list to a screen reader instead of "Core Java, right arrow, OOP". */
.ls-step + .ls-step::before {
  content: "⇢"; color: var(--ls-muted); opacity: .5; margin-right: .4rem; font-size: .9rem;
}
.ls-step { display: flex; align-items: center; }
.ls-step a {
  display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
  font-size: .8rem; font-weight: 650; color: var(--ls-ink);
  padding: .25rem .5rem .25rem .25rem; border-radius: 999px;
}
.ls-step a:hover { background: color-mix(in srgb, var(--lh-a, #6d5ae6) 10%, transparent); }
.ls-step .n {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 800; color: #fff; background: var(--lh-a, var(--ls-violet));
}
.ls-step.done .n::after { content: "✓"; }
.ls-step.done .n { font-size: .78rem; }
/* The number is replaced by a tick when the course is finished, so the row doubles as progress. */
.ls-step.done .n { color: #fff; }

.ls-path-all {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  padding: .7rem 1.2rem; border-radius: .7rem; font-size: .85rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6d5ae6, #4f46e5);
  box-shadow: 0 .3rem .8rem rgba(79, 70, 229, .3);
}
.ls-path-all:hover { filter: brightness(1.07); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .ls-card { transition: none; }
  .ls-card:hover { transform: none; }
}
@media (max-width: 575.98px) {
  .ls-path { flex-direction: column; align-items: stretch; }
  .ls-path-txt { max-width: none; }
  .ls-path-all { margin-left: 0; justify-content: center; }
}

/* ---- course level -------------------------------------------------------- */
/* Tinted by difficulty rather than left in the footer's grey, because the whole reason somebody
   scans this row is to find the course they can actually start. Green/amber/red would read as
   pass-warn-fail, so the ramp is neutral-to-warm instead: none of these is a problem. */
.ls-level { display: inline-flex; align-items: center; gap: .4rem; font-weight: 650; }
.ls-level.beginner     { color: #15803d; }
.ls-level.intermediate { color: #b45309; }
.ls-level.advanced     { color: #a3405a; }
[data-bs-theme="dark"] .ls-level.beginner     { color: #4ade80; }
[data-bs-theme="dark"] .ls-level.intermediate { color: #f0b429; }
[data-bs-theme="dark"] .ls-level.advanced     { color: #ff9ab0; }
