/* ============================================================
   The Balochistan Post — lightbox (lightbox.js)
   A full-screen image viewer shared by the Lens photo-essay and
   by any gallery in any post. It used to live in lens.css under
   .lens-* names; it moved out and was renamed when galleries
   started using it, because an asset whose name says "lens" while
   it serves ordinary articles is the drift this repo keeps fixing.
   Logical properties throughout, so it reads correctly in RTL
   (Urdu, Brahui, Balochi) and LTR editions alike.
   ============================================================ */
.tbp-lb { position: fixed; inset: 0; z-index: 900; background: rgba(6,6,6,.94); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.tbp-lb.open { opacity: 1; pointer-events: all; }

.tbp-lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 92vw; }
.tbp-lb img { max-width: 92vw; max-height: 80vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* The caption is the photo credit — it carries the reporting, so it is part of
   the view rather than something the reader has to close the image to read. */
.tbp-lb-cap { font-family: var(--font-urdu); font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.82); text-align: center; max-width: 68ch; padding-inline: 16px; }
.tbp-lb-cap[hidden] { display: none; }

.tbp-lb-close, .tbp-lb-nav { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.tbp-lb-close:hover, .tbp-lb-nav:hover { background: var(--red); }
.tbp-lb-close:focus-visible, .tbp-lb-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tbp-lb-close { inset-block-start: 22px; inset-inline-end: 22px; }
.tbp-lb-nav { inset-block-start: 50%; transform: translateY(-50%); }
.tbp-lb-prev { inset-inline-start: 20px; }
.tbp-lb-next { inset-inline-end: 20px; }
/* "1 / 3" is two numerals and a slash: in an RTL page the run reordered to
   "3 / 1". The element sets its own direction. */
.tbp-lb-count { position: absolute; inset-block-end: 22px; inset-inline: 0; direction: ltr; text-align: center; color: rgba(255,255,255,.75); font-family: var(--font-mono); font-size: 13px; }

/* On a phone the side buttons would sit on top of the photo; move them down
   beside the counter, where a thumb reaches them anyway. */
@media (max-width: 600px) {
  .tbp-lb img { max-height: 68vh; }
  .tbp-lb-nav { inset-block-start: auto; inset-block-end: 16px; transform: none; width: 42px; height: 42px; }
  .tbp-lb-prev { inset-inline-start: 24px; }
  .tbp-lb-next { inset-inline-end: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .tbp-lb { transition: none; }
}
