/* =====================================================================
   gallery.css — photo gallery grid, filters and lightbox
   ===================================================================== */

.gallery-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.gallery-filters button {
  padding: 8px 18px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--white); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: all .15s ease;
}
.gallery-filters button:hover { border-color: var(--navy); color: var(--navy); }
.gallery-filters button.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.gallery-item {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius-md);
  background: var(--paper); aspect-ratio: 4 / 3; border: 1px solid var(--border);
}
.gallery-item[hidden] { display: none; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.05); }
.gallery-item:focus-visible { outline: 3px solid var(--navy-mid); outline-offset: 2px; }
.gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; color: #fff; font-size: .9rem; line-height: 1.35;
  background: linear-gradient(to top, rgba(14, 53, 100, .88), rgba(14, 53, 100, 0));
  opacity: 0; transition: opacity .2s ease;
}
.gallery-item:hover .gallery-cap, .gallery-item:focus-visible .gallery-cap { opacity: 1; }
@media (hover: none) { .gallery-cap { opacity: 1; } }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 24, 46, .94); padding: 56px 64px;
}
.lb[hidden] { display: none; }
.lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lb-fig img { max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: 6px; background: #fff; }
.lb-fig figcaption { color: #fff; margin-top: 14px; text-align: center; max-width: 760px; font-size: 1rem; line-height: 1.5; }
.lb-close, .lb-nav {
  position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.lb-close:hover, .lb-nav:hover { background: var(--red); }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 3px solid #fff; }
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
@media (max-width: 575.98px) {
  .lb { padding: 56px 8px 24px; }
  .lb-nav { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .lb-fig img { max-height: calc(100vh - 190px); }
}
