/* ============================================================
   TCOMM — gallery.css
   Galeri / Gallery page (templates/template-gallery.php).
   Namespace: .gl-*  (hero, masonry grid, lightbox).
   Tokens + atoms (.eyebrow .reveal .btn) come from base.css;
   footer (.ft) reused from sections.css.
   Scoped via the WP body class .page-template-template-gallery
   where the shared nav needs re-skinning over the dark hero.
   ============================================================ */

/* nav over the dark gallery hero: white logo while not collapsed */
.page-template-template-gallery .site-nav:not(.scrolled) .brand-logo {
  filter: brightness(0) invert(1) drop-shadow(0 1px 5px rgba(0,0,0,0.45));
}
/* collapsed nav sits over LIGHT sections here → keep logo + burger dark */
.page-template-template-gallery .site-nav.scrolled .brand-logo { filter: drop-shadow(0 2px 8px rgba(20,40,30,0.16)); }
.page-template-template-gallery .site-nav.scrolled .nav-burger .bars i { background: var(--ink-dark); filter: none; }
.page-template-template-gallery .nav-links a.is-active { color: #fff; }
.page-template-template-gallery .site-nav.scrolled .nav-links a.is-active { color: var(--green-deep); }
.page-template-template-gallery .drawer-links a.is-active { color: var(--green-deep); }

/* breadcrumb ------------------------------------------------------ */
.gl-crumb {
  display: flex; align-items: center; gap: 9px; margin-bottom: 22px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--grey-dim);
}
.gl-crumb a { color: var(--grey); text-decoration: none; transition: color .2s; }
.gl-crumb a:hover { color: var(--green); }
.gl-crumb .sep { opacity: 0.6; }
.gl-crumb .here { color: var(--green); }

/* ============================================================
   HERO (dark scene, compact)
   ============================================================ */
.gl-hero {
  position: relative; min-height: 62vh; display: flex; align-items: center; overflow: hidden;
  background: radial-gradient(128% 120% at 76% 30%, var(--scene-2) 0%, var(--scene-1) 56%, var(--scene-0) 100%);
}
.gl-hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.gl-rings {
  position: absolute; right: -8%; top: 42%; transform: translateY(-50%);
  width: min(70vw, 760px); aspect-ratio: 1; border-radius: 50%;
  background: repeating-radial-gradient(circle at center, rgba(120,220,165,0.10) 0 1px, transparent 1px 64px);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0,0,0,0.3) 48%, transparent 72%);
          mask: radial-gradient(circle, #000 0%, rgba(0,0,0,0.3) 48%, transparent 72%);
  opacity: 0.6;
}
.gl-nodes {
  position: absolute; right: clamp(40px, 12vw, 220px); top: 50%; transform: translateY(-50%);
  width: 220px; height: 220px; opacity: 0.7;
  background-image: radial-gradient(circle, rgba(86,224,138,0.55) 1.6px, transparent 2px);
  background-size: 30px 30px;
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 70%);
          mask: radial-gradient(circle, #000 10%, transparent 70%);
}
.gl-hero-grade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(100deg, rgba(20,26,24,0.82) 0%, rgba(20,26,24,0.42) 36%, rgba(22,28,25,0.04) 64%, transparent 80%),
    linear-gradient(to top, rgba(20,26,24,0.55) 0%, transparent 40%);
}
.gl-hero-inner {
  position: relative; z-index: 2; width: 100%;
  padding-top: clamp(140px, 22vh, 210px); padding-bottom: clamp(72px, 11vh, 120px);
}
.gl-hero .eyebrow { margin-bottom: 22px; }
.gl-hero h1 { font-size: clamp(40px, 6.2vw, 88px); line-height: 1.0; color: var(--ink); max-width: 16ch; }
.gl-hero h1 .accent { color: var(--green); }
.gl-hero .subhead { margin-top: 22px; max-width: 54ch; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.62; color: var(--grey); }
.gl-hero-meta { margin-top: clamp(26px, 4vh, 40px); display: flex; align-items: center; gap: 12px; }
.gl-hero-meta .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.6s steps(1) infinite; }
.gl-hero-meta .coord-tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--grey-dim);
}

/* ============================================================
   BOARD (light): head + masonry grid
   ============================================================ */
.gl-board { position: relative; background: var(--bg-light); padding: clamp(64px, 9vh, 120px) 0 var(--section-y); }

.gl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.gl-head h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.05; color: var(--ink-dark); margin-top: 14px; letter-spacing: -0.02em; }
.gl-count {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--grey-dark); font-variant-numeric: tabular-nums; white-space: nowrap; padding-bottom: 6px;
}

/* masonry grid: CSS columns keep each figure's natural aspect ratio */
.gl-grid {
  margin-top: clamp(36px, 5vh, 56px);
  columns: 3;
  column-gap: clamp(16px, 1.8vw, 24px);
}
.gl-item {
  position: relative; overflow: hidden; border-radius: 16px;
  break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
  margin: 0 0 clamp(16px, 1.8vw, 24px);
  background: var(--bg-light-2); border: 1px solid var(--hair-dark);
  box-shadow: 0 30px 72px -52px rgba(30,60,45,0.3);
  transition: border-color .25s, box-shadow .25s;
}
.gl-item:hover, .gl-item:focus-within { border-color: rgba(31,138,82,0.26); box-shadow: 0 44px 92px -46px rgba(30,60,45,0.4); }
.gl-open {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: inherit;
}
.gl-open:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }
.gl-open img { display: block; width: 100%; height: auto; transition: transform .45s var(--ease); }
.gl-item:hover .gl-open img, .gl-item:focus-within .gl-open img { transform: scale(1.04); }
.gl-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  padding: 38px 16px 14px; text-align: left;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; line-height: 1.5;
  color: rgba(255,255,255,0.92);
  background: linear-gradient(to top, rgba(10,20,14,0.78) 0%, rgba(10,20,14,0.32) 62%, transparent 100%);
}

