:root{
  --gap: 16px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.08);
}

.gallery{
  list-style: none;
  padding: 0;
  margin: 24px auto;
  max-width: 1200px;

  display: grid;
  gap: var(--gap, 16px);
  grid-template-columns: 1fr;      
}

.gallery-item{
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
}

.gallery-link{
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-image{
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform .25s ease;
}

.gallery-item:hover .gallery-image{
  transform: scale(1.03);
}

.lb{
  position: relative;
  display: inline-block;            
  line-height: 0;                     
}

.lb-img{
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 12px;
}

.lb-caption{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.65);
  color: #fff;
  padding: 10px 14px;
  font: 500 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  border-radius: 0 0 12px 12px;
  text-wrap: balance;
}

.lb-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  background: rgba(0,0,0,.1);
}

.lb-prev{ left: 8px; }
.lb-next{ right: 8px; }

.lb-btn:hover{ background: rgba(0,0,0,.6); }
.lb-btn:active{ transform: translateY(-50%) scale(.98); }

@media (max-width: 480px){
  .gallery-image{ height: 180px; }
}


@media (min-width: 768px){
  .gallery{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1158px){
  .gallery{ grid-template-columns: repeat(3, 1fr); }
}