* { box-sizing: border-box; }
html { background: #fff; }
body {
  margin: 0;
  color: #303030;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.gallery-wrap { width: min(1180px, 100%); margin: 0 auto; padding: 22px 18px 36px; }
.gallery-heading { margin: 0 0 22px; }
.gallery-heading h1 { margin: 0 0 6px; color: #333; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; }
.gallery-heading p { margin: 0; color: #666; }
.album-grid, .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.album-card {
  display: block; overflow: hidden; color: inherit; text-decoration: none;
  border: 1px solid #e1e1e1; border-radius: 5px; background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.07); transition: transform .15s ease, box-shadow .15s ease;
}
.album-card:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,.13); }
.album-card > img { display: block; width: 100%; height: 175px; object-fit: cover; background: #eee; }
.album-info { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.album-info strong { overflow-wrap: anywhere; font-size: 1rem; }
.album-info small { color: #777; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.photo-card { display: block; overflow: hidden; border-radius: 4px; background: #eee; aspect-ratio: 4 / 3; }
.photo-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.photo-card:hover img { transform: scale(1.035); }
.back-link { display: inline-block; margin: 0 0 16px; color: #315f83; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.empty { padding: 18px; background: #f5f5f5; border-radius: 4px; }
.lightbox { display: none; position: fixed; z-index: 99999; inset: 0; align-items: center; justify-content: center; padding: 55px 65px; background: rgba(0,0,0,.93); }
.lightbox.open { display: flex; }
.lightbox-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; border: 0; color: #fff; background: rgba(255,255,255,.14); cursor: pointer; border-radius: 4px; }
.lightbox-close { top: 12px; right: 18px; width: 44px; height: 44px; font-size: 32px; }
.lightbox-prev, .lightbox-next { top: 50%; width: 44px; height: 58px; margin-top: -29px; font-size: 38px; }
.lightbox-prev { left: 12px; } .lightbox-next { right: 12px; }
.lightbox-count { position: absolute; bottom: 15px; left: 0; right: 0; color: #fff; text-align: center; }
@media (max-width: 560px) {
  .gallery-wrap { padding: 16px 12px 28px; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .album-card > img { height: 125px; }
  .album-info { padding: 9px; }
  .album-info strong { font-size: .9rem; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .lightbox { padding: 50px 48px; }
}
