/* =========================================================
   OUR STORY PAGE STYLESHEET
   ---------------------------------------------------------
   Contents:
     1. Host-site overrides (hide header, full-width page)
     2. Subnav — collapse to mobile style
     3. Slides — core scroll/fade behavior
     4. Slide backgrounds (video / image + focus positioning)
     5. Slide content layer (pinned, centered, parallax target)
     6. Chapter title
     7. Slide text block + glow background
     8. Slide text alignment variants
     9. Chapter-select cards
    10. Floating nav buttons (back-to-parent / back-to-top)
    11. Slide nav links (skip link, scroll-down arrow)
    12. Skip-to-chapters linkS
   ========================================================= */

/* =========================================================
   1. HOST-SITE OVERRIDES
   Hide the default page header/breadcrumbs and make the
   page span the full viewport width.
   ========================================================= */
.page-titles,
.breadcrumbs {
  display: none;
}

.page__content-wrapper {
  padding: 0px;
}

body {
  --media-before-content: 0px !important;
}

.page {
  max-width: 100% !important;
}

.our-story-page {
  width: 100%;
}

/* First slide appears instantly — no entrance animation */
.our-story-page .slide:first-child.show,
.our-story-page .slide:first-child.show .slide-content {
  animation: none;
}

/* =========================================================
   2. SUBNAV — COLLAPSE TO MOBILE STYLE
   Forces the site subnav into its mobile hamburger-style
   layout at all widths.
   ========================================================= */
.page {
  overflow: hidden;
  display: grid;
  grid:
    "subNav ." 3em
    "subNav content" 1fr / [c1] 1fr
    [c2] minmax(0, 1fr);
}

.subNav {
  position: absolute;
  top: var(--header-total-height);
  left: 0;
  justify-content: flex-end;
  flex-direction: row-reverse;
  float: left;
  max-width: 100%;
  height: fit-content;
}

/* Toggle button ("Navigation" + chevron) */
.subNav > input {
  width: 145px;
  height: 3em;
  flex-direction: row-reverse;
  flex-shrink: 0;
  padding: 0;
  justify-content: space-evenly;
  background: rgba(206, 32, 26, 1);
}
.subNav > :is(input, input:checked):after {
  content: " ";
  display: inline-block;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  height: 12px;
  width: 12px;
  transition: transform 0.3s;
}
.subNav > input:after {
  transform: rotate(135deg) translateX(-2px) translateY(-2px);
}
.subNav > input:before {
  color: white;
  width: 75px;
  content: "Navigation";
  padding-top: 1px;
}

.subnavBackgroundGradient {
  display: none;
}

/* Drop-down open/close states */
.subNavList.nestedLinkList--d1.nestedLinkList--d1.nestedLinkList__manualDropDown:not(
    :checked
  ) {
  position: absolute;
  height: 3em;
}
.subNavList.nestedLinkList--d1.nestedLinkList--d1.nestedLinkList__manualDropDown:checked {
  position: relative;
  animation: slideOut 0.3s 1 ease-out;
  height: 3em;
}
.subNavList.nestedLinkList--d1.nestedLinkList--d1.nestedLinkList__manualDropDown:checked
  ~ .subNavList {
  translate: 0;
  position: relative;
}
.subNav .nestedLinkList__manualDropDown.nestedLinkList--d1 {
  display: flex;
  opacity: 1;
}
.subNav .nestedLinkList__manualDropDown.nestedLinkList--d1:checked {
  height: 3em;
  width: 3em;
}
.subNavList.nestedLinkList--d1.nestedLinkList--d1.nestedLinkList__manualDropDown:not(
    :checked
  )
  ~ .subNavList {
  translate: -100%;
  position: absolute;
  animation: KeepRel 0.3s;
}

/* Close (X) icon when open */
.subNav .nestedLinkList__manualDropDown.nestedLinkList--d1:checked:before,
.subNav .nestedLinkList__manualDropDown.nestedLinkList--d1:checked:after {
  position: absolute;
  width: 36px;
  height: 4px;
  background-color: white;
  border-radius: 2px;
  transition: transform 0.6s;
  cursor: pointer;
  content: "";
}
.subNav .nestedLinkList__manualDropDown.nestedLinkList--d1:checked:after {
  transform: rotate(-45deg);
}
.subNav .nestedLinkList__manualDropDown.nestedLinkList--d1:checked:before {
  transform: rotate(45deg);
}

