:root {
  --gallery-green: #06493c;
  --gallery-dark: #173129;
  --gallery-muted: #718078;
  --gallery-border: #e4e8e5;
  --gallery-background: #fbfaf7;
  --gallery-accent: #f5b735;
}

.gallery-page {
  min-height: 70vh;
  background: var(--gallery-background);
}

.gallery-container {
  width: min(100% - 40px, 1240px);
  margin-inline: auto;
}

.gallery-page-header {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--gallery-border);
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f7f8f6 100%
    );
}

.gallery-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  font-size: 10px;
  font-weight: 700;
}

.gallery-breadcrumb a {
  color: var(--gallery-green);
}

.gallery-breadcrumb span {
  color: #a5aea9;
  font-size: 7px;
}

.gallery-breadcrumb strong {
  color: #68766f;
}

.gallery-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.gallery-kicker {
  display: inline-block;
  margin-bottom: 7px;
  color: #a56a05;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gallery-title-row h1 {
  margin: 0;
  color: var(--gallery-dark);
  font-family: "Playfair Display", serif;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1;
}

.gallery-title-row p {
  max-width: 560px;
  margin: 11px 0 0;
  color: var(--gallery-muted);
  font-size: 12px;
  line-height: 1.7;
}

.gallery-photo-count {
  min-width: 92px;
  padding: 13px 16px;
  border: 1px solid var(--gallery-border);
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
}

.gallery-photo-count strong,
.gallery-photo-count span {
  display: block;
}

.gallery-photo-count strong {
  color: var(--gallery-green);
  font-size: 22px;
}

.gallery-photo-count span {
  margin-top: 2px;
  color: var(--gallery-muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.gallery-content {
  padding: 28px 0 72px;
}

/*
  True masonry layout:
  3 columns on desktop, 2 on tablet, 1 on mobile.
*/
.gallery-masonry {
  display: block !important;
  width: 100% !important;
  column-count: 3 !important;
  column-gap: 14px !important;
}

.gallery-item {
  display: inline-block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  break-inside: avoid !important;
  page-break-inside: avoid !important;
  vertical-align: top;
}

.gallery-image-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #e8ecea;
  cursor: zoom-in;
}

.gallery-image-button img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  object-fit: cover;
  transition:
    opacity 0.2s ease,
    transform 0.25s ease;
}

.gallery-image-button:hover img {
  opacity: 0.94;
  transform: scale(1.012);
}

.gallery-empty {
  display: grid;
  justify-items: center;
  padding: 55px 20px;
  border: 1px solid var(--gallery-border);
  border-radius: 12px;
  color: var(--gallery-muted);
  background: #ffffff;
  text-align: center;
}

.gallery-empty > i {
  font-size: 30px;
  color: var(--gallery-green);
}

.gallery-empty h2 {
  margin: 13px 0 5px;
  color: var(--gallery-dark);
  font-size: 20px;
}

.gallery-empty p {
  margin: 0;
  font-size: 11px;
}

/* Lightbox */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 15px;
  padding: 34px;
  background: rgba(0, 0, 0, 0.94);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox-stage {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.gallery-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 105px);
  object-fit: contain;
}

.gallery-lightbox-counter {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
  border: 0;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.gallery-lightbox-close {
  position: absolute;
  top: 18px;
  right: 25px;
  width: 44px;
  height: 44px;
  font-size: 36px;
  line-height: 1;
}

.gallery-lightbox-arrow {
  width: 55px;
  height: 70px;
  font-size: 55px;
  line-height: 1;
  opacity: 0.75;
}

.gallery-lightbox-arrow:hover,
.gallery-lightbox-close:hover {
  opacity: 1;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .gallery-masonry {
    column-count: 2 !important;
    column-gap: 11px !important;
  }

  .gallery-item {
    margin-bottom: 11px !important;
  }
}

@media (max-width: 620px) {
  .gallery-container {
    width: min(100% - 24px, 1240px);
  }

  .gallery-page-header {
    padding: 24px 0 23px;
  }

  .gallery-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .gallery-photo-count {
    display: none;
  }

  .gallery-content {
    padding: 18px 0 48px;
  }

  .gallery-masonry {
    column-count: 1 !important;
  }

  .gallery-item {
    margin-bottom: 10px !important;
  }

  .gallery-lightbox {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 5px;
    padding: 25px 8px;
  }

  .gallery-lightbox-arrow {
    width: 40px;
    font-size: 42px;
  }
}
