/* ============================================================
 * Academy cross-link module — shared across data pages (PWLB,
 * SONIA, ...). Provides:
 *   .axl-strip      a compact, question-led academy strip (top of page)
 *   .axl-chip       a small "learn this" CTA for a chart/table header
 *   .axl-modal      the course detail modal
 * Self-contained (axl- prefix) so it doesn't touch the predictor's
 * own pt-* academy styles. Pair with academy-crosslink.js.
 * ============================================================ */

/* --axl-* now alias the canonical --pt-* tokens (from tokens.css, loaded
   on every page that uses this module) so brand changes propagate here too.
   --axl-line is kept distinct (slightly lighter than --pt-line). */
:root {
  --axl-orange:      var(--pt-orange);
  --axl-orange-soft: var(--pt-orange-soft);
  --axl-navy:        var(--pt-navy);
  --axl-ink:         var(--pt-text);
  --axl-muted:       var(--pt-muted);
  --axl-line:        #e3e7ec;
}

/* ---- Top strip (question-led entry points) ---- */
.axl-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 14px;
  margin-bottom: 1rem;
  background: rgba(253, 126, 20, 0.05);
  border: 1px solid rgba(253, 126, 20, 0.18);
  border-left: 3px solid var(--axl-orange);
  border-radius: 10px;
}
.axl-strip-intro {
  display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.axl-strip-intro .bi-mortarboard-fill { color: var(--axl-orange); font-size: 1rem; }
.axl-strip-brand {
  font-size: 0.9rem; font-weight: 700; color: var(--axl-navy); white-space: nowrap;
}
.axl-strip-brand .accent { color: var(--axl-orange); }
.axl-strip-tag {
  font-size: 0.82rem; font-weight: 500; color: var(--axl-muted); white-space: nowrap;
}
.axl-strip-buttons { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.axl-q {
  font-family: inherit;
  font-size: 0.82rem; font-weight: 600;
  color: var(--axl-orange);
  background: #ffffff;
  border: 1px solid rgba(253, 126, 20, 0.35);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
}
.axl-q:hover {
  background: var(--axl-orange); color: #ffffff;
  border-color: var(--axl-orange); transform: translateY(-1px);
}

/* ---- Chart/table header chip ("learn this") ----
 * Soft-orange tint + orange text reads cleanly on BOTH the PWLB dark
 * card-headers and the SONIA light panel-headers. Fills on hover. */
.axl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit;
  font-size: 0.74rem; font-weight: 600; line-height: 1;
  color: var(--axl-orange) !important;
  background: rgba(253, 126, 20, 0.14);
  border: 1px solid rgba(253, 126, 20, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.axl-chip:hover {
  background: var(--axl-orange);
  color: #ffffff !important;
  border-color: var(--axl-orange);
}
.axl-chip .bi { font-size: 0.85rem; }

/* ---- Course modal ---- */
.axl-modal {
  position: fixed; inset: 0; z-index: 1080;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.axl-modal[hidden] { display: none; }
.axl-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(2px);
}
.axl-modal-card {
  position: relative;
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 32px 32px 28px;
  box-shadow: 0 20px 60px rgba(10, 37, 64, 0.30);
  animation: axl-modal-in 0.18s ease-out;
}
@keyframes axl-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.axl-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--axl-muted); border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.axl-modal-close:hover { background: rgba(10, 37, 64, 0.06); color: var(--axl-navy); }
.axl-modal-close .bi { font-size: 1.05rem; }

.axl-modal-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.95rem; font-weight: 700;
  color: var(--axl-orange); margin-bottom: 10px;
}
.axl-modal-eyebrow .bi-mortarboard-fill { font-size: 1.05rem; }
.axl-modal-brand { color: var(--axl-navy); font-weight: 700; }
.axl-modal-brand .accent { color: var(--axl-orange); }
.axl-modal-eyebrow-tail { color: var(--axl-muted); font-weight: 500; }

.axl-modal-title {
  font-size: 1.5rem; font-weight: 800; line-height: 1.2;
  color: var(--axl-navy); margin: 0 0 8px; letter-spacing: -0.005em;
}
.axl-modal-sub {
  font-size: 0.95rem; line-height: 1.55; color: var(--axl-ink); margin: 0 0 14px;
}
.axl-modal-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.axl-modal-stat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; font-weight: 600; color: var(--axl-muted);
  background: rgba(10, 37, 64, 0.04); border-radius: 999px; padding: 5px 11px;
}
.axl-modal-stat .bi { font-size: 0.85rem; }
.axl-modal-stat-cpd { background: var(--axl-orange-soft); color: var(--axl-orange); }

.axl-modal-section { margin-bottom: 16px; }
.axl-modal-section-head {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--axl-muted); margin-bottom: 8px;
}
.axl-modal-list {
  margin: 0; padding-left: 18px;
  font-size: 0.9rem; line-height: 1.55; color: var(--axl-ink);
}
.axl-modal-list li { margin-bottom: 4px; }
.axl-modal-list li::marker { color: var(--axl-orange); }

.axl-modal-about {
  font-size: 0.82rem; line-height: 1.5; color: var(--axl-muted);
  background: rgba(10, 37, 64, 0.03); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 18px;
}
.axl-modal-about strong { color: var(--axl-navy); }

.axl-modal-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: var(--axl-orange); color: #fff;
  font-size: 1rem; font-weight: 700;
  border-radius: 10px; padding: 13px 22px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(253, 126, 20, 0.28);
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.axl-modal-cta:hover {
  background: #e06b00; color: #fff; text-decoration: none;
  box-shadow: 0 8px 22px rgba(253, 126, 20, 0.38); transform: translateY(-1px);
}
.axl-modal-cta .bi { font-size: 1.05rem; }

body.axl-modal-open { overflow: hidden; }

/* ---- Multi-course picker ---- */
.axl-modal-card.axl-modal-card-wide-2 { max-width: 820px; }
.axl-modal-card.axl-modal-card-wide-3 { max-width: 1140px; }

.axl-modal-courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.axl-modal-courses-top {
  margin-top: 4px;
}
.axl-modal-course-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--axl-line); border-radius: 12px;
  padding: 18px;
}
.axl-modal-course-title {
  font-size: 1.05rem; font-weight: 800; line-height: 1.25;
  color: var(--axl-navy); margin: 0 0 8px;
}
.axl-modal-course-sub {
  font-size: 0.85rem; line-height: 1.5; color: var(--axl-ink); margin: 0 0 12px;
}
.axl-modal-course-card .axl-modal-stats { margin-bottom: 12px; }
.axl-modal-course-list {
  flex: 1;
  font-size: 0.82rem; margin-bottom: 16px;
}
.axl-modal-course-card .axl-modal-cta {
  font-size: 0.9rem; padding: 11px 18px; margin-top: auto;
}

@media (max-width: 640px) {
  .axl-modal-courses { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .axl-modal-card { padding: 26px 22px 22px; }
  .axl-modal-title { font-size: 1.3rem; }
}
