/* ============================================================
   ARTWORK GALLERY — standalone sheet (light / dark comparison)
   Adapted from the restraint of levonbiss.com: images dominate,
   interface recedes, generous air.
   ============================================================ */

/* The gallery now lives inside the site shell. Its own palette variables
   are aliased to the site's, so there is exactly one source of colour. */
:root {
  --g-bg: var(--bg);      --g-bg-2: var(--bg-2);   --g-ink: var(--ink);
  --g-ink-2: var(--ink-2);--g-muted: var(--muted); --g-line: var(--line);
  --g-line-2: var(--line-2); --g-accent: var(--accent);
  --g-btn-bg: var(--btn-bg); --g-btn-ink: var(--btn-ink);
  --g-shadow: var(--shadow); --g-tile-bg: var(--bg-3);
}

* { box-sizing: border-box; }

/* ----------  HEADER  ---------- */

/* ----------  TITLE BLOCK  ---------- */
.gal-meta {
  margin-top: 1.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g-muted);
}

/* ----------  FILTER ROW  ---------- */

/* ----------  GRID  ---------- */
.gal-grid { padding-bottom: clamp(4rem, 9vw, 8rem); }

/* Sizes step down as you go: the board's top 24 largest, then 25-60, 61-100,
   and the rest (grouped by color) smallest. The tier comes from
   js/art-catalog.js; with no catalog every piece is tier 1. */
.gal-tier {
  display: grid;
  grid-auto-flow: dense;   /* a landscape piece spans two columns; the next piece fills any gap it leaves */
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.6rem, 3.4vw, 3.4rem) clamp(1.2rem, 2.6vw, 2.6rem);
}
.gal-tier + .gal-tier { margin-top: clamp(1.6rem, 3.4vw, 3.4rem); }
.gal-tier[hidden] { display: none; }
.gal-tier-2 { grid-template-columns: repeat(4, 1fr); gap: clamp(1.3rem, 2.8vw, 2.8rem) clamp(1rem, 2.2vw, 2.2rem); }
.gal-tier-3 { grid-template-columns: repeat(5, 1fr); gap: clamp(1.1rem, 2.2vw, 2.2rem) clamp(0.9rem, 1.8vw, 1.8rem); }
.gal-tier-4 { grid-template-columns: repeat(7, 1fr); gap: clamp(0.9rem, 1.6vw, 1.6rem) clamp(0.6rem, 1.2vw, 1.2rem); }
.gal-tier-3 .gal-title { font-size: 0.95rem; }
.gal-tier-3 .gal-caption { flex-direction: column; gap: 0.1rem; padding-top: 0.6rem; }
.gal-tier-4 .gal-title { font-size: 0.86rem; }
.gal-tier-4 .gal-caption { flex-direction: column; gap: 0; padding-top: 0.45rem; }
.gal-tier-4 .gal-price { font-size: 0.66rem; }
@media (max-width: 1000px) {
  .gal-tier-1 { grid-template-columns: repeat(2, 1fr); }
  .gal-tier-2 { grid-template-columns: repeat(3, 1fr); }
  .gal-tier-3 { grid-template-columns: repeat(4, 1fr); }
  .gal-tier-4 { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 600px) {
  .gal-tier-1 { grid-template-columns: 1fr; }
  .gal-tier-2, .gal-tier-3 { grid-template-columns: repeat(2, 1fr); }
  .gal-tier-4 { grid-template-columns: repeat(3, 1fr); }
  .gal-tier-4 .gal-price { display: none; }
}

.gal-item {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.gal-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  container-type: size;   /* lets the hover frame size itself against the tile's height (cqh) */
  overflow: hidden;
  background: var(--g-tile-bg);
}
.gal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1200ms cubic-bezier(0.16,1,0.3,1), opacity 600ms ease;
}
.gal-item:hover .gal-thumb img,
.gal-item:focus-visible .gal-thumb img { transform: scale(1.035); }

