/* Progressive enhancement: image links work without this module. */
a[data-lightbox] { cursor: zoom-in; }
a[data-lightbox]:focus-visible { outline: 3px solid var(--gold-ink, #87652f); outline-offset: 5px; }

.le-lightbox {
  width: min(1000px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(200, 169, 107, .46);
  border-radius: 18px;
  color: #f5f4ef;
  background: #0b1220;
  box-shadow: 0 32px 100px #0009;
  color-scheme: dark;
}

.le-lightbox::backdrop { background: rgba(3, 9, 17, .88); backdrop-filter: blur(8px); }
.le-lightbox[open] { animation: le-lightbox-enter .18s ease-out; }
.le-lightbox__panel { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); }
.le-lightbox__toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(200, 169, 107, .2);
}
.le-lightbox__title {
  margin: 0;
  color: #f5f4ef;
  font: 650 clamp(.95rem, .85rem + .4vw, 1.125rem)/1.45 var(--sans, Arial, sans-serif);
  overflow-wrap: anywhere;
  min-width: 0;
}
.le-lightbox__actions { display: flex; flex: 0 0 auto; gap: .4rem; }
.le-lightbox__control {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(200, 169, 107, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: #e6cc92;
  transition: background .16s ease, border-color .16s ease;
}
.le-lightbox__control:hover, .le-lightbox__control[aria-pressed="true"] { background: #12343b; border-color: #c8a96b; }
.le-lightbox__control:focus-visible, .le-lightbox__footer a:focus-visible { outline: 3px solid #e6cc92; outline-offset: 3px; }
.le-lightbox__control:disabled { opacity: .45; cursor: default; }
.le-lightbox__close { color: #f5f4ef; }
.le-lightbox__stage {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  background: #060c15;
  scrollbar-color: #8e784d #0b1220;
  scrollbar-width: thin;
}
.le-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  max-height: calc(100dvh - 12rem);
  object-fit: contain;
  border-radius: 5px;
  cursor: zoom-in;
  user-select: none;
}
.le-lightbox.is-zoomed .le-lightbox__stage { display: block; }
.le-lightbox.is-zoomed .le-lightbox__image { width: var(--le-image-width, 1254px); max-width: none; max-height: none; margin-inline: auto; cursor: zoom-out; }
.le-lightbox__error { max-width: 42ch; padding: 2rem 1rem; text-align: center; }
.le-lightbox__footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .3rem 1rem;
  padding: .7rem 1rem;
  border-top: 1px solid rgba(200, 169, 107, .2);
  color: #bac5ce;
  font-size: .875rem;
  line-height: 1.6;
}
.le-lightbox__footer p { margin: 0; }
.le-lightbox__footer a { color: #e6cc92; }

.le-scroll-top {
  position: fixed;
  z-index: 45;
  left: max(1.25rem, env(safe-area-inset-left));
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + .65rem));
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(230, 204, 146, .2);
  border-radius: 50%;
  background: linear-gradient(145deg, #173942, #0b1220 75%);
  color: #e6cc92;
  box-shadow: 0 5px 22px rgba(3, 9, 17, .25), inset 0 1px rgba(255, 255, 255, .05);
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.le-scroll-top:hover { background: #173942; box-shadow: 0 7px 28px rgba(3, 9, 17, .3); transform: translateY(-2px); }
.le-scroll-top:focus-visible { outline: 3px solid #c8a96b; outline-offset: 4px; }
.le-scroll-top__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.le-scroll-top__track { stroke: rgba(230, 204, 146, .17); stroke-width: 1.6; }
.le-scroll-top__progress { stroke: #c8a96b; stroke-width: 1.7; stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; }
.le-scroll-top__icon { position: relative; width: 22px; height: 22px; }
.le-scroll-top__tooltip {
  position: absolute;
  left: calc(100% + .65rem);
  padding: .45rem .75rem;
  border: 1px solid rgba(200, 169, 107, .4);
  border-radius: 7px;
  background: #0b1220;
  color: #f5f4ef;
  font-size: .875rem;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .16s ease, transform .16s ease;
}
@media (hover: hover) {
  .le-scroll-top:hover .le-scroll-top__tooltip, .le-scroll-top:focus-visible .le-scroll-top__tooltip { opacity: 1; transform: translateX(0); }
}
/* Reserve a quiet corner below footer links for the fixed control. */
body[data-le-enhanced] .site-footer { padding-bottom: max(4.75rem, calc(env(safe-area-inset-bottom) + 4.5rem)); }

@keyframes le-lightbox-enter { from { opacity: 0; transform: translateY(5px) scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .le-lightbox { width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 14px; }
  .le-lightbox__panel { max-height: calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .le-lightbox__toolbar { gap: .5rem; padding: .6rem .65rem; }
  .le-lightbox__actions { gap: .3rem; }
  .le-lightbox__stage { padding: .45rem; }
  .le-lightbox__image { max-height: calc(100dvh - 13rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .le-lightbox__footer { padding: .65rem .8rem; }
  .le-scroll-top { width: 52px; height: 52px; left: max(.9rem, env(safe-area-inset-left)); bottom: max(.9rem, calc(env(safe-area-inset-bottom) + .5rem)); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .le-lightbox__footer { display: none; }
  .le-lightbox__image { max-height: calc(100dvh - 7rem); }
}
@media (prefers-reduced-motion: reduce) {
  .le-lightbox[open] { animation: none; }
  .le-scroll-top, .le-scroll-top__tooltip, .le-lightbox__control { transition: none; }
  .le-scroll-top:hover { transform: none; }
}
@media print { .le-lightbox, .le-scroll-top { display: none !important; } }
