/* Hide captions when zoomed in */
.carousel-card.zoomed .carousel-caption-container,
.carousel-card.zoomed .carousel-caption {
  display: none !important;
}
/* === IMAGE CAROUSEL === */

/* Remove border/background and let carousel fill card */
.carousel-card {
  max-width: 100%;
  margin: clamp(1.5rem, 5vw, 2.5rem) 0 clamp(1.5rem, 5vw, 2.5rem) 0 !important;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.image-carousel {
  position: relative;
  width: 100%;
  /* border-radius removed */
  overflow: hidden;
  background: var(--color-bg, #d8dce6);
  display: flex;
  flex-direction: column;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 50vh;
  /* Removed overflow and border-radius to allow full rounding */
}


.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
      background: rgba(60,60,60,0.45); /* Unified grey for all carousel UI */
    color: #fff; /* White arrows */
  border: 2px solid rgba(255,255,255,0.5); /* Match .dot background */
    font-size: 1.5rem;
    padding: 0.25rem 0.7rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.3s, border 0.3s, color 0.3s, box-shadow 0.3s;
  opacity: 0.92;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:focus {
  outline: 2px solid var(--color-black, #181818);
  outline-offset: 2px;
}
.carousel-btn:hover {
  background: rgba(60,60,60,0.65);
  color: #fff;
  border-color: rgba(60,60,60,0.65);
  box-shadow: 0 6px 32px 0 rgba(0,0,0,0.18);
  opacity: 1;
}

.carousel-prev {
  left: 0.5rem;
  transform: translateY(-50%) translateX(-10%);
}

.carousel-next {
  right: 0.5rem;
  transform: translateY(-50%) translateX(10%);
}

.carousel-dots {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 20;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: white;
}

/* === CAROUSEL ZOOM === */
.carousel-card.zoomed {
  position: fixed;
  top: var(--header-height, 64px);
  left: 0;
  width: 100vw;
  height: calc(100% - var(--header-height, 64px));
  max-width: 100vw;
  margin: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vw;
  box-sizing: border-box;
}

/* Only round the images in the carousel */
.carousel-image {
  /* border-radius removed */
  object-fit: cover;
}

/* Set the header height variable on body or html for easy adjustment */
html {
  --header-height: 64px;
}
.carousel-card.zoomed .image-carousel {
  width: 100%;
  height: 100%;
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

.carousel-card.zoomed .carousel-container {
  height: 75vh;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card.zoomed .carousel-caption-container {
  min-height: auto;
  padding: 1.5rem;
}

.carousel-zoom-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
  z-index: 1001;
}

.carousel-card.zoomed .carousel-zoom-close {
  display: block;
}

.carousel-zoom-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.10);
  border-radius: 12px;
}

.carousel-image.active {
  opacity: 1;
}

.carousel-caption-container {
  position: relative;
  background: white;
  padding: 0.5rem 1rem;
  min-height: 4rem;
}

.carousel-caption {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  right: 1rem;
  color: var(--color-black);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  margin: 0;
  padding: 0;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.carousel-caption.active {
  opacity: 1;
}

.carousel-caption.active {
  opacity: 1;
}

/* === CAROUSEL RESPONSIVE === */
@media (max-width: 900px) {
  .carousel-card {
    max-width: 100%;
    margin: clamp(0.25rem, 3vw, 1.5rem);
  }

  .carousel-caption {
    font-size: 1rem;
  }

  .carousel-dots {
    display: none;
  }
}
