/* Grokkists in the wild: gallery page (custom-grokkists-in-the-wild.hbs)
   Uses the Reading Room tokens (screen.css / tokens.css). No colours of its own. */

/* ---------- Heading ---------- */
.wild-hero { padding-bottom: 0; }
.wild-hero .hero-title em { font-style: italic; font-weight: 500; color: var(--action-lift); }
.wild-hero .hero-lede { max-width: 38em; margin-inline: auto; }

/* A few photos standing on the bottom edge of the heading. Filled by wild.js. */
.wild-strip {
  position: relative; max-width: 1100px; margin: clamp(36px, 5vw, 60px) auto 0;
  display: flex; align-items: flex-end; justify-content: center; gap: 12px;
}
.wild-strip[hidden] { display: none; }
.wild-tile {
  flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; background: var(--ground-ink);
  border-radius: 10px 10px 0 0; overflow: hidden; cursor: zoom-in;
}
.wild-tile img { display: block; height: 100%; width: auto; max-width: none; object-fit: cover; }
.wild-tile:nth-child(1) { height: 118px; }
.wild-tile:nth-child(2) { height: 158px; }
.wild-tile:nth-child(3) { height: 134px; }
.wild-tile:nth-child(4) { height: 172px; }
.wild-tile:nth-child(5) { height: 126px; }
.wild-tile:nth-child(6) { height: 150px; }
.wild-tile:focus-visible { outline: 2px solid var(--action-lift); outline-offset: 2px; }
.wild-tile:hover img { filter: brightness(1.08); }
@media (max-width: 760px) {
  .wild-strip { gap: 8px; }
  .wild-tile { flex: 1 1 0; }
  .wild-tile:nth-child(n+4) { display: none; }
  .wild-tile:nth-child(1) { height: 104px; } .wild-tile:nth-child(2) { height: 136px; }
  .wild-tile:nth-child(3) { height: 116px; }
  .wild-tile img { width: 100%; }
}

/* ---------- Callout ---------- */
.wild-callout { background: var(--ground-bone); border-bottom: 1px solid var(--rule); }
.wild-callout-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 32px; padding-block: 22px;
}
.wild-callout p { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.3; color: var(--fg-1); }
.wild-callout .quiet-link { white-space: nowrap; }

/* ---------- Gallery ---------- */
.wild-gallery { padding-top: clamp(36px, 4vw, 56px); }
.wild-count {
  margin: 0 0 8px; min-height: 1.4em;
  font: 500 var(--t-eyebrow, 12px)/1.4 var(--font-sans);
  letter-spacing: var(--tracking-eyebrow, .16em); text-transform: uppercase; color: var(--fg-2);
}

/* Justified rows: every photo gets a width in proportion to its shape, so each
   row fills the line at one height. --ar (width / height) is set by wild.js
   from the image's own width and height attributes. */
.wild-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px 14px; }
.wild-body > h2 {
  flex: 0 0 100%; display: flex; align-items: center; gap: 18px;
  margin: clamp(28px, 4vw, 52px) 0 2px;
  font-family: var(--font-serif); font-weight: 500; font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1; letter-spacing: -.01em; color: var(--fg-1);
}
.wild-body > h2:first-child { margin-top: 8px; }
.wild-body > h2::after { content: ""; flex: 1; height: 1px; background: var(--rule-strong); }
.wild-body > p { flex: 0 0 100%; max-width: var(--measure, 680px); margin: 0; color: var(--fg-2); }

.wild-body figure.kg-image-card {
  --ar: 1.5;
  flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 240px);
  max-width: calc(var(--ar) * 400px);
  min-width: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  cursor: zoom-in;
}
.wild-body figure.kg-image-card img {
  width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover;
  border-radius: 10px; background: var(--ground-bone);
  transition: transform var(--dur-base, 240ms) var(--ease-emerge, ease), filter var(--dur-base, 240ms) var(--ease-emerge, ease);
}
.wild-body figure.kg-image-card:hover img { filter: brightness(1.04) saturate(1.05); }
.wild-body figure.kg-image-card:focus-visible { outline: 2px solid var(--action); outline-offset: 4px; border-radius: 12px; }
.wild-body figure.kg-image-card figcaption {
  margin: 0; padding: 0 2px; text-align: left;
  font: 400 14px/1.45 var(--font-sans); color: var(--fg-2);
  text-wrap: pretty;
}
@media (max-width: 640px) {
  .wild-body { gap: 22px 10px; }
  .wild-body figure.kg-image-card { flex-basis: calc(var(--ar) * 150px); max-width: none; }
}

/* ---------- Send one in ---------- */
.wild-send-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.wild-send-intro .serif-display { margin: 0 0 20px; max-width: 16ch; text-wrap: balance; }
.wild-send-lede { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: 22px; line-height: 1.4; color: var(--fg-2); max-width: 34ch; }
.wild-steps { list-style: none; counter-reset: step; margin: 0 0 28px; padding: 0; display: grid; gap: 18px; }
.wild-steps li { counter-increment: step; position: relative; padding-left: 44px; font-size: 18px; line-height: 1.5; color: var(--fg-1); }
.wild-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-strong);
  display: grid; place-items: center; font: 500 14px/1 var(--font-sans); color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.wild-steps a { color: var(--action-lift); text-decoration: none; border-bottom: 1px solid currentColor; }
.wild-steps a:hover { color: var(--signal-amber, var(--action-lift)); }
.wild-send-note { margin: 0 0 12px; max-width: 52ch; font-size: 15px; line-height: 1.55; color: var(--fg-3); }
.wild-send-actions { margin: 28px 0 0; }
@media (max-width: 820px) { .wild-send-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Viewer ---------- */
.wild-lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: color-mix(in srgb, var(--ground-ink) 96%, transparent); color: var(--fg-1);
}
.wild-lb::backdrop { background: var(--ground-ink); }
.wild-lb-stage {
  position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px; padding: clamp(56px, 7vh, 72px) clamp(16px, 6vw, 88px) clamp(18px, 3vh, 32px);
}
.wild-lb-img { min-height: 0; display: grid; place-items: center; }
.wild-lb-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.wild-lb-cap { max-width: 760px; margin: 0 auto; text-align: center; }
.wild-lb-cap p { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.35; color: var(--fg-1); text-wrap: balance; }
.wild-lb-cap small { display: block; margin-top: 8px; font: 500 12px/1 var(--font-sans); letter-spacing: .16em; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.wild-lb button {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px;
  background: transparent; color: var(--fg-2); border: 1px solid var(--rule); border-radius: 12px;
  font: 400 22px/1 var(--font-sans); cursor: pointer;
  transition: color var(--dur-base, 240ms) var(--ease-emerge, ease), border-color var(--dur-base, 240ms) var(--ease-emerge, ease);
}
.wild-lb button:hover { color: var(--action-lift); border-color: var(--action-lift); }
.wild-lb button:focus-visible { outline: 2px solid var(--action-lift); outline-offset: 2px; }
.wild-lb-x { top: 12px; right: 12px; }
.wild-lb-prev, .wild-lb-next { top: 50%; transform: translateY(-50%); }
.wild-lb-prev { left: 12px; }
.wild-lb-next { right: 12px; }
@media (max-width: 640px) {
  .wild-lb-prev, .wild-lb-next { top: auto; bottom: 14px; transform: none; }
  .wild-lb-stage { padding-bottom: 74px; }
  .wild-lb-cap { padding-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wild-body figure.kg-image-card img, .wild-lb button { transition: none; }
}
