/* Our Story — page title + hero image, then sections (Sidekick split, etc.) */

body.page-our-story {
  background: #fbf7ef;
  min-height: 100vh;
  /* Scroll reveals — timing tuned with script.js IO (later trigger, snappier motion) */
  --story-reveal-delay: 0.4s;
  --story-reveal-duration: 1.6s;
}

body.page-our-story .nav {
  background: #414f39;
}

.story-main {
  --story-pad: clamp(1.75rem, 5vw, 3.5rem);
  max-width: 82rem;
  margin: 0 auto;
  padding-top: calc(clamp(9rem, 16vh, 14rem));
  padding-bottom: max(8rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--story-pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--story-pad), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

/* ----- Title + vertical hero image ----- */
.story-pagehead {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 4vw, 3.5rem);
  width: 100%;
}

.story-pagehead__intro {
  flex: 1 1 0;
  min-width: 0;
  max-width: min(100%, 22rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.5rem, 1.5vw, 0.85rem);
}

.story-pagehead__title {
  font-family: "Instrument Serif", serif;
  text-transform: uppercase;
  /* Min must stay modest: a high floor (e.g. 6rem) wins on narrow viewports if the mobile rule doesn’t apply (e.g. landscape). */
  font-size: clamp(4.25rem, 2.75rem + 5.25vw, 8.75rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0;
  color: #1a1a1a;
}

.story-pagehead__sub {
  font-family: "Luxurious Script", cursive;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: .8;
  letter-spacing: 0.02em;
  margin: 0;
  color: rgba(26, 26, 26, 0.72);
  max-width: 22rem;
}

.story-pagehead__img {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: min(82vh, 56rem);
  object-fit: contain;
  object-position: center;
}

.story-pagehead + .story-section {
  margin-top: clamp(9rem, 16vh, 13rem);
  padding-top: clamp(4.5rem, 12vh, 8rem);
}

/* ----- Section shell (stacked chapters) ----- */
.story-section + .story-section {
  margin-top: clamp(9rem, 16vh, 13rem);
  padding-top: clamp(5.5rem, 14vh, 10rem);
}

.story-section__title {
  font-family: "Instrument Serif", serif;
  text-transform: uppercase;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.04em;
  margin: 0;
  color: #1a1a1a;
}

.story-section__body {
  font-family: "Aboreto", serif;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.03em;
  margin: clamp(1rem, 2.5vw, 1.35rem) 0 0;
  max-width: 42rem;
  color: rgba(26, 26, 26, 0.78);
}

/* ----- First section: paragraphs left, Sidekick logo right ----- */
.story-split {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(2rem, 5vw, 4rem);
  width: 100%;
}

.story-split__text {
  flex: 1 1 0;
  min-width: 0;
  max-width: 36rem;
}

.story-split__lead {
  font-family: "Aboreto", serif;
  text-transform: uppercase;
  font-size: clamp(1.35rem, 4.5vw, 1.55rem);
  font-weight: 400;  letter-spacing: 0.04em;
  margin: 0;
  color: rgba(26, 26, 26, 0.88);
}

.story-split__dateline {
  display: inline-block;
  font-family: "Aboreto", serif;
  font-size: clamp(0.6rem, 1.15vw, 0.7rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0.5rem 0 0;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(65, 79, 57, 0.32);
  border-radius: 999px;
  color: rgba(65, 79, 57, 0.92);
  background: rgba(65, 79, 57, 0.07);
}

.story-split__body {
  font-family: "Instrument Serif", serif;
  font-size: clamp(1.1rem, 2vw, 1.1rem);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.03em;
  margin: clamp(1rem, 2.5vw, 1.35rem) 0 0;
  color: rgba(26, 26, 26, 0.78);
  text-align: left;
}

.story-split__body a,
.story-split__body a:visited {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(65, 79, 57, 0.42);
  text-underline-offset: 0.18em;
}

.story-split__body a:hover {
  text-decoration-color: rgba(65, 79, 57, 0.88);
}

.story-split__body a:focus-visible {
  outline: 2px solid rgba(65, 79, 57, 0.5);
  outline-offset: 3px;
  border-radius: 2px;
}

.story-split__signoff {
  display: block;
  text-align: right;
  margin-top: 0.35rem;
  font-style: normal;
}

.story-split__logo {
  flex: 0 1 clamp(11.5rem, 27vw, 19rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.story-split__logo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.story-split__logo picture {
  display: block;
  width: 100%;
  max-width: 100%;
}

/* Full-width chapter photo in the logo column (text left, image right) — e.g. Alaska */
.story-split__logo--photo {
  flex: 0 1 clamp(14rem, 36vw, 28rem);
}

/* Split row with photo first in markup → image left, text right (same flex band as .story-split__logo--photo) */
.story-split__media {
  flex: 0 1 clamp(14rem, 36vw, 28rem);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
}

.story-split__media picture {
  display: block;
  width: 100%;
  max-width: 100%;
}

.story-split__media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.story-split__text .story-section__title {
  margin: 0;
}

.story-split__text .story-section__body {
  max-width: none;
}

@media (max-width: 48rem) {
  .story-section + .story-section {
    margin-top: clamp(3rem, 8vh, 5.5rem);
    padding-top: clamp(2.25rem, 6vh, 4rem);
  }

  .story-main {
    padding-top: calc(clamp(11.5rem, 22vh, 16rem));
  }

  /* Title + subtitle above the hero collage */
  .story-pagehead {
    flex-direction: column;
    align-items: stretch;
    gap: clamp(6rem, 20vw, 10rem);
  }

  .story-pagehead__intro {
    flex: none;
    width: 100%;
    max-width: min(100%, 22rem);
    align-self: center;
    align-items: center;
    text-align: center;
  }

  /* Page-scoped so this beats the default title rule on narrow viewports */
  body.page-our-story .story-pagehead__title {
    font-size: clamp(4rem, 15vw, 8.75rem);
  }

  /* Keep Luxurious Script subtitle large on small screens (same idea as .things-intro-heading: no shrink) */
  .story-pagehead__sub {
    font-size: clamp(2.25rem, 7.5vw, 3rem);
    line-height: 0.92;
    max-width: min(100%, 22rem);
  }

  /* Bleed collage to viewport edges so it uses full screen width */
  .story-pagehead picture {
    display: block;
    width: calc(
      100% + max(var(--story-pad), env(safe-area-inset-left, 0px)) +
        max(var(--story-pad), env(safe-area-inset-right, 0px))
    );
    max-width: none;
    margin-left: calc(-1 * max(var(--story-pad), env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(var(--story-pad), env(safe-area-inset-right, 0px)));
  }

  .story-pagehead__img {
    width: 100%;
    height: auto;
    max-width: none;
    max-height: min(88vh, 48rem);
    object-fit: contain;
  }

  /* Same text↔photo gap in every chapter row when stacked */
  .story-split {
    flex-direction: column;
    align-items: stretch;
    gap: clamp(4rem, 8vw, 6.5rem);
  }

  /* Copy always stacks above photos on small screens (desktop L/R unchanged) */
  .story-split__text {
    order: 0;
    max-width: min(100%, 22rem);
    width: 100%;
    margin-inline: auto;
    align-self: center;
  }

  .story-split__logo {
    flex: 1 1 auto;
    justify-content: center;
    order: 1;
    max-width: 100%;
  }

  .story-split__logo img {
    width: min(100%, 19rem);
    max-width: 100%;
    height: auto;
    margin-inline: auto;
  }

  /* Sidekick / Hinge art (narrow logo column, not --photo) */
  .story-split__logo:not(.story-split__logo--photo) picture {
    width: min(100%, 19rem);
    margin-inline: auto;
  }

  .story-split__logo:not(.story-split__logo--photo) picture img {
    width: 100%;
    height: auto;
    margin-inline: auto;
  }

  .story-split__logo--photo picture {
    width: min(100%, 28rem);
    margin-inline: auto;
  }

  .story-split__logo--photo picture img {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    object-fit: contain;
  }

  .story-split__media {
    flex: 1 1 auto;
    justify-content: center;
    order: 1;
    max-width: 100%;
  }

  .story-split__media picture {
    width: min(100%, 28rem);
    margin-inline: auto;
  }

  .story-split__media img {
    width: min(100%, 28rem);
    max-width: 100%;
    margin-inline: auto;
    object-fit: contain;
  }
}

/* ----- Scroll-in reveals (same pattern as home: script.js IntersectionObserver + .is-visible) ----- */
body.page-our-story [data-home-reveal] {
  opacity: 0;
  transform: translateY(1.35rem);
  transition:
    opacity var(--story-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--story-reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.page-our-story [data-home-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
  transition-delay: var(--story-reveal-delay);
}

/* Hero collage slightly after title/subtitle */
body.page-our-story .story-pagehead picture[data-home-reveal].is-visible {
  transition-delay: calc(var(--story-reveal-delay) + 0.12s);
}

@media (prefers-reduced-motion: reduce) {
  body.page-our-story [data-home-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}
