/* Before/After slider - robust for HTML5UP Story */
.ba-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Make sure the slider box has height: use aspect-ratio as a fallback */
.ba-slider {
  aspect-ratio: 16 / 9;          /* change if your images are different */
}

/* Let images fill the box consistently */
.ba-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;              /* cover looks best in spotlights */
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.ba-after { z-index: 1; }

.ba-resize {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  z-index: 2;
}

.ba-before { z-index: 2; }

.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
  z-index: 4;
}

.ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 2px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
  pointer-events: none;
  z-index: 3;
}

.ba-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* Make before/after slider fill Story spotlight image column */
.spotlight .image {
  display: flex;
}

.spotlight .image .ba-slider {
  flex: 1;
  height: 100%;
  aspect-ratio: auto;   /* override previous fallback */
}

/* Make spotlight image (before/after) wider */
.spotlight .image {
  flex: 0 0 50%;   /* image gets 60% */
}

.spotlight .content {
  flex: 0 0 50%;  /* text gets 40% */
}
/* Make slider fill Story's spotlight image column */
.spotlight .image { display: flex; }
.spotlight .image .wipe { flex: 1; height: 100%; }

/* The comparison container */
.wipe {
  position: relative;
  width: 100%;
  overflow: hidden;
  --pos: 50%;
  background: #000;            /* shows behind if using object-fit: contain */
}

/* Stack both images in the exact same box */
.wipe-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;         /* use 'cover' if you want no letterboxing */
  display: block;
}

/* Show ONLY the left part of the BEFORE image */
.wipe-before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

/* Invisible range input over the whole area */
.wipe-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
  z-index: 5;
}

/* Divider line + knob */
.wipe-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: rgba(255,255,255,0.95);
  transform: translateX(-1px);
  z-index: 4;
  pointer-events: none;
}

.wipe-knob {
  position: absolute;
  top: 50%;
  left: var(--pos);
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.95);
  z-index: 4;
  pointer-events: none;
}
/* --- GALLERY THUMBNAILS: same tile height, no cropping --- */
.gallery.fit article .image {
  /* fixed tile size like the template, but we control how the img fits */
  position: relative;
  overflow: hidden;

  /* pick an aspect ratio you like for the tiles */
  aspect-ratio: 4 / 3;

  /* center the image in the tile */
  display: flex;
  align-items: center;
  justify-content: center;

  /* optional letterbox color */
  background: rgba(0,0,0,0.08);
}

/* override Story’s absolute-position "cover" behavior */
.gallery.fit article .image img {
  position: relative !important;
  top: auto !important;
  left: auto !important;

  width: 100% !important;
  height: 100% !important;

  object-fit: contain !important;     /* <-- key: no crop */
  object-position: center !important;
}

/* --- LIGHTBOX: center image vertically + horizontally --- */
.gallery.fit.lightbox .modal .inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.gallery.fit.lightbox .modal .inner img {
  /* keep template’s size limits, but ensure it centers nicely */
  max-width: 90vw;
  max-height: 85vh;
}
/* --- Wipe slider labels --- */
.wipe-label {
  position: absolute;
  bottom: 0.75rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 0.25rem;

  z-index: 6;
  pointer-events: none; /* so slider still drags */
}

.wipe-label-left {
  left: 0.75rem;
}

.wipe-label-right {
  right: 0.75rem;
}
/* Banner image: show full image instead of cropping */
.banner .image.fit-contain {
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner .image.fit-contain img {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* <-- key: no crop */
  object-position: center;
  background: #000;         /* optional letterbox color */
}
/* Make banner image wider than text */
.banner .image {
  flex: 0 0 65%;   /* image = 65% */
}

.banner .content {
  flex: 0 0 35%;  /* text = 35% */
}