/* ============================================================
   styles-story.css — Our Story page
   Extends styles.css. Navy #0A1A3F, orange #F7A800.
   Fraunces (display), Inter (body).
   ============================================================ */

/* Prevent nav bar from being over dark hero without context */
.story-body { background: var(--navy-deep); color: var(--paper); }
.story-body nav.top-nav {
  background: rgba(10, 26, 63, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(246, 243, 236, 0.08);
}
.story-body nav.top-nav .logo { color: var(--paper); }
.story-body nav.top-nav .logo-sub { color: rgba(246, 243, 236, 0.55); }
.story-body nav.top-nav .nav-links a { color: var(--paper); }
.story-body nav.top-nav .nav-links a.active { color: var(--orange); }
.story-body nav.top-nav .nav-cta { background: var(--orange); color: var(--ink) !important; }
.story-body nav.top-nav .nav-cta:hover { background: var(--paper) !important; }
.story-body nav.top-nav .menu-toggle span { background: var(--paper); }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  padding: 10px 14px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 600;
  border-radius: 2px;
  z-index: 10000;
}

/* ========= CHAPTER SECTIONS ========= */
.story-chapter {
  position: relative;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--navy);
  color: var(--paper);
  padding: 0;
}

.story-chapter .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.story-chapter .hero-media img,
.story-chapter .hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Slow parallax on scroll — zoom-in slightly as chapter enters */
@media (prefers-reduced-motion: no-preference) {
  .story-chapter .hero-media img,
  .story-chapter .hero-media video {
    transform: scale(1.06);
    transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
  .story-chapter.in-view .hero-media img,
  .story-chapter.in-view .hero-media video {
    transform: scale(1);
  }
}

/* Video + still fallback: the still sits above the video until video plays */
.story-chapter-video .hero-video { z-index: 0; }
.story-chapter-video .hero-video-fallback {
  z-index: 1;
  transition: opacity 0.5s ease;
}

.story-chapter .hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg,
      rgba(10, 26, 63, 0) 0%,
      rgba(10, 26, 63, 0) 45%,
      rgba(10, 26, 63, 0.7) 75%,
      rgba(10, 26, 63, 0.88) 100%),
    linear-gradient(180deg,
      rgba(10, 26, 63, 0.25) 0%,
      rgba(10, 26, 63, 0) 30%);
}

/* Glass panel — bottom-left on desktop */
.chapter-panel {
  position: relative;
  z-index: 3;
  max-width: 560px;
  margin: 0 0 0 6rem;
  margin-bottom: 6rem;
  padding: 2rem 2rem 2.1rem;
  background: rgba(10, 26, 63, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 3px solid var(--orange);
  color: var(--paper);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease 0.1s, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
.story-chapter.in-view .chapter-panel { opacity: 1; transform: none; }

.chapter-num {
  font-family: 'Fraunces', serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 1.1rem;
  display: inline-block;
}

.chapter-headline {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--paper);
  margin-bottom: 0.9rem;
}

.chapter-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.7);
  margin-bottom: 1.1rem;
  border-top: 1px solid rgba(246, 243, 236, 0.2);
  padding-top: 1rem;
}

.chapter-copy {
  font-family: 'Inter', sans-serif;
  font-size: 1.06rem;
  line-height: 1.6;
  color: rgba(246, 243, 236, 0.92);
  font-weight: 400;
}

/* ========= CHAPTER GALLERY STRIP ========= */
.chapter-gallery-wrapper {
  position: relative;
  margin-top: 1.35rem;
}
.chapter-gallery-wrapper::after {
  content: '';
  position: absolute;
  right: 0;
  top: 1px;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to right, rgba(10, 26, 63, 0) 0%, rgba(10, 26, 63, 0.4) 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  border-top-right-radius: 2px;
}
.chapter-gallery-wrapper.scrolled-end::after { opacity: 0; }

.chapter-gallery {
  display: flex;
  gap: 0.5rem;
  padding-top: 1.1rem;
  padding-bottom: 0.5rem;
  border-top: 1px solid rgba(246, 243, 236, 0.18);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-left: 0;
  scroll-padding-right: 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 168, 0, 0.6) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.chapter-gallery:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 2px;
}
.chapter-gallery::-webkit-scrollbar { height: 6px; }
.chapter-gallery::-webkit-scrollbar-track { background: transparent; }
.chapter-gallery::-webkit-scrollbar-thumb {
  background: rgba(247, 168, 0, 0.6);
  border-radius: 3px;
}
.chapter-gallery::-webkit-scrollbar-thumb:hover { background: rgba(247, 168, 0, 0.9); }

