/* =======================================
   Base Styles
======================================= */
body {
  margin: 0;
  height: 100vh;
  font-family: system-ui, sans-serif;
  font-size: 1.1em;
  line-height: 1.4;
  background-color: white;
  color: black;
  overflow: hidden; /* No scrollbars during full-screen carousel */
}

.adaptive-heading {
  text-align: center;
  color: maroon;
  margin: 0.5rem 0 1rem 0;
}

.return-link {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

/* =======================================
   Carousel Layout
======================================= */
.carousel {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.carousel-images img {
  background: white;
  display: block;
  height: 100%;
  margin: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  position: relative;
  width: 100%;
}

.carousel-images img {
  background: black;
  left: 50%;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transition: opacity 0.2s ease;
  width: auto;
}

/* Active image becomes visible */
.carousel-images img.active {
  opacity: 1;
  pointer-events: auto;
}

/* =======================================
   Caption Styling
======================================= */
.carousel-caption {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  top: 10px;
  color: white;
  font-size: 1.2rem;
  left: 50%;
  width: fit-content;
  max-width: 100%;
  padding: 10px 18px;
  position: relative;
  text-align: center;
  transform: translateX(-50%);
  z-index: 30;
}

/* .carousel-caption {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  color: white;
  font-size: 1.2rem;
  left: 50%;
  max-width: 90%;
  padding: 10px 18px;
  position: relative;
  text-align: center;
  transform: translateX(-50%);
  z-index: 30;
}

/* =======================================
   Carousel Buttons (Prev / Next)
======================================= */
button {
  background-color: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 2rem;
  padding: 12px 16px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: background-color 0.2s;
  z-index: 40;
}

button:hover {
  background-color: rgba(0, 0, 0, 0.55);
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* Larger touch-friendly targets on mobile */
@media (max-width: 600px) {
  button {
    font-size: 2.3rem;
    padding: 16px 20px;
  }

  .carousel-caption {
    bottom: 40px;
    font-size: 1.1rem;
  }
}

/* =======================================
   Dark Mode
======================================= */
@media (prefers-color-scheme: dark) {
  body {
    background-color: black;
    color: white;
  }

  .carousel-images {
    background-color: black; /* match system theme */
  }

  .adaptive-heading {
    color: #ffc300; /* optional highlight color */
  }

  .carousel-caption {
    background: rgba(255,255,255,0.25); /* better contrast on black */
  }

  button {
    background-color: rgba(255,255,255,0.35);
  }

  button:hover {
    background-color: rgba(255,255,255,0.55);
  }
}