/* ============================================================
   GALLERY PAGE — masonry grid, lightbox, filter buttons
   ============================================================ */

.gallery-section {
  background: transparent;
}

/* ---------- FILTER BUTTONS ---------- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 50px;
}

.filter-btn {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 11px 26px;
  border: 1px solid rgba(184, 137, 43, 0.4);
  color: var(--white-warm);
  background: transparent;
  border-radius: 40px;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.filter-btn.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: var(--black-deep);
}

/* ---------- MASONRY GRID ---------- */
.masonry {
  columns: 3;
  column-gap: 20px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 20px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(184, 137, 43, 0.12);
  transition: transform 0.45s ease, opacity 0.45s ease;
  display: block;
}

.masonry-item.hide {
  display: none;
}

.gallery-more-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 34px;
}

.gallery-more-wrap p {
  color: rgba(69, 86, 90, .7);
  font-family: var(--font-ui);
  font-size: .9rem;
}

#galleryLoadMore[hidden] { display: none; }

@media (max-width: 768px) {
  .gallery-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px 10px;
  }
  .gallery-filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; scroll-snap-align: center; min-height: 44px; }
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

.masonry-item:hover img {
  transform: scale(1.08);
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0.1) 60%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: var(--transition);
}

/* the tiles are keyboard-operable, so focus gets the same reveal as hover —
   otherwise a keyboard user lands on a tile with no idea what it is */
.masonry-item:hover .masonry-overlay,
.masonry-item:focus-visible .masonry-overlay {
  opacity: 1;
}

.masonry-overlay .cat-tag {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.masonry-overlay h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #FFFFFF !important;   /* the theme's heading ink is !important too */
}

.masonry-overlay .view-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: var(--black-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transform: scale(0);
  transition: var(--transition);
}

.masonry-item:hover .view-icon {
  transform: scale(1);
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.96);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  /* visibility flips instantly on open (so the close button can take focus
     right away) and is held back until the fade-out has finished on close */
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

/* the controls state their own visibility rather than inheriting it, so they
   are focusable the instant .open lands — an inherited value can still be
   stale when the dialog moves focus to the close button */
.lightbox.open .lightbox-close,
.lightbox.open .lightbox-nav {
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 88%;
  max-height: 84vh;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.35s ease;
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 8px;
  border: 1px solid rgba(184, 137, 43, 0.4);
  margin: 0 auto;
}

.lightbox-caption {
  margin-top: 20px;
}

.lightbox-caption .cat-label {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  color: var(--gold-primary);
  margin-bottom: 6px;
  display: block;
}

.lightbox-caption h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #FFFFFF;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 30px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(184, 137, 43, 0.5);
  color: var(--gold-primary);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2010;
}

.lightbox-close:hover {
  background: var(--gold-primary);
  color: var(--black-deep);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(184, 137, 43, 0.5);
  color: var(--gold-primary);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2010;
}

.lightbox-nav:hover {
  background: var(--gold-primary);
  color: var(--black-deep);
}

.lightbox-prev { left: 26px; }
.lightbox-next { right: 26px; }

.lightbox-counter {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  letter-spacing: 2px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  z-index: 2010;
}

.lightbox-counter span {
  color: var(--gold-primary);
}

/* ---------- CATALOGUE TEASER ---------- */
.catalog-teaser {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 50px 30px;
  border-radius: 20px;
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(10,93,97,.16);
}
.catalog-teaser p { color: rgba(69,86,90,.74); margin: 12px 0 26px; font-size: 1.05rem; line-height: 1.6; }
