/* Screenshots page: thumbnail grid (ported from legacy's "Screenshots page (modernized thumbnail gallery)" block)
   and the lightbox, a native <dialog> driven by gallery_lightbox_controller.js in place of legacy's Colorbox. */
.ssGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 6px;
}

.ssCard {
  display: block;
  background: #fff;
  border: 1px solid var(--ptfg-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.06);
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ssCard:hover,
.ssCard:focus {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(20, 20, 40, 0.14);
}

.ssCard-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f4f5f9;
}

.ssCard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.ssCard-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 26, 103, 0.6);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  text-align: center;
  padding: 10px;
}

.ssCard:hover .ssCard-overlay,
.ssCard:focus .ssCard-overlay {
  opacity: 1;
}

.ssCard-label {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: bold;
  color: var(--ptfg-heading);
}

/* ---- Lightbox ---- */
.ssLightbox {
  border: none;
  border-radius: 14px;
  padding: 0;
  background: #fff;
  overflow: hidden;
  max-width: min(94vw, 1100px);
  max-height: 92vh;
  box-shadow: 0 12px 40px rgba(11, 26, 103, 0.35);
}
.ssLightbox::backdrop {
  background: rgba(11, 26, 103, 0.75);
}

.ssLightbox-img {
  display: block;
  max-width: min(94vw, 1100px);
  /* Leave room under the image for the caption bar. */
  max-height: calc(92vh - 44px);
  object-fit: contain;
}

.ssLightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  color: var(--ptfg-heading);
  border-top: 1px solid var(--ptfg-border);
}

.ssLightbox-counter {
  font-weight: normal;
  color: var(--ptfg-muted);
}

.ssLightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  /* A light disc so the X stays visible over any screenshot, light or dark. */
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.ssLightbox-nav {
  position: absolute;
  top: calc(50% - 22px);
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.ssLightbox-nav--prev { left: 10px; }
.ssLightbox-nav--next { right: 10px; }
