/* Scoped to the viewer: existing gallery cards and original links stay intact. */
html.art-lightbox-open,
html.art-lightbox-open body { overflow: hidden !important; }

#art-lightbox {
  box-sizing: border-box;
  inset: 0;
  width: min(1160px, calc(100% - 28px));
  height: min(960px, calc(100vh - 28px));
  height: min(960px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: clamp(14px, 2.5vw, 24px);
  border: 1px solid #9b8145;
  border-radius: 16px;
  background: linear-gradient(145deg, #111b24, #080d14 70%);
  color: #f2ead6;
  font-family: var(--serif-text, Georgia, serif);
  line-height: 1.4;
  letter-spacing: normal;
  box-shadow: 0 24px 80px #0009;
  overflow: auto;
  overscroll-behavior: contain;
}

#art-lightbox:not([open]) { display: none; }
#art-lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
#art-lightbox::backdrop { background: rgba(2, 5, 10, .92); }
#art-lightbox *, #art-lightbox *::before, #art-lightbox *::after { box-sizing: border-box; }
#art-lightbox [hidden] { display: none !important; }

#art-lightbox .art-lightbox__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}
#art-lightbox .art-lightbox__title {
  margin: 0;
  align-self: center;
  min-width: 0;
  color: #f5e4b8;
  font-family: var(--serif-head, Georgia, serif);
  font-size: clamp(21px, 2.7vw, 32px);
  font-weight: 500;
  line-height: 1.15;
  text-align: left;
  overflow-wrap: anywhere;
}
#art-lightbox .art-lightbox__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #9b8145;
  border-radius: 50%;
  background: #101925;
  color: #f5e4b8;
  font: 32px/1 Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, border-color .15s ease;
}
#art-lightbox .art-lightbox__button:hover { background: #283142; border-color: #f0d58d; }
#art-lightbox .art-lightbox__button:disabled { opacity: .45; cursor: default; }
#art-lightbox :is(button, a):focus-visible { outline: 3px solid #f3d887; outline-offset: 3px; }

#art-lightbox .art-lightbox__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 96px;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #030609;
}
#art-lightbox .art-lightbox__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  filter: none;
  transform: none;
}
#art-lightbox .art-lightbox__status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  color: #d8d0bd;
  font: 16px/1.5 Arial, sans-serif;
  text-align: center;
}
#art-lightbox .art-lightbox__details {
  flex: none;
  margin: 0;
  color: #d8c99e;
  font: 14px/1.5 Arial, sans-serif;
  overflow-wrap: anywhere;
}
#art-lightbox .art-lightbox__footer {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
#art-lightbox .art-lightbox__navigation { display: flex; align-items: center; gap: 12px; }
#art-lightbox .art-lightbox__counter { min-width: 64px; color: #e8ddc5; font: 16px/1.4 Arial, sans-serif; text-align: center; }
#art-lightbox .art-lightbox__original {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 10px 4px;
  color: #f0d58d;
  font: 16px/1.5 Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
#art-lightbox .art-lightbox__original:hover { color: #fff2cb; }

@media (max-width: 480px) {
  #art-lightbox { width: calc(100% - 16px); height: calc(100vh - 16px); height: calc(100dvh - 16px); padding: 12px; border-radius: 12px; }
  #art-lightbox[open] { gap: 10px; }
  #art-lightbox .art-lightbox__footer { justify-content: center; gap: 2px; }
  #art-lightbox .art-lightbox__navigation { justify-content: space-between; width: 100%; }
  #art-lightbox .art-lightbox__original { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #art-lightbox *, #art-lightbox *::before, #art-lightbox *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
