/* Reusable Card Carousel Styles */
.card-carousel {
  margin-top: 32px;
  position: relative;
  padding: 0 120px;
}

.card-carousel-wrapper {
  position: relative;
  overflow: hidden;
  padding-bottom: 80px; /* Space for dots */
}

/* Fade gradients at left and right margins */
.card-carousel-wrapper::before,
.card-carousel-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  width: 120px;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.card-carousel-wrapper::before {
  left: 0;
  background: linear-gradient(
    to right,
    var(--colour-cream) 0%,
    transparent 100%
  );
}

.card-carousel-wrapper::after {
  right: 0;
  background: linear-gradient(
    to left,
    var(--colour-cream) 0%,
    transparent 100%
  );
}

/* Base card styling - can be extended by specific card types */
.carousel-card {
  position: relative;
  border-radius: 10px;
  width: 378px;
  height: 440px;
  min-width: 378px;
  min-height: 440px;
  overflow: hidden;
  color: white;
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out !important;
  text-decoration: none !important;
}

.carousel-card:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 32px 32px 8px rgba(0, 0, 0, 0.2) !important;
  z-index: 10;
  color: white !important;
}

.carousel-card:focus,
.carousel-card:visited {
  color: white !important;
  text-decoration: none !important;
}

.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.carousel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0) 0%, transparent 100%);
  z-index: 1;
}

.carousel-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: calc(100% - 64px);
  z-index: 2;
}

.carousel-card-title {
  margin-bottom: 8px;
  color: white;
  transition: transform 0.3s ease;
}

.carousel-card-details {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  line-height: 1;
}

.carousel-card-details i {
  color: var(--colour-pink);
  font-size: 14px;
  align-self: center;
}

.carousel-card-details span {
  font-size: 14px;
  transform: translateY(2px);
}

.carousel-card-btn {
  margin-top: 8px;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  gap: 8px;
}

.carousel-card-btn h3,
.carousel-card-btn i {
  margin: 0;
  align-self: center;
  color: white;
  font-size: 18px;
  line-height: 1;
}

.carousel-card-btn h3 {
  font-family: "Rockwell", serif;
  font-weight: bold;
  transform: translateY(2px);
}

.carousel-card:hover .carousel-card-btn h3 {
  text-decoration: underline;
}

/* Slick carousel navigation arrows */
.card-carousel .slick-prev,
.card-carousel .slick-next {
  z-index: 15;
  font-size: 0;
  width: 40px;
  height: 40px;
  background: var(--colour-maroon);
  color: white;
  border-radius: 50%;
  border: none;
  transition: all 0.3s ease;
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
}

.card-carousel .slick-prev:hover,
.card-carousel .slick-next:hover {
  background: var(--colour-maroon-dark);
  transform: translateY(-50%) scale(1.05);
}

.card-carousel .slick-prev:before,
.card-carousel .slick-next:before {
  font-family: "Font Awesome 6 Free";
  font-weight: bold;
  font-size: 28px;
  color: white !important;
  opacity: 1 !important;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
}

.card-carousel .slick-prev:before {
  content: "\f060"; /* FontAwesome arrow-left */
}

.card-carousel .slick-next:before {
  content: "\f061"; /* FontAwesome arrow-right */
}

.card-carousel .slick-prev {
  right: auto;
  left: 100px;
}

.card-carousel .slick-next {
  right: 100px;
  left: auto;
}

