/* public/css/trainings.css  (TRAIN-02 - the rebuild)
 *
 * Design system for /trainings, loaded by views/layouts/main.ejs only when
 * `type === 'trainings'`, exactly the way blog.css and products.css are loaded.
 * Everything is scoped under `body.trainings-page` so none of it can leak.
 *
 * ---------------------------------------------------------------------------
 * Why this file exists at all - the bug that made the first version look broken
 *
 * v1 of this page was written in Tailwind utilities. public/css/output.css is a
 * COMMITTED BUILD and nothing in `npm start` regenerates it, so a utility that
 * was not already in that file simply does not exist at runtime. 40 of the 133
 * classes v1 used were missing, and they were the load-bearing ones:
 *
 *   pt-12 pb-14 py-14 mt-12 mb-9 mb-7 py-2.5   -> no vertical spacing at all
 *   sm:grid-cols-2 sm:grid-cols-3
 *   md:grid-cols-2 lg:grid-cols-4              -> every grid collapsed to 1 column
 *   gap-5                                      -> and the cells touched
 *   sm:text-xl md:text-2xl lg:text-3xl         -> the h1 stayed at 18px
 *   bg-gradient-to-b from-blue-50/70 to-white  -> the hero gradient never rendered
 *   hover:* (9 of them)                        -> nothing responded to the cursor
 *
 * Confirming pairs, so this is staleness and not a config mistake: pb-12 exists
 * and pt-12 does not; gap-6 exists and gap-5 does not; mb-8 exists and mb-9 does
 * not. Hand-authored CSS is the fix the rest of this codebase already settled on
 * (see the same note at the top of blog.css), and it also puts the whole vertical
 * rhythm on ONE scale instead of scattered magic numbers.
 * ---------------------------------------------------------------------------
 * Design direction - "the shelf"
 *
 * v1 argued for the library in five sections of prose and asked for a signup
 * five times, but never showed what was on offer. There are 11 real videos in 4
 * real courses behind that login; the page's job is to put them on a shelf where
 * the titles can be read, so the account stops feeling like a toll and starts
 * feeling like a key. Hence: a gradient hero carrying the real counts, a
 * catalogue of the four courses with their real episode titles listed and
 * locked, and ONE closing band that explains the way in. Three sections, one
 * primary call to action per screenful.
 * ========================================================================= */

body.trainings-page {
  --tr-ink: #18181B;
  --tr-body: #3F3F46;
  --tr-muted: #71717A;
  --tr-faint: #A1A1AA;
  --tr-rule: #E4E4E7;
  --tr-rule-soft: #F4F4F5;
  --tr-surface: #FAFAFA;
  --tr-accent: #0C66E4;
  --tr-accent-dark: #0A56C4;
  --tr-tint: #EBF3FE;
  --tr-line: #C7D9F7;

  --tr-radius: 14px;
  --tr-radius-lg: 18px;

  /* The whole vertical scale, in two values. Every band and every grid gap on
     the page reads from these, so the rhythm cannot drift the way v1's did. */
  --tr-band: 4.5rem;
  --tr-gap: 1.25rem;

  background: #fff;
  color: var(--tr-body);
}

/* Deliberately no font-size on body: the header and footer partials are sized
   by the bodyClass utilities they were designed against, and every element in
   this file states its own size in rem. */
@media (max-width: 767px) {
  body.trainings-page {
    --tr-band: 3rem;
    --tr-gap: 0.875rem;
  }
}

/* ==================================================================== SHELL */

.tr-shell {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 768px)  { .tr-shell { padding-inline: 2rem; } }
@media (min-width: 1024px) { .tr-shell { padding-inline: 4rem; } }

/* The catalogue is deliberately narrower than the shell: two cards that each
   list episode titles read better at ~500px per column than at 1280/2. */
.tr-shell--narrow { max-width: 1080px; }

.tr-band { padding-block: var(--tr-band); }
.tr-band--tint {
  background: var(--tr-surface);
  border-block: 1px solid var(--tr-rule-soft);
}

/* ===================================================================== TYPE */

.tr-h2 {
  margin: 0 0 0.55rem;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--tr-ink);
}
@media (min-width: 768px) { .tr-h2 { font-size: 1.625rem; } }

.tr-lede {
  margin: 0 auto;
  max-width: 44rem;
  color: var(--tr-muted);
  font-size: 0.9375rem;
  line-height: 1.95;
}

