/* Lesson hero banner with integrated series navigation (TASK-0090).
   Ported from the approved Lovable design (project e2320033). Replaces the old
   mat__hero + bolt-on series card with one cohesive banner. */

.lh {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background-color: #132038;
  box-shadow: 0 18px 40px -18px rgba(10, 18, 34, 0.55);
  box-shadow: 0 18px 40px -18px rgba(10, 18, 34, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
}

/* --- Backdrop --- */
.lh__bg {
  position: absolute;
  inset: 0;
  z-index: -10;
}
.lh__bg-img {
  position: absolute;
  inset: 0;
  z-index: -10;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.7;
}
.lh__bg-scrim {
  position: absolute;
  inset: 0;
  z-index: -10;
  background: linear-gradient(180deg, rgba(19, 32, 56, 0.55) 0%, rgba(19, 32, 56, 0.75) 45%, rgba(19, 32, 56, 0.98) 100%);
}
.lh__bg-plain {
  position: absolute;
  inset: 0;
  z-index: -10;
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(37, 99, 235, 0.35), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(37, 99, 235, 0.18), transparent 60%),
    linear-gradient(180deg, #17264a 0%, #101a30 100%);
}
.lh__accent {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffd500 0%, #ffd500 50%, #2563eb 50%, #2563eb 100%);
}

/* --- Content --- */
.lh__inner {
  position: relative;
  padding: 1.5rem 1.25rem 1.75rem;
}
@media (min-width: 640px) {
  .lh__inner { padding: 2rem 2rem 2.25rem; }
}
@media (min-width: 1024px) {
  .lh__inner { padding: 2.5rem 3rem 3rem; }
}

/* Eyebrow: course + section */
.lh__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}
.lh__course {
  max-width: 100%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.9);
  text-underline-offset: 4px;
  text-decoration: none;
}
.lh__course:hover { color: #fff; text-decoration: underline; }
.lh__eyebrow-sep { color: rgba(255, 255, 255, 0.3); }
.lh__section { color: rgba(255, 255, 255, 0.7); }
/* On narrow screens the eyebrow wraps; hide the middot so it can't sit alone on a line
   (audit 2026-07-04 Finding 20). Course + section then stack cleanly without a separator. */
@media (max-width: 480px) {
  .lh__eyebrow-sep { display: none; }
}

/* Badges */
.lh__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.lh__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  background-color: #2563eb;
}
.lh__code {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.625rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
}

.lh__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) { .lh__title { font-size: 2.25rem; } }
@media (min-width: 1024px) { .lh__title { font-size: 3rem; } }

.lh__summary {
  margin: 1.25rem 0 0;
  max-width: 48rem;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.lh__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-top: 1.5rem;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}
.lh__meta-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.lh__meta-item i { font-size: 0.85em; opacity: 0.8; }

/* Series nav */
.lh__nav {
  margin-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
}
.lh__nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .lh__nav-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
}
.lh__step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0; /* allow the grid column to shrink so long names wrap/clamp instead of overflowing */
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.lh__step:hover { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }
.lh__step:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.6); outline-offset: 2px; }
.lh__step--next { justify-content: flex-end; text-align: right; }
.lh__step-body { min-width: 0; flex: 1; }
.lh__step-eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.5);
}
.lh__step--next .lh__step-eyebrow { text-align: right; }
.lh__step-code {
  margin-right: 0.375rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.125rem 0.375rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.8);
}
.lh__step--next .lh__step-code { margin-right: 0; margin-left: 0.375rem; }
.lh__step-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 0.25rem;
  overflow: hidden;
  white-space: normal;      /* wrap long material names instead of overflowing the hero */
  overflow-wrap: anywhere;  /* break very long unbroken tokens too */
  line-height: 1.3;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.lh__step-arrow { flex-shrink: 0; color: rgba(255, 255, 255, 0.6); transition: transform 0.15s, color 0.15s; }
.lh__step:hover .lh__step-arrow { color: #fff; }
.lh__step--prev:hover .lh__step-arrow { transform: translateX(-2px); }
.lh__step--next:hover .lh__step-arrow { transform: translateX(2px); }
.lh__step--empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
  background: none;
  justify-content: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.3);
  cursor: default;
}
@media (max-width: 639px) { .lh__step--empty { display: none; } }

/* --- Specificity guards: the banner lives inside <article class="mat">, whose
   article-scope rules (.mat h1, .mat a, …) would otherwise repaint hero text dark.
   These scoped selectors (0,2,x) beat the article rules (0,1,x). --- */
.lh .lh__title { color: #fff; }
.lh a.lh__course { color: rgba(255, 255, 255, 0.9); text-decoration: none; }
.lh a.lh__course:hover { color: #fff; text-decoration: underline; }
.lh a.lh__step { color: inherit; }
.lh a.lh__step:hover { color: inherit; }
.lh a.lh__step .lh__step-name { color: #fff; }
.lh .lh__summary { color: rgba(255, 255, 255, 0.82); }
