/* ============================================================
   APEX MARKET MENTOR & ADVISER — Stock Market Academy page
   ============================================================
   Only stock-market-academy.html loads this (body.page-sma).
   Loaded after heritage.css, programs.css and courses.css.

   The page is built around the learning path:
     .sma-strip    the path at a glance, along the foot of the hero
     .sma-path     the centrepiece: Stage 1 (open now) as a large
                   green card, Stages 2 and 3 (coming soon) beside it
     .sma-tabs     the Stage 1 library, one group at a time
                   (built by apex-courses.js; without it every
                   group shows, as before)
     .sma-filter   "Find a sector" over the sector reports
     .sma-reasons  why Apex, a list beside the photos
   ============================================================ */

/* ---------- Hero: the path at a glance ---------- */
.sma-strip { list-style: none; margin: 0; padding: 0; }
.sma-strip .hx-outcome { padding: 0; }
.sma-strip a {
  display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 30px 24px;
  color: inherit; text-decoration: none; transition: background .2s ease;
}
.sma-strip a:hover { background: rgba(220, 183, 101, .08); }
.sma-strip a:focus-visible { outline: 2px solid var(--hx-gold-bright); outline-offset: -4px; }
.sma-strip .hx-outcome:not(.is-open) span:last-child { color: var(--hx-on-dark-muted); }
.sma-strip .is-open span:first-child::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%;
  background: #8fd8b0; box-shadow: 0 0 0 4px rgba(143, 216, 176, .18); vertical-align: middle;
}
.sma-strip .is-open { background: rgba(220, 183, 101, .07); box-shadow: inset 0 3px 0 var(--hx-gold-bright); }

