.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 10px;
  padding: 20px;
}

.photo-item img {
  width: 100%;
  height: auto;
  border-radius: 20px;

  object-fit: cover;
  transition: all 0.8s ease;
}
.photo-item img:hover {
  border-radius: 0px;
  border: #151a1b solid 2px;
}
header {
  border-bottom: #2e88a3 2px solid;
}

.photo-grid p {
  text-align: center;
  font-size: 1.1rem;
  color: #255f85;
  margin: 15px 0;
}
.linkTo {
  font-weight: bold;
  margin-right: 15px;
  text-decoration: underline;
}
a {
  text-decoration: none;
}
.image-hover-wrapper {
  position: relative;
  width: 100%;
  height: auto;
}

.image-hover-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.5s ease;
  object-fit: cover;
}

.hover-image {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1;
}
.linkTo {
  color: hsl(217, 12%, 43%);
}

.copyright {
  text-align: center;
  font-size: 0.8rem;
  color: #444;
  margin-top: 20px;
}
.image-hover-wrapper:hover .hover-image,
.photo-item a:focus .hover-image {
  opacity: 1;
}

.image-hover-wrapper:hover .main-image,
.photo-item a:focus .main-image {
  opacity: 0;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}
.modal-content,
#modalImg {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 10px;
}

#modalText {
  background-color: #fff;
  margin-top: 15px;
  padding: 15px;
  color: #000000;
  text-align: center;
  font-size: 1rem;
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}
@media (hover) {
  .hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
  }
  .photo-item img {
    border: #2e88a3 solid 2px;
  }
}
