/* ============================================================
   Gallery lightbox — Meskavan
   ------------------------------------------------------------
   Full-size view of a gallery photo, with the rest of that
   gallery a click away. Brand colours, and dark enough behind
   the picture that nothing on the page competes with it.
   ============================================================ */

.msk-zoomable {
  cursor: zoom-in;
}

/* The page must not scroll behind the open picture. */
body.msk-lightbox-open {
  overflow: hidden;
}

.msk-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 28px);
  padding: clamp(16px, 4vw, 48px);

  background: rgba(4, 20, 20, 0.97);
  backdrop-filter: blur(6px);
  animation: msk-lightbox-in 0.18s ease-out;
}

.msk-lightbox[hidden] {
  display: none;
}

@keyframes msk-lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .msk-lightbox { animation: none; }
}

/* ── the picture ──────────────────────────────────────────── */

.msk-lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  min-width: 0;
}

.msk-lightbox__image {
  display: block;
  max-width: min(100%, 1400px);
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  background: #0B383C;
}

.msk-lightbox__caption {
  margin: 0;
  max-width: 70ch;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.82);
}

.msk-lightbox__caption[hidden] {
  display: none;
}

.msk-lightbox__counter {
  position: absolute;
  inset-block-end: clamp(14px, 3vw, 26px);
  inset-inline: 0;
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  /* "1 / 5" is a count, not a sentence — it should not flip with the page. */
  direction: ltr;
}

/* ── buttons ──────────────────────────────────────────────── */

.msk-lightbox__nav,
.msk-lightbox__close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(186, 109, 81, 0.92);   /* brand copper */
  color: #FFFFFF;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.msk-lightbox__nav:hover,
.msk-lightbox__close:hover {
  background: #BA6D51;
  transform: scale(1.06);
}

.msk-lightbox__nav:focus-visible,
.msk-lightbox__close:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
}

.msk-lightbox__nav[hidden] {
  display: none;
}

/* The buttons swap sides with the writing direction, so the chevrons have to
   turn round with them: on this site the next photo lies to the left. */
[dir="rtl"] .msk-lightbox__nav svg {
  transform: scaleX(-1);
}

.msk-lightbox__nav svg,
.msk-lightbox__close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msk-lightbox__close {
  position: absolute;
  inset-block-start: clamp(14px, 3vw, 26px);
  inset-inline-end: clamp(14px, 3vw, 26px);
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.14);
}

.msk-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ── small screens: arrows sit under the picture ──────────── */

@media (max-width: 767px) {
  .msk-lightbox {
    flex-wrap: wrap;
    padding-block-end: 84px;
  }

  .msk-lightbox__figure {
    order: -1;
    flex-basis: 100%;
  }

  .msk-lightbox__image {
    max-height: calc(100vh - 210px);
  }

  .msk-lightbox__nav {
    width: 46px;
    height: 46px;
  }
}
