@font-face {
  font-family: 'MyCustomFont';
  src: url('fonts/myheart.ttf') format('truetype');
}

body {
  margin: 0;
  font-family:'MyCustomFont';
  background-color: #FFFBE9;
}

h1 {
  text-align: center;
  margin: 20px 0;
  color: red;
  font-size: 50px;
}

nav {
  padding: 10px 20px;
}

nav a {
  margin-right: 15px;
  color: yellow;
  font-size: 20px;
}

.header-image {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

footer {
  color: white;
  text-align: center;
  margin: 20px 0;
}

#gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  padding: 15px;
  justify-items: center;
}

figure {
  margin: 0;
  cursor: pointer;
}

figure img {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

figure img:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

figcaption {
  text-align: center;
  margin-top: 8px;
  font-size: 16px;
  color: white;
  word-wrap: break-word;
}

#preview {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color:#CBC3E3,;
  padding: 40px;
  box-sizing: border-box;
  display: none;
  overflow: auto;
  text-align: center;
  z-index: 1000;
}

#preview img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

#preview p {
  color: white;
  font-size: 18px;
  margin-top: 15px;
  text-align: center;
  word-wrap: break-word;
}

body.preview-open #gallery {
  grid-template-columns: 1fr;
}

#close-preview {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
}

#close-preview:hover {
  color: yellow;
}

@media (min-width: 600px) {
  h1 {
    font-size: 80px;
  }

  nav a {
    font-size: 30px;
  }

  figcaption {
    font-size: 22px;
  }

  #preview p {
    font-size: 25px;
  }

  #gallery {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }

  figure img {
    width: 400px;
  }
}