.gal-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
}
.gal-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.04rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--g-ink);
  line-height: 1.3;
}
.gal-price {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--g-muted);
  white-space: nowrap;
}

/* ----------  DETAIL OVERLAY  ---------- */
.gal-detail {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  background: var(--g-bg);
}
.gal-detail.is-open { display: block; }
.gal-detail-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
}
@media (max-width: 900px) {
  .gal-detail-inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
}

.gal-detail-media {
  background: var(--g-bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 4rem);
  min-height: 0;
}
.gal-detail-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  box-shadow: var(--g-shadow);
}
@media (max-width: 900px) {
  .gal-detail-media { padding: 4.5rem 1.25rem 1.5rem; }
  .gal-detail-media img { max-height: 54vh; }
}

.gal-detail-buy {
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.5rem, 3.5vw, 3.5rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: safe center;   /* "safe": when the content is taller than the panel, start at the top so the title can't be cut off */
  border-left: 1px solid var(--g-line);
}
@media (max-width: 900px) {
  .gal-detail-buy { border-left: 0; border-top: 1px solid var(--g-line); justify-content: flex-start; }
}

.gal-detail-buy h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  line-height: 1.08;
  margin: 0 0 0.5rem;
  color: var(--g-ink);
}
.gal-detail-sub {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g-muted);
  margin: 0 0 1.8rem;
}
.gal-detail-desc {
  font-size: 0.93rem;
  line-height: 1.75;
  color: var(--g-ink-2);
  margin: 0 0 2rem;
  max-width: 44ch;
}

.gal-field { margin-bottom: 1.4rem; max-width: 380px; }
.gal-field label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g-muted);
  margin-bottom: 0.55rem;
}
.gal-field select {
  width: 100%;
  appearance: none;
  background: transparent;
  border: 1px solid var(--g-line-2);
  color: var(--g-ink);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.85rem 2.6rem 0.85rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 54%, calc(100% - 14px) 54%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.gal-field select:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }

.gal-pricebar {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin: 0 0 1.6rem;
}
.gal-pricebar .amt {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--g-ink);
}
.gal-pricebar .note { font-size: 0.76rem; color: var(--g-muted); letter-spacing: 0.06em; }

.gal-btn {
  appearance: none;
  border: 1px solid var(--g-btn-bg);
  background: var(--g-btn-bg);
  color: var(--g-btn-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1.05rem 2.2rem;
  border-radius: 999px;
  cursor: pointer;
  max-width: 380px;
  transition: opacity 200ms ease, transform 200ms ease;
}
.gal-btn:hover { opacity: 0.84; }
.gal-btn:active { transform: translateY(1px); }
.gal-btn.ghost {
  background: transparent;
  color: var(--g-ink);
  border-color: var(--g-line-2);
  margin-top: 0.7rem;
}

.gal-fineprint {
  margin-top: 1.8rem;
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--g-muted);
  max-width: 40ch;
}
.gal-fineprint strong { color: var(--g-ink-2); font-weight: 500; }

/* detail chrome */
/* the hidden attribute must beat our own display rule below */
.gal-x[hidden], .gal-prev[hidden], .gal-next[hidden] { display: none !important; }
.gal-x, .gal-prev, .gal-next {
  position: fixed;
  z-index: 310;
  appearance: none;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--g-line-2);
  background: var(--g-bg);
  color: var(--g-ink);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease, border-color 200ms ease;
}
.gal-x:hover, .gal-prev:hover, .gal-next:hover { border-color: var(--g-ink); }
.gal-x    { top: 1.25rem; right: 1.25rem; }
.gal-prev { top: 50%; left: 1.25rem; transform: translateY(-50%); }
.gal-next { top: 50%; left: 4.6rem; transform: translateY(-50%); }
@media (max-width: 900px) {
  .gal-prev { top: 1.25rem; left: 1.25rem; transform: none; }
  .gal-next { top: 1.25rem; left: 4.6rem; transform: none; }
}

