/* Gallery lightbox + the photo grid.
 *
 * The album cards and the decade tabs are still shaped by the live site's own
 * stylesheets, vendored alongside this file:
 *   album.css      nextgen_basic_album.min.css  (NextGEN defaults)
 *   grid.css       ngg_styles/nggallery.css     (the RLT theme's overrides)
 *   tabby.css      tabby-responsive-tabs        (tab base styles)
 *   breadcrumbs.css
 * front.css (the legacy theme) already styles `.responsive-tabs__*`.
 *
 * The PHOTO GRID is ours (see below) — the vendored rules size its boxes but never
 * place them. The live site's lightbox is fancybox 1.3.4 driven by several jQuery
 * plugins; this is a small dependency-free replacement styled to match the palette.
 */

/* ---------- the photo grid ----------
 *
 * THE PORTED BOXES STACK, and this is why: grid.css sets
 * `.ngg-gallery-thumbnail-box { width: 25% }` but nothing gives the box a `float`
 * (or inline-block), so each one is a 25%-wide BLOCK on its own line — a single
 * column of narrow photos down the left of a 1200px page. On the live site the
 * float came from NextGEN's own base stylesheet, which this port never vendored.
 * Rather than add a float to a vendored file (which would stop it being diffable
 * against the theme), the grid is laid out here, in the file that is already ours.
 *
 * `auto-fill` + `minmax` is what makes it fill whatever width it is given: the
 * column COUNT follows the viewport, and the tracks share the remaining space
 * (`1fr`), so a 1200px page shows six photos across and a phone shows two — no
 * breakpoint list to maintain. The tiles are square because the archive's thumbs
 * are square (NextGEN cropped them 300x300), so `object-fit: cover` is exact and
 * no photograph is cropped again by the layout.
 *
 * `.ngg-galleryoverview` is only ever the PHOTO grid: the album CARDS on the
 * listing use `.ngg-albumoverview`, so none of this touches them.
 */
.ngg-galleryoverview {
  width: auto;
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  align-items: start;
}

.ngg-gallery-thumbnail-box {
  width: auto;
  margin: 0;
  padding: 0;
}

.ngg-gallery-thumbnail { position: relative; margin: 0; padding: 0; }

.ngg-gallery-thumbnail a { display: block; }

.ngg-gallery-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #111;
  border: 0;
  border-radius: 3px;
  transition: transform .2s ease-out, opacity .2s ease-out;
}
.ngg-gallery-thumbnail a:hover img,
.ngg-gallery-thumbnail a:focus-visible img { opacity: .82; transform: translateY(-2px); }

@media all and (max-width: 700px) {
  .ngg-galleryoverview {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* ---------- photo lightbox ---------- */
body.rlt-lb-open { overflow: hidden; }

.rlt-lb {
  position: fixed; inset: 0; z-index: 2147483000;
  display: none; align-items: center; justify-content: center;
  background: rgba(6, 3, 12, .93);
  padding: 24px;
}
.rlt-lb.is-open { display: flex; }

.rlt-lb-frame {
  position: relative;
  background: #fff;
  padding: 12px;
  max-width: min(1200px, 94vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .6);
}

.rlt-lb-stage { display: flex; align-items: center; justify-content: center; min-height: 120px; }

.rlt-lb-img {
  display: block;
  max-width: min(1180px, 88vw);
  max-height: 74vh;
  width: auto; height: auto;
  opacity: 0; transition: opacity .18s ease-in;
}
.rlt-lb-img.is-ready { opacity: 1; }

.rlt-lb-cap {
  margin: 12px 4px 0;
  font-size: 15px; font-weight: 300; line-height: 1.4;
  color: #14100f; text-align: center;
}
.rlt-lb-count {
  margin: 4px 4px 0;
  font-family: 'Anton', sans-serif;
  font-size: 13px; letter-spacing: .04em;
  color: #320f74; text-align: center;
}

.rlt-lb-close,
.rlt-lb-nav {
  position: absolute; z-index: 2;
  border: 0; background: transparent; cursor: pointer;
  color: #fdcb01; line-height: 1; padding: 4px;
}
.rlt-lb-close { top: -40px; right: -6px; font-size: 38px; }
.rlt-lb-close:hover, .rlt-lb-nav:hover { color: #fff; }
.rlt-lb-nav { top: 50%; transform: translateY(-50%); font-size: 64px; }
.rlt-lb-prev { left: -54px; }
.rlt-lb-next { right: -54px; }

@media all and (max-width: 900px) {
  .rlt-lb { padding: 12px; }
  .rlt-lb-frame { padding: 8px; max-width: 98vw; max-height: 94vh; }
  .rlt-lb-img { max-width: 94vw; max-height: 68vh; }
  .rlt-lb-close { top: -34px; right: 0; font-size: 32px; }
  .rlt-lb-nav { font-size: 44px; }
  .rlt-lb-prev { left: -8px; }
  .rlt-lb-next { right: -8px; }
}

@media all and (max-width: 600px) {
  .rlt-lb-prev, .rlt-lb-next { display: none; }
  .rlt-lb-img { max-height: 62vh; }
}
