.gallery-container {
  max-width: 1200px;
  margin: 40px auto 60px;
  padding: 0 20px;
}

.gallery-grid {
  columns: 3;
  column-gap: 16px;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  border: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.gallery-item:focus-visible,
.gallery-lightbox-close:focus-visible {
  outline: 3px solid #ffbb55;
  outline-offset: 3px;
}

.gallery-item img {
  display: block;
  width: 100%;
  transition: transform 0.4s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(to top, rgb(0 0 0 / 70%), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
  opacity: 1;
}

.gallery-info {
  padding: 16px;
  color: #fff;
}

.gallery-title {
  font-size: 16px;
  font-weight: 700;
}

.gallery-desc {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.85;
}

.gallery-lightbox {
  position: fixed;
  width: min(90vw, 1200px);
  max-width: none;
  max-height: 90vh;
  padding: 48px 24px 24px;
  overflow: auto;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #171717;
  text-align: center;
}

.gallery-lightbox::backdrop {
  background: rgb(0 0 0 / 92%);
}

.gallery-lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}

.gallery-lightbox-content {
  max-width: 100%;
  margin: 0;
}

.gallery-lightbox-content img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  object-fit: contain;
}

.gallery-lightbox-caption {
  margin-top: 12px;
}

@media (max-width: 768px) {
  .gallery-grid { columns: 2; }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item img,
  .gallery-overlay {
    transition: none;
  }
}
