/* ============================================================
   Donato — Project-page lightbox theming (Prompt 65; slate
   variable collapsed to global --slate in Prompt 66 after
   Audit N calibrated the global --slate value to #8191A5).
   Overrides PhotoSwipe v5 defaults to read in Donato's
   vocabulary: var(--ink) backdrop, var(--paper) caption strip,
   IBM Plex Mono tracked-caps, var(--slate) on arrows + counter.
   Loaded only on project pages (alongside
   vendor/photoswipe/photoswipe.css).
   ============================================================ */

.pswp {
  --pswp-bg: var(--ink);
  --pswp-icon-color: var(--paper);
  --pswp-icon-color-secondary: transparent;
}

/* BACKDROP — var(--ink) at 96% */
.pswp__bg {
  background: rgba(0, 0, 0, 0.96);
}

/* TOP BAR — sheet-code corner annotations (counter + close) */
.pswp__top-bar {
  background: transparent;
  height: auto;
  padding: 18px 20px 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 24px;
}

/* Hide PhotoSwipe's default buttons we're not using */
.pswp__button--close,
.pswp__button--zoom,
.pswp__counter {
  display: none !important;
}

/* Custom counter — "3 / 13" tracked caps slate. PhotoSwipe v5
   auto-prefixes registered UI element names with "pswp__". */
.pswp__donato-counter {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  background: transparent;
  border: 0;
  padding: 4px 0;
  height: auto;
  width: auto;
}

/* Custom × CLOSE button */
.pswp__button--donato-close {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: transparent;
  border: 0;
  padding: 4px 0;
  height: auto;
  width: auto;
  cursor: pointer;
  transition: color 200ms ease;
}
.pswp__button--donato-close:hover,
.pswp__button--donato-close:focus-visible {
  color: var(--slate);
  outline: 0;
}

/* NAVIGATION ARROWS — restyled to sheet-code voice */
.pswp__button--arrow {
  width: auto;
  height: auto;
  padding: 12px 18px;
  background: transparent;
  border: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  cursor: pointer;
  transition: opacity 200ms ease;
}
.pswp__button--arrow:hover,
.pswp__button--arrow:focus-visible {
  outline: 0;
  background: transparent;
}
.pswp__button--arrow .pswp__icn,
.pswp__button--arrow svg {
  display: none;
}
.pswp__button--arrow .donato-arrow-label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  white-space: nowrap;
  transition: color 200ms ease;
}
.pswp__button--arrow:hover .donato-arrow-label,
.pswp__button--arrow:focus-visible .donato-arrow-label {
  color: var(--paper);
}
.pswp__button--arrow--prev { left: 24px; }
.pswp__button--arrow--next { right: 24px; }

/* CAPTION STRIP — bottom of viewport, paper background.
   Auto-prefixed by PhotoSwipe → .pswp__donato-caption. */
.pswp__donato-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--paper);
  color: var(--graphite);
  padding: 18px clamp(20px, 4vw, 64px);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 48px);
  align-items: baseline;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 1003;
  border-top: 1px solid var(--rule);
}
.pswp__donato-caption .donato-caption__label {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
}
.pswp__donato-caption .donato-caption__what {
  color: var(--graphite);
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 12px;
  line-height: 1.45;
  max-width: 56ch;
  font-weight: 400;
  flex: 1 1 auto;
}
.pswp__donato-caption .donato-caption__credit {
  color: var(--graphite);
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
}

/* MOBILE — stack caption strip to two rows */
@media (max-width: 600px) {
  .pswp__donato-caption {
    row-gap: 8px;
    column-gap: 20px;
    padding: 14px 20px;
  }
  .pswp__donato-caption .donato-caption__label {
    order: 1;
  }
  .pswp__donato-caption .donato-caption__credit {
    order: 2;
    color: var(--slate);
  }
  .pswp__donato-caption .donato-caption__what {
    order: 3;
    flex: 1 0 100%;
    font-size: 11px;
    text-align: left;
  }
  .pswp__button--arrow { padding: 10px 12px; }
  .pswp__button--arrow .donato-arrow-label { font-size: 11px; }
  .pswp__button--arrow--prev { left: 8px; }
  .pswp__button--arrow--next { right: 8px; }
  .pswp__top-bar { padding: 14px 16px 0; }
}

/* PREFERS-REDUCED-MOTION — PhotoSwipe handles open/close
   transition natively; suppress our extra fades too. */
@media (prefers-reduced-motion: reduce) {
  .pswp__button--donato-close,
  .pswp__button--arrow .donato-arrow-label {
    transition: none;
  }
}

/* CLICKABLE PLATE WRAPPERS — visual affordance that plates
   open the lightbox. Subtle, doesn't break the existing
   :hover scale animation on .plate__photo img. */
[data-lightbox][role="button"] {
  cursor: zoom-in;
}
[data-lightbox][role="button"]:focus-visible {
  /* slate-deep, not slate (Prompt 283): --slate is the
     decorative-only token and reads 2.30:1 against --paper, under
     the 3:1 WCAG 2.2 minimum for a focus indicator. slate-deep is
     the interactive-grade companion and matches the sitewide
     :focus-visible ring now in site.css. */
  outline: 2px solid var(--slate-deep);
  outline-offset: 4px;
}
