.stories-section {
  padding: 35px 0;
}

@media (max-width: 950px) {
  .stories-section {
    padding: 10px 0;
  }
}

.story-card {
  display: flex !important;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.story-card-img {
  margin: 0 auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  padding: 3px; /* ضخامت حلقه */
  background: linear-gradient(to bottom, #7672ec, #0bfcc6);
}

.story-card-img.seen {
  background: linear-gradient(to bottom, #dfdfe5, #e7e7e7);
}

.story-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 2px solid #fff; /* فاصلهٔ سفید بین حلقه و عکس - مثل اینستا */
  box-sizing: border-box;
}

@media (max-width: 950px) {
  .story-card-img {
    width: 75px;
    height: 75px;
  }
}

.story-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-title {
  color: #717171;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0 auto;
}

@media (max-width: 950px) {
  .story-card-title {
    font-size: 10px;
  }
}

.banner-section {
  width: 100%;
  height: 470px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}

.banner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .banner-section {
    width: 100%;
    height: 380px;
  }
}

.banner-card {
  width: 100%;
  height: 100%;
}

/* ===== Story Viewer ===== */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #737292af;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.modal-open {
  overflow: hidden;
}

.story-viewer.active {
  opacity: 1;
  visibility: visible;
}

.story-viewer__progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 12;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.story-viewer__progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}

.story-viewer__progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: inherit;
  will-change: width;
}

.story-viewer__tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28%;
  z-index: 4;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.story-viewer__tap--prev {
  right: 0;
}

.story-viewer__tap--next {
  left: 0;
}

.story-viewer__close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
    background: rgb(6 6 6 / 60%);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.story-viewer__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.story-viewer__swiper {
    position: relative;
    width: min(100%, calc(95vh * 9 / 16));
    max-height: 95vh;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    touch-action: pan-y;
}

@media (max-width: 420px) {
  .story-viewer__swiper {
    width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

.story-viewer__swiper .swiper-slide {
  position: relative;
}

.story-viewer__swiper .swiper-slide video,
.story-viewer__swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  user-select: none;
  -webkit-user-drag: none;
}

.story-viewer__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.99));
  padding: 40px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-viewer__title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.story-viewer__desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-viewer__swiper .swiper-button-prev,
.story-viewer__swiper .swiper-button-next {
  color: #fff;
  width: auto;
  height: auto;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  transition: background 0.2s ease;
}

.story-viewer__swiper .swiper-button-prev:hover,
.story-viewer__swiper .swiper-button-next:hover {
  background: rgba(0, 0, 0, 0.5);
}

.story-viewer__swiper .swiper-button-prev::after,
.story-viewer__swiper .swiper-button-next::after {
  display: none;
}

.story-viewer__swiper .swiper-button-prev svg,
.story-viewer__swiper .swiper-button-next svg {
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  width: 100%;
  fill: none;
  pointer-events: none;
}

@media (max-width: 768px) {
  .story-viewer__close {
    top: 28px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .story-viewer__progress {
    top: 10px;
    left: 10px;
    right: 56px;
  }

  .story-viewer__swiper .swiper-button-prev,
  .story-viewer__swiper .swiper-button-next {
    display: none;
  }
}

/* ===== Swiper: hide desktop nav below 500px ===== */
@media (max-width: 500px) {
  .swiper-desktop-nav {
    display: none !important;
  }
}

/* ===== Swiper Mobile Nav (below 768px) ===== */
.swiper-mobile-nav {
  display: none;
  gap: 8px;
  align-items: center;
  margin-right: auto;
}

@media (max-width: 768px) {
  .swiper-mobile-nav {
    display: flex;
  }
}

.swiper-mobile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #ebebeb;
  color: gray;
  cursor: pointer;
  pointer-events: all;
}