/* Gallery album archive, masonry album page, and lightbox */
.gallery-albums-section,
.gallery-single-section{
  background:#f5f8fc;
}
.gallery-albums-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:22px;
}
.gallery-album-card{
  background:#fff;
  border:1px solid #e7edf5;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 12px 28px rgba(13,52,105,.08);
}
.gallery-album-card__image{
  position:relative;
  display:block;
  min-height:230px;
  background-size:cover;
  background-position:center;
}
.gallery-album-card__image:after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to top,rgba(6,47,99,.45),rgba(6,47,99,0));
}
.gallery-album-card__count{
  position:absolute;
  z-index:1;
  right:14px;
  bottom:14px;
  background:#c99a42;
  color:#fff;
  border-radius:999px;
  padding:5px 12px;
  font-size:11px;
  font-weight:900;
}
.gallery-album-card__body{
  padding:18px;
}
.gallery-album-card time{
  display:block;
  color:#c99a42;
  font-weight:900;
  font-size:11px;
  margin-bottom:7px;
}
.gallery-album-card h2{
  font-size:18px;
  line-height:1.55;
  margin:0 0 8px;
  color:#062f63;
}
.gallery-album-card p{
  font-size:12px;
  line-height:1.8;
  margin:0 0 14px;
  color:#6b7a90;
}
.gallery-single-hero{
  background-size:cover;
  background-position:center;
}
.gallery-description{
  margin-bottom:24px;
}
.masonry-gallery{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  grid-auto-rows:150px;
  grid-auto-flow:dense;
  gap:14px;
}
.masonry-gallery__item{
  position:relative;
  display:block;
  overflow:hidden;
  border-radius:16px;
  background:#d9e2ec;
  box-shadow:0 12px 28px rgba(13,52,105,.08);
}
.masonry-gallery__item--large{
  grid-column:span 2;
  grid-row:span 2;
}
.masonry-gallery__item--wide{
  grid-column:span 2;
}
.masonry-gallery__item--tall{
  grid-row:span 2;
}
.masonry-gallery__item img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .35s ease, filter .35s ease;
}
.masonry-gallery__item:after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to top,rgba(6,47,99,.32),rgba(6,47,99,0));
  opacity:0;
  transition:.25s;
}
.masonry-gallery__item:hover img{
  transform:scale(1.05);
  filter:saturate(1.08);
}
.masonry-gallery__item:hover:after{
  opacity:1;
}
.imam-lightbox{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,16,38,.92);
  padding:36px 82px;
}
.imam-lightbox.is-open{
  display:flex;
}
body.lightbox-open{
  overflow:hidden;
}
.imam-lightbox figure{
  margin:0;
  max-width:min(1100px,100%);
  max-height:100%;
  display:grid;
  gap:12px;
  place-items:center;
}
.imam-lightbox img{
  max-width:100%;
  max-height:calc(100vh - 130px);
  object-fit:contain;
  border-radius:12px;
  box-shadow:0 22px 80px rgba(0,0,0,.42);
}
.imam-lightbox figcaption{
  color:#fff;
  font-size:13px;
  text-align:center;
}
.imam-lightbox__close,
.imam-lightbox__prev,
.imam-lightbox__next{
  position:absolute;
  border:0;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:.2s;
}
.imam-lightbox__close:hover,
.imam-lightbox__prev:hover,
.imam-lightbox__next:hover{
  background:#c99a42;
}
.imam-lightbox__close{
  top:22px;
  left:22px;
  width:42px;
  height:42px;
  border-radius:50%;
  font-size:30px;
  line-height:1;
}
.imam-lightbox__prev,
.imam-lightbox__next{
  top:50%;
  transform:translateY(-50%);
  width:54px;
  height:72px;
  border-radius:16px;
  font-size:48px;
  line-height:1;
}
.imam-lightbox__prev{
  right:22px;
}
.imam-lightbox__next{
  left:22px;
}
.gallery-row a{
  display:block;
  height:92px;
  border-radius:4px;
  background-size:cover;
  background-position:center;
}
@media(max-width:920px){
  .gallery-albums-grid{
    grid-template-columns:repeat(2,1fr);
  }
  .masonry-gallery{
    grid-template-columns:repeat(2,1fr);
    grid-auto-rows:140px;
    gap:10px;
  }
  .imam-lightbox{
    padding:24px 58px;
  }
}
@media(max-width:560px){
  .gallery-albums-grid{
    grid-template-columns:1fr;
  }
  .masonry-gallery{
    grid-template-columns:1fr 1fr;
    grid-auto-rows:118px;
    gap:8px;
  }
  .masonry-gallery__item--large,
  .masonry-gallery__item--wide{
    grid-column:span 2;
  }
  .imam-lightbox{
    padding:24px 12px 78px;
  }
  .imam-lightbox__prev,
  .imam-lightbox__next{
    top:auto;
    bottom:16px;
    transform:none;
    width:52px;
    height:52px;
    font-size:38px;
  }
}