/* ----------  THEME SWITCH (preview only)  ---------- */
@media (max-width: 860px) { .gal-note { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   FRAME-ON-WALL HOVER
   Rendered in CSS, not as 46 x N baked mockup images:
   perfectly uniform by construction, restyleable in one line,
   sharp at any resolution, and adds zero page weight.
   ============================================================ */

/* ---- frame presets (set data-frame on <html>) ---- */
/* Defaults on :root so the effect never depends on JS setting an attribute.
   The [data-frame="..."] blocks below remain as overrides. */
:root,
[data-frame="black"] {
  --fr-wall:      #D6D1C9;
  --fr-wall-2:    #C6C0B6;
  --fr-moulding:  linear-gradient(145deg, #2A2724 0%, #14110E 45%, #0A0908 100%);
  --fr-edge:      rgba(255,255,255,0.14);
  --fr-mat:       #FBFAF7;
  --fr-width:     7px;
  --fr-mat-pad:   7%;
  --fr-scale:     66%;
}
[data-frame="oak"] {
  --fr-wall:      #E4DED3;
  --fr-wall-2:    #D5CEC1;
  --fr-moulding:  linear-gradient(145deg, #D6AE79 0%, #BC8F57 40%, #9A6F3E 100%);
  --fr-edge:      rgba(255,255,255,0.3);
  --fr-mat:       #FFFDF8;
  --fr-width:     10px;
  --fr-mat-pad:   8%;
  --fr-scale:     66%;
}
[data-frame="white"] {
  --fr-wall:      #BFBAB2;
  --fr-wall-2:    #ADA79E;
  --fr-moulding:  linear-gradient(145deg, #FFFFFF 0%, #F2EFE9 50%, #DDD8D0 100%);
  --fr-edge:      rgba(0,0,0,0.10);
  --fr-mat:       #FFFFFF;
  --fr-width:     6px;
  --fr-mat-pad:   0%;
  --fr-scale:     70%;
}
[data-frame="walnut"] {
  --fr-wall:      #DED8CC;
  --fr-wall-2:    #CCC5B6;
  --fr-moulding:  linear-gradient(145deg, #6B4A33 0%, #4A3122 45%, #322116 100%);
  --fr-edge:      rgba(255,255,255,0.16);
  --fr-mat:       #F6F1E6;
  --fr-width:     12px;
  --fr-mat-pad:   9%;
  --fr-scale:     64%;
}
[data-frame="none"] {
  --fr-wall:      #CFC9C0;
  --fr-wall-2:    #BEB8AE;
  --fr-moulding:  none;
  --fr-edge:      transparent;
  --fr-mat:       transparent;
  --fr-width:     0px;
  --fr-mat-pad:   0%;
  --fr-scale:     70%;
}

/* ---- the hover layer ---- */
.gal-framed {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 420ms cubic-bezier(0.22,0.61,0.36,1);
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 0%, var(--fr-wall) 0%, var(--fr-wall-2) 100%);
}
.gal-item:hover .gal-framed,
.gal-item:focus-visible .gal-framed { opacity: 1; }

/* when frames are switched off entirely */
[data-frame="off"] .gal-framed { display: none; }

.gal-frame {
  /* as wide as the frame style asks, but never taller than ~80% of the tile,
     whatever the shape of the work */
  width: min(var(--fr-scale), calc(80cqh / var(--fh, 1.45)));
  background: var(--fr-moulding);
  padding: var(--fr-width);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.28),
    0 10px 20px rgba(0,0,0,0.22),
    0 24px 46px rgba(0,0,0,0.18);
  transform: translateY(6px) scale(0.97);
  opacity: 0;
  transition: transform 520ms cubic-bezier(0.16,1,0.3,1), opacity 420ms ease;
}
.gal-item:hover .gal-frame,
.gal-item:focus-visible .gal-frame { transform: translateY(0) scale(1); opacity: 1; }

/* the mat (passepartout) holds the colour; a plain inner span carries the
   artwork as a background image - so a 43-tile page has 43 <img> elements
   rather than 86, without losing the mat. */
.gal-mat {
  display: block;
  background: var(--fr-mat);
  padding: var(--fr-mat-pad);
  box-shadow: inset 0 0 0 1px var(--fr-edge);
}
.gal-art {
  display: block;
  aspect-ratio: var(--ar, 4 / 5);   /* the work's own proportions - nothing is cropped */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  /* the print sits in the mat, not on it */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.16);
}

[data-frame="none"] .gal-frame { padding: 0; }
[data-frame="none"] .gal-mat { padding: 0; box-shadow: none; }

/* a faint hint of floor so it reads as a room, not a swatch */
.gal-framed::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.10) 100%);
  pointer-events: none;
}
[data-frame="off"] .gal-framed::after { display: none; }

