/* ============================================================
   gallery.css — Beyond J.C. Group OPC | Gallery Page
   Compact page header · filterable masonry grid · lightbox
   Matches site design system: Fraunces/DM Sans, green & yellow accents
   ============================================================ */

:root {
  --gl-green:        #0d542b;
  --gl-green-hover:  #0a4322;
  --gl-green-light:  #dcfce7;
  --gl-yellow:       #eab308;
  --gl-yellow-hover: #ca8a04;
  --gl-ink:          #111111;
  --gl-ink-mid:      #444444;
  --gl-ink-light:    #888888;
  --gl-white:        #ffffff;
  --gl-off-white:    #f8f8f8;
  --gl-border:       #efefef;
  --gl-border-dark:  #e2e2e2;
  --gl-font-display: sans-serif;
  --gl-font-body:    sans-serif;
  --gl-max-w:        1380px;
  --gl-px:           clamp(20px, 5vw, 80px);
  --gl-r-pill:       9999px;
  --gl-t-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --gl-t-fast:       .18s ease;
  --navbar-h:        80px;
}

/* ── Scroll reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ── 1. PAGE HEADER ───────────────────────────────────────── */
.gl-page-header {
  background: var(--gl-white);
  padding: calc(var(--navbar-h) + 52px) var(--gl-px) 0;
  border-bottom: 1px solid var(--gl-border);
  overflow: hidden;
}
.gl-page-header__inner {
  max-width: var(--gl-max-w);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: flex-end;
    padding-left: 5%;
  padding-right: 5%;
}

.gl-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--gl-font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gl-green);
  margin-bottom: 14px;
}
.gl-eyebrow-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gl-green);
  border-radius: 50%;
  animation: glDotPulse 2.5s ease infinite;
}

.gl-page-header__title {
  font-family: var(--gl-font-display);
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 600;
  line-height: 1.0;
  color: var(--gl-ink);
  letter-spacing: -2.5px;
  margin-bottom: 18px;
}
.gl-page-header__title em {
  font-style: italic;
  color: var(--gl-green);
}

.gl-page-header__sub {
  font-family: var(--gl-font-body);
  font-size: 16px;
  font-weight: 300;
  color: var(--gl-ink-light);
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 28px;
}

.gl-page-header__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 52px;
}

.gl-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--gl-font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--gl-ink-mid);
  background: var(--gl-off-white);
  border: 1px solid var(--gl-border-dark);
  border-radius: var(--gl-r-pill);
  padding: 5px 14px;
}
.gl-meta-chip svg { color: var(--gl-green); flex-shrink: 0; }

/* Featured image */
.gl-page-header__featured {
  position: relative;
  height: 420px;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  align-self: flex-end;
}
.gl-page-header__featured-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.gl-page-header__featured:hover .gl-page-header__featured-img {
  transform: scale(1.03);
}

.gl-page-header__featured-badge {
  position: absolute;
  bottom: 16px; left: 16px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-radius: var(--gl-r-pill);
  padding: 6px 14px;
  font-family: var(--gl-font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--gl-ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.gl-page-header__featured-badge svg { color: var(--gl-green); }

/* ── 2. FILTER BAR ────────────────────────────────────────── */
.gl-filter-bar {
  position: sticky;
  top: var(--navbar-h);
  z-index: 900;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--gl-border);
}
.gl-filter-bar__inner {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: var(--gl-max-w);
  margin-inline: auto;
  padding: 12px var(--gl-px);
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
}
.gl-filter-bar__inner:active { cursor: grabbing; }
.gl-filter-bar__inner::-webkit-scrollbar { display: none; }

.gl-pill {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: var(--gl-r-pill);
  border: 1px solid var(--gl-border-dark);
  background: transparent;
  color: var(--gl-ink-light);
  font-family: var(--gl-font-body);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s var(--gl-t-spring);
}
.gl-pill:hover {
  border-color: var(--gl-ink-light);
  color: var(--gl-ink);
  transform: translateY(-1px);
}
.gl-pill.active {
  background: var(--gl-green);
  border-color: var(--gl-green);
  color: var(--gl-white);
}

/* ── 3. SECTION CHROME ────────────────────────────────────── */
.gl-section-header {
  text-align: center;
  margin-bottom: 48px;
}
.gl-section-header .gl-eyebrow { justify-content: center; }

.gl-section-title {
  font-family: var(--gl-font-display);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  color: var(--gl-ink);
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin-bottom: 10px;
}
.gl-section-sub {
  font-family: var(--gl-font-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--gl-ink-light);
}

/* ── 4. GALLERY MAIN ──────────────────────────────────────── */
.gl-main {
  background: var(--gl-white);
  padding: 72px 0 88px;
}
.gl-main__inner {
  max-width: var(--gl-max-w);
  margin-inline: auto;
  padding-inline: var(--gl-px);
}

/* Masonry CSS grid */
.gl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  gap: 12px;
}

