/* =========================
   Stories
========================= */

.stories-section {
  width: 100%;
  padding: 24px 0 18px;
}

.stories-container {
  width: 90%;
  max-width: 1450px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-container::-webkit-scrollbar {
  display: none;
}

.story-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  flex: 0 0 auto;
  width: 90px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  font: inherit;
  color: #fff;
}

.story-thumbnail-wrap {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  padding: 3px;
  border: 3px solid #f6d24a;
  display: block;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.story-thumbnail {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.story-title {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-item:hover .story-thumbnail-wrap {
  transform: scale(1.05);
}

.story-item:focus-visible .story-thumbnail-wrap {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Mobile */
@media (max-width: 767px) {
  .stories-section {
    padding: 16px 0 12px;
  }

  .stories-container {
    width: 100%;
    gap: 12px;

    padding-left: 16px;
    padding-right: 16px;
  }

  .story-item {
    width: 72px;
  }

  .story-thumbnail-wrap {
    width: 66px;
    height: 66px;
    padding: 2px;
    border-width: 2px;
  }

  .story-title {
    font-size: 11px;
  }

  .story-viewer-nav {
    display: none;
  }
}

/* =========================
   Story Viewer
========================= */

body.story-viewer-open {
  overflow: hidden;
}

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.story-viewer.is-open {
  display: flex;
}

.story-viewer-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer-video-wrap {
  position: relative;
  height: min(90vh, 850px);
  aspect-ratio: 9 / 16;
  max-width: calc(100vw - 120px);
  background: #000;
  overflow: hidden;
  border-radius: 16px;
  touch-action: pan-x;
}

.story-viewer-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.story-viewer-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 20px 18px;
  color: #fff;
  font-family: "Gotham Medium", sans-serif;
  font-size: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  pointer-events: none;
}

.story-viewer-close {
  position: absolute;
  top: 25px;
  right: 30px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 30px;
  line-height: 1;

  cursor: pointer;
}

.story-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.story-viewer-prev {
  left: 30px;
}

.story-viewer-next {
  right: 30px;
}

/* Mobile */
@media (max-width: 767px) {
  .story-viewer-video-wrap {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .story-viewer-close {
    top: 18px;
    right: 18px;
  }

  .story-viewer-nav {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .story-viewer-prev {
    left: 12px;
  }

  .story-viewer-next {
    right: 12px;
  }

  .story-viewer-title {
    padding: 50px 20px calc(20px + env(safe-area-inset-bottom));
  }
}
