/* ==========================================================================
   Training page (round 20, Solutions layout round 21). Layout only: controls come from components.css
   and every size from tokens.css. Copy from Training.pdf; card grid and FAQ
   rows follow the Figma Product Page (frames 2022:1046 and 2022:1010).
   ========================================================================== */

/* ---- Shared text roles ------------------------------------------------- */
/* Lead: the one-line statement under each heading (same role as the Enquire lead) */
.trn-lead { font-family: var(--font-display); font-weight: var(--weight-light); font-size: var(--fs-title); line-height: 1.3; color: #fff; }
/* Note: the closing line of a block, white body text so it reads as the takeaway */
.trn-note { font-size: var(--fs-body); line-height: var(--lh-body); color: #fff; }
.trn-note strong { font-weight: var(--weight-medium); }
.trn-eyebrow { font-size: var(--fs-small); color: var(--text-secondary); letter-spacing: 0.02em; }

/* ---- Hero (round 22) --------------------------------------------------
   Solutions pages: full bleed cinematic photo, short heading at the bottom.
   GSAP scales the media wrapper on load and moves the img on scroll, so the
   two transforms live on different elements and never fight. The img is 108%
   tall and starts 8% above the top, which leaves room for the parallax. */
.trn-hero { position: relative; height: 100vh; height: 100svh; min-height: 40rem; overflow: hidden; background: #000; isolation: isolate; }
.trn-hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.trn-hero__media img {
  position: absolute; left: 0; top: -8%; width: 100%; height: 108%;
  object-fit: cover; object-position: 62% 60%;
}
.trn-hero__shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0) 22%, rgb(0 0 0 / 0) 52%, rgb(0 0 0 / 0.88) 100%),
    radial-gradient(60% 55% at 0% 100%, rgb(0 0 0 / 0.7) 0%, rgb(0 0 0 / 0) 70%);
}
.trn-hero__content {
  position: absolute; inset: auto 0 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-8);
  padding-bottom: clamp(2.5rem, 6vh, 4.5rem);
}
.trn-hero__title { display: grid; justify-items: start; gap: var(--space-5); }
.trn-hero__aside { display: grid; justify-items: start; gap: var(--space-5); max-width: 22rem; }

/* ---- Light second section (round 21) ----------------------------------
   Every Solutions page keeps its second section light for contrast. */
.trn-light { background: #fff; color: #000; padding: var(--section-y) 0; }
.trn-intro {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 7vw, 9rem); align-items: start;
  padding-bottom: clamp(3.5rem, 7vw, 7rem); margin-bottom: clamp(3.5rem, 7vw, 7rem);
  border-bottom: 1px solid #e6e6e6;
}
/* Intro statement: words darken on scroll, the same sweep as the home intro */
.trn-intro__statement { max-width: 24ch; font-family: var(--font-display); font-weight: var(--weight-light); font-size: var(--fs-display-2); line-height: 1.15; color: #000; text-wrap: balance; }
.trn-intro__statement .w { transition: none; }
.trn-intro__copy { display: grid; gap: var(--space-5); padding-top: var(--space-2); }
.trn-light .t-body { color: var(--color-gray-550); }
.trn-light .t-display { color: #000; }
.trn-light .t-display .muted { color: var(--color-gray-450); }
.trn-light .trn-lead, .trn-light .trn-note { color: #000; }
.trn-light .trn-eyebrow { color: var(--color-gray-550); }
.trn-light .trn-split__media { background: var(--color-gray-50); }

/* ---- Text + image split ------------------------------------------------ */
.trn-split { padding: var(--section-y) 0; }
.trn-split__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(3rem, 7vw, 9rem); align-items: center; }
.trn-split--reverse .trn-split__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.trn-split__copy { display: grid; justify-items: start; gap: var(--space-5); max-width: 36rem; }
.trn-split__copy .t-display { margin-bottom: var(--space-2); }
.trn-split__copy .trn-note { margin-top: var(--space-2); }
.trn-split__media { margin: 0; aspect-ratio: 743 / 416; border-radius: var(--radius-md); overflow: hidden; background: var(--color-gray-900); }
.trn-split__media img { width: 100%; height: 100%; object-fit: cover; }
/* Colour photo kept in the black and white language of the page, colour on hover */
.trn-split__media--mono img { filter: grayscale(1) contrast(1.05); transition: filter var(--dur-slow) var(--ease-out); }
.trn-split__media--mono:hover img { filter: grayscale(0); }

/* ---- Modules slider (round 21) ----------------------------------------
   Design system parts: .counter, .slider-controls (40 px arrows), glass cards.
   Cards run off the right edge of the screen; the viewport only clips on the
   left so a passed card never slides over the side column. */
.trn-modules { position: relative; overflow: hidden; padding: var(--section-y) 0; }
.trn-modules__bg {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 0.2) 30%, rgb(0 0 0 / 0.2) 70%, #000 100%), url("../img/hero-bg.webp") 70% 50% / cover no-repeat;
}
.trn-modules .container { position: relative; }
.trn-modules__head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 6rem); align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.trn-modules__head .t-body { max-width: 26rem; }

