/* ============================================================================
   /courses/ — two-hub course map
   Mirrors the homepage "Your Path" section: two hubs sit side by side, and each
   one flows down into its single flagship course. Indigo = Build With AI,
   teal = Self Hosting. Uses the global studio tokens (--accent, --signal, fonts).
   ========================================================================== */

.lwh-rails {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 2.5rem;
  max-width: 60rem;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .lwh-rails { grid-template-columns: 1fr 1fr; align-items: start; }
}

.lwh-rail {
  --rail-accent: var(--accent);
  display: flex;
  flex-direction: column;
}
.lwh-rail--build { --rail-accent: var(--accent); }  /* indigo */
.lwh-rail--host  { --rail-accent: var(--signal); }  /* teal   */

/* ---- Hub node: compact chip echoing the homepage hub identity ---- */
.lwh-rail__hub {
  position: relative;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--rail-accent) 35%, var(--line));
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--rail-accent) 11%, var(--surface)),
    var(--surface) 70%);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.lwh-rail__hub:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--rail-accent) 55%, var(--line));
}
.lwh-rail__hub-icon {
  flex-shrink: 0;
  width: 2.5rem; height: 2.5rem;
  border-radius: 10px;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--rail-accent) 16%, transparent);
}
.lwh-rail__hub-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lwh-rail__hub-text { display: flex; flex-direction: column; line-height: 1.15; }
.lwh-rail__hub-eyebrow {
  font-family: var(--font-mono);
  font-size: .62rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--rail-accent) 70%, var(--muted));
}
.lwh-rail__hub-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em;
  color: var(--ink);
}
.lwh-rail__hub-arrow {
  margin-left: auto; flex-shrink: 0;
  color: var(--rail-accent);
  transition: transform .2s ease;
}
.lwh-rail__hub:hover .lwh-rail__hub-arrow { transform: translateX(3px); }

/* ---- Vertical dashed flow: the course "comes from" the hub ---- */
.lwh-rail__flow {
  --rail-dash: color-mix(in srgb, var(--rail-accent) 62%, var(--line));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .85rem 0;
}
.lwh-rail__flow-line {
  width: 2px; height: 1.4rem; border-radius: 2px;
  background-image: linear-gradient(to bottom, var(--rail-dash) 0 5px, transparent 5px 11px);
  background-size: 100% 11px;
  animation: lwh-rail-dash .85s linear infinite;
}
.lwh-rail__flow-label {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
  padding: .26rem .7rem; border-radius: 999px;
  border: 1px dotted color-mix(in srgb, var(--rail-accent) 50%, var(--line));
  background: color-mix(in srgb, var(--rail-accent) 8%, var(--surface));
  color: color-mix(in srgb, var(--rail-accent) 78%, var(--ink));
}
@keyframes lwh-rail-dash { to { background-position: 0 11px; } }

/* ---- Course card lands under the flow with a hub-tinted top accent ---- */
.lwh-rail__course { position: relative; }
.lwh-rail__course > a { display: block; height: 100%; }
.lwh-rail__course .card-memphis { height: 100%; }
.lwh-rail__course::before {
  content: "";
  position: absolute; top: 0; left: 1.1rem; right: 1.1rem; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--rail-accent);
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .lwh-rail__flow-line { animation: none; }
}

/* ============================================================================
   "Why learn with me" feature cards — left-aligned editorial layout.
   Titles reserve two lines and bottom-align so every description starts on the
   same baseline regardless of how the title wraps.
   ========================================================================== */
.lwh-why-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  height: 100%;
}
.lwh-why-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem; height: 3rem;
  border-radius: 12px;
  margin-bottom: 1.1rem;
}
.lwh-why-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 .55rem;
  /* Reserve two lines and bottom-align so all descriptions line up */
  min-height: 2.86rem;
  display: flex;
  align-items: flex-end;
}
.lwh-why-desc {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}
@media (max-width: 639px) {
  /* Single column on mobile — no need to reserve title height */
  .lwh-why-title { min-height: 0; }
}