.chapter-thumb {
  background: transparent;
  border: 1px solid rgba(246, 243, 236, 0.22);
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
  height: 80px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
  position: relative;
  scroll-snap-align: start;
}
.chapter-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease, opacity 0.25s ease;
  opacity: 0.88;
}
.chapter-thumb:hover,
.chapter-thumb:focus-visible {
  border-color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  outline: none;
}
.chapter-thumb:hover img,
.chapter-thumb:focus-visible img {
  opacity: 1;
  transform: scale(1.06);
}

/* ========= LEFT-EDGE PROGRESS RAIL ========= */
.story-progress {
  position: fixed;
  top: 50%;
  left: 1.6rem;
  transform: translateY(-50%);
  z-index: 50;
  pointer-events: none;
}
.story-progress-line {
  position: absolute;
  left: 10px;
  top: -120px;
  bottom: -120px;
  width: 2px;
  background: rgba(246, 243, 236, 0.18);
  overflow: hidden;
  border-radius: 2px;
}
.story-progress-line::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: var(--fill, 0%);
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-hot) 100%);
  transition: height 0.1s linear;
}
.story-progress-dots {
  position: relative;
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.story-progress-dots button {
  pointer-events: auto;
  background: transparent;
  border: 0;
  padding: 4px 0 4px 28px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  color: rgba(246, 243, 236, 0.55);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  transition: color 0.25s ease;
}
.story-progress-dots button::before {
  content: '';
  position: absolute;
  left: 4px; top: 50%;
  width: 12px; height: 12px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 2px solid rgba(246, 243, 236, 0.35);
  background: var(--navy-deep);
  transition: all 0.25s ease;
}
.story-progress-dots button:hover { color: var(--paper); }
.story-progress-dots button:hover::before { border-color: var(--orange); }
.story-progress-dots button.active { color: var(--orange); }
.story-progress-dots button.active::before {
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(247, 168, 0, 0.18);
}
.story-progress-dots .dot-num {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: none;
}
.story-progress-dots .dot-label {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.story-progress-dots button:hover .dot-label,
.story-progress-dots button.active .dot-label {
  opacity: 1;
  transform: none;
}
.story-progress-dots button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ========= END CTA ========= */
.story-end {
  background: var(--navy);
  color: var(--paper);
  padding: 7rem 0 8rem;
  position: relative;
  overflow: hidden;
}
.story-end::before {
  content: 'SEBA';
  position: absolute;
  bottom: -80px;
  right: -20px;
  font-family: 'Fraunces', serif;
  font-size: 22rem;
  font-weight: 700;
  color: rgba(247, 168, 0, 0.04);
  line-height: 0.8;
  letter-spacing: -0.05em;
  pointer-events: none;
}
.story-end-inner { position: relative; max-width: 780px; }
.story-end h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--paper);
  margin: 0.6rem 0 1.2rem;
}
.story-end h2 em { font-style: italic; color: var(--orange); }
.story-end p {
  color: rgba(246, 243, 236, 0.75);
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 2.5rem;
}
.story-end-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.story-end .section-eyebrow { color: var(--orange); }
.story-end .btn-ghost-light {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(246, 243, 236, 0.4);
}
.story-end .btn-ghost-light:hover {
  background: var(--paper);
  color: var(--navy);
  border-color: var(--paper);
}

/* ========= HOMEPAGE TEASER BLOCK (host: index.html) ========= */
.story-teaser {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--navy);
  color: var(--paper);
}
.story-teaser-bg {
  position: absolute; inset: 0; z-index: 0;
}
.story-teaser-bg img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.03);
  transition: transform 1.2s ease;
}
.story-teaser:hover .story-teaser-bg img { transform: scale(1); }
.story-teaser-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg,
    rgba(10,26,63,0.88) 0%,
    rgba(10,26,63,0.5) 60%,
    rgba(10,26,63,0.2) 100%);
}
.story-teaser-inner {
  position: relative; z-index: 2;
  padding: 4.5rem 2rem 4.5rem;
  max-width: 720px;
}
.story-teaser .section-eyebrow { color: var(--orange); margin-bottom: 1.4rem; }
.story-teaser h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 3.8vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin-bottom: 1rem;
}
.story-teaser h2 em { font-style: italic; color: var(--orange); }
.story-teaser p {
  color: rgba(246,243,236,0.78);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 1.8rem;
}
.story-teaser .btn-orange { background: var(--orange); color: var(--ink); }

