/* ============================================================
   PQA Gallery Block
   ============================================================ */

/* ── Outer container ── */
.pqa-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--pqa-navy);
  border-radius: 4px;
  margin-bottom: 0.875rem;
  /* Pointer events only active when JS has initialised */
  user-select: none;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 4 / 3) {
  .pqa-gallery::before {
    content: '';
    display: block;
    padding-top: 75%; /* 3/4 = 0.75 */
  }
}

/* ── Stage ── */
.pqa-gallery-stage {
  position: absolute;
  inset: 0;
}

/* ── Individual slides ── */
.pqa-gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  /* transition set via JS so the speed field is respected */
  transition: opacity var(--pqa-gallery-speed, 800ms) ease-in-out;
}

.pqa-gallery-slide.is-active {
  opacity: 1;
}

.pqa-gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Arrows ── */
.pqa-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
  opacity: 0;
}

.pqa-gallery:hover .pqa-gallery-arrow,
.pqa-gallery:focus-within .pqa-gallery-arrow {
  opacity: 1;
}

.pqa-gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.62);
}

.pqa-gallery-arrow:focus-visible {
  outline: 2px solid var(--pqa-accent-blue);
  outline-offset: 2px;
  opacity: 1;
}

.pqa-gallery-arrow--prev { left: 0.75rem; }
.pqa-gallery-arrow--next { right: 0.75rem; }

/* ── Dot indicators ── */
.pqa-gallery-dots {
  position: absolute;
  bottom: 0.875rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  opacity: 0;
  transition: opacity 0.18s;
}

.pqa-gallery:hover .pqa-gallery-dots,
.pqa-gallery:focus-within .pqa-gallery-dots {
  opacity: 1;
}

.pqa-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.pqa-gallery-dot.is-active {
  background: #fff;
  transform: scale(1.3);
}

.pqa-gallery-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.pqa-gallery-dot:focus-visible {
  outline: 2px solid var(--pqa-accent-blue);
  outline-offset: 2px;
}

/* ── Empty-state preview (editor only) ── */
.pqa-gallery--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pqa-light-navy);
  color: var(--pqa-text-light);
  font-size: 0.875rem;
  font-style: italic;
  border: 1px dashed var(--pqa-border);
}