/* ============================================================
   LAYOUT OPTIONS (set data-layout on <html>)
   All 46 works are 4:5, so true masonry gains nothing -
   these create rhythm by varying scale and offset instead.
   ============================================================ */

/* 1. UNIFORM - the default, even rows */
[data-layout="uniform"] .gal-grid { grid-template-columns: repeat(3, 1fr); }

/* 2. STAGGERED - middle column dropped, like a hung wall */
[data-layout="stagger"] .gal-grid { grid-template-columns: repeat(3, 1fr); }
[data-layout="stagger"] .gal-item:nth-child(3n + 2) { transform: translateY(clamp(2rem, 6vw, 5.5rem)); }

/* 3. EDITORIAL - every 7th work runs large across two columns */
[data-layout="editorial"] .gal-grid {
  grid-template-columns: repeat(6, 1fr);
  align-items: start;
}
[data-layout="editorial"] .gal-item { grid-column: span 2; }
[data-layout="editorial"] .gal-item:nth-child(7n + 1) { grid-column: span 3; }
[data-layout="editorial"] .gal-item:nth-child(7n + 4) { grid-column: span 3; }

/* 4. DUET - two large per row, generous, closer to a print catalogue */
[data-layout="duet"] .gal-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2.4rem, 5vw, 5rem) clamp(2rem, 4vw, 4rem);
}

@media (max-width: 1000px) {
  [data-layout] .gal-grid { grid-template-columns: repeat(2, 1fr); }
  [data-layout="editorial"] .gal-grid { grid-template-columns: repeat(4, 1fr); }
  [data-layout="editorial"] .gal-item,
  [data-layout="editorial"] .gal-item:nth-child(7n + 1),
  [data-layout="editorial"] .gal-item:nth-child(7n + 4) { grid-column: span 2; }
  [data-layout="stagger"] .gal-item:nth-child(3n + 2) { transform: none; }
  [data-layout="stagger"] .gal-item:nth-child(2n) { transform: translateY(clamp(1.5rem, 5vw, 3.5rem)); }
}
@media (max-width: 600px) {
  [data-layout] .gal-grid,
  [data-layout="editorial"] .gal-grid { grid-template-columns: 1fr; }
  [data-layout="editorial"] .gal-item,
  [data-layout="editorial"] .gal-item:nth-child(7n + 1),
  [data-layout="editorial"] .gal-item:nth-child(7n + 4) { grid-column: span 1; }
  [data-layout="stagger"] .gal-item:nth-child(2n) { transform: none; }
}

/* ---- preview control panel ---- */
@media (max-width: 760px) { .gal-div { display: none; } }

/* ----------  SIZE SCALE  ----------
   Four rectangles at true relative proportion. Choosing a print size from a
   dropdown alone is abstract; seeing 5x7 next to 16x20 is not.             */
