.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 0 0 28px;
}

.gal-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  border: 1px solid #d5dfd7;
  border-radius: 10px;
  background: #fff;
}

.gal-card__image {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #edf2ee;
}

.gal-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gal-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 12px 14px 14px;
}

.gal-card__title {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1.35;
}

.gal-card__title a,
.gal-card__link {
  color: #4f705c;
}

.gal-card__teaser,
.gal-card__meta {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
}

.gal-card__meta {
  color: #6c776f;
}

.gal-card__link {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
}

.gallery-detail-head {
  margin: 0 0 16px;
}

.g-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.g-gallery-link,
.g-gallery-item {
  display: block;
  min-width: 0;
  margin: 0;
}

.g-gallery-img {
  display: block;
  width: 100%;
  height: 210px;
  border-radius: 8px;
  object-fit: cover;
}

.g-gallery-caption {
  padding: 7px 2px 0;
  font-size: 14px;
  line-height: 1.4;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  background: rgba(0, 0, 0, .9);
}

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

#glb-wrap {
  display: flex;
  max-width: 100%;
  max-height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#glb-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
}

#glb-cap {
  max-width: min(920px, 100%);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: .9;
}

#glb-prev,
#glb-next,
#glb-close {
  position: absolute;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

#glb-close { top: 12px; right: 12px; }
#glb-prev { top: 50%; left: 10px; transform: translateY(-50%); }
#glb-next { top: 50%; right: 10px; transform: translateY(-50%); }

@media (max-width: 767px) {
  .gallery-list { grid-template-columns: 1fr; }
  .g-gallery { grid-template-columns: 1fr; }
  .g-gallery-img { height: auto; max-height: none; object-fit: contain; }
  #glb-prev,
  #glb-next { padding: 12px; font-size: 26px; }
}
