/* Our Story — year dial + single card */

.story-page main {
  max-width: none;
  padding: 0.35rem 0 2.5rem;
}

.story-intro {
  text-align: center;
  padding: 0.35rem 1rem 0;
  max-width: 36rem;
  margin: 0 auto;
}

.story-intro .page-title {
  margin-bottom: 0.25rem;
}

.story-intro .page-title::after {
  margin-top: 0.4rem;
}

.story-tagline:empty {
  display: none;
}

.story-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  opacity: 0.85;
}

.story-hint {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.55;
  text-align: center;
  margin: 1.5rem 0 0;
}

/* Year dial */

.story-dial-wrap {
  position: relative;
  margin: 0.25rem 0 0;
}

.story-dial-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 5.5rem;
  height: 3.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  pointer-events: none;
  z-index: 1;
}

.story-dial {
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Keep snap target under the fixed center chip on all viewports. */
  scroll-padding-inline: calc(50% - 2.75rem);
  padding: 1.25rem calc(50% - 2.75rem);
  gap: 0;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
}

.story-dial::-webkit-scrollbar {
  display: none;
}

.story-dial-year {
  box-sizing: border-box;
  flex: 0 0 5.5rem;
  width: 5.5rem;
  height: 3.25rem;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
  opacity: 0.35;
  transition: opacity 0.25s ease, color 0.25s ease;
  background: none;
  border: none;
  color: var(--text);
  padding: 0;
  margin: 0;
  cursor: pointer;
  transform: none;
  -webkit-tap-highlight-color: transparent;
}

.story-dial-year__label {
  /* Tracking without optical left-shift: cancel trailing letter-spacing. */
  letter-spacing: 0.12em;
  margin-inline-end: -0.12em;
  text-indent: 0;
}

.story-dial-year.active {
  opacity: 1;
  color: var(--text-display);
}

/* Card — tight under intro; top of photo leads */

.story-cards {
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.35rem 0.65rem 0.35rem;
}

.story-card-panel {
  display: none;
}

.story-card-panel.active {
  display: block;
  animation: story-card-enter 0.35s ease;
}

@keyframes story-card-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.story-card {
  padding: 0.875rem 0.75rem 1rem;
  background: var(--surface-soft);
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
}

.story-photos {
  margin: 0 0 0.85rem;
}

.story-photos--multi {
  overflow: hidden;
}

.story-photo-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0.75rem;
  width: 100%;
}

/* Transform carousel — avoids nested scroll stealing the year dial’s scrollLeft on iOS. */
.story-photos--multi .story-photo-track {
  overflow: visible;
  scroll-snap-type: none;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: auto;
  touch-action: pan-y;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-photos--multi .story-photo-track.is-dragging {
  transition: none;
}

.story-photo-track::-webkit-scrollbar {
  display: none;
}

.story-photo-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  min-width: 0;
}

.story-photos--multi .story-photo-slide {
  scroll-snap-align: unset;
}

.story-photo-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.story-photo-dot {
  width: 0.4rem;
  height: 0.4rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-display) 32%, var(--border));
  cursor: pointer;
  opacity: 0.55;
  transition:
    width 0.28s ease,
    background 0.28s ease,
    opacity 0.28s ease;
}

.story-photo-dot.active {
  width: 1.15rem;
  background: var(--text-display);
  opacity: 1;
}

.story-photo {
  width: 100%;
  margin: 0;
}

.story-photo img,
.story-video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100svh - var(--site-header-height, 5.75rem) - 10.5rem);
  margin: 0;
  object-fit: contain;
  object-position: top center;
  border-radius: 6px;
}

.story-video {
  width: 100%;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.story-photo__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: center;
  color: var(--text-muted);
}

.story-photo__source {
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid currentColor;
}

.story-photo__source:hover {
  color: var(--text);
  opacity: 1;
}

.story-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  text-align: center;
}

.story-card p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.65;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  text-align: center;
}

.story-card p + p {
  margin-top: 0.65rem;
}

.story-card--joke {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10rem;
  background: transparent;
  border-style: dashed;
}

.story-card--joke p {
  font-size: 1.05rem;
  font-style: italic;
  max-width: 22rem;
  margin: 0 auto;
}

.story-cta {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--text);
  border-radius: 999px;
  transition: background 0.2s;
}

.story-cta:hover {
  background: var(--surface-soft);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .story-dial {
    scroll-behavior: auto;
  }

  .story-dial-year,
  .story-card-panel.active {
    animation: none;
  }

  .story-photo-track {
    scroll-behavior: auto;
  }

  .story-photos--multi .story-photo-track {
    transition: none;
  }

  .story-photo-dot {
    transition: none;
  }
}
