* {
  box-sizing: border-box;
}

html {
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
  color: #222;
}
:root {
  --green: #2f7d32 ;
}
body {
  margin: 0;
  background: #fff;
}

.more-wrapper {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 10px;
}

.more-button {
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 1rem;
  cursor: pointer;
}

.more-button:hover {
  background: var(--green);
  color: #fff;
}

.no-scroll {
  overflow: hidden;
}

.site-header {
  text-align: center;
  padding: 42px 20px 28px;
}

.site-title {
  color: var(--green);
  text-decoration: none;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.site-subtitle {
  margin: 10px 0 0;
  color: #777;
  font-size: 1rem;
}

.gallery-page {
  width: min(1400px, 94%);
  margin: 0 auto;
  padding: 10px 0 60px;
}

.gallery-heading {
  text-align: center;
  margin-bottom: 24px;
}

.back-link {
  display: inline-block;
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 1rem;
  text-decoration: none;
  margin-bottom: 18px;
  cursor: pointer;
}

.back-link:hover {
  background: var(--green);
  color: #fff;
  text-decoration: none;
}

.gallery-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--green);
}

.gallery-heading p {
  margin: 8px 0 0;
  color: #777;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: min(900px, 100%);
  margin: 0 auto 32px;
}

.filter-button {
  width: 100%;
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 22px;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.photo-card {
  min-width: 0;
}

.photo-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.photo-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.photo-button:hover img {
  transform: scale(1.015);
  opacity: 0.92;
}

.photo-caption {
  padding: 11px 2px 4px;
  text-align: center;
}

.photo-caption h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.photo-caption p {
  margin: 5px 0 0;
  color: #777;
  font-size: 0.88rem;
}

.error-message {
  grid-column: 1 / -1;
  text-align: center;
  color: #a33;
  padding: 40px;
}

.site-footer {
  text-align: center;
  padding: 25px 20px 35px;
  color: #999;
  font-size: 0.75rem;
  line-height: 1.6;
}

.site-footer p {
  margin: 3px 0;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.92);
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: fixed;
  top: 12px;
  right: 20px;
  z-index: 1002;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 200;
}

.lightbox-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 30px;
  width: min(1250px, 96vw);
  max-height: 92vh;
  align-items: center;
}

.lightbox-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

.lightbox-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.photo-details {
  color: #fff;
  padding: 10px 0;
}

.photo-details h2 {
  margin: 0 0 22px;
  font-size: 1.7rem;
  font-weight: 600;
}

.photo-details dl {
  margin: 0;
}

.photo-details dl div {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.photo-details dt {
  color: #aaa;
}

.photo-details dd {
  margin: 0;
  word-break: break-word;
}

.map-link {
  display: inline-block;
  margin-top: 20px;
  color: #9bd39d;
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

@media (max-width: 1000px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lightbox-content {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .lightbox-image-wrap img {
    max-height: 62vh;
  }

  .photo-details {
    width: min(600px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 700px) {
  .site-header {
    padding-top: 30px;
  }

  .gallery-page {
    width: 92%;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .lightbox {
    padding: 20px 14px;
  }

  .lightbox-close {
    right: 12px;
    font-size: 2.6rem;
  }
}

@media (max-width: 430px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    justify-content: flex-start;
  }
}
