/*
 * CITY OF LEGENDS: the field guide kit (src/guide/). Every class starts g-.
 *
 * Same Neon Ink rules as site.css: hard edges, flat colour, halftone dots for
 * shade, a misregistered two-plate offset on display type. No blur, no glow,
 * no soft gradients. Mobile first; the min-width blocks are wider layouts.
 * Nothing here animates. Hover lifts are stepped and only run when the reader
 * has not asked for reduced motion.
 *
 * A track's own stylesheet (places.css, threats.css, people.css, make.css)
 * styles its own components and never restyles a g- class.
 */

/* ── typographic page head ─────────────────────────────────────────── */

.g-head {
  position: relative;
  padding: 72px 0 40px;
  background-color: var(--night);
  background-image: radial-gradient(rgba(56, 232, 255, 0.09) 1.2px, transparent 1.6px);
  background-size: 9px 9px;
  border-bottom: 3px solid var(--paper);
}
.g-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 8px;
  background: var(--acc, var(--registry));
}
.g-title {
  margin: 0 0 16px;
  max-width: 15em;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 9.5vw, 92px);
  line-height: 0.88;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow:
    3px 0 0 var(--acc, var(--registry)),
    -3px 0 0 var(--lattice);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.g-lede {
  max-width: 38em;
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  color: var(--paper);
}
.g-stamp {
  display: inline-block;
  margin: 0 0 18px;
  padding: 3px 12px;
  border: 3px solid var(--acc, var(--sodium));
  color: var(--acc, var(--sodium));
  font-family: var(--display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}

/* ── the bar under the head: breadcrumb and sub-nav ────────────────── */

.g-bar {
  padding: 14px 0 16px;
  background: var(--ink);
  border-bottom: 3px solid var(--paper);
}
.g-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--dim);
}
.g-crumbs li + li::before {
  content: "/";
  margin: 0 10px;
  color: var(--registry-text);
}
.g-crumbs a {
  color: var(--text);
}
.g-crumbs [aria-current] {
  color: var(--paper);
}
.g-sub ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  /* a phone shows one row that scrolls sideways, with the right edge faded to say there is more */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.g-sub li {
  flex: none;
  scroll-snap-align: start;
}
.g-sub a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--line);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.g-sub a:hover {
  border-color: var(--sodium);
}
.g-sub a.on {
  border-color: var(--sodium);
  color: var(--sodium);
}
.g-sub a[aria-current="page"] {
  background: var(--sodium);
  color: var(--ink);
}

/* ── status chips and the key ──────────────────────────────────────── */

