﻿img {
  max-width: 100%;
  height: auto;
}
.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: row dense;
  width: 90%;
  margin: auto;
}
.gallery > :nth-child(7n+1) {
  grid-column: span 2;
  grid-row: span 2;
}
.gallery img {
  display: block;
  aspect-ratio: 1/1;
  border-radius: 6px;
  -o-object-fit: cover;
     object-fit: cover;
  overflow: hidden;
}

dialog.lightbox {
  border: none;
  padding: 0;
  -webkit-animation: fadeIn 0.3s ease-out;
          animation: fadeIn 0.3s ease-out;
}
dialog.lightbox::-webkit-backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}
dialog.lightbox::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}
dialog.lightbox img {
  -o-object-fit: contain;
     object-fit: contain;
  display: block;
  overflow: hidden;
  height: 100%;
  width: 100%;
  max-width: 90vw;
  max-width: 90dvw;
  max-height: 90vh;
  max-height: 90dvh;
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}