/* V27: generated folder-based photo galleries. Scoped to the gallery section only. */
#gallery .auto-gallery,
#gallery .auto-gallery-16 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 20px;
}
#gallery .auto-gallery-16 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#gallery .auto-gallery .auto-photo {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 17px;
  background: color-mix(in srgb, var(--theme-surface2, #152b40) 83%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme-accent, #75adff) 32%, transparent);
}
#gallery .auto-gallery .auto-photo > button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}
#gallery .auto-gallery .auto-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .22s ease;
}
#gallery .auto-gallery .auto-photo > button:hover img { transform: scale(1.025); }
#gallery .auto-gallery-16 .auto-photo img { aspect-ratio: 1 / 1; }
#gallery .auto-gallery .auto-photo figcaption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  min-height: 65px;
  padding: 12px 14px;
  font-size: .82rem;
  line-height: 1.35;
}
#gallery .auto-gallery .photo-title { font-weight: 800; color: var(--theme-text, #fff); }
#gallery .auto-gallery .photo-subtitle { font-size: .73rem; font-weight: 700; color: var(--theme-accent2, #ffc8cc); }
#gallery .auto-gallery .photo-empty .photo-empty-art {
  aspect-ratio: 1 / 1;
  background: color-mix(in srgb, var(--theme-bg, #090c17) 65%, var(--theme-surface, #182536));
  border-bottom: 1px dashed color-mix(in srgb, var(--theme-accent, #84b6ff) 30%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: var(--theme-muted, #abbaca);
}
#gallery .auto-gallery .photo-empty-art > span { font-size: 2.8rem; font-weight: 850; opacity: .42; }
#gallery .auto-gallery .photo-empty-art small { max-width: 75%; text-align: center; opacity: .7; font-size: .73rem; }
#gallery .photo-gallery-empty {
  padding: 25px 26px;
  border: 1px dashed color-mix(in srgb, var(--theme-accent, #84b6ff) 42%, transparent);
  background: color-mix(in srgb, var(--theme-surface, #172c44) 72%, transparent);
  border-radius: 18px;
  margin-top: 20px;
}
#gallery .photo-gallery-empty p { margin-top: 9px; line-height: 1.65; }
#gallery .photo-legacy-gallery > .gallery-grid { margin-top: 20px; }
@media (max-width: 1200px) {
  #gallery .auto-gallery-16 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
  #gallery .auto-gallery, #gallery .auto-gallery-16 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 530px) {
  #gallery .auto-gallery, #gallery .auto-gallery-16 { grid-template-columns: 1fr; }
  #gallery .auto-gallery-16 .auto-photo img, #gallery .auto-gallery-16 .photo-empty-art { aspect-ratio: 4 / 3; }
}
