/* =====================================================================
   PHOTO GALLERY SECTION  —  gallery.css
===================================================================== */

/* ── Section shell (mirrors .merch-section) ── */
.gallery-section {
  padding: 3rem 1.5rem;
  background: var(--off-white);
  position: relative;
  border-top: 4px solid var(--red);
}

/* Red/white/red bottom stripe (mirrors merch top stripe) */
.gallery-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--red) 0%,
    var(--white) 50%,
    var(--red) 100%
  );
}

/* ── Slider wrapper ── */
.gallery-slider-wrap {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

/* ── Arrows ── */
.gallery-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--blue-mid);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
  z-index: 2;
}

.gallery-arrow:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.08);
}

.gallery-arrow:active {
  transform: scale(0.96);
}

.gallery-arrow--prev {
  margin-right: 1rem;
}
.gallery-arrow--next {
  margin-left: 1rem;
}

/* ── Track outer (clips overflow) ── */
.gallery-track-outer {
  flex: 1;
  overflow: hidden;
}

/* ── Track inner (slides sit side-by-side) ── */
.gallery-track {
  display: flex;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* ── Individual slide ── */
.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Image wrapper (matches .merch-img-wrap style) ── */
.gallery-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: var(--smoke);
  border: 2px solid var(--border-dark);
  box-shadow:
    6px 6px 0 var(--red),
    12px 12px 0 rgba(0, 40, 104, 0.12);
  border-radius: var(--radius);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-img-wrap:hover .gallery-img {
  transform: scale(1.03);
}

/* Placeholder (reuses site pattern) */
.gallery-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--smoke);
  border: 2px dashed var(--border-dark);
  text-align: center;
  padding: 1.5rem;
}

/* ── Caption (mirrors .poster-caption) ── */
.gallery-caption {
  margin-top: 0;
  width: 100%;
  background: var(--blue);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 10px 14px;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.5;
  border: 2px solid var(--border-dark);
  border-top: none;
  box-shadow:
    6px 6px 0 var(--red),
    12px 12px 0 rgba(0, 40, 104, 0.12);
  margin-bottom: 16px;
}

/* ── Expand button on image ── */
.gallery-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--blue-mid);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity var(--transition),
    transform var(--transition),
    background var(--transition);
  z-index: 3;
}

.gallery-img-wrap:hover .gallery-expand-btn {
  opacity: 1;
  transform: scale(1);
}

.gallery-expand-btn:hover {
  background: var(--red);
  border-color: var(--red);
}

/* ── Photo modal ── */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-modal.is-open {
  pointer-events: all;
  opacity: 1;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.gallery-modal-inner {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal.is-open .gallery-modal-inner {
  transform: scale(1);
}

.gallery-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--blue-mid);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
  z-index: 2;
}

.gallery-modal-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.1);
}

.gallery-modal-img-wrap {
  border: 3px solid var(--border-dark);
  box-shadow:
    8px 8px 0 var(--red),
    16px 16px 0 rgba(0, 40, 104, 0.18);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--smoke);
  max-height: calc(92vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 80px);
  object-fit: contain;
}

.gallery-modal-caption {
  margin-top: 0;
  width: 100%;
  background: var(--blue);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 10px 14px;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.5;
  border: 2px solid var(--border-dark);
  border-top: none;
  box-shadow:
    8px 8px 0 var(--red),
    16px 16px 0 rgba(0, 40, 104, 0.18);
}

/* =====================================================================
   RESPONSIVE
===================================================================== */

@media (max-width: 768px) {
  .gallery-arrow {
    width: 36px;
    height: 36px;
  }

  .gallery-arrow--prev {
    margin-right: 0.6rem;
  }
  .gallery-arrow--next {
    margin-left: 0.6rem;
  }

  .gallery-caption {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  .gallery-img-wrap,
  .gallery-caption {
    box-shadow:
      4px 4px 0 var(--red),
      8px 8px 0 rgba(0, 40, 104, 0.12);
  }
}

@media (max-width: 520px) {
  .gallery-section {
    padding: 4rem 1rem;
  }

  .gallery-arrow {
    width: 32px;
    height: 32px;
  }

  .gallery-arrow svg {
    width: 16px;
    height: 16px;
  }

  .gallery-arrow--prev {
    margin-right: 0.4rem;
  }
  .gallery-arrow--next {
    margin-left: 0.4rem;
  }

  .gallery-img-wrap,
  .gallery-caption {
    box-shadow: 3px 3px 0 var(--red);
  }
}
