/* The pages below the home page: About, Research, Experience and Education.
   The home page gives the summary, and these pages the detail. */

/* A topic is one row: the mark on the left, and the title, the text and the
   papers on the right. */
.topic {
  display: grid;
  grid-template-columns: 12rem 1fr;
  /* The mark keeps the height of its line. Without this rule the grid makes
     it as tall as the row. */
  align-items: start;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
}

.topic:first-of-type { border-top: 0; padding-top: 0; }

.topic-mark {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 0.2rem;
}

.topic-mark .glyph {
  color: var(--accent);
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

/* Without min-width a long title makes the row too wide. */
.topic-body { min-width: 0; }

.topic h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.topic p {
  max-width: var(--w-prose);
  margin-top: 0.6rem;
  font-size: 0.99rem;
}

/* The papers of a topic. Each paper is one row: the year, the title, and a
   mark that shows a link. */
.related { margin-top: 1.4rem; }

.related-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The title gets the full measure, and the year and the mark hang on the
   two sides. */
.related ul {
  list-style: none;
  margin-top: 0.35rem;
  max-width: calc(var(--w-prose) + 5.6rem);
}

/* A line divides two rows. The first row has the label above it. */
.related li + li { border-top: 1px solid var(--line); }

/* A title on a second line stays in its column. */
.related a {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 1rem;
  column-gap: 1.1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  color: inherit;
  text-decoration: none;
}

.related .year {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 140ms ease;
}

/* The line below the title shows on a pointer or the focus, on the text
   only. */
.related-title {
  font-size: 0.95rem;
  line-height: 1.45;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.related-go {
  justify-self: end;
  font-size: 0.8rem;
  color: var(--line-strong);
  transition: color 140ms ease, transform 140ms ease;
}

.related a:hover .related-title, .related a:focus-visible .related-title {
  color: var(--accent-strong);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.related a:hover .year, .related a:focus-visible .year { color: var(--accent); }

.related a:hover .related-go, .related a:focus-visible .related-go {
  color: var(--accent);
  transform: translateX(3px);
}

/* Reduced motion keeps the colour change, and drops the move. */
@media (prefers-reduced-motion: reduce) {
  .related a:hover .related-go, .related a:focus-visible .related-go { transform: none; }
}

/* A line of text below a block, in the mono style of a label. */
.page-note {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* The links to the other pages, at the end of each page. */
.cross-nav {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 1.5rem 5.5rem;
}

.cross-nav-inner {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.cross-nav .cross-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.4rem;
}

@media (max-width: 720px) {
  .topic { grid-template-columns: 1fr; gap: 0.9rem; padding: 1.8rem 0; }
  .topic h2 { font-size: 1.08rem; }

  /* A narrow screen gives the title more of the width. */
  .related a {
    grid-template-columns: 2.2rem minmax(0, 1fr) 0.9rem;
    column-gap: 0.85rem;
  }
  .cross-nav { padding: 0 1.15rem 3.75rem; }
}
