/* ============================================================
   AquaLayer™ — gallery.css
   Deck-aligned with home/about: pearl cases + closing.
   ============================================================ */

.gallery-hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 110px));
  padding-bottom: clamp(48px, 6vw, 88px);
  overflow: hidden;
}
.gallery-hero .breadcrumb { margin-bottom: var(--s5); }
.gallery-hero .eyebrow { color: var(--tide); }
.gallery-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 0.7rem + 5.2vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  max-width: 12ch;
  margin-top: var(--s3);
  color: var(--pearl);
}
.gallery-hero__lead {
  margin-top: var(--s5);
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 48ch;
  font-weight: 300;
}
.gallery-hero__note {
  margin-top: var(--s4);
  max-width: 52ch;
  font-size: .9rem;
  line-height: 1.5;
  color: rgba(240,240,224,.55);
  font-weight: 400;
}

.gallery-empty {
  grid-column: 1 / -1;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: rgba(0,16,32,.55);
  margin: var(--s4) 0;
}

/* Filter — sharp edges, not pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--s6);
}
.filter-btn {
  border: 1px solid rgba(0,16,32,.14);
  border-radius: 0;
  padding: 10px 16px;
  min-height: 44px;
  font-family: var(--font-tech);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(0,16,32,.5);
  background: transparent;
  transition: border-color .35s var(--ease), color .35s var(--ease);
}
.filter-btn:hover {
  border-color: rgba(0,16,32,.4);
  color: var(--abyss);
}
.filter-btn.is-active {
  border-color: var(--abyss);
  color: var(--abyss);
}

/* Cases */
.case-grid {
  display: grid;
  gap: var(--s5) clamp(16px, 2vw, 28px);
  grid-template-columns: 1fr;
  max-width: 56rem;
  margin-inline: auto;
}
@media (min-width: 720px) {
  .case-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .case-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
  }
}
.case {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.case[hidden] { display: none; }
.case__media {
  margin: 0 0 var(--s3);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(0,16,32,.08);
}
.case__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case__media--video {
  position: relative;
}
.case__video-fallback {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(0,16,32,.55), rgba(88,164,180,.35)),
    rgba(0,16,32,.2);
}
.case__play {
  position: absolute;
  inset: auto auto 14px 14px;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  font-size: .7rem;
  letter-spacing: 0;
  color: var(--pearl);
  background: rgba(0,8,16,.72);
  border: 1px solid rgba(240,240,224,.35);
  pointer-events: none;
}
.case__open[aria-label*="Open"] .case__media--video {
  cursor: pointer;
}
.case h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--abyss);
  margin: 0 0 8px;
}
.band-pearl .case-cap {
  color: rgba(0,16,32,.48);
}
.band-pearl .case-cap b {
  color: var(--tide);
  font-weight: 500;
}

/* Case open control */
.case__open {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 var(--s3);
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
  position: relative;
}
.case__open:focus-visible {
  outline: 1px solid var(--tide);
  outline-offset: 3px;
}
.case__open .case__media { margin: 0; }
.case__open::after {
  content: 'View';
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-family: var(--font-tech);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pearl);
  background: rgba(0,16,32,.55);
  padding: 8px 12px;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.case__open:hover::after,
.case__open:focus-visible::after { opacity: 1; }

/* ---------- Album viewer ---------- */
html.album-open { overflow: hidden; }

.album {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
}
.album[hidden] { display: none; }

.album__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 8, 16, .92);
  cursor: pointer;
}

.album__stage {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: min(92vh, 920px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--s4);
  outline: none;
}

.album__figure {
  margin: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: var(--abyss-deep);
  border: 1px solid rgba(240,240,224,.1);
  overflow: hidden;
  max-height: min(72vh, 720px);
}
.album__figure img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(72vh, 720px);
  object-fit: contain;
}
.album__video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(72vh, 720px);
  background: #000;
  object-fit: contain;
}

.album__meta {
  display: grid;
  gap: 8px;
  color: var(--pearl);
  padding-inline: 2px;
}
.album__count {
  margin: 0;
  font-family: var(--font-tech);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tide);
}
.album__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pearl);
}
.album__cap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-family: var(--font-tech);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(240,240,224,.55);
}
.album__cap b {
  color: var(--tide);
  font-weight: 500;
}

.album__close,
.album__nav {
  position: absolute;
  border: 1px solid rgba(240,240,224,.22);
  background: rgba(0,16,32,.55);
  color: var(--pearl);
  cursor: pointer;
  font-family: var(--font-tech);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: border-color .3s var(--ease), color .3s var(--ease), background-color .3s var(--ease);
}
.album__close:hover,
.album__nav:hover:not(:disabled) {
  border-color: var(--tide);
  color: var(--tide);
}
.album__close:disabled,
.album__nav:disabled {
  opacity: .35;
  cursor: default;
}

.album__close {
  top: 0;
  right: 0;
  z-index: 2;
  width: 48px;
  height: 48px;
  font-size: .75rem;
}

.album__nav {
  top: 42%;
  transform: translateY(-50%);
  z-index: 2;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  font-size: .7rem;
}
.album__nav--prev { left: 0; }
.album__nav--next { right: 0; }

@media (max-width: 719px) {
  .album__nav {
    top: auto;
    bottom: 0;
    transform: none;
  }
  .album__nav--prev { left: 0; }
  .album__nav--next { right: 0; left: auto; }
  .album__close { top: -4px; right: -4px; }
  .album__stage {
    padding-bottom: 56px;
    max-height: 96vh;
  }
  .case__open::after { opacity: 1; }
}
