/* ==========================================================================
   Brandcrest Gallery Module
   Self-contained, prefixed with .bc- to avoid collisions on integration.
   Drop this file + bc-gallery.js + /images into any page.
   ========================================================================== */

.bc-gallery-root {
  --bc-navy: #1B2A38;
  --bc-navy-soft: #24374A;
  --bc-white: #FFFFFF;
  --bc-steel: #6B7280;
  --bc-ink: #14181C;
  --bc-chalk: #FAFAF7;

  --bc-font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --bc-font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --bc-font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  background: var(--bc-white);
  color: var(--bc-ink);
  font-family: var(--bc-font-body);
  -webkit-font-smoothing: antialiased;
  padding: 0 0 clamp(3rem, 6vw, 5rem);
}

.bc-gallery-root * {
  box-sizing: border-box;
}

.bc-gallery-root img {
  display: block;
  max-width: 100%;
}

/* ---------- Banner ---------- */

.bc-banner {
  background: var(--bc-navy);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 5vw, 3rem);
}

.bc-banner-mark {
  font-family: var(--bc-font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  color: var(--bc-white);
}

/* ---------- Grid ---------- */

.bc-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 0;
  columns: 4 260px;
  column-gap: 1.1rem;
}

@media (max-width: 900px) {
  .bc-grid { columns: 2 220px; }
}

@media (max-width: 520px) {
  .bc-grid { columns: 1; }
}

.bc-card {
  position: relative;
  break-inside: avoid;
  margin: 0 0 1.1rem;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bc-navy);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bc-card.bc-hide {
  display: none;
}

.bc-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
  filter: saturate(0.94) contrast(1.02);
}

.bc-card:hover img {
  transform: scale(1.045);
  filter: saturate(1.05) contrast(1.04);
}

.bc-card:focus-visible {
  outline: 3px solid var(--bc-navy);
  outline-offset: -3px;
}

/* ---------- Empty state ---------- */

.bc-empty {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem clamp(1.25rem, 5vw, 3rem);
  font-family: var(--bc-font-mono);
  color: var(--bc-steel);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.bc-empty.bc-show {
  display: block;
}

/* ---------- Lightbox ---------- */

.bc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  padding: clamp(1rem, 4vw, 3rem);
}

.bc-lightbox.bc-open {
  opacity: 1;
  visibility: visible;
}

.bc-lightbox-inner {
  position: relative;
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bc-lightbox-img-wrap {
  position: relative;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bc-lightbox img {
  max-height: 78vh;
  width: auto;
  max-width: 100%;
  border-radius: 3px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.bc-lb-btn {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(250, 250, 247, 0.35);
  color: var(--bc-chalk);
  width: 42px;
  height: 42px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease;
  font-family: var(--bc-font-mono);
}

.bc-lb-btn:hover {
  background: var(--bc-white);
  border-color: var(--bc-white);
  color: var(--bc-navy);
}

.bc-lb-btn:focus-visible {
  outline: 2px solid var(--bc-white);
  outline-offset: 2px;
}

.bc-lb-close {
  top: -56px;
  right: 0;
}

.bc-lb-prev {
  left: -56px;
  top: 50%;
  transform: translateY(-50%);
}

.bc-lb-next {
  right: -56px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 760px) {
  .bc-lb-prev { left: 4px; }
  .bc-lb-next { right: 4px; }
  .bc-lb-close { top: -48px; right: 4px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .bc-gallery-root * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