@keyframes slideOut {
  from {
    left: calc(-100%);
  }
  to {
    left: 0;
  }
}
@keyframes KeepRel {
  from {
    position: relative;
  }
  to {
    position: relative;
  }
}

/* =========================================================
   3. SLIDES — CORE SCROLL/FADE BEHAVIOR
   Each slide is a full-height scroll section. Its background
   and content children are pinned to the viewport; the slide's
   own opacity fades it in/out as the JS toggles .show.
   ========================================================= */
.our-story-page .slide {
  position: relative;
  height: 100vh; /* tweak this to change scroll distance per slide */
  opacity: 0;
  transition: opacity 0.8s;
  pointer-events: none; /* inactive slides let clicks pass through */
}
.our-story-page .slide.show {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

/* iOS chokes on several simultaneous videos — only render the active one */
.ios .our-story-page .slide {
  display: none;
}
.ios .our-story-page .slide.show {
  display: block;
  animation: slideFadeIn 0.8s;
}
@keyframes slideFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Outro is the positioning context for the static skip link (sec. 11) */
#outro {
  position: relative;
}

/* =========================================================
   4. SLIDE BACKGROUNDS
   Video / image pinned to cover the viewport, with focus
   point shifted away from wherever the text block sits.
   ========================================================= */
.our-story-page .slide-bg-video,
.our-story-page .slide-bg-image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
.our-story-page .slide-bg-video {
  object-fit: cover;
  object-position: center;
}
.our-story-page .slide-bg-image {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* left text → focus right-ish (not pinned to the edge) */
.our-story-page .slide:has(.slide-text.top-left) .slide-bg-video,
.our-story-page .slide:has(.slide-text.center-left) .slide-bg-video,
.our-story-page .slide:has(.slide-text.left-center) .slide-bg-video,
.our-story-page .slide:has(.slide-text.bottom-left) .slide-bg-video {
  object-position: 85% center;
}
/* right text → focus left-ish */
.our-story-page .slide:has(.slide-text.top-right) .slide-bg-video,
.our-story-page .slide:has(.slide-text.center-right) .slide-bg-video,
.our-story-page .slide:has(.slide-text.right-center) .slide-bg-video,
.our-story-page .slide:has(.slide-text.bottom-right) .slide-bg-video {
  object-position: 15% center;
}
/* top-center text → focus lower-ish */
.our-story-page .slide:has(.slide-text.top-center) .slide-bg-video {
  object-position: center 85%;
}
/* bottom-center text → focus upper-ish */
.our-story-page .slide:has(.slide-text.bottom-center) .slide-bg-video {
  object-position: center 15%;
}

/* =========================================================
   5. SLIDE CONTENT LAYER
   Pinned to the viewport, centers its children. The JS
   parallax sets margin-top on this element while a slide
   is active.
   ========================================================= */
.our-story-page .slide-content {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
}
.our-story-page .slide:not(#intro):not(#chapter-select) .slide-content {
  padding: 150px 60px;
}
.our-story-page .slide.show .slide-content {
  animation: slideContentUp 0.8s;
}
@keyframes slideContentUp {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 900px) {
  .our-story-page .slide:not(#intro):not(#chapter-select) .slide-content {
    padding-left: clamp(15px, 5vw, 60px);
    padding-right: clamp(15px, 5vw, 60px);
    padding-top: 100px;
    padding-bottom: 50px;
    margin-top: 0;
  }
}

/* =========================================================
   6. CHAPTER TITLE
   The white "Chapter 01: History" heading. Pinned top-left
   and OUTSIDE the parallax movement, like the old
   ChapterTitle.
   ========================================================= */
.our-story-page .slide-title {
  position: fixed;
  top: 100px;
  left: 100px;
  margin: 0;
  max-width: calc(100% - 200px);
  font-size: 52px;
  font-weight: bold;
  line-height: 1.1em;
  color: #fff;
  min-width: 903px;
  z-index: 2;
}

@media screen and (max-width: 900px) {
  .our-story-page .slide-title {
    top: 75px;
    left: 15px;
    max-width: calc(100% - 30px);
    min-width: 300px;
  }
}

/* =========================================================
   7. SLIDE TEXT BLOCK + GLOW BACKGROUND
   Everything derives from one knob: --text-scale.
   Box width is measured in characters, padding in em,
   glow in % of the box — so the shape stays proportional
   at every screen size with no per-breakpoint tuning.
   ========================================================= */
.our-story-page .slide:not(#intro):not(#chapter-select) .slide-text {
  /* THE one knob: fluid with viewport, 15px floor, 24px ceiling.
     Mixing vh + vw means both short laptops AND narrow phones
     shrink it — replaces both of your media query font overrides. */
  --text-scale: clamp(15px, 1.6vh + 0.65vw, 24px);

  font-size: var(--text-scale);
  position: relative;
  z-index: 1;
  width: fit-content; /* box hugs the text… */
  max-width: min(46ch, 88vw); /* …but lines never exceed ~46 chars */
  line-height: 1.35;
  color: #000;

  /* Keeps short text from spreading into one thin wide line —
     the browser balances line lengths into a tidy block */
  text-wrap: balance;
}

.our-story-page .slide:not(#intro):not(#chapter-select) .slide-text {
  padding: 4em 2em; /* scales with --text-scale */
}

/* Glow image — % insets of a box whose proportions are now
   stable, so the image stretch looks the same at every size */
.our-story-page .slide-text::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image: var(--background);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  z-index: -1;
  pointer-events: none;
}