.tr-lede--start { margin-inline: 0; }

/* The header is fixed, so an in-page jump has to leave room for it. */
.tr-anchor { scroll-margin-top: 6rem; }

.tr-head {
  text-align: center;
  margin-bottom: 2.25rem;
}
.tr-head .tr-eyebrow { margin-bottom: 0.85rem; }

.tr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--tr-tint);
  color: var(--tr-accent);
}
.tr-eyebrow svg { width: 14px; height: 14px; flex: none; }
.tr-eyebrow--onDark { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ================================================================== BUTTONS */

.tr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.tr-btn:hover { transform: translateY(-1px); }
.tr-btn svg { width: 18px; height: 18px; flex: none; }

.tr-btn--onDark { background: #fff; color: var(--tr-accent); }
.tr-btn--onDark:hover { background: var(--tr-tint); }
.tr-btn--ghostDark { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.tr-btn--ghostDark:hover { background: rgba(255, 255, 255, 0.14); }
.tr-btn--solid { background: var(--tr-accent); color: #fff; }
.tr-btn--solid:hover { background: var(--tr-accent-dark); }
.tr-btn--quiet { border-color: var(--tr-rule); color: var(--tr-body); background: #fff; }
.tr-btn--quiet:hover { background: var(--tr-surface); border-color: var(--tr-faint); }

.tr-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ===================================================================== HERO
 * The site's signature marketing gradient, and the same blue the portal opens
 * with - so arriving inside after login does not look like a different product.
 */

.tr-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(179deg, #3C83F5, #2A5CAB);
  padding-block: calc(var(--tr-band) * 1.05) var(--tr-band);
}
.tr-hero::after {
  content: '';
  position: absolute;
  inset-block-start: -30%;
  inset-inline-start: -10%;
  width: 55%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
  pointer-events: none;
}

.tr-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .tr-hero__grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: 3.5rem;
  }
}

.tr-hero__title {
  margin: 0.9rem 0 0.85rem;
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.015em;
}
@media (min-width: 640px)  { .tr-hero__title { font-size: 2rem; } }
@media (min-width: 1024px) { .tr-hero__title { font-size: 2.375rem; line-height: 1.4; } }

.tr-hero__text {
  margin: 0 0 1.75rem;
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9375rem;
  line-height: 2;
}
@media (min-width: 1024px) { .tr-hero__text { font-size: 1rem; } }

/* ----- the counts. Read out of the database, not written by hand. ----- */

.tr-stats {
  display: flex;
  flex-wrap: wrap;
  margin-block: 1.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 1.25rem;
}
.tr-stat { padding-inline: 1.25rem; }
.tr-stat:first-child { padding-inline-start: 0; }
.tr-stat + .tr-stat { border-inline-start: 1px solid rgba(255, 255, 255, 0.22); }
.tr-stat__value { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.tr-stat__label { display: block; font-size: 0.75rem; color: rgba(255, 255, 255, 0.72); }

/* ----- the player. A real screenshot of the software being taught, behind a
   play glyph and a caption bar: it says "there is video about this program"
   without a stock illustration, and it gives the page a real LCP anchor. ----- */

.tr-player {
  position: relative;
  display: block;
  border-radius: var(--tr-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 26px 60px -22px rgba(9, 32, 77, 0.6);
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tr-player:hover { transform: translateY(-3px); box-shadow: 0 30px 66px -22px rgba(9, 32, 77, 0.7); }
.tr-player__img { display: block; width: 100%; height: auto; }
.tr-player__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 30, 70, 0.55), rgba(12, 40, 92, 0.18) 55%);
}
.tr-player__disc {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  translate: 50% -50%;
  width: 66px;
  height: 66px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(6, 22, 54, 0.35);
  transition: scale 0.2s;
}
.tr-player:hover .tr-player__disc { scale: 1.06; }
.tr-player__disc svg { width: 25px; height: 25px; color: var(--tr-accent); }
.tr-player__bar {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  font-size: 0.8125rem;
}
.tr-player__bar b {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tr-player__bar span {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.82);
}
.tr-player__bar svg { width: 13px; height: 13px; flex: none; }

/* ================================================================ CATALOGUE
 * Two up, and it stays two up. Each card carries real episode titles; a
 * four-across grid would wrap every one of them onto three lines. */

.tr-courses {
  display: grid;
  gap: var(--tr-gap);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .tr-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tr-course {
  --tr-c: var(--tr-accent);
  --tr-c-tint: var(--tr-tint);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.375rem 1.25rem;
  border: 1px solid var(--tr-rule);
  border-radius: var(--tr-radius);
  background: #fff;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.tr-course::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--tr-c);
}
.tr-course:hover {
  border-color: var(--tr-c);
  box-shadow: 0 16px 36px -18px rgba(24, 24, 27, 0.3);
  transform: translateY(-3px);
}
.tr-course:focus-visible { outline: 2px solid var(--tr-c); outline-offset: 3px; }

.tr-course__top {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}
.tr-course__icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--tr-c-tint);
  display: grid;
  place-items: center;
}
.tr-course__icon svg { width: 22px; height: 22px; color: var(--tr-c); }
.tr-course__name {
  margin: 0 0 0.2rem;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.6;
  color: var(--tr-ink);
  transition: color 0.18s;
}
.tr-course:hover .tr-course__name { color: var(--tr-c); }
.tr-course__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--tr-muted);
}
.tr-course__meta b { color: var(--tr-c); font-weight: 700; }
.tr-course__dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--tr-faint);
}

