/* ============================================================
   FDKSA Gallery Page Styles
   ============================================================ */

/* ── PAGE HERO ──────────────────────────────────────────── */
.gallery-hero {
  position: relative;
  background: linear-gradient(140deg, #1e0a4a 0%, #3b1278 30%, #6d28d9 65%, #8b5cf6 100%);
  padding: calc(var(--nav-h) + 52px) 0 64px;
  overflow: hidden;
}
.gallery-hero .blob-1 { width: 500px; height: 500px; top: -200px; right: -80px; }
.gallery-hero .blob-2 { width: 300px; height: 300px; bottom: -80px; left: -60px; }

.gallery-hero-inner { position: relative; z-index: 2; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  margin-bottom: 24px;
  transition: color .2s;
}
.back-link:hover { color: #fff; }
.back-link svg { width: 16px; height: 16px; }

.gallery-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: #fff;
  line-height: 1.1;
  margin-bottom: 14px;
}
.gallery-hero-title em { color: var(--gold); font-style: italic; }
.gallery-hero-sub {
  font-size: .97rem;
  color: rgba(255,255,255,.65);
  max-width: 500px;
}

/* ── MAIN CONTENT ───────────────────────────────────────── */
.gallery-main { padding: 64px 0 100px; }

/* ── STICKY GLASS TOOLBAR ───────────────────────────────── */
.g-toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 60;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.g-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.g-tabs { display: flex; gap: 6px; flex-wrap: wrap; background: var(--off-white); padding: 5px; border-radius: 50px; }
.g-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border: none; background: transparent;
  font-family: inherit; font-size: .84rem; font-weight: 600; color: var(--muted);
  border-radius: 50px; cursor: pointer; transition: all .2s var(--ease); white-space: nowrap;
}
.g-tab:hover { color: var(--text); }
.g-tab.active { background: #fff; color: var(--purple); box-shadow: 0 2px 10px rgba(30,10,74,.12); }
.g-dot { width: 8px; height: 8px; border-radius: 50%; }
.g-selects { display: flex; gap: 10px; flex-wrap: wrap; }
.g-select-wrap { position: relative; }
.g-select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.g-select {
  appearance: none; -webkit-appearance: none;
  padding: 10px 36px 10px 16px; border: 1.5px solid var(--border); border-radius: 50px;
  background: #fff; font-family: inherit; font-size: .84rem; font-weight: 600; color: var(--text);
  cursor: pointer; transition: border-color .2s;
}
.g-select:hover, .g-select:focus { border-color: var(--purple-mid); outline: none; }
@media (max-width: 620px) {
  .g-toolbar-inner { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 0; }
  .g-tabs { justify-content: center; }
  .g-selects { justify-content: stretch; }
  .g-select-wrap { flex: 1; }
  .g-select { width: 100%; }
}

.gallery-count {
  font-size: .76rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); margin: 28px 0; font-weight: 700;
}
.gallery-count span { font-weight: 800; color: var(--purple); }

/* ── CLEAN UNIFORM GRID ─────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.gc {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--off-white);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .6s ease, translate .6s var(--ease);
}
.gc:hover { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(30,10,74,.2); }

@media (max-width: 980px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 540px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Reveal-on-scroll */
.reveal { opacity: 0; translate: 0 24px; }
.reveal.revealed { opacity: 1; translate: 0 0; }

.gallery-empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted); }
.gallery-empty svg { width: 46px; height: 46px; opacity: .35; margin-bottom: 12px; }
.gallery-empty p { font-size: .95rem; }
.gc.hidden { display: none; }

