/* =========================================================
   Trip photo lightbox (trip pages only). Uses the tokens of main.css.
   ========================================================= */

/* The "N photos" pill is a button; the main photo opens the lightbox too. */
.trip-gallery__main[data-gallery] { cursor: zoom-in; }
.trip-gallery__open {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer;
}
.trip-gallery__open:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 4px; border-radius: 999px; }

body.has-lightbox { overflow: hidden; }

.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 56px 72px 72px; background: rgba(22, 20, 15, .94); color: var(--c-white);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .2s, visibility 0s; }
.lightbox__figure { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; min-height: 0; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 190px); width: auto; height: auto; object-fit: contain; border-radius: 12px; background: var(--c-ink-2); }
.lightbox__caption { max-width: 760px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--c-nile-text); }
.lightbox__count { position: absolute; left: 20px; top: 20px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 13px; font-weight: 700; }

.lightbox__btn {
  position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: var(--c-white); cursor: pointer;
  transition: background .2s, color .2s;
}
.lightbox__btn:hover { background: var(--c-gold); color: var(--c-ink); }
.lightbox__btn:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 3px; }
.lightbox__btn .icon { width: 22px; height: 22px; }
.lightbox__close { top: 14px; right: 14px; }
.lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__prev .icon { transform: rotate(180deg); }
.lightbox--single .lightbox__prev, .lightbox--single .lightbox__next, .lightbox--single .lightbox__count { display: none; }

@media (max-width: 720px) {
  .lightbox { padding: 64px 12px 84px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 16px; transform: none; }
  .lightbox__prev { left: calc(50% - 56px); }
  .lightbox__next { right: calc(50% - 56px); }
  .lightbox__img { max-height: calc(100vh - 230px); }
}
@media (prefers-reduced-motion: reduce) { .lightbox { transition: none; } }