/* ---------- The learning path ---------- */
.sma-path {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: stretch;
}
.sma-stage {
  position: relative; display: flex; flex-direction: column; scroll-margin-top: 8px;
  background: var(--hx-paper); border: 1px solid var(--hx-rule); border-radius: 20px;
}
.sma-stage__head { padding: 28px 30px 18px; }
.sma-stage__tags { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sma-stage__num {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--hx-green); color: var(--hx-gold-bright);
  font-size: 0.7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.sma-stage__live, .sma-stage__soon {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 11px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.sma-stage__live { background: rgba(143, 216, 176, .14); color: #8fd8b0; border: 1px solid rgba(143, 216, 176, .4); }
.sma-stage__live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sma-stage__soon { border: 1px dashed var(--hx-gold); color: var(--hx-gold-ink); }
.sma-stage__head h3 { margin: 16px 0 6px; font-family: var(--hx-serif); font-weight: 500; font-size: 2rem; line-height: 1.05; color: var(--hx-green); }
.sma-stage__goal { margin: 0 0 8px; font-family: var(--hx-serif); font-style: italic; font-size: 1.2rem; line-height: 1.3; color: var(--hx-gold-ink); }
.sma-stage__head p:last-child { margin: 0; font-size: 0.94rem; line-height: 1.6; color: var(--hx-ink-muted); }

.sma-topics { list-style: none; margin: 0; padding: 4px 16px 16px; display: grid; gap: 2px; }
.sma-topics a, .sma-topics__item {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; column-gap: 10px;
  padding: 13px 14px; border-radius: 12px; color: var(--hx-ink); text-decoration: none;
}
.sma-topics a { transition: background .16s ease; }
.sma-topics a:focus-visible { outline: 2px solid var(--hx-gold-bright); outline-offset: -2px; }
.sma-topics__num { font-family: var(--hx-serif); font-size: 1.3rem; font-weight: 600; line-height: 1; color: var(--hx-gold); font-variant-numeric: lining-nums; }
.sma-topics__name { font-weight: 600; line-height: 1.35; }
.sma-topics__where { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.sma-topics__where::after { content: ' \2192'; }

/* Stage 1: the open stage, in the site's deep green */
.sma-stage--open {
  background: var(--hx-green) radial-gradient(120% 80% at 100% 0%, rgba(220, 183, 101, .16), transparent 60%);
  border-color: rgba(220, 183, 101, .45); color: var(--hx-on-dark);
  box-shadow: 0 40px 80px -50px rgba(2, 31, 21, .9);
}
.sma-stage--open .sma-stage__head { padding: 36px 38px 20px; }
.sma-stage--open .sma-stage__num { background: var(--hx-gold-bright); color: var(--hx-green); }
.sma-stage--open .sma-stage__head h3 { font-size: clamp(2.4rem, 4vw, 3.2rem); color: #fffdf7; }
.sma-stage--open .sma-stage__goal { color: var(--hx-gold-bright); font-size: 1.35rem; }
.sma-stage--open .sma-stage__head p:last-child { color: var(--hx-on-dark-muted); }
.sma-stage--open .sma-topics { padding: 4px 22px 8px; }
.sma-stage--open .sma-topics a { color: var(--hx-on-dark); border: 1px solid rgba(220, 183, 101, .18); background: rgba(255, 255, 255, .03); margin-bottom: 8px; }
.sma-stage--open .sma-topics a:hover { background: rgba(220, 183, 101, .12); border-color: rgba(220, 183, 101, .5); }
.sma-stage--open .sma-topics__num { color: var(--hx-gold-bright); }
.sma-stage--open .sma-topics__where { color: var(--hx-gold-bright); }

.sma-facts {
  list-style: none; margin: 8px 38px 0; padding: 18px 0 0; border-top: 1px solid rgba(220, 183, 101, .22);
  display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 0.92rem; color: var(--hx-on-dark-muted);
}
.sma-facts li { display: inline-flex; align-items: baseline; gap: 7px; }
.sma-facts strong { font-family: var(--hx-serif); font-size: 1.7rem; font-weight: 600; line-height: 1; color: var(--hx-gold-bright); }
.sma-stage__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding: 24px 38px 36px; }

/* Stages 2 and 3: listed, quieter, nothing to open yet */
.sma-path__next { display: grid; gap: 24px; align-content: stretch; }
.sma-stage.is-soon { background: rgba(251, 247, 236, .6); border-style: dashed; }
.sma-stage.is-soon .sma-stage__num { background: rgba(3, 42, 29, .6); }
.sma-stage.is-soon .sma-stage__head { padding-bottom: 10px; }
.sma-stage.is-soon .sma-stage__head h3 { font-size: 1.75rem; color: var(--hx-ink-muted); }
.sma-stage.is-soon .sma-stage__goal { font-size: 1.05rem; }
.sma-stage.is-soon .sma-topics { padding-bottom: 6px; }
.sma-stage.is-soon .sma-topics__item { grid-template-columns: 40px 1fr; padding: 8px 14px; }
.sma-stage.is-soon .sma-topics__num { font-size: 1.1rem; color: rgba(201, 162, 75, .65); }
.sma-stage.is-soon .sma-topics__name { font-weight: 500; color: var(--hx-ink-muted); }
.sma-notify {
  align-self: flex-start; margin: auto 30px 24px; padding-top: 6px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #0b6141;
}
.sma-notify:hover { color: var(--hx-green); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Course library: tabs ---------- */
.sma-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 0 auto 34px; padding: 6px; width: fit-content; max-width: 100%;
  background: var(--hx-paper); border: 1px solid var(--hx-rule); border-radius: 999px;
}
.sma-tabs button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--hx-ink);
  transition: background .16s ease, color .16s ease;
}
.sma-tabs button:hover { background: rgba(201, 162, 75, .14); color: var(--hx-green); }
.sma-tabs button:focus-visible { outline: 2px solid var(--hx-gold); outline-offset: 2px; }
.sma-tabs button[aria-selected="true"] { background: var(--hx-green); color: var(--hx-on-dark); }
.sma-tabs__count {
  min-width: 26px; padding: 2px 8px; border-radius: 999px; text-align: center;
  background: rgba(201, 162, 75, .18); color: var(--hx-gold-ink); font-size: 0.75rem; font-variant-numeric: tabular-nums;
}
.sma-tabs button[aria-selected="true"] .sma-tabs__count { background: rgba(220, 183, 101, .22); color: var(--hx-gold-bright); }
.page-sma .cx-groups[data-tabs].is-tabbed { gap: 0; }
.page-sma .cx-groups.is-tabbed .cx-group[hidden] { display: none; }
.page-sma .cx-groups.is-tabbed .cx-group__head { display: none; }

/* ---------- Course cards on this page ---------- */
/* Every course is free: the page says so once, so the cards drop their badge. */
.page-sma .cx-tile { border-radius: 16px; }
.page-sma .cx-tile__badge { display: none; }
.page-sma .cx-tile__lock { position: static; margin-top: auto; padding: 0 22px 20px; justify-content: flex-start; }
/* "Open" becomes a text link with an arrow after it (row-reverse puts ::before last;
   the arrow is decoration, so it has an empty alternative for screen readers). */
.page-sma .cx-tile.is-open .cx-tile__open {
  display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 6px;
  padding: 0; background: none; color: var(--hx-gold-ink); font-size: 0.88rem;
}
.page-sma .cx-tile__open::before { content: '\2192'; content: '\2192' / ''; }
.page-sma .cx-tile:hover .cx-tile__open,
.page-sma .cx-tile__open:hover,
.page-sma .cx-tile__open:focus-visible { background: none; color: var(--hx-green); text-decoration: underline; text-underline-offset: 4px; }
.page-sma .cx-tile__top { padding-bottom: 16px; }
.page-sma .cx-tile__kicker span { font-size: 2.4rem; }

/* Sector reports: a compact, searchable list instead of 32 tall cards */
.page-sma .cx-tiles--compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.page-sma .cx-tiles--compact .cx-tile { flex-direction: row; align-items: center; border-radius: 12px; box-shadow: none; }
.page-sma .cx-tiles--compact .cx-tile:hover { transform: none; }
.page-sma .cx-tiles--compact .cx-tile__top { flex: 1; padding: 14px 16px; gap: 2px; }
.page-sma .cx-tiles--compact .cx-tile__kicker,
.page-sma .cx-tiles--compact .cx-tile__summary { display: none; }
.page-sma .cx-tiles--compact .cx-tile__title { font-family: inherit; font-size: 0.98rem; font-weight: 600; line-height: 1.3; }
.page-sma .cx-tiles--compact .cx-tile__meta { font-size: 0.76rem; }
.page-sma .cx-tiles--compact .cx-tile__lock { margin: 0; padding: 0 16px 0 0; }
.page-sma .cx-tiles--compact .cx-tile.is-open .cx-tile__open { font-size: 0; }
.page-sma .cx-tiles--compact .cx-tile__open::before { font-size: 1.15rem; }
.page-sma .cx-tiles--compact .cx-tile[hidden] { display: none; }

.sma-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 0 0 18px; }
.sma-filter__box { position: relative; flex: 1 1 280px; max-width: 420px; }
.sma-filter__box svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--hx-gold-ink); pointer-events: none; }
.sma-filter input {
  width: 100%; min-height: 48px; padding: 0 16px 0 42px; border: 1px solid var(--hx-rule); border-radius: 999px;
  background: #fffdf7; font: inherit; font-size: 0.95rem; color: var(--hx-ink);
}
.sma-filter input:focus { outline: 2px solid var(--hx-gold); outline-offset: 1px; border-color: var(--hx-gold); }
.sma-filter__count { font-size: 0.8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--hx-gold-ink); }
.sma-filter__none { margin: 6px 0 0; color: var(--hx-ink-muted); }


