/* ============================================
   PHOTO GALLERY — JUSTIFIED MODE
   Flickr-style rows filled by the engine. The grid
   is a flex container; each item's height is pinned to
   the justified row height and its flex-basis grows with
   the image's natural aspect ratio. See
   justified-photo-gallery.js.
   ============================================ */

/* The base grid sets `display: grid` on `.photo-gallery__grid` at the same
   specificity as a bare `.photo-gallery__grid--justified` rule, so the per-mode
   selector must be scoped under the mode modifier on the root to win the
   cascade regardless of load order. Mirrors the `.photo-gallery--{mode} …`
   scoping used by the grid/tiles modes. */
.photo-gallery--justified .photo-gallery__grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gallery-gap);
}

.photo-gallery--justified .photo-gallery__item {
    height: var(--gallery-justified-row-height, 200px);
    width: auto;
    aspect-ratio: auto;
}
