/* Generated from src/style.ts. */

:root {
  --ground:   #ebe5e0;   /* the desk */
  --panel:    #faf7f5;   /* the tool's own surfaces sit on it */
  --surface:  #ffffff;   /* the diff, and nothing else */
  --ink:      #1e1a18;
  --muted:    #4b443f;
  --faint:    #5c534d;
  --rule:     #dbd3cd;
  --rule-2:   #c2b7b0;
  --accent:   #6f3a2c;   /* clay */
  --accent-2: #8a4d3d;

  /* The diff inks. Dark enough on their tints to clear 4.5:1 for body text. */
  --add:      #14532d;
  --add-bg:   #e4f2e8;
  --add-rule: #2f7d4f;
  --del:      #7f1d1d;
  --del-bg:   #fbe7e5;
  --del-rule: #b04037;

  --lift:     0 0 0 1px var(--rule-2);
  --tap:      44px;

  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { background: var(--ground); color: var(--ink); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: var(--accent); color: #fff; }

.shell { max-width: 52rem; margin: 0 auto; padding: 2.25rem 1.25rem 5rem; }

/* ------------------------------- typography ------------------------------- */

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
}
@media (min-width: 40rem) { h1 { font-size: 1.6rem; } }

h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; letter-spacing: -0.01em; }

.lede { color: var(--muted); margin: 0; max-width: 62ch; font-size: 0.95rem; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.8rem;
}

a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: var(--accent); }

.section { border-top: 1px solid var(--rule); padding-top: 1.4rem; margin-top: 1.7rem; }

/* --------------------------------- header -------------------------------- */

header.masthead { padding-bottom: 0.2rem; }

nav.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 1rem 0 0;
  padding: 0.8rem 0 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}
nav.tabs a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 0.2rem 0; }
nav.tabs a:hover { color: var(--accent); }
nav.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* ------------------------------- changelog -------------------------------- */

/* A date is a heading for the entries under it, not a row in a table. Sticky
   so that scrolling a long day never leaves an entry without its date. */
.daymark {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ground);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--faint);
  padding: 1.6rem 0 0.5rem;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.daymark:first-of-type { padding-top: 0.6rem; }

.entry {
  display: block;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-top: 0.7rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .1s ease;
}
a.entry:hover { border-color: var(--accent); }
a.entry:active { transform: scale(0.995); }

.entry-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.entry-title { font-weight: 600; font-size: 1rem; line-height: 1.35; }
.entry-meta { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); }
.entry-summary { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.93rem; }

/* The count of words in and out. Mono because they are figures. */
.wordcount { font-family: var(--mono); font-size: 0.76rem; white-space: nowrap; }
.wordcount .in  { color: var(--add); }
.wordcount .out { color: var(--del); }

/* ---------------------------------- tags ---------------------------------- */

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  border: 1px solid var(--rule-2);
  color: var(--faint);
  background: var(--ground);
  white-space: nowrap;
}
.tag.edited     { color: var(--accent); border-color: var(--accent); }
.tag.added      { color: var(--add); border-color: var(--add-rule); }
.tag.removed    { color: var(--del); border-color: var(--del-rule); }
.tag.reappeared { color: var(--add); border-color: var(--add-rule); }
.tag.retitled   { color: var(--accent); border-color: var(--rule-2); }
.tag.pdf_replaced { color: var(--accent); border-color: var(--accent); }
/* Metadata churn is recorded but must not compete: it is not a policy change. */
.tag.metadata   { color: var(--faint); border-color: var(--rule); }
.tag.seeded     { color: var(--faint); border-color: var(--rule); background: transparent; }

/* ---------------------------------- diff ---------------------------------- */

.diff {
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 0.4rem 0;
  margin-top: 1rem;
  overflow-x: auto;
}

.dline {
  position: relative;
  padding: 0.28rem 1rem 0.28rem 2.1rem;
  font-size: 0.95rem;
  line-height: 1.55;
}
/* The gutter marker. Colour is never the only signal that a line moved. */
.dline::before {
  position: absolute;
  left: 0.75rem;
  top: 0.28rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--faint);
}
.dline.same { color: var(--muted); }
.dline.same::before { content: "\00a0"; }
.dline.add  { background: var(--add-bg); border-left: 3px solid var(--add-rule); }
.dline.add::before  { content: "+"; color: var(--add); }
.dline.del  { background: var(--del-bg); border-left: 3px solid var(--del-rule); text-decoration: line-through; text-decoration-color: var(--del-rule); }
.dline.del::before  { content: "\2212"; color: var(--del); }

/* A heading keeps its weight inside the diff so the shape of the article
   survives. Without this a rewritten section reads as undifferentiated prose. */
.dline.h { font-weight: 600; font-size: 1rem; color: var(--ink); }

/* Word-level marks inside a rewritten line. */
.w-add { background: #bfe6cd; color: var(--add); border-radius: 2px; padding: 0 1px; }
.w-del { background: #f6c9c4; color: var(--del); border-radius: 2px; padding: 0 1px; text-decoration: line-through; }

/* Long runs of unchanged text are noise. Collapsed behind a details element so
   the page opens on what changed and the context is still one click away. */
.context { border: 0; margin: 0; }
.context > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.3rem 1rem 0.3rem 2.1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
}
.context > summary::-webkit-details-marker { display: none; }
.context > summary:hover { color: var(--accent); }

/* --------------------------------- panels --------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-top: 0.7rem;
}

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 1px solid var(--rule); padding: 0.6rem 0; display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.rows li:first-child { border-top: 0; }
.rows .when { font-family: var(--mono); font-size: 0.76rem; color: var(--faint); margin-left: auto; }

dl.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
dl.facts dt { color: var(--faint); font-family: var(--mono); font-size: 0.78rem; padding-top: 0.15rem; }
dl.facts dd { margin: 0; }

.empty { color: var(--muted); font-size: 0.95rem; padding: 2rem 0; }

.ghost {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0 1.1rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  text-decoration: none;
  cursor: pointer;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

footer.foot {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.85rem;
}
footer.foot a { color: var(--faint); }

/* The affiliation disclaimer.
   Set in the ink colour rather than the footer's --faint, and given a rule
   above it, because a disclaimer that is styled like fine print reads as fine
   print. It has to survive being skimmed: someone landing on a changelog of
   scholarship policy needs to know in one glance that this is not the
   programme's own site. */
footer.foot .disclaimer {
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 0.8rem;
  margin: 0 0 0.9rem;
}

/* The same statement on the about page, where it is the first thing on the
   page rather than the last. */
.card.notice { border-color: var(--accent); background: var(--panel); }

/* The article's own text on /article/:id, rendered from the stored body. */
.prose { font-size: 0.97rem; }
.prose h1, .prose h2, .prose h3 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.prose p, .prose li { color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.prose td, .prose th { border: 1px solid var(--rule); padding: 0.35rem 0.5rem; text-align: left; }
.prose img { max-width: 100%; height: auto; }
.prose-wrap { overflow-x: auto; }
