.story-page {
  max-width: 1600px;
}

.story-page .heading--large {
  --clamp-min: 20;
  --clamp-max: 39;
  margin-top: 114px;
}

.story-page h3.wp-block-heading {
  --clamp-max: 25;
  --clamp-min: 18;
  margin-bottom: clamp(10px, 2vw, 20px) !important;
}

.story-page__number {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 0.2em 0.4em;
  text-align: center;
  white-space: nowrap;
  width: fit-content;
}

.story-gallery {
  width: 100%;
}

.story-gallery__main {
  background: var(--ivory);
  overflow: hidden;
}

.story-gallery__main .swiper-wrapper {
  align-items: stretch;
}

.story-gallery__main-slide {
  margin: 0;
  aspect-ratio: 16 / 9;
}

.story-gallery__main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 12px);
  margin-top: clamp(8px, 1vw, 14px);
  padding-inline: 56px;
}

.story-gallery__thumb {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
  transition: filter 0.3s ease;
}

@media (hover: hover) {
  .story-gallery__thumb:hover {
    filter: brightness(108%);
  }
}

.story-gallery__thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-page__content {
  margin-top: 70px;
  padding-top: 0;
}

.story-page__content h3 + p {
  margin-top: 0;
}

.story-episode-links {
  margin-top: 60px;
  margin-bottom: 0;
  padding-top: 20px;
  background-image:
    linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold));
  background-position:
    0 4px,
    0 0;
  background-repeat: no-repeat;
  background-size:
    100% 2px,
    100% 1px;
}

.story-episode-links__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.story-episode-links__item {
  min-width: 0;
  border-right: 1px solid rgb(150 125 84 / 45%);
  border-bottom: 1px solid rgb(150 125 84 / 45%);
  transition: border-color 0.3s ease;
}

.story-episode-links__item:nth-child(-n + 6) {
  border-top: 1px solid rgb(150 125 84 / 45%);
}

.story-episode-links__item:nth-child(6n + 1) {
  border-left: 1px solid rgb(150 125 84 / 45%);
}

.story-page__content .story-episode-links__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(54px, 4vw, 72px);
  color: var(--gold);
  background: rgb(253 249 241 / 72%);
  --clamp-min: 16;
  --clamp-max: 20;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  text-underline-offset: 0;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

@media (hover: hover) {
  .story-episode-links__item:hover {
    border-color: var(--gold);
  }

  .story-page__content .story-episode-links__link:hover {
    background: var(--gold);
    color: var(--white);
  }
}

@media (max-width: 980px) {
  .story-gallery__thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .story-page .heading--large {
    margin-top: 80px;
  }

  .story-page__number {
    top: 44px;
    padding: 0.1em 0.3em;
  }

  .story-gallery__thumbs {
    padding-inline: 20px;
  }

  .story-page__content {
    margin-top: 50px;
  }

  .story-episode-links {
    margin-top: 40px;
  }

  .story-episode-links__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .story-episode-links__item:nth-child(-n + 6) {
    border-top: 0;
  }

  .story-episode-links__item:nth-child(-n + 3) {
    border-top: 1px solid rgb(150 125 84 / 45%);
  }

  .story-episode-links__item:nth-child(6n + 1) {
    border-left: 0;
  }

  .story-episode-links__item:nth-child(3n + 1) {
    border-left: 1px solid rgb(150 125 84 / 45%);
  }

  .story-page__content .story-episode-links__link {
    min-height: 52px;
    --clamp-min: 16;
    --clamp-max: 20;
  }
}
