section.block-gallery-lightboxed{
}
.gallery-images{
    width:100%;
}
/* ===== Gallery Masonry ===== */
.gallery-grid.gallery-layout-masonry {
    column-count: 4;
    column-gap: 1.5rem;
    padding: 0;
    margin: 0 auto;
    list-style: none;
}

@media (max-width: 1024px) {
    .gallery-grid.gallery-layout-masonry { column-count: 3; }
}

@media (max-width: 600px) {
    .gallery-grid.gallery-layout-masonry { column-count: 2; }
}

.gallery-grid.gallery-layout-masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.gallery-grid.gallery-layout-masonry .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-grid.gallery-layout-landscape,
.gallery-grid.gallery-layout-portrait {
    display: grid;
    gap: 1.5rem;
    padding: 0;
    margin: 0 auto;
    list-style: none;
    width: 100%;
    justify-content: center; /* enables centering when grid is narrower than container */
}

/* Column rules driven by PHP class */
.gallery-grid.gallery-layout-landscape.gallery-cols-1,
.gallery-grid.gallery-layout-portrait.gallery-cols-1 {
    grid-template-columns: min(100%, 1100px);
}

.gallery-grid.gallery-layout-landscape.gallery-cols-2,
.gallery-grid.gallery-layout-portrait.gallery-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 1100px;
}

.gallery-grid.gallery-layout-landscape.gallery-cols-3,
.gallery-grid.gallery-layout-portrait.gallery-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1300px;
}

.gallery-grid.gallery-layout-landscape.gallery-cols-4,
.gallery-grid.gallery-layout-portrait.gallery-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 1600px;
}

/* Responsive safety */
@media (max-width: 1024px) {
    .gallery-grid.gallery-layout-landscape.gallery-cols-4,
    .gallery-grid.gallery-layout-portrait.gallery-cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 1300px;
    }
}

@media (max-width: 600px) {
    .gallery-grid.gallery-layout-landscape.gallery-cols-4,
    .gallery-grid.gallery-layout-landscape.gallery-cols-3,
    .gallery-grid.gallery-layout-landscape.gallery-cols-2,
    .gallery-grid.gallery-layout-portrait.gallery-cols-4,
    .gallery-grid.gallery-layout-portrait.gallery-cols-3,
    .gallery-grid.gallery-layout-portrait.gallery-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 900px;
    }
}

@media (max-width: 420px) {
    .gallery-grid.gallery-layout-landscape.gallery-cols-4,
    .gallery-grid.gallery-layout-landscape.gallery-cols-3,
    .gallery-grid.gallery-layout-landscape.gallery-cols-2,
    .gallery-grid.gallery-layout-portrait.gallery-cols-4,
    .gallery-grid.gallery-layout-portrait.gallery-cols-3,
    .gallery-grid.gallery-layout-portrait.gallery-cols-2 {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

/* Cards */
.gallery-layout-landscape .gallery-item,
.gallery-layout-portrait .gallery-item {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-layout-landscape .gallery-item { aspect-ratio: 4/3; }
.gallery-layout-portrait .gallery-item  { aspect-ratio: 3/4; }

.gallery-layout-landscape .gallery-item img,
.gallery-layout-portrait .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    position: absolute;
}

/* ===== Lightbox ===== */
/*.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999999999;
}

.gallery-lightbox:target {
    display: flex;
}

.gallery-lightbox img {
    width: auto;
    height: auto;
    max-width: 80vw;
    max-height: 67vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 2rem;
    text-decoration: none;
    line-height: 1;
}*/
.gallery-lightbox{
  position: fixed;
  inset: 0;
    background: rgba(255,255,255,.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999999;
}

.gallery-lightbox.is-open{
  display: flex;
}

/* click-anywhere close layer */
.gallery-lightbox-close{
    position: absolute;
    top: 120px;
    right: 2rem;
    color: #000;
    padding: 10px;
    font-size: 35px;
    line-height: 1em;
    width: 45px;
    text-decoration: none;
    line-height: 20px;
    border: 1px solid #dedede;
    border-radius: 50%;
    display: inline-block;
    height: 45px;
}

.gallery-lightbox-close svg{ 
    position: absolute;
  inset: 0;
    top: 2rem;
    left: calc(100% - 4rem);
}
/* image container */
.gallery-lightbox-figure{
  position: relative;
  z-index: 1;
  max-width: min(1200px, 92vw);
  max-height: 92vh;
  margin: 0;
}

.gallery-lightbox-figure img{
  max-width: 80vw;
  max-height: 67vh;
  width: auto;
  height: auto;
  display: block;
}

.gallery-credits{
    width:100%;
    background: var(--color-primary);
    padding: calc(var(--side-margin)*1.5)  var(--side-margin);
}
.photo-credits{
    width: 100%;
    text-align: center;
}
.photo-credits h4{
    font-weight: 600;
    margin-right: 10px;
}
.photo-credits h4,
.photo-credits p{
    display: inline-block;
}