/* ==========================================================================
   Carousel — native CSS scroll-snap, no JS dependency for the scrolling
   itself. JS only adds the controls, so with JS disabled each gallery
   degrades to a swipeable / scrollable strip of photos.
   ========================================================================== */

.crsl {
  position: relative;
  overflow: hidden;
}

.crsl__track {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.crsl__track::-webkit-scrollbar {
  display: none;
}

.crsl__track:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.crsl__track > img {
  -webkit-flex: 0 0 100%;
  -ms-flex: 0 0 100%;
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  -o-object-fit: cover;
  object-fit: cover;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Card galleries keep the rounded / shadowed treatment the images had. */
.crsl--card {
  margin-bottom: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px 0 rgba(87, 35, 0, 0.2);
}

/* --- Scrim: keeps white controls legible over pale photos --------------- */
.crsl__scrim {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 86px;
  background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0));
  background-image: linear-gradient(to top, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: 1;
}

/* --- Arrows ------------------------------------------------------------- */
.crsl__btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  color: #1a1a1a;
  background-color: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 0;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  -webkit-transition: opacity 0.25s ease, background-color 0.2s ease;
  transition: opacity 0.25s ease, background-color 0.2s ease;
}

.crsl__btn--prev { left: 12px; }
.crsl__btn--next { right: 12px; }

.crsl:hover .crsl__btn,
.crsl:focus-within .crsl__btn { opacity: 1; }

.crsl__btn:hover { background-color: #fff; }

.crsl__btn:focus-visible {
  opacity: 1;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.crsl__btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

/* --- Dots --------------------------------------------------------------- */
.crsl__dots {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  z-index: 2;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 7px;
}

.crsl__dot {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-transition: width 0.25s ease, background-color 0.25s ease;
  transition: width 0.25s ease, background-color 0.25s ease;
}

/* Expand the touch target well past the visual dot. */
.crsl__dot::after {
  content: "";
  position: absolute;
  top: -9px;
  right: -5px;
  bottom: -9px;
  left: -5px;
}

.crsl__dot[aria-current="true"] {
  width: 22px;
  background-color: #fff;
}

.crsl__dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* --- Counter (used instead of dots on long galleries) ------------------- */
.crsl__count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 99px;
  font-family: Yantramanav, sans-serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* --- Touch / mobile ----------------------------------------------------- */
/* On touch devices the swipe *is* the control, so the arrows only add
   clutter and steal thumb space over the photo. */
@media (hover: none) {
  .crsl__btn { display: none; }
}

@media screen and (max-width: 767px) {
  .crsl__btn { display: none; }

  .crsl__track > img { max-height: 280px; }

  .crsl__dot { width: 8px; height: 8px; }
  .crsl__dot[aria-current="true"] { width: 24px; }

  .crsl__dots { bottom: 10px; }
  .crsl__count { right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .crsl__track { scroll-behavior: auto; }
  .crsl__btn,
  .crsl__dot { -webkit-transition: none; transition: none; }
}