/* Typography — all relative to the knob */
.our-story-page .slide-text p {
  font-size: 1em;
  margin: 0 !important;
  margin: 0.65em 0;
}
.our-story-page .slide-text h2 {
  margin: 0 0 0.45em;
  font-size: 1.5em;
  font-weight: bold;
  color: #000;
}
.our-story-page .slide-text h3 {
  margin: 0 0 0.65em;
  font-size: 1em;
  font-weight: bold;
  color: #000;
}

/* =========================================================
   8. SLIDE TEXT ALIGNMENT VARIANTS
   Position classes live on .slide-text. Horizontal alignment
   first, then vertical via auto margins.
   ========================================================= */

/* horizontal: left */
.our-story-page .slide-text.top-left,
.our-story-page .slide-text.center-left,
.our-story-page .slide-text.left-center,
.our-story-page .slide-text.bottom-left {
  align-self: flex-start;
  text-align: left;
}
/* horizontal: right */
.our-story-page .slide-text.top-right,
.our-story-page .slide-text.center-right,
.our-story-page .slide-text.right-center,
.our-story-page .slide-text.bottom-right {
  align-self: flex-end;
  text-align: right;
}
/* horizontal: center */
.our-story-page .slide-text.center,
.our-story-page .slide-text.top-center,
.our-story-page .slide-text.bottom-center {
  align-self: center;
  text-align: center;
}

/* vertical: top */
.our-story-page .slide-text.top-left,
.our-story-page .slide-text.top-center,
.our-story-page .slide-text.top-right {
  margin-bottom: auto;
  margin-top: 0;
}
/* vertical: bottom */
.our-story-page .slide-text.bottom-left,
.our-story-page .slide-text.bottom-center,
.our-story-page .slide-text.bottom-right {
  margin-top: auto;
  margin-bottom: 0;
}
/* vertical: center (default, but explicit) */
.our-story-page .slide-text.center-left,
.our-story-page .slide-text.center,
.our-story-page .slide-text.center-right,
.our-story-page .slide-text.left-center,
.our-story-page .slide-text.right-center {
  margin-top: auto;
  margin-bottom: auto;
}

/* =========================================================
   9. CHAPTER-SELECT CARDS
   The grid of chapter thumbnails on the select slide.
   ========================================================= */
.our-story-page .slide-chapters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100vw;
  max-width: 1385px;
}

.our-story-page .contentBox {
  flex: 0 0 calc(20% - 30px);
  max-width: 240px;
  text-align: center;
  color: #fff;
}
.our-story-page .contentBox__bg {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  margin-bottom: 15px;
}
.our-story-page .contentBox__title {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
}
.our-story-page .contentBox__title--link:hover {
  text-decoration: underline;
}
.our-story-page .contentBox__content {
  font-size: 18px;
  color: #fff;
}

@media screen and (max-width: 512px) {
  .our-story-page .contentBox {
    flex-basis: calc(33.333% - 20px);
  }
}

/* =========================================================
   10. FLOATING NAV BUTTONS
   Back-to-parent / back-to-top circles, injected by the JS
   before the footer.
   ========================================================= */