.g-st {
  display: inline-block;
  padding: 1px 8px;
  border: 2px solid var(--paper);
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--paper);
  vertical-align: 0.1em;
}
.g-st-dev {
  background: var(--lattice);
  border-color: var(--lattice);
  color: var(--ink);
}
.g-st-partial {
  background: var(--sodium);
  border-color: var(--sodium);
  color: var(--ink);
}
.g-st-mapped {
  border-style: dashed;
}
.g-st-workshop {
  border-style: dotted;
  border-color: var(--dim);
  color: var(--dim);
}
.band-paper .g-st-designed,
.band-paper .g-st-mapped {
  border-color: var(--ink);
  color: var(--ink);
}
.g-status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0 0 16px;
}
.g-key {
  padding: 18px 0;
  background: var(--night-2);
  border-bottom: 3px solid var(--paper);
}
.g-key-line {
  margin: 0;
  max-width: 52rem;
  font-size: 16px;
  color: var(--paper);
}
.g-key-more summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sodium);
}
.g-key-defs {
  display: grid;
  gap: 8px 24px;
  margin: 4px 0 0;
}
.g-key-defs div {
  display: grid;
  justify-items: start;
  gap: 4px;
}
.g-key-defs dd {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

/* ── copy ──────────────────────────────────────────────────────────── */

.g-prose {
  max-width: 46rem;
}
.g-prose p {
  margin: 0 0 1em;
  font-size: 18px;
}
.g-prose p:last-child {
  margin-bottom: 0;
}

/* ── canon lines ───────────────────────────────────────────────────── */

.g-q {
  max-width: 42rem;
  margin: 32px 0;
}
.g-q blockquote {
  margin: 0;
  padding: 2px 0 2px 20px;
  border-left: 6px solid var(--registry);
}
.g-q blockquote p {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(23px, 3.6vw, 30px);
  line-height: 1.1;
  color: var(--paper);
}
.g-q figcaption {
  margin: 10px 0 0 26px;
  font-size: 15px;
  color: var(--dim);
}
.g-qwall {
  display: grid;
  gap: 8px 32px;
  margin: 28px 0;
}
.g-qwall .g-q {
  margin: 0 0 18px;
}
.g-qwall .g-q blockquote p {
  font-size: 21px;
}

/* ── found documents: in-world text set as type ────────────────────── */

.g-docs {
  display: grid;
  gap: 26px;
  margin: 32px 0;
  align-items: start;
}
.g-doc {
  margin: 0;
  max-width: 30rem;
}
.g-doc-body p {
  margin: 0;
}
.g-doc figcaption {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--dim);
}
.g-doc-where {
  font-weight: 700;
  color: var(--text);
}
.g-doc-sign .g-doc-body {
  padding: 16px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  outline: 3px solid var(--paper);
  box-shadow: 8px 8px 0 var(--registry);
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.g-doc-notice .g-doc-body {
  padding: 16px 18px 18px;
  background: var(--paper);
  color: var(--ink);
  border-top: 10px solid var(--ink);
  font-size: 16px;
  line-height: 1.4;
}
.g-doc-notice .g-doc-body p:first-child {
  margin-bottom: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.g-doc-graffiti .g-doc-body {
  padding: 8px 4px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--sodium);
  text-shadow: 3px 3px 0 var(--registry);
  transform: rotate(-2.5deg);
}
.g-doc-plate .g-doc-body {
  padding: 14px 16px;
  background: var(--night-2);
  border: 3px solid var(--dim);
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.g-doc-broadcast .g-doc-body {
  padding: 12px 16px;
  background: var(--night-2);
  border-left: 8px solid var(--lattice);
  color: var(--lattice);
  font-style: italic;
  font-size: 18px;
  line-height: 1.35;
}
.g-doc-form .g-doc-body {
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-size: 16px;
}
.g-doc-form .g-doc-body p {
  padding: 6px 0;
  border-bottom: 1px solid var(--ink);
}
.g-doc-form .g-doc-body p:last-child {
  border-bottom: 0;
}
.g-doc-card .g-doc-body {
  padding: 26px 18px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 0 0 3px var(--paper), 7px 7px 0 3px var(--sodium);
  background-image: linear-gradient(var(--sodium), var(--sodium));
  background-size: 100% 12px;
  background-repeat: no-repeat;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.15;
  text-transform: uppercase;
}
.g-doc-note .g-doc-body {
  position: relative;
  padding: 22px 16px 16px;
  background: #ece6d2;
  color: var(--ink);
  font-style: italic;
  font-size: 17px;
  line-height: 1.35;
  transform: rotate(1.2deg);
}
.g-doc-note .g-doc-body::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 84px;
  height: 22px;
  margin-left: -42px;
  background: rgba(217, 210, 189, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.g-doc-chalk .g-doc-body {
  padding: 14px 16px;
  background: #15171c;
  border: 3px solid #2c2f37;
  color: var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

/* ── figures ───────────────────────────────────────────────────────── */

.g-fig {
  max-width: 56rem;
  margin: 32px 0 40px;
}
.g-entry-art .g-fig {
  margin: 0;
}

/* ── infobox ───────────────────────────────────────────────────────── */

.g-facts {
  max-width: 42rem;
  margin: 0 0 28px;
  border: 3px solid var(--paper);
  background: var(--ink);
  box-shadow: 6px 6px 0 var(--registry);
}
.g-facts div {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.g-facts div:last-child {
  border-bottom: 0;
}
.g-facts dt {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sodium);
}
.g-facts dd {
  margin: 0;
  color: var(--paper);
}

/* ── tables: stacked cards on a phone, a table from 640px ──────────── */

.g-table-wrap {
  margin: 28px 0;
}
.g-table {
  width: 100%;
  border-collapse: collapse;
}
.g-table caption {
  margin: 0 0 12px;
  text-align: left;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sodium);
}
.g-table thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.g-table tr {
  display: block;
  margin: 0 0 14px;
  border: 3px solid var(--paper);
  background: var(--ink);
}
.g-table th,
.g-table td {
  display: block;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.g-table tbody th {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  color: var(--paper);
}
.g-table td::before {
  content: attr(data-label);
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sodium);
}

/* ── ladders: real sequences ───────────────────────────────────────── */

.g-ladder {
  margin: 28px 0;
  padding: 0;
  list-style: none;
  max-width: 52rem;
}
.g-ladder li {
  display: grid;
  gap: 4px 18px;
  padding: 14px 0;
  border-top: 3px solid var(--paper);
}
.g-ladder li:last-child {
  border-bottom: 3px solid var(--paper);
}
.g-ladder-at {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--sodium);
}
.g-ladder p {
  margin: 0;
}
.g-ladder-label b {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  color: var(--paper);
}

/* ── link cards ────────────────────────────────────────────────────── */

.g-cards {
  display: grid;
  gap: 18px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}
.g-card {
  border: 3px solid var(--acc, var(--paper));
  background: var(--night);
  box-shadow: 6px 6px 0 var(--registry);
}
.g-card-hit {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.g-card-art {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 3px solid var(--acc, var(--paper));
}
.g-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* a card with no picture, beside cards that have one: a halftone plate keeps the titles on one line */
.g-card-plate {
  position: relative;
  background-color: var(--ink);
  background-image: radial-gradient(rgba(217, 210, 189, 0.12) 1.2px, transparent 1.6px);
  background-size: 9px 9px;
}
.g-card-plate::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 38%;
  height: 8px;
  background: var(--acc, var(--sodium));
}
.g-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 18px 18px;
}
.g-card-body b {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-card-sm);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}
.g-card-body > span:not(.g-st):not(.g-card-tag) {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
}
.g-card-tag {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc, var(--sodium));
}

