/*
 * Participation Apps -- the guides' photo lightbox (assets/guide-lightbox.js).
 * Bump PPA_GUIDE_PAGE_VER (inc/ppa-guide-pages.php) when this file changes.
 *
 * Appended to <body>, outside any guide wrapper, so every rule is under the
 * viewer's own .ppa-glb root. The theme paints bare <button>s and underlines
 * link hovers; the buttons here state their own colours and decoration.
 */

.ppa-glb {
  position: fixed;
  inset: 0;
  z-index: 100000;                 /* above Groovy Menu's sticky header */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px 24px;
  background: rgba(15, 8, 24, .92);
  opacity: 0;
  transition: opacity .18s ease;
  -webkit-tap-highlight-color: transparent;
}
/* The theme and plugins set display on all sorts of things; hidden means hidden. */
.ppa-glb[hidden] { display: none !important; }
.ppa-glb.is-open { opacity: 1; }

.ppa-glb-fig {
  margin: 0;
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ppa-glb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  transform: scale(.985);
  transition: transform .18s ease, opacity .18s ease;
}
.ppa-glb.is-open .ppa-glb-img { transform: scale(1); }
.ppa-glb.is-loading .ppa-glb-img { opacity: .35; }
.ppa-glb.is-broken .ppa-glb-img { min-width: 240px; min-height: 160px; }

.ppa-glb-cap {
  margin: 0;
  max-width: 60ch;
  color: #e2e8f0;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}
.ppa-glb-text { font-weight: 700; color: #fff; }
.ppa-glb-count { margin-left: 6px; color: #cbd5e1; font-size: 13px; font-weight: 500; white-space: nowrap; }
.ppa-glb-count:empty { display: none; }

.ppa-glb .ppa-glb-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .3) !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12) !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s ease;
}
.ppa-glb .ppa-glb-btn:hover { background: rgba(255, 255, 255, .24) !important; }
.ppa-glb .ppa-glb-btn:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.ppa-glb .ppa-glb-btn[hidden] { display: none !important; }
.ppa-glb .ppa-glb-btn svg { display: block; pointer-events: none; }

.ppa-glb-x { top: 14px; right: 16px; width: 46px; height: 46px; }
.ppa-glb-nav { top: 50%; width: 52px; height: 52px; transform: translateY(-50%); }
.ppa-glb-prev { left: 14px; }
.ppa-glb-next { right: 14px; }

/* Phones: the arrows move under the picture so they never cover it, and the
   picture gets the width. Swiping works too. */
@media (max-width: 640px) {
  .ppa-glb { padding: 64px 12px 92px; }
  .ppa-glb-img { max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); }
  .ppa-glb-nav { top: auto; bottom: 22px; transform: none; }
  .ppa-glb-prev { left: calc(50% - 64px); }
  .ppa-glb-next { right: calc(50% - 64px); }
}

@media (prefers-reduced-motion: reduce) {
  .ppa-glb, .ppa-glb-img, .ppa-glb .ppa-glb-btn { transition: none; }
  .ppa-glb-img, .ppa-glb.is-open .ppa-glb-img { transform: none; }
}
