/* eyespecialist.sg — /eye-tests/ — loaded after site.css.
 *
 * .tjump is a section card linking down the page; .tcard is one test. Both
 * cap at 54rem so they clear the fixed .toc rail, which from 90rem sits over
 * the right of .shell's content column. Square corners, per the house rule. */

/* ---- Section cards ------------------------------------------------------ */

.tjumps {
  display: grid;
  gap: var(--space-sm);
  max-width: 54rem;
  margin-top: var(--space-xl);
  padding: 0;
  list-style: none;
}

.tjump {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  height: 100%;
  padding: var(--space-md) var(--space-lg);
  color: inherit;
  text-decoration: none;
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-left: var(--rule-thick) solid var(--color-accent);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}

.tjump:hover {
  border-color: var(--color-accent);
  background: var(--color-paper);
}

.tjump__name {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.3;
  color: var(--color-ink);
  transition: color var(--dur-micro) var(--ease-out);
}

/* A down arrow: every card lands further down this page, not on another. */
.tjump__name::after {
  content: "↓";
  margin-left: auto;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-accent);
  transition: transform var(--dur-micro) var(--ease-out);
}

.tjump:hover .tjump__name {
  color: var(--color-accent);
}

.tjump:hover .tjump__name::after {
  transform: translateY(3px);
}

.tjump__note {
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  text-wrap: pretty;
}

.tjump__count {
  margin-top: auto;
  padding-top: var(--space-2xs);
  color: var(--color-accent);
}

/* ---- Test cards --------------------------------------------------------- */

.tcards {
  display: grid;
  gap: var(--space-md);
  max-width: 54rem;
  margin-top: var(--space-xl);
  padding: 0;
  list-style: none;
}

.tcard {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-top: var(--rule-thick) solid var(--color-accent);
  border-radius: var(--radius-sm);
}

/* On a tinted band the card steps back UP to paper, or it vanishes into it. */
.band .tcard {
  background: var(--color-paper);
}

.tcard__name {
  font-size: var(--text-lg);
  line-height: 1.25;
}

.tcard__body {
  max-width: var(--measure);
  font-size: var(--text-base);
  color: var(--color-ink-2);
  text-wrap: pretty;
}

.tcard__text {
  display: grid;
  align-content: start;
  gap: var(--space-sm);
}

.tcard__tag {
  max-width: none;
  padding-top: var(--space-sm);
  border-top: var(--rule-hair) solid var(--color-rule-2);
  color: var(--color-accent);
}

.tcards + .copy {
  margin-top: var(--space-lg);
}

/* ---- Section head beside a photograph ---------------------------------- */

.tsplit {
  display: grid;
  gap: var(--space-lg);
  max-width: 54rem;
}

.tfig {
  max-width: 28rem;
  margin: 0;
}

.tfig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--color-paper-3);
}

.tfig figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-wrap: pretty;
}

/* ---- The four tests in every package ----------------------------------- */

.tbase {
  display: grid;
  gap: var(--space-sm);
  max-width: 54rem;
  margin-top: var(--space-lg);
  padding: 0;
  list-style: none;
}

.tbase__item {
  display: grid;
  align-content: start;
  gap: var(--space-2xs);
  padding: var(--space-md);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-top: var(--rule-thick) solid var(--color-accent);
  border-radius: var(--radius-sm);
}

.tbase__name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: 1.3;
  color: var(--color-ink);
}

.tbase__gloss {
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  text-wrap: pretty;
}

.tbase + .copy {
  margin-top: var(--space-lg);
}

/* ---- .agrid — the Amsler grid, /eye-tests/amsler-grid/ -----------------
 * Drawn in a 200-unit box. The strokes are in viewBox units, not
 * non-scaling, so the lines stay the same share of a square at every size. */

.agrid {
  max-width: 26rem;
  margin: var(--space-lg) 0 0;
}

.agrid__svg {
  display: block;
  width: 100%;
  height: auto;
}

.agrid__field {
  fill: var(--color-paper);
}

.agrid__lines,
.agrid__edge {
  fill: none;
  stroke: var(--color-ink);
}

.agrid__lines {
  stroke-width: 0.5;
}

.agrid__edge {
  stroke-width: 1.4;
}

.agrid__dot {
  fill: var(--color-ink);
}

.agrid__patch-in,
.agrid__patch-mid,
.agrid__patch-out {
  stop-color: var(--color-ink);
}

.agrid__patch-in  { stop-opacity: 0.55; }
.agrid__patch-mid { stop-opacity: 0.3; }
.agrid__patch-out { stop-opacity: 0; }

.agrid__cue {
  margin-top: var(--space-xs);
  text-align: center;
}

.agrid__caveat {
  font-size: var(--text-sm);
}

.agrid__how {
  margin-top: var(--space-2xl);
}

.copy__list--num {
  list-style: decimal;
}

.copy__list--num li::marker {
  color: var(--color-accent);
  font-variant-numeric: lining-nums tabular-nums;
}

.agrid-pair .agrid__svg {
  max-width: 15rem;
}

@media (min-width: 48rem) {
  .tjumps,
  .tcards,
  .tbase {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Subgrid, so name, text and tag rows line up across a row of cards even
   * where one tag wraps to two lines. */
  .tcard {
    grid-row: span 3;
    grid-template-rows: subgrid;
    padding: var(--space-lg);
  }

  .tcard--wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .tjumps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tbase {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tsplit {
    grid-template-columns: minmax(0, 1fr) 20rem;
    column-gap: var(--space-xl);
    align-items: center;
  }

  .tfig {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tjump,
  .tjump__name,
  .tjump__name::after {
    transition: none;
  }
}