/* ── on-page index, link rows, see also ────────────────────────────── */

.g-jump ul,
.g-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.g-jump a,
.g-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--sodium);
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sodium);
}
.g-jump a:hover,
.g-links a:hover {
  background: var(--sodium);
  color: var(--ink);
}
.g-also {
  padding: 40px 0;
}
.g-also-h {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 32px;
  text-transform: uppercase;
  color: var(--paper);
}
.g-also .g-links {
  margin: 0;
}

/* ── entries: one named thing on a long page ───────────────────────── */

.g-entry {
  display: grid;
  gap: 24px;
  padding: 34px 0;
  border-top: 3px solid var(--line);
}
.g-entry-head {
  margin: 0 0 12px;
}
.g-entry-head h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}
.g-aka {
  margin: 6px 0 0;
  font-style: italic;
  color: var(--dim);
}
.g-entry-lede {
  font-size: 19px;
  color: var(--paper);
}
.g-entry-copy > p {
  max-width: 46rem;
}

/* ── wider screens ─────────────────────────────────────────────────── */

@media (min-width: 640px) {
  .g-key-defs {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
  .g-qwall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .g-docs {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  .g-facts div {
    grid-template-columns: 10em 1fr;
    gap: 14px;
  }
  .g-cards {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  .g-ladder li {
    grid-template-columns: 9em 1fr;
  }
  .g-ladder-plain li {
    grid-template-columns: 1fr;
  }
  .g-sub ul {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .g-table thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
  .g-table thead th {
    padding: 10px 12px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .g-table tr {
    display: table-row;
    margin: 0;
    border: 0;
    background: none;
  }
  .g-table th,
  .g-table td {
    display: table-cell;
  }
  .g-table tbody th {
    font-size: 20px;
  }
  .g-table td::before {
    content: none;
  }
}

@media (min-width: 960px) {
  .g-entry.has-art {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .g-card {
    transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
  }
  .g-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--registry);
  }
}

/* a long table of one-line rows, on a phone: the name and the chip share a line and the cell labels go */
@media (max-width: 639px) {
  .g-table-flat tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 10px;
  }
  .g-table-flat th,
  .g-table-flat td {
    border-bottom: 0;
  }
  .g-table-flat tbody th {
    flex: 1 1 auto;
    padding-bottom: 0;
    font-size: 20px;
  }
  .g-table-flat td::before {
    content: none;
  }
  .g-table-flat td:nth-child(2) {
    flex: none;
    padding-bottom: 0;
  }
  .g-table-flat td:last-child {
    flex: 1 1 100%;
    padding-top: 4px;
  }
}
