/* Container */
.cts-wrap {
  position: relative;
}
/* Card */
.cts-card {
  background: #ffffff69;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
  max-width: 920px;
  margin: 0 auto;
}
/* Header */
.cts-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.cts-card__title h3 {
  margin: 0;
  font-size: 1.125rem;
}
.cts-date {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin-top: 4px;
}
/* Overall */
.cts-overall {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cts-overall__num {
  font-weight: 600;
}
/* Body */
.cts-text p {
  margin: 0 0 10px 0;
}
/* Aspects */
.cts-aspects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 14px;
}
.cts-aspect dt {
  font-weight: 600;
  color: #333;
}
.cts-aspect dd {
  margin: 4px 0 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cts-num {
  font-size: 0.9rem;
  color: #555;
}

/* Stars */
.cts-stars {
  position: relative;
  display: inline-block;
  line-height: 0;
  width: 120px;
  height: 22px;
}
.cts-stars__base,
.cts-stars__fill {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.cts-stars__base .cts-star {
  fill: none;
  stroke: #bbb;
  stroke-width: 1.2;
}
.cts-stars__fill {
  overflow: hidden;
}
.cts-stars__fill .cts-star {
  fill: #f5a623;
  width: 21px;
}

/* Swiper pagination/arrows sizing tweak */
.swiper-pagination-bullet {
  width: 10px;
  height: 10px;
}
.swiper-button-prev,
.swiper-button-next {
  color: #333;
}

/* Make the wrapper breathe on small screens */
.cts-wrap {
  padding: 0 16px;
}

/* Ensure the swiper itself takes width */
.cts-wrap .swiper {
  width: 100%;
}

/* Card responsive spacing */
@media (max-width: 640px) {
  .cts-card {
    padding: 16px;
    border-radius: 12px;
  }
  .cts-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cts-name {
    font-size: 1rem;
  }
  .cts-date {
    font-size: 0.85rem;
  }
  .cts-overall__num {
    font-size: 0.95rem;
  }
  .cts-aspects {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cts-stars {
    width: 100px;
    height: 20px;
  } /* smaller star bar */
  /* Hide arrows on very small screens; dots are enough */
  .swiper-button-prev,
  .swiper-button-next {
    display: none;
  }
  .cts-stars__base,
  .cts-stars__fill {
    gap: 0;
  }
}

/* Make sure no parent sets odd overflow that clips fades */
.swiper,
.swiper-wrapper,
.swiper-slide {
  min-height: 1px;
}

/* If your theme imposes overflow hidden on containers, ensure slides remain visible in fade */
.swiper-wrapper {
  overflow: visible;
}

/* Force LTR just for this slider so Swiper translates the right way */
.cts-wrap .swiper,
.cts-wrap .swiper-wrapper,
.cts-wrap .swiper-slide {
  direction: ltr !important;
  padding-bottom: 14px;
}

/* Make sure fade effect shows the active slide */
.swiper-fade .swiper-slide {
  opacity: 0;
}
.swiper-fade .swiper-slide.swiper-slide-active,
.swiper-fade .swiper-slide.swiper-slide-duplicate-active {
  opacity: 1 !important;
}

/* Safety: slider always fills the width */
.cts-wrap .swiper {
  width: 100%;
}
/* Optional: let fades breathe; avoids clipping */
.cts-wrap .swiper-wrapper {
  overflow: visible;
}

/* --- Aspect ratings responsive layout --- */
.cts-wrap .cts-aspects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* desktop: 4 across */
  gap: 10px 18px;
}

/* Mobile: two columns */
@media (max-width: 768px) {
  .cts-wrap .cts-aspects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cts-stars__fill .cts-star {
    fill: #f5a623;
    width: 16px;
  }
  .cts-stars__base,
  .cts-stars__fill {
    gap: 10px;
  }
}

/* Card responsive spacing */
@media (max-width: 640px) {
  .cts-card {
    padding: 16px;
    border-radius: 12px;
  }
  .cts-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cts-name {
    font-size: 1rem;
  }
  .cts-date {
    font-size: 0.85rem;
  }
  .cts-overall__num {
    font-size: 0.95rem;
  }
  .cts-aspects {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cts-stars {
    width: 100px;
    height: 20px;
  } /* smaller star bar */
  /* Hide arrows on very small screens; dots are enough */
  .swiper-button-prev,
  .swiper-button-next {
    display: none;
  }
  .cts-stars__base,
  .cts-stars__fill {
    gap: 5px;
  }
}

/* Really small phones: stack (one column) */
@media (max-width: 380px) {
  .cts-wrap .cts-aspects {
    grid-template-columns: 1fr;
  }
  .cts-stars__fill .cts-star {
    fill: #f5a623;
    width: 15px;
  }
  .cts-stars__base,
  .cts-stars__fill {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
}

/* Star bar sizing tweaks so it fits nicely at smaller widths */
/* @media (max-width: 768px) {
  .cts-wrap .cts-stars {
    width: 100px;
    height: 20px;
  }
}
@media (max-width: 380px) {
  .cts-wrap .cts-stars {
    width: 92px;
    height: 18px;
  }
} */

/* Keep each aspect tidy in the grid */
.cts-wrap .cts-aspect dt {
  font-weight: 600;
}
.cts-wrap .cts-aspect dd {
  margin: 4px 0 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- STAR BAR: Safari-safe sizing ---------------------------------- */

/* One-row grid, center each cell */
.cts-stars__base,
.cts-stars__fill {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-flow: column;
  align-items: center;
  justify-items: center;
  gap: 4px;
}

/* Give *both* SVGs an explicit size (Safari defaults to 300x150 otherwise) */
.cts-stars .cts-star {
  /* keep the star size in one place */
  --star-size: 21px;
  width: var(--star-size);
  height: var(--star-size);
  display: block; /* avoid inline baseline weirdness */
  pointer-events: none;
}

/* Grey outline (track) */
.cts-stars__base .cts-star {
  fill: none;
  stroke: #bbb;
  stroke-width: 1.2;
}

/* Orange fill */
.cts-stars__fill .cts-star {
  fill: #f5a623;
}

/* Mobile star sizing */
@media (max-width: 768px) {
  .cts-stars .cts-star {
    --star-size: 16px;
  }
  .cts-stars__base,
  .cts-stars__fill {
    gap: 6px;
  }
}
@media (max-width: 380px) {
  .cts-stars .cts-star {
    --star-size: 15px;
  }
  .cts-stars__base,
  .cts-stars__fill {
    gap: 5px;
  }
}
