/* ============================================================
   BSD ONE SECURITY — Gallery Page CSS
   Full image support · Masonry grid · Lightbox with nav
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.gallery-hero {
  position: relative;
  padding: 150px 0 70px;
  background: var(--black);
  overflow: hidden;
}

.gallery-hero-bg { position: absolute; inset: 0; pointer-events: none; }

.gallery-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 20%, transparent 80%);
}

.gallery-hero-glow {
  position: absolute;
  top: -60px; right: -60px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(192,32,42,0.13) 0%, transparent 65%);
}

.gallery-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.9;
  color: var(--white);
}

.gallery-hero h1 span { color: var(--red); }

.gallery-hero-sub {
  font-size: 1rem;
  color: var(--grey-300);
  max-width: 520px;
  margin-top: 18px;
  font-weight: 300;
  line-height: 1.7;
}

/* ── Filter Bar ───────────────────────────────────────────── */
.gallery-filter-bar-light {
  background: rgba(255,255,255,0.96);
  border-top: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 16px 0;
  position: sticky;
  top: 70px;
  z-index: 100;
  backdrop-filter: blur(16px);
}

.gallery-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gf-btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0,0,0,0.12);
  background: transparent;
  color: #555555;
  cursor: pointer;
  transition: var(--transition);
}

.gf-btn:hover,
.gf-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ── Masonry Grid ─────────────────────────────────────────── */
.gallery-section-light {
  background: #F8F8F8;
  padding: 48px 0 80px;
}

.gallery-masonry {
  columns: 3;
  column-gap: 16px;
}

@media (max-width: 991px) { .gallery-masonry { columns: 2; } }
@media (max-width: 575px)  { .gallery-masonry { columns: 1; } }

/* ── Gallery Item ─────────────────────────────────────────── */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  cursor: pointer;
}

.gallery-item-inner {
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.gallery-item:hover .gallery-item-inner {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 0 0 1px rgba(192,32,42,0.2);
  border-color: rgba(192,32,42,0.25);
}

/* ── Image area ───────────────────────────────────────────── */
.gallery-img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #E8E8E8;
  /* Heights vary by nth-child for masonry rhythm */
  min-height: 220px;
}

/* Vary masonry card heights */
.gallery-item:nth-child(3n+1) .gallery-img-wrap { min-height: 280px; }
.gallery-item:nth-child(3n+2) .gallery-img-wrap { min-height: 220px; }
.gallery-item:nth-child(3n)   .gallery-img-wrap { min-height: 320px; }
.gallery-item:nth-child(4)    .gallery-img-wrap { min-height: 240px; }
.gallery-item:nth-child(7)    .gallery-img-wrap { min-height: 200px; }
.gallery-item:nth-child(10)   .gallery-img-wrap { min-height: 340px; }

/* Real photo */
.gallery-img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img { transform: scale(1.05); }

/* Fallback shown when no image is set */
.gallery-img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #F0F0F0 0%, #E4E4E4 100%);
}

.gallery-img-fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent, transparent 20px,
    rgba(0,0,0,0.025) 20px, rgba(0,0,0,0.025) 40px
  );
}

.gallery-img-fallback i {
  font-size: 2.8rem;
  color: rgba(192,32,42,0.18);
  position: relative;
  z-index: 1;
}

.gallery-img-fallback span {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #AAAAAA;
  position: relative;
  z-index: 1;
}

/* ── Hover overlay ────────────────────────────────────────── */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
  opacity: 0;
  transition: opacity 0.32s ease;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  z-index: 2;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-overlay-content { width: 100%; }

.gallery-category-chip {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 5px;
}

.gallery-item-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--white);
  display: block;
  margin-bottom: 1px;
}

.gallery-item-meta {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
}

/* Zoom icon (top-right) */
.gallery-zoom {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.28s ease, background 0.2s ease;
  backdrop-filter: blur(6px);
  z-index: 3;
}

.gallery-item:hover .gallery-zoom { opacity: 1; }
.gallery-zoom:hover { background: var(--red); }

