/* Our Recent Trainings, internally scrollable film strip with a synced name list */
.training-scroll {
  --ts-ink: #1c2539;
  --ts-muted: #5d666f;
  --ts-faded: #c7c9cf;
  --ts-accent: #fa8b17;
  --ts-line: #000;
  --ts-bg: var(--gotezu-bg, #f7f4ef);
  /* image height drives the 16:9 width, so the photo never outgrows the panel */
  --ts-shot-h: clamp(260px, 46vh, 520px);
  --ts-window-h: calc(var(--ts-shot-h) * 1.34);
  --ts-gap: 18px;
  position: relative;
  background: var(--ts-bg);
}

.training-scroll__viewport {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(64px, 7vw, 110px) 20px;
  background: var(--ts-bg);
  box-sizing: border-box;
}

.training-scroll__frame {
  position: relative;
  width: 100%;
  max-width: 1340px;
  border: 2px solid var(--ts-line);
  border-radius: 34px;
  padding: 52px 56px;
  box-sizing: border-box;
}

.training-scroll__rail {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ts-faded);
}

.training-scroll__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 0;
  align-items: center;
}

/* Names sit on the layer above the photos */
.training-scroll__col {
  position: relative;
  z-index: 2;
  min-width: 0;
  padding-left: 22px;
}

.training-scroll__eyebrow {
  margin: 0 0 26px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ts-muted);
}

/* Window the list travels inside, follows the strip's scroll position */
.training-scroll__names {
  position: relative;
  height: var(--ts-window-h);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%
  );
  mask-image: linear-gradient(
    to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%
  );
}

.training-scroll__list {
  list-style: none;
  margin: 0;
  padding: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.training-scroll__name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  font-family: "Red Hat Display", sans-serif;
  font-size: clamp(26px, 3.4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.28;
  color: var(--ts-faded);
  cursor: pointer;
  /* light halo keeps the names legible where they cross the photo */
  text-shadow: 0 0 22px rgba(247, 244, 239, 0.92), 0 0 8px rgba(247, 244, 239, 0.8);
  transition: color 0.45s ease, opacity 0.4s ease;
}

.training-scroll__name.is-on {
  color: var(--ts-ink);
}

.training-scroll__name-meta {
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ts-faded);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.45s ease, color 0.45s ease;
}

.training-scroll__name.is-on .training-scroll__name-meta {
  opacity: 1;
  color: var(--ts-accent);
}

/* Right column, the strip scrolls inside its own little window */
.training-scroll__stage {
  position: relative;
  z-index: 1;
  /* right-anchored but wider than its column, so it reaches back under the names */
  justify-self: end;
  width: calc(var(--ts-shot-h) * 16 / 9);
  height: var(--ts-window-h);
}

.training-scroll__media {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  /* keep the gesture inside the strip instead of running the page along with it */
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 37, 57, 0.32) transparent;
}

.training-scroll__media:focus-visible {
  outline: 2px solid var(--ts-accent);
  outline-offset: 4px;
}

.training-scroll__media::-webkit-scrollbar {
  width: 4px;
}

.training-scroll__media::-webkit-scrollbar-track {
  background: transparent;
}

.training-scroll__media::-webkit-scrollbar-thumb {
  background: rgba(28, 37, 57, 0.3);
  border-radius: 4px;
}

.training-scroll__media::-webkit-scrollbar-thumb:hover {
  background: rgba(28, 37, 57, 0.5);
}

.training-scroll__track {
  display: flex;
  flex-direction: column;
  gap: var(--ts-gap);
  /* left edge fades out so the names stay readable over the photos */
  -webkit-mask-image: linear-gradient(
    to right, transparent 0%, rgba(0, 0, 0, 0.28) 14%, #000 34%
  );
  mask-image: linear-gradient(
    to right, transparent 0%, rgba(0, 0, 0, 0.28) 14%, #000 34%
  );
}

/* Light wash at both ends so images emerge from and dissolve into the background */
.training-scroll__fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 15%;
  z-index: 2;
  pointer-events: none;
}

.training-scroll__fade--top {
  top: 0;
  background: linear-gradient(
    to bottom, var(--ts-bg) 0%, rgba(247, 244, 239, 0.7) 45%, rgba(247, 244, 239, 0) 100%
  );
}

.training-scroll__fade--bottom {
  bottom: 0;
  background: linear-gradient(
    to top, var(--ts-bg) 0%, rgba(247, 244, 239, 0.7) 45%, rgba(247, 244, 239, 0) 100%
  );
}

.training-scroll__shot {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: var(--ts-shot-h);
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #e4e2de;
  scroll-snap-align: center;
}

.training-scroll__shot img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video cards, thumbnail until the viewer asks for the player */
.training-scroll__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(56px, 5vw, 74px);
  height: clamp(56px, 5vw, 74px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ts-ink);
  box-shadow: 0 12px 34px rgba(15, 20, 30, 0.28);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.training-scroll__play svg {
  width: 42%;
  height: 42%;
  margin-left: 6%;
}

.training-scroll__play:hover,
.training-scroll__play:focus-visible {
  background: var(--ts-accent);
  color: #fff;
  outline: none;
}

.training-scroll__shot iframe {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
}

.training-scroll__shot.is-playing img,
.training-scroll__shot.is-playing .training-scroll__play {
  display: none;
}

.training-scroll__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 20, 28, 0.72);
  color: #fff;
  font-family: "DM Sans", sans-serif;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s ease;
}

.training-scroll__close:hover {
  background: var(--ts-accent);
}

/* While a video plays: lock the strip, clear the masks, hold its name in ink */
.training-scroll.is-video-open .training-scroll__media {
  overflow: hidden;
}

.training-scroll.is-video-open .training-scroll__track,
.training-scroll.is-video-open .training-scroll__fade {
  -webkit-mask-image: none;
  mask-image: none;
  background: none;
}

.training-scroll.is-video-open .training-scroll__name {
  opacity: 0.18;
}

.training-scroll.is-video-open .training-scroll__name.is-on {
  opacity: 1;
  color: var(--ts-ink);
}

@media (max-width: 1280px) {
  .training-scroll__frame {
    padding: 42px 40px;
  }

  .training-scroll__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  }
}

@media (max-width: 1100px) {
  .training-scroll {
    --ts-shot-h: clamp(220px, 40vh, 400px);
  }

  .training-scroll__frame {
    padding: 34px 30px;
  }

  .training-scroll__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  }

  .training-scroll__name {
    font-size: clamp(22px, 3vw, 34px);
  }
}

/* Stacked and static below this width, everything scrolls with the page */
@media (max-width: 900px) {
  .training-scroll__viewport {
    padding: 56px 18px 64px;
  }

  .training-scroll__frame {
    padding: 28px 20px;
    border-radius: 24px;
  }

  .training-scroll__rail {
    display: none;
  }

  .training-scroll__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .training-scroll__col {
    padding-left: 0;
  }

  .training-scroll__names {
    height: auto;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .training-scroll__list {
    transform: none !important;
    padding: 0 !important;
  }

  .training-scroll__name {
    color: var(--ts-ink);
    font-size: 24px;
    cursor: default;
  }

  .training-scroll__name-meta {
    opacity: 1;
    color: var(--ts-muted);
  }

  .training-scroll__stage {
    justify-self: stretch;
    width: 100%;
    height: auto;
  }

  .training-scroll__media {
    overflow: visible;
    scroll-snap-type: none;
  }

  .training-scroll__track {
    padding: 0 !important;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .training-scroll__fade {
    display: none;
  }

  .training-scroll__shot {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .training-scroll__name, .training-scroll__name-meta {
    transition: none;
  }
}
