/* ════════════════════════════════════════════════════
   GALLERY PAGE STYLES — Rotated Diamond Card Grid
   Fixed: proper image visibility, contrast, text
   Paste this block at the bottom of pages.css
════════════════════════════════════════════════════ */

/* ── GALLERY HERO BANNER ── */
.gallery-hero {
  padding-top: calc(var(--nav-height) + var(--space-4xl)) !important;
  padding-bottom: 44px !important;
  background: var(--color-bg-secondary) !important;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(251,191,36,0.10);
}
.gallery-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 90% at 50% 110%,
    rgba(251,191,36,0.06) 0%, transparent 65%);
  pointer-events: none;
}

/* ── GALLERY SECTION ── */
.gallery-section {
  padding-top: 60px !important;
  padding-bottom: 100px !important;
  background: var(--color-bg-primary, #0a0600);
  overflow: hidden;
}

/* ── FILTER BUTTONS ── */
.gallery-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 70px;
}
.filter-btn {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 9999px;
  padding: 10px 24px;
  cursor: pointer;
  transition: color 0.28s, background 0.28s, border-color 0.28s, box-shadow 0.28s;
}
.filter-btn:hover {
  color: var(--gold);
  border-color: rgba(251,191,36,0.45);
  background: rgba(251,191,36,0.06);
}
.filter-btn.active {
  color: #000;
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 6px 22px rgba(251,191,36,0.38);
}

/* ════════════════════════════════════════════════════
   DIAMOND GRID
   Row pattern:  3 → 2 → 3 → 2
   Even rows offset right to interlock diamonds
════════════════════════════════════════════════════ */
.gallery-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 40px 0 80px;
}

.gallery-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: -72px;
  position: relative;
  z-index: 1;
}

.gallery-row:nth-child(even) {
  transform: translateX(138px);
}

.gallery-row:last-child {
  margin-bottom: 0;
}

/* ── DIAMOND ITEM — rotated square ── */
.gallery-item {
  position: relative;
  width: 250px;
  height: 250px;
  transform: rotate(45deg);
  overflow: hidden;
  cursor: pointer;
  margin: 0 5px;
  /* NO background fallback so image is the only thing shown */
  background: #0d0800;
  border: 1.5px solid rgba(251,191,36,0.30);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(251,191,36,0.06);
  transition:
    border-color 0.32s ease,
    box-shadow   0.32s ease,
    transform    0.32s ease;
  z-index: 1;
}

.gallery-item:hover {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(251,191,36,0.15),
    0 0 44px rgba(251,191,36,0.30),
    0 20px 60px rgba(0,0,0,0.7);
  transform: rotate(45deg) scale(1.07);
  z-index: 10;
}

.gallery-item.hidden { display: none; }

/* ════════════════════════════════════════════════════
   IMAGE — counter-rotated, fills the full diamond
   KEY FIX: position absolute, oversized, centered
════════════════════════════════════════════════════ */
.gallery-item img {
  position: absolute;
  /* Center the image in the rotated square */
  top:  50%;
  left: 50%;
  /* Oversized so it fills every corner of the diamond after -45deg rotation */
  /* sqrt(2) ≈ 1.414 → use 142% minimum; 150% gives safe overlap */
  width:  150%;
  height: 150%;
  object-fit: cover;
  object-position: center center;
  /* Counter-rotate so the photo stays upright */
  transform: translate(-50%, -50%) rotate(-45deg);
  /* GOOD VISIBILITY: bright, natural colours */
  filter: brightness(1.0) contrast(1.05) saturate(1.05);
  transition: filter 0.4s ease, transform 0.4s ease;
  /* Hide broken-image alt text */
  font-size: 0;
  color: transparent;
}

/* Slightly brighter on hover */
.gallery-item:hover img {
  filter: brightness(1.08) contrast(1.06) saturate(1.12);
  transform: translate(-50%, -50%) rotate(-45deg) scale(1.08);
}

/* ════════════════════════════════════════════════════
   DARK VIGNETTE OVERLAY
   Sits above the image, keeps corners dark so the
   diamond shape "reads" visually, text stays legible
════════════════════════════════════════════════════ */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Radial vignette — dark at corners, clear at centre */
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.45) 100%
  );
  z-index: 1;
  pointer-events: none;
  transition: background 0.32s ease;
}