.gc-bg { position: absolute; inset: 0; transition: transform .6s var(--ease); }
.gc:hover .gc-bg { transform: scale(1.06); }
.gc-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.gc:hover .gc-photo { transform: scale(1.06); }
.gc-bg-missions { background: linear-gradient(135deg, #3b1278 0%, #7c3aed 100%); }
.gc-bg-sple     { background: linear-gradient(135deg, #7a5c00 0%, #c49b20 100%); }
.gc-bg-community { background: linear-gradient(135deg, #065f46 0%, #059669 100%); }
.gc-bg-alt { filter: hue-rotate(20deg) brightness(1.1); }

.gc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.05) 55%, transparent 100%);
}
.gc-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  color: rgba(255,255,255,.25);
  transition: transform .3s var(--ease), color .3s;
}
.gc:hover .gc-icon { color: rgba(255,255,255,.12); transform: translate(-50%,-60%) scale(.85); }
.gc-icon svg { width: 52px; height: 52px; }

.gc-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 18px 18px 16px;
  transform: translateY(8px);
  opacity: .92;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.gc:hover .gc-info { transform: translateY(0); opacity: 1; }
.gc-cat {
  display: inline-block;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 50px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}
.gc-cat.missions  { background: rgba(124,58,237,.85); }
.gc-cat.sple      { background: rgba(212,155,32,.9); }
.gc-cat.community { background: rgba(5,150,105,.85); }
.gc-info h4 { font-size: .92rem; font-weight: 700; color: #fff; margin-bottom: 3px; line-height: 1.3; }
.gc-big .gc-info h4 { font-size: 1.15rem; }
.gc-info p  { font-size: .73rem; color: rgba(255,255,255,.7); }

.gc-zoom {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  opacity: 0;
  transform: scale(.8) translateY(-4px);
  transition: opacity .25s, transform .25s var(--ease), background .2s;
  pointer-events: none;
}
.gc-zoom svg { width: 16px; height: 16px; }
.gc:hover .gc-zoom { opacity: 1; transform: scale(1) translateY(0); }

.gallery-placeholder-note {
  text-align: center;
  margin-top: 40px;
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
  padding: 14px 24px;
  background: var(--off-white);
  border-radius: 50px;
  border: 1px dashed var(--border);
  display: inline-block;
  width: 100%;
}

/* ── LIGHTBOX ───────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,5,25,.96);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 72px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lb-close {
  position: absolute;
  top: 24px; right: 28px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
  z-index: 10;
}
.lb-close:hover { background: rgba(255,255,255,.2); }
.lb-close svg { width: 18px; height: 18px; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  transition: background .2s, transform .2s var(--ease);
  z-index: 10;
}
.lb-nav:hover { background: rgba(124,58,237,.9); border-color: rgba(255,255,255,.6); }
.lb-prev { left: 28px; }
.lb-next { right: 28px; }
.lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) translateX(2px); }
.lb-nav svg { width: 20px; height: 20px; }

.lb-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  max-width: 96vw;
  margin: auto;            /* centers, but allows scroll when taller than screen */
}
/* The stage hugs the image's real shape — no forced letterbox */
.lb-visual {
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.lb-visual img {
  display: block;
  max-height: 84vh;        /* big — fills most of the screen height */
  max-width: 64vw;
  width: auto; height: auto;
  border-radius: 18px;
}
/* Placeholder (no real photo yet) gets a tidy fixed frame */
.lb-visual .lb-ph {
  width: min(52vw, 560px);
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
}
.lb-visual .lb-ph svg { width: 96px; height: 96px; }

.lb-meta { text-align: left; max-width: 340px; flex-shrink: 0; }
.lb-cat {
  display: inline-block;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 15px;
  border-radius: 50px;
  margin-bottom: 12px;
}
.lb-cat.missions  { background: rgba(124,58,237,.25); color: #c4b5fd; }
.lb-cat.sple      { background: rgba(196,155,32,.2);  color: #fcd34d; }
.lb-cat.community { background: rgba(5,150,105,.2);   color: #6ee7b7; }

.lb-title { font-family: 'Playfair Display', serif; font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; margin-bottom: 8px; line-height: 1.2; }
.lb-date  { font-size: .85rem; color: rgba(255,255,255,.55); margin-bottom: 14px; letter-spacing: .3px; }
.lb-desc  { font-size: .92rem; color: rgba(255,255,255,.7); line-height: 1.7; }

.lb-counter {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  font-size: .78rem;
  color: rgba(255,255,255,.45);
  font-weight: 600;
  letter-spacing: 1px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .lb-content { flex-direction: column; gap: 16px; }
  .lb-meta { text-align: center; max-width: 640px; }
  .lb-visual img { max-height: 60vh; max-width: 92vw; }
  .lb-visual .lb-ph { width: min(74vw, 560px); }
  /* Move the arrows to the bottom corners — always visible, easy to tap */
  .lb-nav { top: auto; bottom: 18px; transform: none; width: 48px; height: 48px; }
  .lb-prev { left: 18px; }
  .lb-next { right: 18px; }
  .lb-prev:hover, .lb-next:hover { transform: none; }
  .lb-counter { bottom: 30px; }
}
@media (max-width: 480px) {
  .lb-visual img { max-height: 52vh; }
  .lb-desc { display: none; }
}