.gal-scale {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
  margin: 0 0 1.5rem;
  min-height: 92px;
}
.gal-scale-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.gal-scale-box {
  border: 1px solid var(--g-line-2);
  background: transparent;
  transition: background 220ms ease, border-color 220ms ease;
}
.gal-scale-item:hover .gal-scale-box { border-color: var(--g-ink); }
.gal-scale-item[aria-pressed="true"] .gal-scale-box {
  background: var(--g-ink);
  border-color: var(--g-ink);
}
.gal-scale-cap {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--g-muted);
  white-space: nowrap;
  transition: color 220ms ease;
}
.gal-scale-item[aria-pressed="true"] .gal-scale-cap { color: var(--g-ink); }

/* ----------  LOADING / EMPTY STATES  ---------- */
.gal-loading {
  grid-column: 1 / -1;
  padding: 4rem 0;
  color: var(--g-muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

/* ----------  CART  ---------- */
.cart-open {
  appearance: none;
  position: relative;
  border: 1px solid var(--g-line-2);
  background: transparent;
  color: var(--g-ink);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 200ms ease;
}
.cart-open:hover { border-color: var(--g-ink); }
.cart-count {
  position: absolute;
  top: -7px; right: -7px;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--g-accent);
  color: var(--g-btn-ink);
  font-size: 0.64rem;
  line-height: 19px;
  letter-spacing: 0;
  text-align: center;
}

.cart-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 320ms var(--ease, cubic-bezier(0.22,0.61,0.36,1));
}
.cart-drawer.is-open ~ .cart-backdrop,
.cart-drawer.is-open + .cart-backdrop { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 510;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--g-bg);
  border-left: 1px solid var(--g-line);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 420ms cubic-bezier(0.16,1,0.3,1), visibility 0s 420ms;
}
.cart-drawer.is-open { transform: translateX(0); visibility: visible; transition: transform 420ms cubic-bezier(0.16,1,0.3,1); }

.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--g-line);
}
.cart-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--g-ink);
}
.cart-close {
  appearance: none; border: 0; background: transparent;
  color: var(--g-muted); font-size: 1.4rem; line-height: 1;
  cursor: pointer; padding: 0.2rem 0.4rem;
}
.cart-close:hover { color: var(--g-ink); }

.cart-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { color: var(--g-muted); font-size: 0.88rem; padding: 2rem 0; }

.cart-line {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--g-line);
}
.cart-line img { width: 54px; height: 68px; object-fit: cover; display: block; }
.cart-line-meta { min-width: 0; }
.cart-line-meta strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem; font-weight: 400; color: var(--g-ink);
}
.cart-line-meta small { display: block; margin-top: 0.15rem; color: var(--g-muted); font-size: 0.74rem; }
.cart-line-right { text-align: right; font-size: 0.85rem; color: var(--g-ink); }
.cart-remove {
  display: block; margin-top: 0.3rem;
  appearance: none; border: 0; background: transparent;
  color: var(--g-muted); font: inherit; font-size: 0.68rem;
  letter-spacing: 0.08em; text-decoration: underline; cursor: pointer;
}
.cart-remove:hover { color: var(--g-ink); }

.cart-foot { padding: 1.3rem 1.5rem; border-top: 1px solid var(--g-line); }
.cart-sub {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1rem;
}
.cart-sub span:first-child { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--g-muted); }
.cart-sub span:last-child { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.5rem; color: var(--g-ink); }
.cart-note { margin: 0.9rem 0 0; font-size: 0.72rem; line-height: 1.6; color: var(--g-muted); }
#cart-checkout { width: 100%; max-width: none; }
#cart-checkout:disabled { opacity: 0.4; cursor: not-allowed; }

.gal-ship-note {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g-accent);
}

/* Landscape works take one column like every other piece, shown at their own
   proportions (uncropped) and centered in the space their portrait neighbors'
   pictures take; the caption stays on the row's line. They used to span two
   columns, which made them read as more special than the rest.
   initGrid tags them (is-wide) and sets --ar from the catalog. */
