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

.gallery img {
  margin: 0;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: pointer;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-image:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 55px rgba(0,0,0,0.38);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  inset: 0;
  padding: 2rem;
  overflow: auto;
  background-color: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
}

.modal.is-open {
  display: block;
}

.modal-figure {
  position: relative;
  width: fit-content;
  max-width: min(1200px, 92vw);
  margin: auto;
}

.modal-content {
  margin: auto;
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 86vh;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.modal.is-open .modal-content {
  opacity: 1;
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 1003;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  background: rgba(7, 11, 18, 0.84);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.modal-close:hover {
  background: rgba(16, 24, 39, 0.96);
}

@media (max-width: 640px) {
  .modal { padding: 1rem; }
  .modal-figure { max-width: 100%; }
  .modal-close { top: 0.7rem; right: 0.7rem; width: 44px; height: 44px; font-size: 28px; }
}
