/* Gallery-only correction. Keep spoiler content in layout so its controls
   determine the card's minimum height instead of clipping inside a crop. */
.visual-gallery-page .gallery-thumbnail.has-spoiler-blanket .gallery-thumbnail-media {
  display: grid;
}
.visual-gallery-page .gallery-thumbnail.has-spoiler-blanket .gallery-thumbnail-button {
  grid-area: 1 / 1;
  height: 100%;
  aspect-ratio: auto;
}
.visual-gallery-page .gallery-thumbnail-media > .gallery-spoiler-blanket {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
  min-width: 0;
}
@media (max-width: 720px) {
  .visual-gallery-page .visual-gallery-grid:not(.single-visual) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  }
  .visual-gallery-page .gallery-thumbnail {
    min-width: 0;
  }
  .visual-gallery-page .gallery-card-actions .mini-action {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }
  .visual-gallery-page .gallery-card-back {
    align-content: start;
  }
}
/* The large viewer already contains the note, credit and source. */
.visual-gallery-page .gallery-info-button {
  display: none;
}
.visitor-preview-active .visual-gallery-page .gallery-card-actions {
  display: none !important;
}
.visual-gallery-page .gallery-thumbnail footer {
  text-align: center;
}