/* ── 5. GALLERY ITEMS ─────────────────────────────────────── */
.gl-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--gl-off-white);
  cursor: pointer;
  outline: none;
  transition: transform .3s var(--gl-t-spring), box-shadow .3s;
}
.gl-item:hover,
.gl-item:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  z-index: 2;
}
.gl-item:focus-visible {
  outline: 3px solid var(--gl-green);
  outline-offset: 2px;
}

/* Span variants */
.gl-item--tall   { grid-row: span 2; }
.gl-item--wide   { grid-column: span 2; }
.gl-item--normal { grid-row: span 1; }

.gl-item__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease;
}
.gl-item:hover .gl-item__img { transform: scale(1.06); }

/* Hover overlay */
.gl-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}
.gl-item:hover .gl-item__overlay,
.gl-item:focus-visible .gl-item__overlay { opacity: 1; }

.gl-item__zoom {
  color: var(--gl-white);
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  padding: 8px;
  backdrop-filter: blur(4px);
  margin-bottom: 8px;
  transition: transform .22s var(--gl-t-spring);
}
.gl-item:hover .gl-item__zoom { transform: scale(1.15); }

.gl-item__label {
  font-family: var(--gl-font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  text-align: center;
}

/* ── 6. LIGHTBOX ──────────────────────────────────────────── */
.gl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gl-lightbox[hidden] { display: none; }

.gl-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
  cursor: pointer;
}

.gl-lightbox__panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 90vw;
  max-height: 90vh;
}

.gl-lightbox__img-wrap {
  position: relative;
  max-width: 80vw;
  max-height: 85vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.gl-lightbox__img {
  display: block;
  max-width: 80vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}

.gl-lightbox__close {
  position: fixed;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--gl-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s;
  z-index: 2;
}
.gl-lightbox__close:hover { background: rgba(255,255,255,.2); }

.gl-lightbox__nav {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--gl-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s, transform .22s var(--gl-t-spring);
}
.gl-lightbox__nav:hover {
  background: rgba(255,255,255,.22);
  transform: scale(1.08);
}

.gl-lightbox__caption {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--gl-font-body);
  font-size: 13px;
  font-weight: 300;
  color: rgba(255,255,255,.7);
  text-align: center;
  white-space: nowrap;
}

.gl-lightbox__counter {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--gl-font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.08);
  padding: 4px 14px;
  border-radius: var(--gl-r-pill);
}

/* ── 7. CTA BAND ──────────────────────────────────────────── */
.gl-cta {
  background: var(--gl-green);
  padding: 88px var(--gl-px);
}
.gl-cta__inner {
  max-width: var(--gl-max-w);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.gl-cta__title {
  font-family: var(--gl-font-display);
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 600;
  color: var(--gl-white);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.gl-cta__title em {
  font-style: italic;
  color: var(--gl-yellow);
}
.gl-cta__sub {
  font-family: var(--gl-font-body);
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
  max-width: 480px;
}

.gl-cta__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.gl-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--gl-r-pill);
  font-family: var(--gl-font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .22s var(--gl-t-spring), box-shadow .22s, background .18s;
}
.gl-cta__btn:hover { transform: translateY(-2px); }

.gl-cta__btn--primary {
  background: var(--gl-yellow);
  color: var(--gl-ink);
  box-shadow: 0 4px 16px rgba(234,179,8,.25);
}
.gl-cta__btn--primary:hover {
  background: var(--gl-yellow-hover);
  color: var(--gl-white);
  box-shadow: 0 8px 24px rgba(234,179,8,.35);
}
.gl-cta__btn--ghost {
  background: rgba(255,255,255,.1);
  color: var(--gl-white);
  border: 1.5px solid rgba(255,255,255,.25);
}
.gl-cta__btn--ghost:hover { background: rgba(255,255,255,.2); }

/* ── 8. ANIMATIONS ────────────────────────────────────────── */
@keyframes glDotPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.6); opacity: .5; }
}

/* ── 9. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .gl-grid { grid-template-columns: repeat(2, 1fr); }
  .gl-item--wide { grid-column: span 2; }
}
@media (max-width: 860px) {
  .gl-page-header__inner { grid-template-columns: 1fr; }
  .gl-page-header__featured { height: 300px; border-radius: 16px; }
  .gl-cta__inner { flex-direction: column; align-items: flex-start; }
  .gl-lightbox__nav { display: none; }
}
@media (max-width: 540px) {
  .gl-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .gl-item--tall, .gl-item--wide { grid-column: span 1; grid-row: span 1; }
  .gl-cta__actions { flex-direction: column; width: 100%; }
  .gl-cta__btn { justify-content: center; }
}