/* ─── 1. Fixed-height container that doesn't reflow the page ─── */
.carousel {
  max-height: 500px;
  background: #000; /* letterbox color for portrait images */
}

.carousel-inner {
  max-height: 500px;
}

.carousel-item {
  max-height: 500px;
  overflow: hidden;
  text-align: center;
}

.carousel-item img {
  max-height: 500px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* ─── 2. Wrap each image in a clickable link to open in new tab ─── */
/* Handled via the Lua filter workaround below — see note */

/* ─── 3a. Arrow buttons: visible pill outside the image area ─── */
.carousel-control-prev,
.carousel-control-next {
  width: 3rem;
  top: 50%;
  transform: translateY(-50%);
  height: 3rem;
  opacity: 1;
  background: none;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 2.2rem;
  height: 2.2rem;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  background-size: 55%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: background-color 0.2s;
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.85);
}

/* ─── 3b. Dot indicators: raised above image with contrast ─── */
.carousel-indicators {
  bottom: -2rem;       /* push below the image entirely */
  margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
  background-color: #888;
  border-top: none;
  border-bottom: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s;
  margin: 1em 0.05em 1em 0.05em !important;
}

.carousel-indicators .active {
  background-color: #222;
  opacity: 1;
}

/* Add breathing room below carousel for the external indicators */
.carousel-container,
div:has(> .carousel) {
  padding-bottom: 2.5rem;
}