/* Gallery page styles */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  align-items: stretch;
}

.gallery-item {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 16px;
  border: 2px solid #000;
  border-radius: 10px;
  box-sizing: border-box;
  height: 100%;
  text-align: center;
}

.gallery-item a {
  display: block;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  display: block;
  object-fit: cover;
  border: 7px groove rgba(150, 11, 11, 0.775);
  border-radius: 8px;
  box-sizing: border-box;
}

.gallery-item h3 {
  margin: 12px 0 8px;
  font-size: 1.4em;
  text-align: center;
}

.gallery-item p {
  margin: 0;
  text-align: center;
}

.gallery-caption {
  margin-top: 12px;
  text-align: center;
  font-family: Georgia, serif;
  font-size: 1.1em;
  color: #000;
  font-weight: 600;
}

h1 {
  font-family: Rye, Georgia, serif;
  font-size: clamp(2rem, 6vw, 3rem);
    display: block;
  width: fit-content;
  max-width: 94%;
    margin: 0 auto;
    background-color: rgb(180, 174, 174, 0.5);
    padding: 0.2em 0.4em;
     border-radius: 8px;
    border: 7px groove rgba(150, 11, 11, 0.775);
}

p{
  font-size: clamp(1.05rem, 3.4vw, 1.7rem);
    line-height: 1.6;
    text-align: center;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    color: rgb(147, 4, 4);
    background-color: rgba(249, 245, 245, 0.75);
    display: block;
    width: min(94%, 980px);
    margin: 0 auto;
        border-radius: 8px;
    border: 7px groove rgba(150, 11, 11, 0.775);
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px auto;
  }

  .gallery-item {
    padding: 12px;
  }

  .gallery-caption {
    font-size: 1rem;
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 94%;
    align-items: start;
  }

  .gallery-item {
    padding: 8px;
    height: auto;
  }

  .gallery-caption {
    display: block;
    width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-top: 8px;
    font-size: clamp(0.7rem, 2.8vw, 0.9rem);
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
  }

  p {
    border-width: 5px;
  }
}