/* lightbox.css : the image dialog of lightbox.js (loads only on pages with data-pil-lightbox links).
   Logical properties only: the previous button sits on the reading-start side, the next on the end side. */
html.pil-lb-open { overflow: hidden; }

.pil-lb {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 72px 72px 64px;
  background: rgba(18, 16, 13, .97);
  color: #fff;
  opacity: 0;
}
.pil-lb[hidden] { display: none; }
.pil-lb.is-open { opacity: 1; }

.pil-lb__figure {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3, 12px);
}
.pil-lb__img {
  display: block; max-width: 100%; max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px);
  width: auto; height: auto; object-fit: contain; background: #fff;
}
.pil-lb.is-loading .pil-lb__img { opacity: .35; }
.pil-lb__caption {
  max-width: 62ch; text-align: center; font-size: var(--t-small, .9375rem); line-height: 1.5; color: #f1eee6;
}
.pil-lb__count {
  position: absolute; inset-block-end: 16px; inset-inline-start: 0; inset-inline-end: 0;
  text-align: center; font-size: var(--t-small, .9375rem); color: #d9d5ca;
}

.pil-lb__btn {
  position: absolute; z-index: 1;
  display: grid; place-items: center;
  width: 48px; height: 48px; min-width: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: #f3f1ec; color: #333; cursor: pointer; box-shadow: 0 0 0 2px rgba(18, 16, 13, .6), 0 4px 14px rgba(0, 0, 0, .45);
}
.pil-lb__btn:hover:not(:disabled) { background: #fff; }
.pil-lb__btn:disabled { opacity: .35; cursor: default; }
.pil-lb__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #104848; }
.pil-lb__close { inset-block-start: 16px; inset-inline-end: 16px; }
.pil-lb__prev, .pil-lb__next { inset-block-start: 50%; margin-block-start: -24px; }
.pil-lb__prev { inset-inline-start: 12px; }
.pil-lb__next { inset-inline-end: 12px; }
/* the chevron is drawn pointing right (the LTR "next"); flip it where it should point left */
.pil-lb[dir="ltr"] .pil-lb__prev svg, .pil-lb[dir="rtl"] .pil-lb__next svg { transform: scaleX(-1); }

@media (max-width: 599px) {
  .pil-lb { padding: 64px 12px 72px; }
  .pil-lb__img { max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
  .pil-lb__prev, .pil-lb__next { inset-block-start: auto; inset-block-end: 12px; margin-block-start: 0; }
  .pil-lb__prev { inset-inline-start: 16px; }
  .pil-lb__next { inset-inline-end: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .pil-lb { transition: opacity .2s ease; }
  .pil-lb__img { transition: opacity .15s ease; }
}