/* Slick carousel dots */
.card-carousel .slick-dots {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: auto;
  text-align: center;
  z-index: 10;
  display: flex !important;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.card-carousel .slick-dots li {
  width: 14px;
  height: 14px;
  margin: 0;
  display: block;
}

.card-carousel .slick-dots li button {
  width: 14px;
  height: 14px;
  padding: 0;
  background: url("https://assets-cdn.sums.su/NH/1web-assets/global-assets/media/indicator-inactive-dark.svg")
    no-repeat center;
  background-size: contain;
  font-size: 0;
  border: none;
  cursor: pointer;
}

.card-carousel .slick-dots li button:before {
  display: none;
}

.card-carousel .slick-dots li.slick-active button {
  background: url("https://assets-cdn.sums.su/NH/1web-assets/global-assets/media/indicator-active.svg")
    no-repeat center;
  background-size: contain;
}

/* Slick track and slide styling */
.card-carousel .slick-track {
  display: flex;
  align-items: center;
  padding-left: 120px;
  padding-right: 120px;
}

.card-carousel .slick-slide {
  margin-right: 32px;
  transition: opacity 0.3s ease;
  width: 378px !important; /* Force original card width */
}

.card-carousel .slick-slide .carousel-card {
  width: 378px !important; /* Ensure card maintains its width */
  height: 440px;
  flex-shrink: 0;
}

.card-carousel .slick-slide:focus {
  outline: none;
}

/* Additional carousel container styling */
.card-carousel-wrapper {
  padding-bottom: 48px;
}

/* No-cards state and error state styling */
.no-cards-state,
.error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 440px; /* Match carousel card height */
  min-height: 440px;
  margin: 0 auto;
  text-align: center;
  font-size: 18px;
  color: var(--colour-maroon, #8b0000);
  font-family: "Rockwell", serif;
  position: relative;
}

/* Ensure cards maintain their original size and spacing */
.card-carousel .slick-slide > div {
  width: 378px;
}

.card-carousel .slick-slide:last-child > div {
  width: 378px;
}

/* Override default slick list styling */
.card-carousel .slick-list {
  overflow: visible;
  margin: 0;
  padding: 0;
}

.card-carousel .slick-prev.slick-disabled,
.card-carousel .slick-next.slick-disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.card-carousel .slick-prev.slick-disabled:hover,
.card-carousel .slick-next.slick-disabled:hover {
  background: var(--colour-maroon);
  transform: translateY(-50%);
}

/* Background color variants for different sections */
.card-carousel-wrapper::before {
  background: linear-gradient(
    to right,
    var(--bg-colour, white) 0%,
    transparent 100%
  );
}

.card-carousel-wrapper::after {
  background: linear-gradient(
    to left,
    var(--bg-colour, white) 0%,
    transparent 100%
  );
}

/* ===== CAROUSEL RESPONSIVE STYLES ===== */

@media (max-width: 1439px) {
  .carousel-card-btn h3,
  .carousel-card-btn i {
    margin: 0;
    align-self: center;
    color: white;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1;
  }
}

/* Tablet breakpoint */
@media (max-width: 768px) {
  .carousel-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .carousel-card-content {
    padding: 24px;
  }

  /* Carousel buffer zone adjustments */
  .card-carousel {
    padding: 0 64px;
  }

  .carousel-card-btn {
    margin-top: 12px;
  }

  .card-carousel .slick-track {
    padding-left: 64px;
    padding-right: 64px;
  }

  .card-carousel .slick-prev {
    left: 44px;
  }

  .card-carousel .slick-next {
    right: 44px;
  }

  .card-carousel-wrapper::before,
  .card-carousel-wrapper::after {
    width: 64px;
  }

  /* No-cards state adjustments for tablet */
  .no-cards-state,
  .error-state {
    height: 400px;
    min-height: 400px;
    font-size: 16px;
  }

  /* Tablet carousel card sizing - with higher specificity */
  .card-carousel .carousel-card {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
  }

  .card-carousel .slick-slide {
    width: 300px !important;
    margin-right: 16px !important;
  }

  .card-carousel .slick-slide .carousel-card {
    width: 300px !important;
    height: 400px !important;
  }

  .card-carousel .slick-slide > div {
    width: 300px !important;
  }

  .card-carousel .slick-slide:last-child > div {
    width: 300px !important;
  }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
  /* Carousel buffer zone adjustments for mobile */
  .card-carousel {
    padding: 0 16px;
  }

  .card-carousel .slick-track {
    padding-left: 16px;
    padding-right: 16px;
  }

  .card-carousel .slick-prev {
    display: none !important;
  }

  .card-carousel .slick-next {
    display: none !important;
  }

  .card-carousel-wrapper::before,
  .card-carousel-wrapper::after {
    width: 16px;
  }

  /* Mobile card gap adjustment */
  .card-carousel .slick-slide {
    margin-right: 8px !important;
  }

  /* No-cards state adjustments for mobile */
  .no-cards-state,
  .error-state {
    height: 400px;
    min-height: 400px;
    font-size: 14px;
    padding: 0 16px;
  }

  /* Mobile carousel card sizing */
  .card-carousel .carousel-card {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
  }

  .card-carousel .slick-slide {
    width: 300px !important;
  }

  .card-carousel .slick-slide .carousel-card {
    width: 300px !important;
    height: 400px !important;
  }

  .card-carousel .slick-slide > div {
    width: 300px !important;
  }

  .card-carousel .slick-slide:last-child > div {
    width: 300px !important;
  }
}

@media (max-width: 320px) {
  /* No-cards state adjustments for smallest mobile */
  .no-cards-state,
  .error-state {
    height: 360px;
    min-height: 360px;
    font-size: 13px;
  }

  /* Mobile carousel card sizing */
  .card-carousel .carousel-card {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    height: 360px !important;
    min-height: 360px !important;
    max-height: 360px !important;
  }

  .card-carousel .slick-slide {
    width: 280px !important;
  }

  .card-carousel .slick-slide .carousel-card {
    width: 280px !important;
    height: 360px !important;
  }

  .card-carousel .slick-slide > div {
    width: 280px !important;
  }

  .card-carousel .slick-slide:last-child > div {
    width: 280px !important;
  }
}
