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

.gallery-card {
  border: 2px solid #000000;
  padding: 0;
  background: #ffffff;
  border-radius: 0px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 1 / 1;
  position: relative;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.gallery-card:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

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

.gallery-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  line-height: 1.3;
}

.gallery-empty {
  margin-top: 12px;
  color: #dbe8e2;
  background: transparent;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  z-index: 1300;
  padding: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}

.gallery-lightbox.open {
  display: flex;
}

.gallery-lightbox img {
  max-width: min(96vw, 1600px);
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.gallery-lightbox-title {
  color: #ffffff;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #000000;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.38);
}

.gallery-lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 44px;
  height: 44px;
  font-size: 1rem;
  color: #ffffff;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  color: #ffffff;
}

.gallery-lightbox-prev {
  left: 18px;
}

.gallery-lightbox-next {
  right: 18px;
}

@media (max-width: 680px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