/* ========= ABOUT PAGE BANNER (host: about.html) ========= */
.story-banner {
  background: var(--navy);
  color: var(--paper);
  padding: 0;
  border-top: 1px solid rgba(246,243,236,0.08);
  border-bottom: 1px solid rgba(246,243,236,0.08);
}
.story-banner a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.6rem 2rem;
  max-width: 1320px;
  margin: 0 auto;
  text-decoration: none;
  color: var(--paper);
  transition: background 0.25s ease;
  position: relative;
}
.story-banner a::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--orange);
}
.story-banner a:hover { background: rgba(247,168,0,0.06); }
.story-banner-eyebrow {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--orange);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.story-banner-text {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.story-banner-arrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.story-banner a:hover .story-banner-arrow span { transform: translateX(4px); }
.story-banner-arrow span { display: inline-block; transition: transform 0.2s ease; }

/* ========= MOBILE / RESPONSIVE ========= */
@media (max-width: 900px) {
  .chapter-panel {
    margin: 0 1rem 1.4rem;
    padding: 1.5rem 1.4rem 1.6rem;
    max-width: none;
    min-height: 36svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .story-chapter { align-items: flex-end; }

  .story-progress { left: 0.5rem; }
  .story-progress-line { left: 8px; }
  .story-progress-dots button { padding-left: 22px; }
  .story-progress-dots .dot-label { display: none; }
  .story-progress-dots button::before {
    width: 10px; height: 10px;
  }

  .chapter-headline { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  .chapter-copy { font-size: 1rem; line-height: 1.55; }

  .chapter-gallery-wrapper { margin-top: 1.1rem; }
  .chapter-gallery-wrapper::after { width: 48px; }
  .chapter-gallery {
    padding-top: 0.9rem;
    gap: 0.45rem;
    scroll-padding-right: 48px;
    touch-action: pan-x pan-y;
  }
  .chapter-gallery::-webkit-scrollbar { height: 4px; }
  .chapter-thumb { height: 64px; }

  .story-teaser-inner { padding: 3rem 1.5rem; }
  .story-teaser-overlay {
    background: linear-gradient(180deg,
      rgba(10,26,63,0.55) 0%,
      rgba(10,26,63,0.88) 100%);
  }

  .story-banner a {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.4rem 1.5rem;
  }
  .story-banner-arrow { justify-self: flex-start; }

  .story-end { padding: 5rem 0 6rem; }
}

/* Hide progress rail entirely on the smallest viewports */
@media (max-width: 480px) {
  .story-progress { display: none; }
}

/* ========= REDUCED MOTION ========= */
@media (prefers-reduced-motion: reduce) {
  .story-chapter .hero-media img,
  .story-chapter .hero-media video,
  .story-chapter.in-view .hero-media img,
  .story-chapter.in-view .hero-media video {
    transform: none !important;
    transition: none !important;
  }
  .chapter-panel {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .chapter-thumb,
  .chapter-thumb img {
    transition: none !important;
  }
  .chapter-gallery { scroll-behavior: auto; }
  .chapter-gallery-wrapper::after { transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ========= SWIPE LIGHTBOX ========= */
.sq-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 26, 63, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  overscroll-behavior: contain;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sq-lightbox[aria-hidden="false"] {
  display: flex;
  animation: sq-lightbox-fade-in 0.25s ease;
}

@keyframes sq-lightbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sq-lightbox__stage {
  position: relative;
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sq-lightbox__image {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.sq-lightbox__image.sq-is-dragging {
  transition: none;
}

.sq-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sq-lightbox__nav:hover,
.sq-lightbox__nav:focus-visible {
  background: rgba(247, 168, 0, 0.3);
  border-color: #F7A800;
  outline: none;
}

.sq-lightbox__nav:focus-visible {
  outline: 2px solid #F7A800;
  outline-offset: 2px;
}

.sq-lightbox__nav--prev { left: 24px; }
.sq-lightbox__nav--next { right: 24px; }

@media (max-width: 767px), (hover: none) {
  .sq-lightbox__nav { display: none; }
}

.sq-lightbox__close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sq-lightbox__close:hover,
.sq-lightbox__close:focus-visible {
  background: rgba(247, 168, 0, 0.3);
  border-color: #F7A800;
  outline: 2px solid #F7A800;
  outline-offset: 2px;
}

.sq-lightbox__footer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: 80vw;
  pointer-events: none;
}

.sq-lightbox__caption {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.sq-lightbox__counter {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0;
}

.sq-lightbox__sentinel {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sq-lightbox,
  .sq-lightbox__image {
    animation: none !important;
    transition: none !important;
  }
}
