/* ============================================================
   CAPABILITY OUTCOMES
   ============================================================ */

.cap.featured h3 { font-size: var(--text-xl); line-height: var(--leading-xl); }

.msg .who {
  font-size: var(--text-xs);
  font-weight: var(--font-book);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.msg.q .who { color: var(--gray-700); }
.msg.a .who { color: var(--ai-bg-strong); }
.msg .text {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--text-primary);
  font-weight: var(--font-book);
}
.msg.q .text { color: var(--text-primary); }
.msg.a {
  background: var(--ai-bg);
  border-left: 2px solid var(--ai-accent);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ============================================================
   FIND COURSES — tabbed browse-by-discipline
   (relocated from home-additions.css)
   ============================================================ */
.findcourses { background: var(--surface-page); }
.fc-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0 var(--space-6);
  margin-bottom: var(--space-10);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
/* Tab strip overflow signal — main.js stamps [data-overflow] based on the
   strip's scroll position. The fade-mask is the visual cue that there are
   tabs past the visible edge; it shifts as the user scrolls left/right.
   Without this, on tablet/mobile widths the 6 tabs scroll-overflow with
   no hint, and tab-1 visitors never discover Safety or Business. */
.fc-tabs[data-overflow="right"] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}
.fc-tabs[data-overflow="left"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px);
          mask-image: linear-gradient(to right, transparent, #000 56px);
}
.fc-tabs[data-overflow="both"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.fc-tab {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 0 0 var(--space-4);
  background: transparent;
  color: var(--gray-800);
  font-size: var(--text-md);
  line-height: 1.3;
  font-weight: var(--font-book);
  letter-spacing: -0.01em;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}
.fc-tab:hover { color: var(--blue-600); }
.fc-tab:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.fc-tab.is-active {
  border-bottom-color: var(--blue-600);
  color: var(--blue-600);
}
.fc-panel { animation: fcFade var(--duration-base) var(--ease-out); }
.fc-panel[hidden] { display: none; }
@keyframes fcFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* ============================================================
   WHY NEXT — 3-column editorial value props
   ============================================================ */
.whynext { background: var(--surface-subtle); }
.why-grid {
  list-style: none;
  margin: var(--space-12) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
}
.why-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.why-card .why-mark {
  font-size: var(--icon-4xl);
  line-height: 1;
  color: var(--blue-600);
  margin-bottom: var(--space-2);
  align-self: flex-start;
  transform-origin: left center;
}
/* Reveal: strict per-card sequence — icon wipes left-to-right, then text
   fades (no movement). The three cards cascade so the section reads as
   icon₁ → text₁ → icon₂ → text₂ → icon₃ → text₃. AOS only stamps
   .aos-animate as the in-view trigger; its opacity:0 fade on the card is
   overridden so the card itself doesn't fade as a whole.
   All states gated by [data-aos] so pages without JS (or reduced-motion,
   which skips AOS init) render the cards fully revealed. */
.why-card .why-mark {
  font-variation-settings: 'FILL' 0;
}
.why-card[data-aos="fade"] {
  opacity: 1 !important;
}
.why-card[data-aos] .why-mark {
  clip-path: inset(0 100% 0 0);
}
.why-card[data-aos] .why-t,
.why-card[data-aos] .why-d {
  opacity: 0;
}
.why-card[data-aos].aos-animate .why-mark {
  clip-path: inset(0 0 0 0);
  transition: clip-path 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.why-card[data-aos].aos-animate .why-t,
.why-card[data-aos].aos-animate .why-d {
  opacity: 1;
  transition: opacity 250ms ease-out 500ms;
}
/* Desktop cascade: card 2 waits for card 1's text to land; card 3 waits for
   card 2's. Mobile (single column, cards stack and enter view one at a time)
   skips the inter-card delay so a scrolled-in card doesn't sit blank. */
@media (min-width: 901px) {
  .why-card[data-aos]:nth-child(2).aos-animate .why-mark {
    transition-delay: 750ms;
  }
  .why-card[data-aos]:nth-child(2).aos-animate .why-t,
  .why-card[data-aos]:nth-child(2).aos-animate .why-d {
    transition-delay: 1250ms;
  }
  .why-card[data-aos]:nth-child(3).aos-animate .why-mark {
    transition-delay: 1500ms;
  }
  .why-card[data-aos]:nth-child(3).aos-animate .why-t,
  .why-card[data-aos]:nth-child(3).aos-animate .why-d {
    transition-delay: 2000ms;
  }
}
.why-t {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  letter-spacing: -0.015em;
  font-weight: var(--font-bold);
  color: var(--text-primary);
}
.why-d {
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--text-secondary);
  font-weight: var(--font-book);
  max-width: 42ch;
}
@media (max-width: 900px) {
  .why-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}

/* ============================================================
   REDESIGN V2 — operators, course cards, academies carousel
   (relocated from home-additions.css)
   ============================================================ */

/* TRUSTED — real partner logos + honest "Operator logo" placeholders */
.trust-track .org-ph {
  flex: 0 0 auto;
  height: 72px;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-10);
}

