/* ==========================================================================
   Layout system A — GALLERY
   --------------------------------------------------------------------------
   Used by: terrarium ($850)
   Reference: a museum shop catalogue. Generous, unhurried, single column of
   thought with objects placed on it.

   WHAT MAKES THIS DIFFERENT FROM THE OTHER FOUR
     · one column, 980px, never wider — the page reads top to bottom
     · an oversized standfirst paragraph, 30px, that IS the design
     · full-bleed image bands with a caption tucked underneath
     · an alternating list of rows: image left / image right, no grid
     · numbered index below the fold, like a contents page
     · NO two-column hero, NO card grid on the homepage, NO sidebar

   Requires core.css.
   ========================================================================== */

.gal-page {
  width: min(980px, 100% - 44px);
  margin-inline: auto;
}

.gal-page-wide {
  width: min(1240px, 100% - 44px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- opening */
.gal-open {
  padding: clamp(52px, 9vw, 118px) 0 clamp(34px, 5vw, 58px);
}

.gal-open h1 {
  font-size: clamp(2.35rem, 6.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 17ch;
  margin-bottom: 0.35em;
}

/* the oversized standfirst. 30px is deliberately far above normal body copy:
   on a gallery page this paragraph carries the design, not the layout. */
.gal-stand {
  font-size: clamp(1.18rem, 2.5vw, 1.85rem);
  line-height: 1.42;
  letter-spacing: -0.018em;
  color: var(--d-ink);
  max-width: 34ch;
  margin: 0 0 1.1em;
}

.gal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding-top: 22px;
  border-top: 1px solid var(--d-line);
  font-size: 0.85rem;
  color: var(--d-muted);
}

/* ------------------------------------------------------------ image bands */
.gal-band {
  margin: clamp(40px, 6vw, 78px) 0;
}

.gal-band-img {
  aspect-ratio: 21 / 9;
  border-radius: var(--d-radius);
  background:
    radial-gradient(ellipse at 30% 40%,
      color-mix(in srgb, var(--d-accent) 30%, var(--d-surface)),
      var(--d-surface) 68%);
  display: grid;
  place-items: center;
  font-family: var(--d-font);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: color-mix(in srgb, var(--d-ink) 38%, transparent);
}

.gal-band-cap {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--d-muted);
}

/* ------------------------------------------------- alternating object rows */
.gal-row {
  display: grid;
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  padding: clamp(30px, 5vw, 56px) 0;
  border-top: 1px solid var(--d-line);
}

@media (min-width: 780px) {
  .gal-row { grid-template-columns: 1fr 1fr; }
  .gal-row-flip .gal-row-img { order: 2; }
}

.gal-row-img {
  aspect-ratio: 4 / 3;
  border-radius: var(--d-radius);
  background:
    radial-gradient(circle at 60% 35%,
      color-mix(in srgb, var(--d-accent) 24%, var(--d-surface)),
      var(--d-surface) 70%);
}

.gal-row h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
  margin-bottom: 0.3em;
}

.gal-row p {
  color: var(--d-muted);
  max-width: 46ch;
}

.gal-row .gal-num {
  font-family: var(--d-font);
  font-size: 0.9rem;
  color: var(--d-accent);
  display: block;
  margin-bottom: 10px;
}

/* ------------------------------------------------------ the contents index */
.gal-index {
  border-top: 1px solid var(--d-line);
  margin-top: clamp(40px, 6vw, 70px);
}

.gal-index-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--d-line);
  text-decoration: none;
  transition: padding-left 0.24s cubic-bezier(0.16, 0.84, 0.28, 1),
              color 0.24s ease;
}

.gal-index-item:hover {
  padding-left: 10px;
  color: var(--d-accent);
}

.gal-index-item .gal-i {
  font-family: var(--d-font);
  font-size: 0.85rem;
  color: var(--d-muted);
}

.gal-index-item .gal-t {
  font-family: var(--d-font);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -0.015em;
}

.gal-index-item .gal-p {
  font-size: 0.9rem;
  color: var(--d-muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------- full bleed */
.gal-bleed {
  background: color-mix(in srgb, var(--d-ink) 4%, var(--d-bg));
  padding: clamp(46px, 7vw, 92px) 0;
  margin: clamp(40px, 6vw, 76px) 0;
}

/* a quiet, wide quote — not the shared .d-quote */
.gal-quiet {
  font-family: var(--d-font);
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
  line-height: 1.36;
  letter-spacing: -0.02em;
  max-width: 30ch;
  margin: 0;
}

.gal-quiet-src {
  display: block;
  margin-top: 18px;
  font-family: var(--d-sans);
  font-size: 0.85rem;
  letter-spacing: 0;
  color: var(--d-muted);
}

@media (max-width: 620px) {
  .gal-index-item { grid-template-columns: 34px 1fr; }
  .gal-index-item .gal-p { grid-column: 2; }
}
