/* --- Carousel layout (portfolio only) --- */

/* Carousel fills the card width; height is driven by the image (1280x720) */
.carousel {
  position: relative;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Track spans full width */
.carousel-track {
  width: 100%;
}

/* Each slide takes full width; only the active one is shown */
.carousel-slide {
  width: 100%;
  display: none;
}

.carousel-slide.active {
  display: block;
}

/* Caption: one-liner above image, left aligned, wraps on multiple lines */
.carousel-caption {
  line-height: 1.4;
  height: calc(1.4em * 2);   /* reserve 2 lines */
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  text-align: left;
  color: #000000;
  white-space: normal;
  overflow-wrap: anywhere;     /* allow wrapping instead of cropping */
  overflow-y: auto;
  overflow-x: hidden;
}

/* Wrapper ensures the image scales responsively with no cropping */
.carousel-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;          /* just in case */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* IMPORTANT: if the image is wrapped in <a>, the <a> must also fill the wrapper */
.carousel-image-wrapper > a,
.carousel-image-wrapper > img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Images scale to the carousel width, keep aspect ratio, no cropping */
.carousel-image-wrapper img {
  border-radius: 10px;
  display: block;
  width: 100%;
  height: 100%;              /* critical: tie image to wrapper height */
  /*height: auto;*/                 /* 1280x720 ratio preserved */
  object-fit: contain;       /* no cropping */
}


/* Buttons & dots */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.carousel-btn.prev {
  left: 0.75rem;
}

.carousel-btn.next {
  right: 0.75rem;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #c5cfdd;
  cursor: pointer;
}

.carousel-dots .dot.active {
  background: #004f9e;
}

.carousel-toggle {
  position: absolute;
  bottom: 0.6rem;
  right: 0.75rem;
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.carousel-toggle:hover {
  background: rgba(0, 0, 0, 0.5);
}
