/* ── Carousel wrapper ── */
.carousel {
  position: relative;
  max-width: 860px;
  margin: 2rem auto;
}

/* Hidden but functional radio inputs */
.carousel input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* ── Viewport: clips the scrolling track ── */
.carousel-viewport {
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ── Track: two slides laid out side by side ── */
.carousel-track {
  display: flex;
  width: 200%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#cs1:checked ~ .carousel-viewport .carousel-track { transform: translateX(0%);   }
#cs2:checked ~ .carousel-viewport .carousel-track { transform: translateX(-50%); }

/* ── Slides ── */
.carousel-slide {
  position: relative;
  width: 50%;          /* 50 % of 200 % track = 100 % of viewport */
  height: 420px;
  background-size: cover;
  background-position: center;
}

/*
 * url() is the primary layer; the gradient is the fallback layer shown
 * whenever the image file is absent or fails to load.
 * Replace slide1.jpg / slide2.jpg with your own images.
 */
.slide-1 {
  background-image:
    url('slide1.jpg'),
    linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
}

.slide-2 {
  background-image:
    url('slide2.jpg'),
    linear-gradient(135deg, #3a1a5c 0%, #7b2d9f 100%);
}

/* ── Text overlay ── */
.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 2rem 1.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
  color: #fff;
}

.carousel-caption h2 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  border: none;       /* override any page-level h2 border */
  padding: 0;
}

.carousel-caption p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ── Navigation arrows ── */
/*
 * Four labels are emitted: two "for-cs2" (shown when slide 1 is active)
 * and two "for-cs1" (shown when slide 2 is active).  CSS toggles which
 * pair is visible so clicking either arrow always goes to the other slide.
 */
.carousel-arrow {
  position: absolute;
  top: 210px;               /* vertically centred in the 420 px slide */
  transform: translateY(-50%);
  z-index: 10;
  display: none;            /* shown below via :checked rules */
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 1.2rem;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  line-height: 1;
  text-decoration: none;
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.35);
}

.carousel-left  { left: 1rem; }
.carousel-right { right: 1rem; }

#cs1:checked ~ .for-cs2 { display: flex; }
#cs1:checked ~ .for-cs1 { display: none;  }
#cs2:checked ~ .for-cs1 { display: flex; }
#cs2:checked ~ .for-cs2 { display: none;  }

/* ── Navigation dots ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0;
}

.carousel-dots label {
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dots label:hover {
  background: #999;
}

#cs1:checked ~ .carousel-dots label[for="cs1"],
#cs2:checked ~ .carousel-dots label[for="cs2"] {
  background: #0d6efd;
  transform: scale(1.3);
}
