/* Runtime-only Gallery enhancement. Existing figure/grid geometry is unchanged. */
.ras-gallery-grid [data-rsg-open] {
  cursor: zoom-in;
}

.ras-gallery-grid [data-rsg-open]:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #17221d;
}

.rsg-lightbox {
  --rsg-lightbox-gutter: clamp(16px, 3vw, 32px);
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--rsg-lightbox-gutter);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  box-shadow: none;
  overflow: hidden;
  overscroll-behavior: contain;
}

.rsg-lightbox[open] {
  display: grid;
}

.rsg-lightbox::backdrop {
  background: rgb(14 18 16 / 86%);
}

.rsg-lightbox .rsg-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.rsg-lightbox .rsg-lightbox__frame {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #232b27;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 24%), 0 16px 60px rgb(0 0 0 / 38%);
}

.rsg-lightbox.rsg-lightbox--empty .rsg-lightbox__frame,
.rsg-lightbox.rsg-lightbox--error .rsg-lightbox__frame {
  box-sizing: border-box;
  min-width: min(280px, calc(100vw - var(--rsg-lightbox-gutter) * 2));
  min-height: 180px;
  padding: 72px 72px 56px;
}

.rsg-lightbox .rsg-lightbox__image {
  grid-area: 1 / 1;
  display: block;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: min(980px, calc(100vw - var(--rsg-lightbox-gutter) * 2));
  max-height: calc(100vh - var(--rsg-lightbox-gutter) * 2);
  max-height: calc(100dvh - var(--rsg-lightbox-gutter) * 2);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: none;
  cursor: default;
}

.rsg-lightbox :is(.rsg-lightbox__close, .rsg-lightbox__previous, .rsg-lightbox__next) {
  appearance: none;
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #ddd9ce;
  border-radius: 50%;
  background: #fffaf0;
  color: #17221d;
  font-family: Arial, sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.rsg-lightbox :is(.rsg-lightbox__close, .rsg-lightbox__previous, .rsg-lightbox__next) span {
  display: block;
  color: inherit;
  font: inherit;
  pointer-events: none;
}

.rsg-lightbox :is(.rsg-lightbox__close, .rsg-lightbox__previous, .rsg-lightbox__next):is(:hover, :active) {
  background: #232b27;
  color: #ffffff;
}

.rsg-lightbox :is(.rsg-lightbox__close, .rsg-lightbox__previous, .rsg-lightbox__next):focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px #17221d;
}

.rsg-lightbox :is(.rsg-lightbox__previous, .rsg-lightbox__next) {
  top: 50%;
  right: auto;
  transform: translateY(-50%);
  font-size: 36px;
}

.rsg-lightbox .rsg-lightbox__previous { left: 12px; }
.rsg-lightbox .rsg-lightbox__next { right: 12px; }

.rsg-lightbox :is(.rsg-lightbox__previous, .rsg-lightbox__next) svg {
  display: block;
  flex: none;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.rsg-lightbox .rsg-lightbox__counter {
  position: absolute;
  z-index: 1;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 12px;
  border: 1px solid #8a958f;
  border-radius: 999px;
  background: #232b27;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rsg-lightbox .rsg-lightbox__counter-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.rsg-lightbox .rsg-lightbox__error {
  grid-area: 1 / 1;
  max-width: 32rem;
  margin: 0;
  padding: 20px;
  background: #232b27;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
}

.rsg-lightbox .rsg-lightbox__spinner {
  grid-area: 1 / 1;
  z-index: 1;
  pointer-events: none;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 3px solid #8a958f;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: rsg-lightbox-spin 800ms linear infinite;
}

.rsg-lightbox [hidden] {
  display: none !important;
}

@keyframes rsg-lightbox-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .rsg-lightbox :is(.rsg-lightbox__close, .rsg-lightbox__previous, .rsg-lightbox__next) { transition: none; }
  .rsg-lightbox .rsg-lightbox__spinner { animation: none; }
}