.tr-course__list {
  margin: 0;
  padding: 0.8rem 0 0;
  list-style: none;
  border-top: 1px solid var(--tr-rule-soft);
  flex: 1;
}
.tr-course__ep {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.32rem;
  font-size: 0.8125rem;
  color: var(--tr-muted);
}
.tr-course__ep svg { width: 13px; height: 13px; flex: none; color: var(--tr-faint); }
.tr-course__ep span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-course__more {
  padding-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tr-c);
}

.tr-course__go {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--tr-rule-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--tr-c);
}
.tr-course__go svg { width: 15px; height: 15px; flex: none; }

/* =================================================================== WAY IN
 * v1 spent one section on a three-step explainer, a second telling the visitor
 * not to use the sales form, and a third repeating the CTA. All three collapse
 * into this single band. */

.tr-way { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) {
  .tr-way { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3rem; }
}

.tr-steps {
  display: grid;
  gap: var(--tr-gap);
  grid-template-columns: 1fr;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 620px) {
  .tr-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tr-step { position: relative; }
.tr-step__num {
  position: relative;
  z-index: 1;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: var(--tr-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
/* The dashed run between the numbers turns three boxes into one path. RTL, so
   it leaves each number on its left and reaches the column beside it. */
@media (min-width: 620px) {
  .tr-step:not(:last-child) .tr-step__num::after {
    content: '';
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 100%;
    width: calc(100% + var(--tr-gap));
    border-top: 1px dashed var(--tr-line);
  }
}
.tr-step__title {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tr-ink);
}
.tr-step__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.85;
  color: var(--tr-muted);
}

/* The support card. The product-manager goal was to stop support calls arriving
   as sales leads. v1 tried to do that by explaining the lead pipeline to the
   visitor, which reads as a telling-off. Putting the support number plainly next
   to the self-serve path does the same job silently. */
.tr-aside {
  border: 1px solid var(--tr-rule);
  border-radius: var(--tr-radius);
  background: #fff;
  padding: 1.375rem;
}
.tr-aside__title {
  margin: 0 0 0.3rem;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--tr-ink);
}
.tr-aside__text {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--tr-muted);
}
.tr-phone {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-block: 0.4rem;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--tr-accent);
  text-decoration: none;
}
.tr-phone svg { width: 17px; height: 17px; flex: none; }
.tr-phone:hover { color: var(--tr-accent-dark); }
.tr-aside__foot {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--tr-rule-soft);
  font-size: 0.8125rem;
  color: var(--tr-muted);
}
.tr-aside__foot a { color: var(--tr-accent); font-weight: 600; text-decoration: none; }
.tr-aside__foot a:hover { text-decoration: underline; }

/* ================================================================ SIGNED IN
 * The page changes job once there is a session: stop selling the account, just
 * open the door. */

.tr-inside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.125rem 1.375rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--tr-radius);
  background: rgba(255, 255, 255, 0.12);
}
.tr-inside__icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
}
.tr-inside__icon svg { width: 21px; height: 21px; color: #fff; }
.tr-inside__body { flex: 1 1 14rem; min-width: 0; }
.tr-inside__title { margin: 0 0 0.15rem; font-size: 0.9375rem; font-weight: 800; }
.tr-inside__text { margin: 0; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.78); }