.trn-slider { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4.5rem); align-items: stretch; }
.trn-slider__side { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-5); }
.trn-slider__name { font-family: var(--font-display); font-weight: var(--weight-light); font-size: var(--fs-title); line-height: 1.25; color: #fff; min-height: 2.5em; }
.trn-slider__bar { width: 100%; max-width: 12rem; height: 2px; border-radius: 2px; background: var(--color-gray-800); overflow: hidden; }
.trn-slider__bar span { display: block; height: 100%; width: calc(100% / 7); background: #fff; border-radius: inherit; transition: width var(--dur-slow) var(--ease-out); }
.trn-slider__side .slider-controls { margin-top: auto; }
/* Round 23: no card is ever cut. The viewport clips at its own edges and JS
   sizes the cards (--card-w) so a whole number of them fills it exactly; the
   wide first card spans two slots when three or more fit. */
.trn-slider__viewport { position: relative; min-width: 0; clip-path: inset(-2rem -1px -2rem -1px); touch-action: pan-y; cursor: grab; }
.trn-slider__viewport.is-dragging { cursor: grabbing; }
.trn-slider__track { display: flex; align-items: stretch; gap: var(--space-2); margin: 0; padding: 0; list-style: none; will-change: transform; }

.trn-card {
  flex: none; width: var(--card-w, clamp(16.5rem, 23vw, 22rem)); min-height: 24rem;
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-8) var(--space-8) var(--space-10);
  border-radius: var(--radius-md);
  background: rgb(24 24 26 / 0.5);
  border: 1px solid rgb(255 255 255 / 0.05);
  backdrop-filter: blur(var(--blur-card)) saturate(1.2); -webkit-backdrop-filter: blur(var(--blur-card)) saturate(1.2);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
  user-select: none;
}
.trn-card:hover { background: rgb(38 38 40 / 0.6); border-color: rgb(255 255 255 / 0.08); }
/* Cards before the active one dim as they leave */
.trn-card.is-past { opacity: 0.35; }
.trn-card.is-active { border-color: rgb(255 255 255 / 0.1); }
.trn-card--wide { width: var(--card-w-wide, clamp(20rem, 34vw, 33rem)); }
.trn-card__icon { width: 2.625rem; height: 2.625rem; display: grid; place-items: center; margin-bottom: var(--space-4); border-radius: 0.5rem; background: var(--color-gray-850); color: #fff; }
.trn-card__icon svg { width: 1.125rem; height: 1.125rem; }
.trn-card__title { font-size: var(--fs-body); font-weight: var(--weight-regular); line-height: 1.3; color: #fff; }
.trn-card__text { display: grid; gap: var(--space-3); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-secondary); }
.trn-card__close { color: #fff; }

/* ---- Certification timeline (round 21) ---------------------------------
   Four stops rising from a ticked rail. --p (0 to 1) is the rail fill, driven
   by a GSAP scrub; --h is each stem height, set inline. */
.trn-cert { padding: var(--section-y) 0; overflow: hidden; }
.trn-cert__head { display: grid; justify-items: center; gap: var(--space-4); max-width: 42rem; margin-inline: auto; }
.trn-cert__head .t-display { margin-bottom: var(--space-3); }

.tl {
  --p: 1; --rail: 0.875rem; --pill: 2.5rem;
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end;
  max-width: 68rem; margin: clamp(2.5rem, 4vw, 3.5rem) auto 0; padding: 0; list-style: none;
}
/* The rail: base ticks plus a bright copy that fills with --p */
.tl::before, .tl::after {
  content: ""; position: absolute; left: 0; bottom: calc(var(--pill) / 2 - var(--rail) / 2); height: var(--rail);
  background: repeating-linear-gradient(90deg, var(--color-gray-700) 0 2px, transparent 2px 6px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  pointer-events: none;
}
.tl::before { right: 0; }
.tl::after { width: calc(var(--p) * 100%); background-image: repeating-linear-gradient(90deg, var(--color-gray-200) 0 2px, transparent 2px 6px); }
.tl__stop { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.tl__label { font-family: var(--font-display); font-weight: var(--weight-light); font-size: var(--fs-title-lg); line-height: 1.2; color: #fff; text-align: center; margin-bottom: var(--space-3); }
.tl__stop:not(.tl__stop--last) .tl__label { color: var(--text-muted); }
.tl__dot { position: relative; width: 0.5625rem; height: 0.5625rem; border-radius: 50%; border: 1px solid var(--color-gray-200); background: #000; }
.tl__stop--last .tl__dot { background: #fff; border-color: #fff; }
.tl__stop--last .tl__dot::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgb(255 255 255 / 0.7);
  animation: tl-pulse 2.4s var(--ease-out) infinite;
}
@keyframes tl-pulse { from { scale: 1; opacity: 1; } to { scale: 3.2; opacity: 0; } }
/* Round 23: stems gain opacity stop by stop as the timeline advances */
.tl__stem { width: 1px; height: var(--h); background: linear-gradient(180deg, #fff, rgb(255 255 255 / 0.15)); opacity: var(--o, 1); transform-origin: 50% 100%; }
.tl__stop:nth-child(1) { --o: 0.25; }
.tl__stop:nth-child(2) { --o: 0.45; }
.tl__stop:nth-child(3) { --o: 0.7; }
.tl__stop:nth-child(4) { --o: 1; }
.tl__pill {
  display: inline-flex; align-items: center; gap: var(--space-3);
  height: var(--pill); padding: 0 0.25rem 0 var(--space-4);
  border-radius: var(--radius-pill); background: var(--color-gray-900); border: 1px solid var(--color-gray-800);
  font-size: var(--fs-small); color: var(--color-gray-200); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tl__icon { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #000; }
.tl__icon svg { width: 1rem; height: 1rem; }

/* ---- From training to treatment ---------------------------------------- */
.trn-next { padding: var(--section-y) 0; }
.trn-next__panel {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: stretch;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--color-gray-950); border: 1px solid var(--color-gray-800);
}
.trn-next__copy { display: grid; justify-items: start; align-content: center; gap: var(--space-5); padding: clamp(2.5rem, 6vw, 6rem) clamp(1.5rem, 5vw, 5.5rem); }
.trn-next__copy .t-display { margin-bottom: var(--space-2); }
.trn-next__copy .btn { margin-top: var(--space-3); }
.trn-next__media { position: relative; margin: 0; min-height: 22rem; }
.trn-next__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
/* Blend the photo into the panel on its inner edge */
.trn-next__media::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, var(--color-gray-950) 0%, rgb(17 17 17 / 0) 40%); pointer-events: none; }

/* ---- FAQ (Figma 2022:1010) --------------------------------------------- */
.trn-faq { position: relative; overflow: hidden; padding: var(--section-y) 0; }
.trn-faq__bg {
  position: absolute; inset: 0 0 auto; height: min(42rem, 100%); pointer-events: none; opacity: 0.9;
  background: url("../img/partner-bg.jpg") center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 55%, transparent 100%);
}
.trn-faq .container { position: relative; }
.trn-faq .t-display { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); max-width: 80rem; margin-inline: auto; }
.faq__col { display: grid; align-content: start; gap: var(--space-3); }
.faq__item {
  border-radius: 1.75rem;
  background: var(--color-gray-950);
  border: 1px solid var(--color-gray-800);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.faq__item:hover, .faq__item.is-open { background: var(--color-gray-900); }
.faq__item h3 { margin: 0; font: inherit; }
.faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  width: 100%; min-height: 3.5rem; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-6);
  font-size: var(--fs-body); line-height: 1.35; color: #fff; text-align: left;
}
.faq__icon { flex: none; width: 2.875rem; height: 2.5rem; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--color-gray-700); color: #fff; transition: background var(--dur-base) var(--ease-out); }
.faq__icon svg { width: 1.125rem; height: 1.125rem; transition: rotate var(--dur-base) var(--ease-out); }
.faq__q:hover .faq__icon { background: var(--color-gray-600); }
.faq__item.is-open .faq__icon { background: #fff; color: #000; }
.faq__item.is-open .faq__icon svg { rotate: 90deg; }
.faq__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease-out); }
.faq__a > div { overflow: hidden; }
.faq__a p { padding: 0 var(--space-6) var(--space-6); max-width: 38rem; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-secondary); }
.faq__item.is-open .faq__a { grid-template-rows: 1fr; }

.page-training .footer { padding-top: clamp(4rem, 8vw, 9rem); }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1024px) {
  .trn-split__grid, .trn-split--reverse .trn-split__grid, .trn-modules__head, .trn-intro { grid-template-columns: 1fr; gap: var(--space-12); }
  .trn-modules__head, .trn-intro { gap: var(--space-5); }
  .trn-split--reverse .trn-split__media { order: -1; }
  .trn-next__panel { grid-template-columns: 1fr; }
  .trn-next__media { order: -1; min-height: 0; aspect-ratio: 16 / 9; }
  .trn-next__media::before { background: linear-gradient(0deg, var(--color-gray-950) 0%, rgb(17 17 17 / 0) 45%); }
  .faq { grid-template-columns: 1fr; max-width: 44rem; }
  /* Slider: controls row above the cards */
  .trn-slider { grid-template-columns: 1fr; gap: var(--space-8); }
  .trn-slider__side { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); }
  .trn-slider__name { min-height: 0; }
  .trn-slider__bar { display: none; }
  .trn-slider__side .slider-controls { margin-top: 0; }
  .trn-hero__media img { object-position: 64% 60%; }
}
@media (max-width: 760px) {
  /* Timeline turns vertical: the rail runs down the left, pills become icon discs */
  .tl { grid-template-columns: 1fr; gap: var(--space-3); max-width: 26rem; }
  .tl::before, .tl::after {
    left: calc(var(--pill) / 2 - var(--rail) / 2); right: auto; bottom: auto; top: 0; width: var(--rail);
    background: repeating-linear-gradient(180deg, var(--color-gray-700) 0 2px, transparent 2px 6px);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
  }
  .tl::before { bottom: 0; }
  .tl::after { height: calc(var(--p) * 100%); background-image: repeating-linear-gradient(180deg, var(--color-gray-200) 0 2px, transparent 2px 6px); }
  .tl__stop { display: grid; grid-template-columns: var(--pill) minmax(0, 1fr); align-items: center; column-gap: var(--space-5); padding: var(--space-4) 0; }
  .tl__label { grid-column: 2; grid-row: 1; text-align: left; margin: 0; }
  .tl__pill { grid-column: 1; grid-row: 1; width: var(--pill); padding: 0; justify-content: center; background: #000; border: 0; }
  .tl__icon { width: var(--pill); height: var(--pill); }
  .tl__pill-text, .tl__stem { display: none; }
  .tl__dot { grid-column: 1; grid-row: 1; position: absolute; right: -0.25rem; top: 50%; translate: 0 -50%; display: none; }
  .tl__stop--last .tl__icon { box-shadow: 0 0 0 0.375rem rgb(255 255 255 / 0.12); }
}
@media (max-width: 640px) {
  .trn-card { min-height: 0; padding: var(--space-6) var(--space-6) var(--space-8); }
  .trn-slider__side { grid-template-columns: auto minmax(0, 1fr); }
  .trn-slider__side .slider-controls { grid-column: 1 / -1; }
  .trn-next__copy .btn { white-space: normal; height: auto; min-height: var(--btn-height); padding-block: var(--space-2); text-align: center; }
  .faq__q { padding-left: var(--space-5); }
  .faq__a p { padding-inline: var(--space-5); }
  .trn-hero__content { flex-direction: column; align-items: flex-start; gap: var(--space-6); }
  /* Phones: the photo sits in the top 62% and fades into black under the copy */
  .trn-hero__media { inset: 0 0 auto; height: 62%; }
  .trn-hero__media img { object-position: 58% 60%; }
  .trn-hero__shade {
    background:
      linear-gradient(180deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0) 16%, rgb(0 0 0 / 0) 40%, #000 62%);
  }
}

/* Long two-line statements: balance the lines so no word is left alone */
.trn .t-display { text-wrap: balance; }
