/* On file detail pages the active screenshot sets the height of its own frame. */
.article-page.modern-material [data-gallery] .article-gallery-stage,
.article-page.modern-material [data-gallery] .article-gallery-stage > [data-gallery-open] {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  padding: 0;
}
.article-page.modern-material [data-gallery] .article-gallery-stage #full-photo {
  display: block;
  position: static;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto;
  padding: 0;
  object-fit: contain;
}
.article-page.modern-material [data-gallery] .article-gallery-thumbs > [data-gallery-thumb] {
  padding: 0;
  border: 0;
}
.article-page.modern-material [data-gallery] .article-gallery-thumbs > [data-gallery-thumb]:is(.is-active,:focus-visible) {
  outline: 2px solid var(--ui-action);
  outline-offset: -2px;
}
.article-page.modern-material [data-gallery] .article-gallery-thumbs img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none;
  padding: 0;
  border: 0;
  object-fit: cover !important;
  object-position: center;
}
/* DLE emits nested list items until the gallery script turns them into links. */
.article-page.modern-material [data-gallery] .article-gallery-thumbs [data-native-gallery] li {
  height: 66px;
}
.article-page.modern-material [data-gallery] .article-gallery-thumbs [data-native-gallery] li > a {
  display: block;
  height: 100%;
}

.article-page .article-header > h1[data-material-title] {
  width: 100%;
  min-width: 0;
  max-width: none;
  text-wrap: wrap;
  overflow-wrap: anywhere;
}
