/* Helpful Tech montage + slideshow.
   One component, used on case studies, /accessibility and /technology.
   Keyboard first: every thumbnail is a real button, the viewer traps focus,
   Escape closes, arrows move, and every frame carries a written caption. */

.gal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin: 1.4rem 0 .6rem;
}
.gal-b {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream, #E9DFCC);
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
}
.gal-b img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.gal-b:hover img, .gal-b:focus-visible img { transform: scale(1.04); }
.gal-b:focus-visible { outline: 3px solid var(--terracotta, #C04A2E); outline-offset: 2px; }
/* Feature the first frame across two columns on wider screens. */
.gal-b:first-child { grid-column: span 2; aspect-ratio: 3 / 2; }
@media (max-width: 520px) {
  .gal { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gal-b:first-child { grid-column: span 2; }
}

.gal-hint {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft, #4A453E);
  margin: 0 0 2rem;
}

/* ── Viewer ── */
.galv[hidden] { display: none !important; }
.galv {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(16, 14, 12, .95);
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.galv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  color: #EFE7D8;
}
.galv-count {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  letter-spacing: .1em;
}
.galv-x {
  background: none;
  border: 1px solid rgba(239,231,216,.35);
  color: #EFE7D8;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.galv-x:hover { background: rgba(239,231,216,.12); }
.galv-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 0;
}
.galv-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.galv-nav {
  background: rgba(239,231,216,.1);
  border: 1px solid rgba(239,231,216,.3);
  color: #EFE7D8;
  border-radius: 999px;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.galv-nav:hover { background: rgba(239,231,216,.22); }
.galv-nav:disabled { opacity: .25; cursor: default; }
.galv-cap {
  flex: 0 0 auto;
  color: #DCD3C3;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  max-width: 720px;
  margin: 12px auto 4px;
}
.galv :focus-visible { outline: 2px solid #EFE7D8; outline-offset: 2px; }
@media (max-width: 520px) {
  .galv-nav { width: 40px; height: 40px; }
  .galv-cap { font-size: 13px; }
}