.gallery-item:hover::after {
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    rgba(0,0,0,0.0) 0%,
    rgba(0,0,0,0.25) 100%
  );
}

/* ════════════════════════════════════════════════════
   STATIC TITLE — always visible (like reference image)
   Counter-rotated so text reads normally
════════════════════════════════════════════════════ */
.gallery-item-title-static {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  z-index: 3;
  pointer-events: none;
  /* Bottom-half position — same as reference image */
  padding-top: 60%;
}

.gallery-item-title-static span {
  font-family: var(--font-display);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  padding: 0 10px;
  /* Strong text shadow for legibility over any image */
  text-shadow:
    0 1px 3px rgba(0,0,0,0.9),
    0 2px 12px rgba(0,0,0,0.8),
    0 4px 24px rgba(0,0,0,0.6);
}

/* ════════════════════════════════════════════════════
   HOVER OVERLAY — category + title revealed on hover
════════════════════════════════════════════════════ */
.gallery-item-overlay {
  position: absolute;
  inset: -25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.32s ease;
  /* Dark overlay behind the text on hover */
  background: transparent;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

/* Gold line accent above category */
.gallery-item-overlay::before {
  content: "";
  display: block;
  width: 30px;
  height: 1.5px;
  background: var(--gold);
  margin-bottom: 8px;
  border-radius: 2px;
}

.gallery-item-category {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 7px;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

.gallery-item-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.4;
  margin: 0;
  text-align: center;
  padding: 0 16px;
  text-shadow:
    0 1px 4px rgba(0,0,0,0.95),
    0 3px 16px rgba(0,0,0,0.8);
}

/* Hide static title on hover so overlay takes over cleanly */
.gallery-item:hover .gallery-item-title-static {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Gold top-edge shimmer */
.gallery-item-shimmer {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251,191,36,0.5), transparent);
  z-index: 5;
  pointer-events: none;
}

@keyframes gallery-fade-in {
  from { opacity: 0; transform: rotate(45deg) scale(0.88); }
  to   { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* ════════════════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.lightbox.active { opacity: 1; pointer-events: all; }

.lightbox-content {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  max-width: 88vw; max-height: 88vh;
}

/* Reset ALL the diamond image tricks for lightbox */
.lightbox-content img {
  position: static !important;
  display: block !important;
  top: auto !important; left: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 76vh !important;
  object-fit: contain !important;
  transform: none !important;
  filter: none !important;
  border-radius: 14px !important;
  font-size: inherit !important;
  color: inherit !important;
  background: transparent !important;
  border: 1px solid rgba(251,191,36,0.22);
  outline: 2px solid rgba(251,191,36,0.12);
  outline-offset: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  animation: lb-zoom-in 0.32s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes lb-zoom-in {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-caption { margin-top: 18px; text-align: center; }

.lightbox-caption-category {
  font-family: var(--font-body); font-size: 9.5px; font-weight: 700;
  letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 6px;
}

.lightbox-caption-title {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 500; color: var(--text-primary);
  letter-spacing: 0.3px; margin: 0;
}

.lightbox-close {
  position: fixed; top: 24px; right: 28px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%; color: rgba(255,255,255,0.8);
  font-size: 18px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
  z-index: 10000;
}
.lightbox-close:hover {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.5);
  color: var(--gold); transform: rotate(90deg);
}

.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%; color: rgba(255,255,255,0.75);
  font-size: 18px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.28s;
  z-index: 10000;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-nav:hover {
  background: rgba(251,191,36,0.14);
  border-color: rgba(251,191,36,0.45); color: var(--gold);
}
.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .gallery-item { width: 210px; height: 210px; }
  .gallery-row { margin-bottom: -60px; }
  .gallery-row:nth-child(even) { transform: translateX(115px); }
}

@media (max-width: 900px) {
  .gallery-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 36px 24px;
    padding: 20px;
  }
  .gallery-row {
    margin-bottom: 0 !important;
    transform: none !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  .gallery-item { width: 170px; height: 170px; margin: 10px; }
  .gallery-item-title-static { padding-top: 55%; }
}

@media (max-width: 540px) {
  .gallery-item { width: 130px; height: 130px; }
  .filter-btn { padding: 8px 14px; font-size: 9px; }
  .gallery-item-title-static span { font-size: 9px; }
  .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 14px; }
  .lightbox-prev { left: 8px; } .lightbox-next { right: 8px; }
}