/* ==========================================================================
   BCT Expo 2026 — article photo gallery + lightbox
   Additive stylesheet: every rule is scoped to .bct-gallery / .bct-lb, so it
   cannot affect any other page or component. Uses the site's existing
   font variables and navy palette.
   ========================================================================== */

.bct-gallery {
  --bct-navy: #0d2347;
  --bct-navy-deep: #0b1a31;
  --bct-gold: #d4af37;
  --bct-gold-soft: #e9cf7a;
  --bct-copy: #bccbe0;
  margin: 2.75rem 0 2.5rem;
}

/* ---------- Heading block ---------- */
.bct-gallery .bct-gallery__head {
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(30, 48, 80, 0.12);
  position: relative;
}
.bct-gallery .bct-gallery__head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 64px;
  height: 2px;
  background: var(--bct-gold);
}
.bct-gallery .bct-gallery__title {
  font-family: var(--font-heading, "Poppins", sans-serif);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.25;
  color: var(--navy, #0b1a31);
  margin: 0 0 0.45rem;
}
.bct-gallery .bct-gallery__subtitle {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted, #4a6080);
  margin: 0;
  max-width: 60ch;
}

/* ---------- Grid ---------- */
.bct-gallery .bct-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Card ---------- */
.bct-gallery .bct-gallery__grid > li {
  display: flex;
  margin: 0;
  padding: 0;
}
.bct-gallery .bct-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: linear-gradient(180deg, var(--bct-navy) 0%, var(--bct-navy-deep) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(11, 26, 49, 0.2);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.bct-gallery .bct-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.65);
  box-shadow: 0 12px 28px rgba(11, 26, 49, 0.3);
}

.bct-gallery .bct-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #08142a;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.bct-gallery .bct-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% var(--focus-y, 50%);
  transition: transform 0.5s ease;
}
.bct-gallery .bct-card:hover .bct-card__media img {
  transform: scale(1.03);
}
.bct-gallery .bct-card__zoom {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(11, 26, 49, 0.78);
  border: 1px solid rgba(212, 175, 55, 0.7);
  color: var(--bct-gold-soft);
  font-size: 0.72rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.bct-gallery .bct-card:hover .bct-card__zoom,
.bct-gallery .bct-card__media:focus-visible .bct-card__zoom {
  opacity: 1;
  transform: scale(1);
}
.bct-gallery .bct-card__media:focus-visible {
  outline: 2px solid var(--bct-gold-soft);
  outline-offset: -3px;
}

.bct-gallery .bct-card__body {
  position: relative;
  padding: 1.05rem 1rem 1.1rem;
  border-top: 2px solid var(--bct-gold);
  flex: 1;
}
.bct-gallery .bct-card__title {
  font-family: var(--font-heading, "Poppins", sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #ffffff;
  margin: 0 0 0.4rem;
}
.bct-gallery .bct-card__desc {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--bct-copy);
  margin: 0;
}

/* ---------- Tablet / mobile grid ---------- */
@media (max-width: 768px) {
  .bct-gallery .bct-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}
@media (max-width: 520px) {
  .bct-gallery {
    margin: 2.25rem 0 2rem;
  }
  .bct-gallery .bct-gallery__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
  .bct-gallery .bct-card__desc {
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.bct-lb {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 14, 28, 0.93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.bct-lb[hidden] {
  display: none;
}
.bct-lb.is-open {
  opacity: 1;
}

.bct-lb__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  width: min(1000px, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  background: var(--bct-navy, #0d2347);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.22s ease;
}
.bct-lb.is-open .bct-lb__panel {
  transform: none;
}

.bct-lb__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #060f20;
}
.bct-lb__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  object-fit: contain;
  transition: opacity 0.18s ease;
}
.bct-lb__img.is-swapping {
  opacity: 0;
}

.bct-lb__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.75rem 1.75rem;
  border-left: 1px solid rgba(212, 175, 55, 0.25);
  overflow-y: auto;
}
.bct-lb__count {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bct-gold-soft, #e9cf7a);
  margin: 0 0 0.85rem;
}
.bct-lb__count::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-top: 0.7rem;
  background: var(--bct-gold, #d4af37);
}
.bct-lb__title {
  font-family: var(--font-heading, "Poppins", sans-serif);
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.75rem;
}
.bct-lb__desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #c9d6e8;
  margin: 0;
}
.bct-lb__source {
  margin: 1.5rem 0 0;
  font-size: 0.75rem;
  color: rgba(201, 214, 232, 0.6);
}

/* Buttons (close / prev / next) */
.bct-lb__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.7);
  background: rgba(11, 26, 49, 0.82);
  color: var(--bct-gold-soft, #e9cf7a);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.bct-lb__btn:hover {
  background: var(--bct-gold, #d4af37);
  color: var(--bct-navy-deep, #0b1a31);
}
.bct-lb__btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.bct-lb__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
}
.bct-lb__prev,
.bct-lb__next {
  position: absolute;
  top: 50%;
  z-index: 2;
  margin-top: -22px;
}
.bct-lb__prev {
  left: 0.75rem;
}
.bct-lb__next {
  right: 0.75rem;
}

/* Lightbox on tablets/phones: stack image over caption */
@media (max-width: 820px) {
  .bct-lb {
    padding: 0.5rem;
  }
  .bct-lb__panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, auto) auto;
    width: min(560px, 100%);
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
  }
  .bct-lb__img {
    max-height: 62vh;
    max-height: 62dvh;
  }
  .bct-lb__info {
    justify-content: flex-start;
    padding: 1.25rem 1.25rem 1.5rem;
    border-left: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    overflow: visible;
  }
  .bct-lb__title {
    font-size: 1.1rem;
  }
  .bct-lb__desc {
    font-size: 0.92rem;
  }
  .bct-lb__source {
    margin-top: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bct-gallery .bct-card,
  .bct-gallery .bct-card__media img,
  .bct-gallery .bct-card__zoom,
  .bct-lb,
  .bct-lb__panel,
  .bct-lb__img {
    transition: none !important;
  }
  .bct-gallery .bct-card:hover {
    transform: none;
  }
  .bct-gallery .bct-card:hover .bct-card__media img {
    transform: none;
  }
}
