*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  font-family: "wotfard", sans-serif;
}

body {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 {
  text-align: center;
  margin: 1em 0;
}

main {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

picture {
  position: relative;
  margin: 8px;
}

/* Show placeholder images (low-resolution blurred images) */
picture::before {
  content: "";
  position: absolute;
  z-index: 1;
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.6;
  }
}

img {
  /* Since images are inline by default, they add unwanted whitespace below them due to text-line spacing. This can cause misalignment in layouts. To fix this, use display:block which removes extra whitespace and ensures the image takes up only its own space. */
  display: block;
  width: calc(90vw / 3);
  height: 600px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  border-radius: 4px;
}

.hide::before {
  content: "";
  opacity: 0;
  animation: none;
}

[data-image="image-1"]::before {
  background-image: url(images/low-resolution-images/image-1.jpg);
}

[data-image="image-2"]::before {
  background-image: url(images/low-resolution-images/image-2.jpg);
}

[data-image="image-3"]::before {
  background-image: url(images/low-resolution-images/image-3.jpg);
}

[data-image="image-4"]::before {
  background-image: url(images/low-resolution-images/image-4.jpg);
}

[data-image="image-5"]::before {
  background-image: url(images/low-resolution-images/image-5.jpg);
}

[data-image="image-6"]::before {
  background-image: url(images/low-resolution-images/image-6.jpg);
}

[data-image="image-7"]::before {
  background-image: url(images/low-resolution-images/image-7.jpg);
}

[data-image="image-8"]::before {
  background-image: url(images/low-resolution-images/image-8.jpg);
}

[data-image="image-9"]::before {
  background-image: url(images/low-resolution-images/image-9.jpg);
}

[data-image="image-10"]::before {
  background-image: url(images/low-resolution-images/image-10.jpg);
}

[data-image="image-11"]::before {
  background-image: url(images/low-resolution-images/image-11.jpg);
}

[data-image="image-12"]::before {
  background-image: url(images/low-resolution-images/image-12.jpg);
}

[data-image="image-13"]::before {
  background-image: url(images/low-resolution-images/image-13.jpg);
}

[data-image="image-14"]::before {
  background-image: url(images/low-resolution-images/image-14.jpg);
}

[data-image="image-15"]::before {
  background-image: url(images/low-resolution-images/image-15.jpg);
}

[data-image="image-16"]::before {
  background-image: url(images/low-resolution-images/image-16.jpg);
}

[data-image="image-17"]::before {
  background-image: url(images/low-resolution-images/image-17.jpg);
}

[data-image="image-18"]::before {
  background-image: url(images/low-resolution-images/image-18.jpg);
}

/* Mobile devices (up to 767px) */
@media (max-width: 767px) {
  img {
    width: 90vw;
  }
}

/* Tablet devices (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  img {
    width: 45vw;
  }
}

/* Desktop devices (1024px and above) */
@media (min-width: 1024px) {
  img {
    width: 30vw;
  }
}