/* empty state ----------------------------------------------------- */
.gl-empty {
  margin-top: clamp(24px, 4vh, 40px); display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 16px; padding: clamp(56px, 9vh, 96px) 24px; border: 1px dashed var(--hair-dark); border-radius: 22px;
  background: var(--surface-3);
}
.gl-empty .ico {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--hair-dark); color: var(--green-deep);
}
.gl-empty .ico svg { width: 26px; height: 26px; }
.gl-empty h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 2vw, 26px); color: var(--ink-dark); }
.gl-empty p { font-size: 15px; line-height: 1.6; color: var(--grey-dark); max-width: 44ch; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.gl-lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: clamp(20px, 5vh, 64px);
  background: rgba(8,14,11,0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .28s var(--ease);
}
.gl-lightbox.open { display: flex; }
.gl-lightbox.in { opacity: 1; }
.gl-lb-stage { position: relative; max-width: min(1100px, 92vw); width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.gl-lb-frame {
  position: relative; width: 100%; aspect-ratio: 16/10; max-height: 76vh; border-radius: 16px; overflow: hidden;
  background: var(--scene-1); display: grid; place-items: center;
  box-shadow: 0 50px 120px -40px rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.1);
}
.gl-lb-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gl-lb-cap { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--grey); text-align: center; max-width: 70ch; }
.gl-lb-cap b { color: var(--green-bright); font-variant-numeric: tabular-nums; font-weight: 500; margin-right: 12px; }
.gl-lb-close, .gl-lb-nav {
  position: absolute; z-index: 5; width: 48px; height: 48px; border-radius: 12px; cursor: pointer; border: 0;
  display: grid; place-items: center; color: var(--ink);
  background: rgba(20,40,30,0.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); transition: background .2s, transform .15s var(--ease);
}
.gl-lb-close:hover, .gl-lb-nav:hover { background: var(--green-deep); transform: scale(1.04); }
.gl-lb-close { top: -4px; right: -4px; }
.gl-lb-close svg, .gl-lb-nav svg { width: 20px; height: 20px; }
.gl-lb-nav.prev { left: clamp(-8px, -2vw, -28px); top: 50%; transform: translateY(-50%); }
.gl-lb-nav.next { right: clamp(-8px, -2vw, -28px); top: 50%; transform: translateY(-50%); }
.gl-lb-nav.prev:hover { transform: translateY(-50%) scale(1.04); }
.gl-lb-nav.next:hover { transform: translateY(-50%) scale(1.04); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .gl-grid { columns: 2; }
}
@media (max-width: 680px) {
  .gl-hero h1 { font-size: clamp(34px, 11vw, 52px); }
  .gl-grid { columns: 1; }
  .gl-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .gl-lb-frame { aspect-ratio: 4/3; }
  .gl-lb-close, .gl-lb-nav { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .gl-hero-meta .dot { animation: none; }
  .gl-lightbox { transition: none; }
  .gl-open img { transition: none; }
  .gl-item:hover .gl-open img, .gl-item:focus-within .gl-open img { transform: none; }
}

/* ============================================================
   Showcase slider — modern, minimalist; swipe + arrows + dots.
   ============================================================ */
.gl-showcase { position: relative; background: var(--bg-light); padding: clamp(56px, 8vh, 96px) 0 0; }
.gl-slider {
  position: relative; border-radius: 22px; overflow: hidden;
  background: #0c231a;
  box-shadow: 0 44px 96px -44px rgba(8, 25, 17, 0.6);
}
.gl-sl-track {
  display: flex; height: clamp(320px, 58vh, 640px);
  transition: transform .55s cubic-bezier(.22,.61,.36,1);
  touch-action: pan-y; cursor: grab;
}
.gl-sl-track:active { cursor: grabbing; }
.gl-slide { flex: 0 0 100%; position: relative; margin: 0; }
.gl-slide .gl-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gl-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none;
}
.gl-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
  padding: clamp(60px, 9vw, 96px) clamp(20px, 3vw, 34px) clamp(56px, 6vw, 68px);
  background: linear-gradient(transparent, rgba(4, 14, 9, 0.85));
  color: #fff; display: flex; flex-direction: column; gap: 7px;
}
.gl-slide figcaption .n { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; color: var(--green); }
.gl-slide figcaption .t {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(15px, 1.6vw, 21px); line-height: 1.3; max-width: 56ch;
}
.gl-sl-ui {
  position: absolute; z-index: 2;
  left: clamp(20px, 3vw, 34px); right: clamp(20px, 3vw, 34px); bottom: clamp(16px, 2.4vw, 24px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.gl-sl-dots { display: flex; gap: 8px; }
.gl-sl-dot {
  width: 22px; height: 3px; border-radius: 99px; border: 0; padding: 0;
  background: rgba(255,255,255,0.3); cursor: pointer;
  transition: background .25s ease, width .25s ease;
}
.gl-sl-dot.on { background: var(--green); width: 36px; }
.gl-sl-btns { display: flex; gap: 10px; }
.gl-sl-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.28); background: rgba(6,18,12,0.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .25s ease, border-color .25s ease, color .25s ease, transform .2s ease;
}
.gl-sl-btn:hover { background: var(--green); border-color: var(--green); color: #08130d; transform: translateY(-2px); }
.gl-sl-btn svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .gl-sl-track { transition: none; } }
@media (max-width: 680px) {
  .gl-sl-track { height: clamp(240px, 46vh, 380px); }
  .gl-slide figcaption .t { font-size: 14px; }
  .gl-slider { border-radius: 16px; }
}
