/*------------------------------------------------
 * SECTION: STORIES FEATURE
 *------------------------------------------------*/

/* Story Thumbnails in Hero Section */
.story-thumbnails {
  display: flex;
  align-items: center;
  z-index: 5;
  position: relative;
}

.story-thumbnail-link {
  position: relative;
  width: 6.4rem;
  height: 6.4rem;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  box-shadow: 0 0 0 0.8rem #f1f1f1;
  cursor: pointer;
  transition: transform .3s ease;
}

.story-thumbnail-link:hover {
  transform: scale(1.05);
}

.story-thumbnail-link:not(:first-child) {
  margin-left: -.8rem;
}

.story-thumbnail-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stories Modal */
.stories-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(14, 14, 14, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stories-modal[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.stories-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 0;
}

.stories-modal__close svg {
  width: 2rem;
  height: 2rem;
  color: #ffffff;
}

/* Stories Carousel */
.stories-carousel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  position: relative;
  transform: translateX(0);
}

/* Story Slide */
.story-slide-wrapper {
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.story-slide-wrapper.active {
  z-index: 5;
}


.story-slide {
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  width: 33rem;
  height: 58rem;
  gap: 1.9333rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
}

.story-slide-wrapper.active .story-slide {
  width: 41rem;
  height: 68.4rem;
  padding: 2.4rem;
  gap: 2.4rem;
  flex-shrink: 0;
}

.story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.story-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(14, 14, 14, 0) 50%, rgba(14, 14, 14, 0.8) 100%);
}

.story-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  z-index: 5;
}

.story-title {
  color: #ffffff;
  font-size: 2.6rem;
  font-style: normal;
  font-weight: 600;
  line-height: 110%; /* 2.86rem */
  letter-spacing: -0.078rem;
}

.story-button {
  background: #ffffff;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
}

.story-button-text {
  color: #0e0e0e;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: normal;
  letter-spacing: -0.0195rem;
  text-transform: uppercase;
  min-height: 2.4rem; /* 24px */
  display: flex;
  align-items: center;
}

/* Progress Bars */
.story-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 5;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
  padding-bottom: 0.5rem;
}

.story-progress-bars {
  display: flex;
  gap: 0.25rem;
  padding: 1rem 1rem 0.75rem 1rem;
  align-items: center;
  backdrop-filter: blur(0.25rem);
}

.story-progress-bar {
  background: rgba(255, 255, 255, 0.32);
  height: 0.25rem;
  flex: 1;
  border-radius: 0.125rem;
  overflow: hidden;
  position: relative;
}

.story-progress-bar.completed .story-progress-inner {
  width: 100%;
}

.story-progress-inner {
  background: #ffffff;
  height: 100%;
  width: 0;
  position: absolute;
  left: 0;
  top: 0;
  transition: width linear;
}

.story-info {
  padding: 0.25rem 1rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.story-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.story-category {
  color: #ffffff;
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 500;
}

/* Fix for progress bar animation */
.story-progress-bar.active .story-progress-inner {
  width: 0;
  transition: width linear;
  will-change: width;
}

.story-slide-wrapper:not(.active) .story-progress-inner {
  transition: none !important;
}

/* Ensure story button is hidden when not needed */
.story-button[style*="display: none"] {
  display: none !important;
}

/* Tablet Breakpoint */
@media (max-width: 1079px) {
  .story-slide-wrapper {
      padding: 0 0.5rem;
  }
  
  .story-slide {
      width: 20.625rem; /* 330px */
      height: 36.25rem; /* 580px */
  }
  
  .story-content {
      padding: 1.8rem;
      gap: 1.8rem;
  }
  
  .story-title {
      font-size: 2rem; /* 20.94px */
  }
  
  .story-button {
      padding: 0.6rem 0.8rem 0.6rem 1.2rem;
  }
  

  .story-thumbnails {
    padding: 1.6rem 0;
    gap: .8rem;
  }

  .story-thumbnail-link {
    width: 5.6rem;
    height: 5.6rem;
    box-shadow: none;
  }

  .story-thumbnail-link:not(:first-child) {
      margin-left: 0;
  }

  .stories-modal__close {
    top: 1.6rem;
    right: 1.6rem;
    width: 3.2rem;
    height: 3.2rem;
  }
  .stories-modal__close svg {
    width: 3.2rem;
    height: 3.2rem;
    color: #ffffff;
  }

  .stories-modal__close svg path {
    stroke: #616161;
  }
  
}

/* Mobile Breakpoint */
@media (max-width: 767px) {
  .stories-modal__close {
    top: 4rem;
    width: 2.4rem;
    height: 2.4rem;
  }

  .stories-modal__close svg {
    width: 2.4rem;
    height: 2.4rem;
  }
  
  .story-thumbnail-link {
      width: 3.75rem; /* 60px */
      height: 3.75rem; /* 60px */
  }
  
  .story-slide-wrapper {
      padding: 0 0.25rem;
  }

  .story-slide-wrapper.active .story-slide {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
  }
  
  .story-progress-bars {
      padding: 1.6rem;
  }

  .story-progress-bar {
    height: 0.4rem;
  }
  
  .story-info {
    padding: 0.4rem 6.4rem 0.8rem 1.6rem;
  }
  
  .story-icon {
      width: 2.4rem;
      height: 2.4rem;
      flex: 0 0 2.4rem;
  }
  
  .story-category {
      font-size: 1.4rem;
  }
  
  .story-content {
      padding: 2.4rem;
      gap: 2.4rem;
  }
  
  .story-title {
      font-size: 2.4rem;
  }

  .story-button {
    padding: 1.2rem 0.8rem 1.2rem 1.2rem;
  }
}