/* Real partner logo image */
.org-ph--img img {
  max-height: 40px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  /* brightness(0) flattens brand SVGs to uniform dark silhouettes on the light bg */
  filter: grayscale(1) brightness(0);
  opacity: 0.55;
  transition: opacity var(--duration-base) var(--ease-out),
              filter var(--duration-base) var(--ease-out);
}
.org-ph--img:hover img { opacity: 1; }

/* Honest placeholder box for unsupplied operator logos —
   dashed pill that reads "OPERATOR LOGO" instead of inventing a brand name. */
.org-ph--placeholder {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--font-medium);
  color: var(--text-muted);
  height: 40px;
  padding: 0 var(--space-4);
  min-width: 0;
  width: 140px;
  margin: 0 var(--space-10);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-full);
}

/* ACADEMIES — full-bleed carousel of dark image cards.
   .acad is only ever mounted inside .acads, so rules are unqualified. */
.acads { background: var(--surface-subtle); }
.acads-grid {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Track bleeds past both wrap edges so cards can be partially visible
     on the left as well as the right. padding-left counter-shifts the
     first card so the start state still aligns to the wrap's left edge. */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: var(--space-3) var(--gutter-desktop) var(--space-6) calc(50vw - 50%);
}
.acads-grid::-webkit-scrollbar { display: none; }
.acad {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 0 0 clamp(264px, 23vw, 320px);
  scroll-snap-align: start;
  min-height: 440px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.acad:hover { transform: translateY(-4px); }
.acad-illo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}
.acad-illo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.acad:hover .acad-illo img { transform: scale(1.05); }
.acad-illo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    var(--alpha-black-60) 0%,
    var(--alpha-black-40) 20%,
    var(--alpha-black-20) 38%,
    transparent 60%,
    var(--alpha-black-5) 100%);
}
.acad-head {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-6) var(--space-6);
  color: var(--white);
  text-shadow: 0 1px 16px var(--alpha-black-50);
}
.acad-t {
  margin: 0;
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: var(--font-medium);
  letter-spacing: -0.015em;
}
.acad-meta {
  display: block;
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
}
.acad-plus {
  position: absolute;
  z-index: 2;
  right: var(--space-4);
  bottom: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--blue-600);
  color: var(--white);
  display: grid;
  place-items: center;
  transition: background var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.acad-plus .ms { font-size: var(--icon-2xl); }
.acad:hover .acad-plus { background: var(--darkblue); }

/* ACADEMIES — carousel controls (arrows + dot indicators) */
.acads-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.acads-dots {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.acads-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.acads-dot:hover { background: var(--text-muted); }
.acads-dot.is-active { background: var(--blue-600); }
.acads-nav { display: flex; gap: var(--space-2); flex: 0 0 auto; }
.acads-arrow {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--surface-page);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.acads-arrow:hover { background: var(--blue-600); color: var(--white); border-color: var(--blue-600); }
.acads-arrow:disabled { opacity: 0.35; cursor: default; }
.acads-arrow:disabled:hover { background: var(--surface-page); color: var(--text-primary); border-color: var(--border-default); }
.acads-arrow .ms { font-size: var(--icon-2xl); }

/* RESPONSIVE — find-courses tabs scroll horizontally, grids
   collapse from 4/3 to 2 then 1 column. Academies carousel
   stacks on mobile (the bleed/scroll trick is desktop-only). */
@media (max-width: 1023px) {
  .fc-tab { font-size: var(--text-base); }
  .fc-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .fc-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }

  /* Academies stay horizontal on mobile — one card at a time with a
     small peek of the next, so the carousel still reads as a carousel.
     Bleed disabled — viewport is too narrow for the effect to read. */
  .acads-grid {
    margin-left: 0;
    margin-right: 0;
    padding: var(--space-3) var(--space-6) var(--space-6) 0;
  }
  .acad {
    flex: 0 0 85%;
    min-height: 380px;
  }
}