/* ── Caption strip below image ────────────────────────────── */
.gallery-caption {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #FFFFFF;
}

.gc-title {
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 700;
  color: #111111;
  display: block;
}

.gc-sub {
  font-size: 0.7rem;
  color: #888888;
  margin-top: 2px;
  display: block;
}

/* ════════════════════════════════════════════════════════════
   LIGHTBOX
   Full-screen image viewer with prev/next + close
════════════════════════════════════════════════════════════ */
.bsd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bsd-lightbox.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Lightbox panel ───────────────────────────────────────── */
.lightbox-panel {
  position: relative;
  width: 92vw;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0,0,0,0.8);
  animation: lb-in 0.3s ease forwards;
}

@keyframes lb-in {
  from { transform: scale(0.94) translateY(16px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);     opacity: 1; }
}

/* ── Image area ───────────────────────────────────────────── */
.lightbox-img-area {
  flex: 1;
  background: #0A0A0A;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 70vh;
  overflow: hidden;
  position: relative;
}

/* Actual image */
.lightbox-img-area img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  border-radius: 0;
  transition: opacity 0.2s ease;
}

/* Fallback icon when no image */
.lightbox-icon-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-icon-fallback i {
  font-size: 6rem;
  color: rgba(192,32,42,0.3);
}

.lightbox-icon-fallback span {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

/* Loading state */
.lightbox-img-area.is-loading::after {
  content: '';
  position: absolute;
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Info bar ─────────────────────────────────────────────── */
.lightbox-info {
  background: var(--black-card);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.lightbox-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lightbox-chip {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.lightbox-title-text {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-meta-text {
  font-size: 0.72rem;
  color: var(--grey-500);
  white-space: nowrap;
}

/* Counter "3 / 16" */
.lightbox-counter {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--grey-700);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ── Close button ─────────────────────────────────────────── */
.lightbox-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 42px; height: 42px;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
  backdrop-filter: blur(6px);
}

.lightbox-close:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.08);
}

/* ── Prev / Next arrows ───────────────────────────────────── */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(6px);
  z-index: 10;
  user-select: none;
}

.lightbox-arrow:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-50%) scale(1.08);
}

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

.lightbox-arrow.disabled {
  opacity: 0.25;
  pointer-events: none;
}

/* ── Keyboard hint ────────────────────────────────────────── */
.lightbox-kbd-hint {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.lightbox-kbd-hint kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Hide hint after 3s via JS class */
.lightbox-kbd-hint.fade-out { opacity: 0; }

/* ── Stats row ────────────────────────────────────────────── */
.gallery-stats-row-light {
  background: #FFFFFF;
  border-top: 1px solid rgba(0,0,0,0.07);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  padding: 48px 0;
}

.gallery-stat-item { text-align: center; padding: 0 24px; }

.gallery-stat-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: #111111;
  line-height: 1;
}

.gallery-stat-num span { color: var(--red); }
.gallery-stat-num .accent { color: var(--red); }

.gallery-stat-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888888;
  margin-top: 6px;
  display: block;
}

/* ── Social CTA ───────────────────────────────────────────── */
.gallery-social-cta-light {
  background: #F8F8F8;
  padding: 80px 0;
  text-align: center;
}

.gallery-social-cta-light h2 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  color: #111111;
}

.gallery-social-cta-light h2 span { color: var(--red); }
.gallery-social-cta-light .section-label { color: var(--red); }
.gallery-social-cta-light .text-grey { color: #555555; }

.social-handle-chips {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.social-handle-chip,
.social-handle-chip-light {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: #444444;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.social-handle-chip:hover,
.social-handle-chip-light:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(192,32,42,0.04);
  transform: translateY(-2px);
}

.social-handle-chip i,
.social-handle-chip-light i { color: var(--red); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .lightbox-panel { width: 96vw; border-radius: var(--radius-lg); }
  .lightbox-arrow { width: 38px; height: 38px; font-size: 0.9rem; }
  .lightbox-arrow.prev { left: 8px; }
  .lightbox-arrow.next { right: 8px; }
  .lightbox-info { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .lightbox-kbd-hint { display: none; }
}