/* ==========================================================================
   RG Garden — Gallery Page Specific Stylesheet
   Source of Truth: RG Garden.html Reference
   ========================================================================== */

/* Category Filter Bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.fb {
  min-height: 46px;
  padding: 0 22px;
  background: transparent;
  border: 1px solid rgba(37, 35, 31, .35);
  border-radius: 0;
  cursor: pointer;
  font: 500 .72rem/1 var(--f-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--charcoal);
  transition: background-color .4s, color .4s, border-color .4s;
}

.fb:hover {
  border-color: var(--charcoal);
}

.fb[aria-pressed=true] {
  background: var(--charcoal);
  color: var(--ivory);
  border-color: var(--charcoal);
}

.gcount {
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: 30px;
}

/* Masonry Layout */
.mas {
  column-count: 3;
  column-gap: 20px;
}

.gi {
  display: block;
  break-inside: avoid;
  margin: 0 0 20px;
  cursor: zoom-in;
  animation: pop .7s var(--ease) both;
}

.gi .ph {
  aspect-ratio: var(--r);
}

.gi .ph-in.has-img ~ .ph-l {
  display: none;
}

.gi:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
}

/* Gallery Hero Arch Stacking */
.phero .arch {
  z-index: 3;
  pointer-events: none;
}

/* Lightbox Modal */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(27, 25, 22, .97);
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: calc(70px + env(safe-area-inset-top, 0px)) max(64px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(64px, env(safe-area-inset-left, 0px));
  opacity: 0;
  transition: opacity .4s;
}

.lb.open {
  opacity: 1;
}

.lb-stage {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.lb-stage .ph {
  --ph-bg: var(--ph-dark);
  --ph-fg: rgba(244, 239, 230, .62);
  max-height: 68vh;
}

.lb-stage .ph.go {
  animation: lbin .6s var(--ease) both;
}

.lb-cap {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font: 500 .72rem/1.5 var(--f-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--paper-soft);
  text-align: center;
}

.lb-btn {
  position: absolute;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(244, 239, 230, .4);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: background-color .35s, color .35s;
}

.lb-btn:hover {
  background: var(--ivory);
  color: var(--charcoal);
}

.lb-x {
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
}

.lb-p {
  left: max(10px, env(safe-area-inset-left, 0px));
  top: 50%;
  transform: translateY(-50%);
}

.lb-n {
  right: max(10px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
}

/* Gallery Responsive */
@media (max-width: 900px) {
  .mas {
    column-count: 2;
    column-gap: 12px;
  }
  .gi {
    margin-bottom: 12px;
  }
  .lb {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .lb-p {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: max(16px, env(safe-area-inset-left, 0px));
    transform: none;
  }
  .lb-n {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    transform: none;
  }
}
