/* Grid caption (in the cards) */
.edc-caption {
  font-size: 0.85rem;
  line-height: 1.3;
  color: #555;
  margin-top: 6px;
}

/* Pagination */
.edc-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 35px;
  flex-wrap: wrap;
}

.edc-page-btn {
  border: 1px solid #ddd;
  background: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.edc-page-btn[aria-current=page] {
  background: #111;
  color: #fff;
  border-color: #111;
}

.edc-items {
  position: relative;
}

.edc-items.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
}

.edc-figure .edc-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  height: auto;
}

@supports not (aspect-ratio: 1/1) {
  .edc-figure > .edc-link {
    position: relative;
    display: block;
  }
  .edc-figure > .edc-link::before {
    content: "";
    display: block;
    padding-top: 100%;
    /* 1:1 square */
  }
  .edc-figure > .edc-link .edc-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
.edc-items.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 3px solid #999;
  border-top-color: transparent;
  animation: edc-spin 0.7s linear infinite;
}

/* Overlay */
.edc-ajax-overlay[hidden] {
  display: none;
}

.edc-ajax-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  /* lightbox uses 9999 */
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: wait;
}

.edc-ajax-overlay__spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid #777;
  border-top-color: transparent;
  animation: edc-spin 0.8s linear infinite;
}

/* Lightbox overlay + animation */
.edc-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.edc-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.edc-lightbox__inner {
  margin: auto;
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.edc-lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
}

/* Image "pop-in" on open */
.edc-lightbox__img {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  transform: translateY(6px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
  will-change: transform, opacity;
}

.edc-lightbox.is-open .edc-lightbox__img {
  transform: none;
  opacity: 1;
}

/* Caption in overlay (JS toggles [hidden]) */
.edc-lightbox__caption[hidden] {
  display: none;
}

.edc-lightbox__caption {
  color: #ddd;
  margin-top: 10px;
  font-size: 0.95rem;
  text-align: center;
}

.edc-lightbox__counter {
  position: absolute;
  bottom: -28px;
  color: #aaa;
  font-size: 0.85rem;
}

/* Controls (above image) */
.edc-lightbox__close,
.edc-lightbox__nav {
  position: absolute;
  top: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 22px;
  line-height: 38px;
  text-align: center;
  backdrop-filter: blur(2px);
  z-index: 5;
}

.edc-lightbox__close {
  right: 8px;
}

.edc-lightbox__close {
  line-height: 1;
}

.edc-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.edc-lightbox__prev {
  left: -50px;
}

.edc-lightbox__next {
  right: -50px;
}

@media (max-width: 768px) {
  .edc-lightbox__prev {
    left: 8px;
  }
  .edc-lightbox__next {
    right: 8px;
  }
}
/* Spinner keyframes */
@keyframes edc-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .edc-lightbox,
.edc-lightbox__img {
    transition: none;
  }
}