.back-to-parent,
.back-to-top {
  position: fixed;
  width: 49px;
  height: 49px;
  font-size: 0; /* hides the "Back"/"Top"/"Next" labels */
  background-color: rgba(37, 97, 156, 0.9);
  border-radius: 49px;
  box-shadow:
    -1px 1px 0 0 rgba(0, 0, 0, 0.2),
    0 0 15px 0 rgba(0, 0, 0, 0.2);
  text-decoration: none;
  overflow: hidden;
  z-index: 2;
  transition: background-color 0.8s;
}
.back-to-parent:hover,
.back-to-top:hover {
  background-color: #fff !important;
}

.back-to-parent {
  top: 50px;
  left: 50px;
  display: none;
}
.back-to-parent.show {
  display: inline-block;
}

.back-to-top {
  bottom: 50px;
  left: 50px;
  display: none;
}
.back-to-top.show {
  display: inline-block;
}

/* Arrow glyphs (rotated bordered squares) */
.back-to-parent .left-arrow,
.back-to-top .up-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  transition: border 0.8s;
}
.back-to-parent .left-arrow {
  top: 17px;
  left: 19px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
}
.back-to-top .up-arrow {
  top: 20px;
  left: 17px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
}
.back-to-parent:hover .left-arrow {
  border-color: rgba(37, 97, 156, 1);
}
.back-to-top:hover .up-arrow {
  border-color: rgba(37, 97, 156, 1);
}

/* =========================================================
   11. SLIDE NAV LINKS
   Fixed bottom-center container holding the skip link and
   scroll-down arrow.
   ========================================================= */
.slide-nav-links {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

/* Skip link — hidden by default, JS toggles .show */
.skip-link {
  color: white;
  text-decoration: none;
  display: inline-block;
  font-size: 20px;
  text-shadow: 4px 4px 2px rgba(0, 0, 0, 0.25);
  visibility: hidden;
  opacity: 0;
  margin-bottom: 15px;
  transition:
    opacity 0.4s,
    visibility 0.4s,
    padding 0.8s,
    text-shadow 0.8s;
}
.skip-link:hover {
  padding-bottom: 5px;
  text-shadow: 8px 8px 2px rgba(0, 0, 0, 0.35);
}
.skip-link.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.slide-nav-links.under-content {
  bottom: auto;
}

/* On the outro, the JS moves the link into #outro and adds
   .static-skip — pins it to the bottom of the slide instead
   of floating, so it never overlaps the footer. */
.skip-link.static-skip {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  display: block;
  width: fit-content;
}

/* Scroll-down arrow — hidden by default, JS toggles .show */
.scroll-down {
  width: 60px;
  display: block;
  height: auto;
  background: none;
  box-shadow: none;
  border-radius: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.4s,
    visibility 0s 0.4s,
    transform 0.4s;
}
.scroll-down:hover {
  transform: translateY(5px);
}
.scroll-down.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.4s,
    visibility 0s,
    transform 0.4s;
}
.scroll-down .down-arrow {
  display: block;
  width: 100%;
  height: auto;
}
.scroll-down:hover .down-arrow {
  border-color: rgba(37, 97, 156, 1);
}

/* =========================================================
   12. SKIP-TO-CHAPTERS LINK
   In-slide link, only visible on intro / chapter-end slides.
   ========================================================= */
.our-story-page .slide:not(.chapter-end):not(.intro) .skip-to-chapters {
  display: none;
}

.our-story-page .slide .skip-to-chapters {
  color: white;
  text-decoration: none;
  display: inline-block;
  font-size: 20px;
  text-shadow: 4px 4px 2px rgba(0, 0, 0, 0.25);
  transition:
    padding 0.8s,
    text-shadow 0.8s;
  margin-bottom: 15px;
}

@media screen and (max-width: 1400px) {
  .back-to-parent {
    top: 20px;
    left: 20px;
  }
  .back-to-top {
    bottom: 20px;
    left: 20px;
  }
  .back-to-parent,
  .back-to-top {
    width: 39px;
    height: 39px;
  }
  .back-to-parent .left-arrow,
  .back-to-top .up-arrow {
    width: 12px;
    height: 12px;
  }
  .back-to-parent .left-arrow {
    top: 14px;
    left: 16px;
  }
  .back-to-top .up-arrow {
    top: 17px;
    left: 14px;
  }

  .slide-nav-links {
    bottom: 20px;
  }
  .skip-link {
    font-size: 17px;
    text-wrap: nowrap;
  }
  .scroll-down {
    width: 35px;
  }
}