/* ---------- Why Apex: a list beside the photos ---------- */
.sma-reasons { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sma-reasons li {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--hx-paper); border: 1px solid var(--hx-rule); border-radius: 14px;
}
.sma-reasons li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sma-reasons__ic {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--hx-green); color: var(--hx-gold-bright);
}
.sma-reasons__ic svg { width: 20px; height: 20px; }
.sma-reasons__text { font-family: var(--hx-serif); font-size: 1.15rem; font-weight: 500; line-height: 1.25; color: var(--hx-green); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1024px) {
  .sma-path { grid-template-columns: 1fr; }
  .sma-path__next { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sma-path__next { grid-template-columns: 1fr; gap: 16px; }
  .sma-path { gap: 16px; }
  .sma-stage--open .sma-stage__head { padding: 28px 22px 16px; }
  .sma-stage--open .sma-topics { padding: 4px 12px 4px; }
  .sma-topics a { grid-template-columns: 34px 1fr; row-gap: 2px; }
  .sma-topics a .sma-topics__where { grid-column: 2; }
  .sma-facts { margin: 6px 22px 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px 18px; font-size: 0.82rem; }
  .sma-facts li { flex-direction: column; gap: 2px; }
  .sma-stage__actions { padding: 20px 22px 26px; }
  .sma-stage__actions .hx-btn { flex: 1 1 100%; }
  .sma-stage__head { padding: 24px 20px 12px; }
  .sma-notify { margin: auto 20px 20px; }
  .sma-tabs { border-radius: 18px; width: 100%; }
  .sma-tabs button { flex: 1 1 100%; justify-content: space-between; }
  .sma-reasons { grid-template-columns: 1fr; }
  .sma-strip a { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .sma-topics a, .sma-tabs button, .sma-strip a { transition: none; }
}
