/* PhotoSwipe — V500 (custom arrows + intact default icons) */
.pswp {
  --pswp-bg: #07111d;
  --pswp-placeholder-bg: #12202e;
  /* Keep PhotoSwipe defaults for zoom / close glyphs (secondary = “hole” / +) */
  --pswp-icon-color: #fff;
  --pswp-icon-color-secondary: #4f4f4f;
  --pswp-icon-stroke-color: #4f4f4f;
  --pswp-icon-stroke-width: 2px;
  --pswp-root-z-index: 100000;
}

/* Isolate from theme button rules */
.pswp button,
.pswp a.pswp__button {
  font: inherit;
  line-height: normal;
  color: inherit;
  background: none;
  border: 0;
  box-shadow: none;
  appearance: none;
}

.pswp svg {
  display: block;
  max-width: none;
  overflow: visible;
}

.pswp__icn-shadow {
  fill: none !important;
  stroke: var(--pswp-icon-stroke-color);
  stroke-width: var(--pswp-icon-stroke-width);
}

/* Hide bulky default arrows — replaced by .pswp__button--v500-arrow */
.pswp__button--arrow {
  display: none !important;
}

.pswp__button--v500-arrow {
  position: absolute;
  top: 50%;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(7, 17, 29, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 20px -10px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #fff !important;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pswp__button--v500-arrow:hover {
  background: var(--amber-400, #ffa922);
  border-color: var(--amber-400, #ffa922);
  color: #1a1205 !important;
  box-shadow: 0 8px 22px -10px rgba(255, 169, 34, 0.55);
}

.pswp__button--v500-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.pswp__button--v500-arrow svg {
  width: 18px;
  height: 18px;
  fill: none !important;
  stroke: #fff !important;
  color: #fff !important;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.35));
}

.pswp__button--v500-arrow svg path {
  fill: none !important;
  stroke: #fff !important;
}

.pswp__button--v500-arrow:hover svg,
.pswp__button--v500-arrow:hover svg path {
  stroke: #1a1205 !important;
  color: #1a1205 !important;
  filter: none;
}

/* Theme dark: keep arrows readable on near-black overlay */
:root[data-theme="dark"] .pswp__button--v500-arrow {
  background: rgba(0, 0, 0, 0.45);
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 8px 20px -10px rgba(0, 0, 0, 0.7);
}

:root[data-theme="dark"] .pswp__button--v500-arrow:hover {
  background: var(--amber-400, #ffa922);
  border-color: #fff;
}

.pswp__button--v500-prev {
  left: 16px;
}

.pswp__button--v500-next {
  right: 16px;
}

.pswp--one-slide .pswp__button--v500-arrow {
  display: none;
}

.pswp__counter {
  font-family: var(--f-mono, "Space Grotesk", sans-serif);
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.pswp__thumbnails {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  display: flex;
  gap: 8px;
  max-width: min(92vw, 720px);
  padding: 8px;
  overflow-x: auto;
  transform: translateX(-50%);
  border-radius: 14px;
  background: rgba(7, 17, 29, 0.45);
  backdrop-filter: blur(10px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pswp__thumbnails::-webkit-scrollbar {
  display: none;
}

.pswp__thumbnails[hidden] {
  display: none !important;
}

.pswp__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 44px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1220;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pswp__thumb.is-active {
  opacity: 1;
  border-color: var(--amber-400, #ffa922);
  transform: translateY(-1px);
}

.pswp__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Custom toolbar SVGs — stroke icons, not PhotoSwipe sprite offsets */
.pswp__button--download-button .pswp__icn,
.pswp__button--share-button .pswp__icn,
.pswp__button--fullscreen-button .pswp__icn,
.pswp__button--play-button .pswp__icn {
  position: absolute;
  top: 14px;
  left: 9px;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #fff;
  color: #fff;
}

.pswp__button--play-button .pswp__icn {
  fill: #fff;
  stroke: none;
}

@media (max-width: 700px) {
  .pswp__button--v500-arrow {
    width: 40px;
    height: 40px;
  }

  .pswp__button--v500-prev {
    left: 10px;
  }

  .pswp__button--v500-next {
    right: 10px;
  }

  .pswp__thumb {
    width: 52px;
    height: 36px;
  }
}