.gal-item.is-wide .gal-thumb { aspect-ratio: var(--ar, 3 / 2); margin-block: auto; }

/* ----------  SEARCH  ---------- */
.gal-search {
  margin-top: 1.7rem;
  max-width: 340px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--g-line-2);
  padding-bottom: 0.35rem;
  color: var(--g-muted);
  transition: border-color 300ms ease;
}
.gal-search:focus-within { border-color: var(--g-ink-2); color: var(--g-ink-2); }
.gal-search-icon { width: 15px; height: 15px; flex: none; }
.gal-search input {
  flex: 1;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0.3rem 0;
  font: inherit;
  font-size: 1rem;            /* 16px: phones don't zoom the page on focus */
  color: var(--g-ink);
}
.gal-search input::placeholder { color: var(--g-muted); font-family: var(--serif); font-style: italic; font-size: 1.08rem; opacity: 1; }
.gal-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.gal-search-clear {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--g-muted); font-size: 1.25rem; line-height: 1; padding: 0 0.15rem;
}
.gal-search-clear:hover { color: var(--g-ink); }
.gal-search-status {
  margin: 0.55rem 0 0;
  min-height: 1.2em;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--g-muted);
}
.gal-item[hidden] { display: none !important; }

/* ----------  HEADER: the mongoose explorer from the back of the cards  ----------
   Sits left of the heading; its magnifying glass faces the title and the
   search box. Its height is the text block's height exactly (top of the title
   to the search line): the image adds nothing to the row's height (height 0)
   and then stretches to it (min-height 100%), its width following from the
   picture's own proportions. Above the heading, small, on phones. */
.gal-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(1.2rem, 3vw, 2.6rem); align-items: stretch; }
/* bottom sits on the search line (the status line below it is excluded), width capped so it stays slim */
.gal-explorer { display: block; height: 0; min-height: calc(100% - 1.4rem); width: auto; max-width: min(200px, 22vw); aspect-ratio: 480 / 534; object-fit: contain; object-position: center bottom; }
@media (max-width: 600px) {
  .gal-head { grid-template-columns: 1fr; row-gap: 0.4rem; }
  .gal-head > .narrow { width: 100%; }
  .gal-explorer { height: auto; min-height: 0; width: 120px; }
}

/* ----------  FIELD GUIDE  ---------- */
/* a museum-style explainer under the gallery: numbered entries, each with a
   print as its example */
.field-guide { padding: clamp(4rem, 9vw, 7.5rem) 0; border-top: 1px solid var(--g-line); }
.fg-head { max-width: 40rem; margin-bottom: clamp(2.4rem, 5vw, 4rem); }
.fg-kicker { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--g-accent); }
.fg-head h2 { margin: 0.7rem 0 0.6rem; }
.fg-intro { color: var(--g-muted); margin: 0; }
.fg-entries { display: grid; gap: clamp(2.6rem, 5vw, 4.2rem); }
.fg-entry { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(1.4rem, 4vw, 3.6rem); align-items: center; }
.fg-entry:nth-child(even) .fg-fig { order: 2; }
.fg-fig { display: block; max-width: 360px; width: 100%; justify-self: center; }
.fg-fig img { display: block; width: 100%; height: auto; border-radius: 2px; }
.fg-text { max-width: 34rem; }
.fg-num { font-family: var(--serif); font-size: 1.1rem; color: var(--g-accent); letter-spacing: 0.08em; }
.fg-text h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin: 0.35rem 0 0.8rem; }
.fg-text p { color: var(--g-ink-2); line-height: 1.7; }
.fg-try { display: inline-block; margin-top: 0.4rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--g-accent); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
@media (max-width: 760px) {
  .fg-entry { grid-template-columns: 1fr; }
  .fg-entry:nth-child(even) .fg-fig { order: 0; }
  .fg-fig { max-width: 300px; justify-self: start; }
}
.gal-eyebrow { display: block; margin-bottom: 0.6rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--g-accent); }
