#album>* {
  box-sizing: border-box;

}

.flickity-viewport {
  overflow: hidden !important;
}

.carousel {
  width: 100%;
  height: 100%;
  /* let it fill parent */
  background: #fff;
}

.carousel-cell {
  width: 100%;
  height: 300px;
  margin-right: 10px;
  background: #fff;
  border-radius: 5px;
  counter-increment: gallery-cell;
}

.carousel-cell>a {
  pointer-events: auto;
}

.carousel-cell img {
  height: 300px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* crop + fill */
  display: block;
}

.carousel-wrap {
  position: relative;
  width: 100% !important;
}

/* Keep layout consistent */
.carousel {
  width: 100%;
  min-height: 300px;
  background: #fff;
  aspect-ratio: 1 / 1 !important; 
}

/* Hide cells during load to avoid the “one-by-one” flash */
.carousel .carousel-cell {
  visibility: hidden;
}

.carousel-wrap.is-ready .carousel .carousel-cell {
  visibility: visible;
}

/* While loading: hide Flickity viewport; show spinner */
.carousel-wrap.is-loading .carousel {
  visibility: hidden;
  opacity: 0;
}

.carousel-wrap.is-ready .carousel {
  visibility: visible;
  opacity: 1;
  transition: opacity .2s ease;
}

/* Spinner overlay */
.spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  /* solid white, matches your theme */
  z-index: 5;
}

.carousel-wrap.is-ready .spinner {
  display: none;
}

/* spinner graphic */
.spinner::after {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #e0e0e0;
  border-top-color: #555;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Keep from earlier */
.flickity-viewport {
  overflow: hidden !important;
}

.flickity-page-dots {
  position: static;
  margin-top: 10px;
  text-align: center;
}

.carousel-cell {
  width: 100%;
  height: 100%;
}

.carousel-cell a,
.carousel-cell img {
  display: block;
  width: 100%;
  height: 100%;
}

.carousel-cell img {
  object-fit: cover;
}




/* position dots in gallery */
.flickity-page-dots {
  position: static;
  /* remove absolute positioning */
  margin-top: 1rem;
  /* add spacing from carousel */
  text-align: center;
  /* center them horizontally */
}

/* white circles */
.flickity-page-dots .dot {
  width: 12px;
  height: 12px;
  opacity: 1;
  background: transparent;
  border: 2px solid gray;
}

/* fill-in selected dot */
.flickity-page-dots .dot.is-selected {
  background: gray;
}

.pswp__bg {
  background: #fff !important;
  opacity: 1 !important;
  /* make sure it's fully opaque */
}

/* Remove captions (if any) */
.pswp__caption,
.pswp__custom-caption {
  display: none !important;
}

/* Style controls (close, arrows, zoom, etc.) */
.pswp__button {
  color: #444 !important;
  /* dark gray */
  fill: #444 !important;
  /* for svg icons */
  opacity: 1 !important;
  /* keep them visible */
}

/* Optional: hover effect for clarity */
.pswp__button:hover {
  color: #000 !important;
  fill: #000 !important;
}

/* Position dots below the image area */
.pswp-dots {
  position: absolute;
  bottom: 16px;
  /* distance from bottom edge */
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  /* dots purely for display (not clickable) */
}

/* Style */
.pswp-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
}

.pswp-dots span.active {
  background: #444;
  /* active color */
}


.pswp__counter {
  display: none !important;
}