/* Still close to browser defaults — a readable column, a cleaner serif than
   Times, and no link underlines. Colors are left to the browser. */

:root {
  /* Let the browser flip its default colors in dark mode. */
  color-scheme: light dark;
}

body {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
  /* Charter and its descendants: same shape as the default serif, better fitted
     for screens. Falls back to the system serif, never to a downloaded font. */
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-top: 2rem;
}

hr {
  border: none;
  border-top: 1px solid;
  opacity: 0.15;
  margin: 2.5rem 0;
}

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid;
  opacity: 0.75;
}

code,
pre {
  font-size: 0.9em;
}

/* Same hairline as tables and <hr>, boxing the block rather than tinting it —
   the background stays the page background. */
pre {
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  padding: 0.9rem 1rem;
  margin: 1.5rem 0;
}

/* Shiki highlights at build time and emits both palettes as custom properties.
   Picking one here means no client-side JavaScript and no theme flash. */
.shiki,
.shiki span {
  color: var(--shiki-light);
}

@media (prefers-color-scheme: dark) {
  .shiki,
  .shiki span {
    color: var(--shiki-dark);
  }
}

/* Long content (code, ascii diagrams) scrolls itself instead of pushing the
   page sideways. Tables get a wrapper for this — `display: block` on a table
   would stop border-collapse from applying. */
pre,
.scroll {
  overflow-x: auto;
  max-width: 100%;
}

.scroll {
  margin: 1.5rem 0;
}

/* Same hairline as <hr>: enough to separate rows, not a grid of boxes. */
table {
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.4rem 1rem 0.4rem 0;
  border-bottom: 1px solid;
}

/* The border colour is the text colour, so it has to be quieted down
   per element — opacity would fade the text with it. */
th {
  border-bottom-color: color-mix(in srgb, currentColor 35%, transparent);
}

td {
  border-bottom-color: color-mix(in srgb, currentColor 15%, transparent);
}

table tr:last-child td {
  border-bottom: none;
}

img {
  max-width: 100%;
  height: auto;
}

header {
  margin: 1.5rem 0 2.5rem;
  font-weight: bold;
}

footer {
  margin-top: 4rem;
  font-size: 0.9em;
  opacity: 0.7;
}

/* Dates: present but quiet, in the same color as the text. */
.date {
  font-size: 0.9em;
  opacity: 0.6;
  margin-top: 0.25rem;
}

/* Post list: title first, date underneath. No columns, no bullets. */
.posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.posts li {
  margin: 1.5rem 0;
}

.posts a {
  font-size: 1.15em;
}
