.gallery-page { background: var(--surface-soft); }
.gallery-section { padding: clamp(44px, 7vw, 90px) 0 clamp(70px, 10vw, 120px); }
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.gallery-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: #dfe6ec;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.gallery-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .35s ease;
}
.gallery-card::after {
  content: "View";
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,31,63,.88);
  color: #fff;
  font-family: Archivo, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease;
}
.gallery-card:hover img,
.gallery-card:focus-visible img { transform: scale(1.035); }
.gallery-card:hover::after,
.gallery-card:focus-visible::after { opacity: 1; transform: translateY(0); }

.gallery-dialog {
  width: min(1100px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: #081522;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.gallery-dialog::backdrop { background: rgba(0,14,28,.86); }
.gallery-dialog__inner { position: relative; }
.gallery-dialog img {
  width: 100%;
  max-height: calc(100dvh - 28px);
  object-fit: contain;
}
.gallery-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,31,63,.94);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.gallery-dialog__close:hover { background: var(--brand-green); }

@media (min-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (min-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
  .gallery-card:nth-child(7n + 1) { grid-row: span 2; }
  .gallery-card:nth-child(7n + 1) img { aspect-ratio: 4 / 6.2; }
}
@media (min-width: 1280px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (hover: none) {
  .gallery-card::after { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-card img, .gallery-card::after { transition: none; }
}

/* v5.0 gallery: an uneven photographic contact sheet. */
.gallery-page { background: #f5f3ed; }
.gallery-section { background: #f5f3ed; }
.gallery-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.gallery-card { grid-column: span 3; border-radius: 0; background: #10283b; }
.gallery-card:nth-child(7n + 1) { grid-column: span 6; grid-row: span 2; }
.gallery-card:nth-child(5n + 3) { grid-column: span 4; }
.gallery-card img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; }
.gallery-card::after { background: linear-gradient(0deg, rgba(16,40,59,.72), transparent 58%); }
.gallery-dialog { border-radius: 0; }
@media (max-width: 767px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gallery-card, .gallery-card:nth-child(7n + 1), .gallery-card:nth-child(5n + 3) { grid-column: span 1; grid-row: auto; }
  .gallery-card:nth-child(5n + 1) { grid-column: span 2; }
  .gallery-card img { min-height: 170px; }
}
