/* Native dialog supplies modal focus containment, Escape and a top-layer backdrop. */
html.l1t-gallery-open { overflow: hidden; }
:is(.article__body, [data-landing-body]) .wp-block-gallery a[aria-haspopup="dialog"] { cursor: zoom-in; }
.article-gallery {
  box-sizing: border-box;
  width: min(1600px, calc(100% - 2rem));
  height: min(1100px, calc(100dvh - 2rem));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #edf6f52b;
  border-radius: 6px;
  background: #030a0e;
  color: #edf6f5;
  font: 400 1rem/1.5 Inter, sans-serif;
}
.article-gallery[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.article-gallery::backdrop { background: #001019ed; }
.article-gallery__toolbar { display: flex; align-items: center; gap: 1.5rem; padding: .5rem 1rem; border-bottom: 1px solid #edf6f52b; }
.article-gallery__count { color: #a1a1a1; font-variant-numeric: tabular-nums; }
.article-gallery__original { color: #12afc4; margin-inline-start: auto; font-size: .875rem; text-underline-offset: .2em; }
.article-gallery__button { flex-shrink: 0; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #edf6f54d; border-radius: 4px; background: #00141f; color: #edf6f5; font: 400 2rem/1 sans-serif; cursor: pointer; }
.article-gallery__button[hidden] { display: none; }
.article-gallery__button:hover { color: #bfe43f; border-color: #12afc4; }
.article-gallery :is(button, a):focus-visible { outline: 2px solid #bfe43f; outline-offset: 3px; }
.article-gallery__stage { display: flex; align-items: center; min-height: 0; gap: 1rem; padding: 1rem; touch-action: pan-y pinch-zoom; }
.article-gallery__figure { flex: 1; min-width: 0; height: 100%; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1rem; }
.article-gallery__media { display: grid; min-height: 0; min-width: 0; }
.article-gallery__image { grid-area: 1 / 1; width: 100%; height: 100%; min-height: 0; object-fit: scale-down; }
.article-gallery__caption { max-height: 6em; overflow-y: auto; text-align: center; color: #edf6f5; font-size: .9375rem; }
.article-gallery__caption:empty { display: none; }
.article-gallery__status { min-height: 1.5em; margin: 0; padding: 0 1rem .75rem; color: #a1a1a1; font-size: .8125rem; text-align: center; }
@media (max-width: 640px) {
  .article-gallery { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .article-gallery__stage { position: relative; padding: .75rem .5rem 4rem; }
  .article-gallery__stage > button { position: absolute; bottom: .5rem; }
  .article-gallery__stage > button:first-child { left: 1rem; }
  .article-gallery__stage > button:last-child { right: 1rem; }
}

.article-gallery__image--enter { animation: article-gallery-in 160ms ease-out both; }
.article-gallery__image--exit { opacity: 0; animation: article-gallery-out 160ms ease-out both; }
@keyframes article-gallery-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes article-gallery-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .article-gallery__image { animation: none; }
}
