.gallery-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

.gallery-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
}

.gallery-back,
.gallery-bottom-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.gallery-back:hover,
.gallery-bottom-link:hover { color: var(--text); }

.gallery-kicker {
  margin: 30px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.gallery-intro h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.gallery-description {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.gallery-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 105px;
  height: 105px;
  margin: 0;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 50%;
  line-height: 1.1;
}

.gallery-count strong { font-size: 35px; letter-spacing: -.06em; }
.gallery-count span { color: var(--muted); font-size: 12px; }

.gallery-grid { columns: 4 220px; column-gap: 16px; }

.artwork-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .05);
  vertical-align: top;
  transition: transform .2s ease, box-shadow .2s ease;
}

.artwork-card:hover,
.artwork-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 9px 25px rgba(0, 0, 0, .12);
}

.artwork-card a { display: block; background: #f2f2f0; }
.artwork-card a:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.artwork-card img { display: block; width: 100%; height: auto; }

.artwork-card figcaption {
  padding: 12px 14px 13px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.gallery-bottom-link { display: inline-block; margin-top: 26px; }

body.night-mode .gallery-intro,
body.night-mode .gallery-count { border-color: rgba(255, 255, 255, .18); }

body.night-mode .gallery-back:hover,
body.night-mode .gallery-bottom-link:hover { color: #fff; }

body.night-mode .artwork-card {
  background: #1b1b1b;
  border-color: rgba(255, 255, 255, .12);
  box-shadow: none;
}

body.night-mode .artwork-card a { background: #292929; }

@media (max-width: 700px) {
  .gallery-page { padding: 36px 18px 64px; }
  .gallery-intro { align-items: start; }
  .gallery-count { width: 75px; height: 75px; }
  .gallery-count strong { font-size: 26px; }
  .gallery-grid { columns: 2 170px; column-gap: 12px; }
  .artwork-card { margin-bottom: 12px; }
}

@media (max-width: 520px) {
  .gallery-grid { columns: 1; }
}

@media (max-width: 420px) {
  .gallery-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .artwork-card { transition: none; }
}
