/*
 * The text pages (src/seo/staticPages.ts): each period, the rulers, the
 * chronology and the people, as plain HTML in the app's own shell colours.
 * A stylesheet rather than inline style, because the CSP allows no inline
 * style (docker/nginx.conf).
 */
:root {
  --bg: #12100e;
  --bg-raised: #1b1815;
  --ink: #f2ece3;
  --ink-dim: #c9bfb1;
  --ink-faint: #918676;
  --rule: #2e2822;
  --accent: #e8866b;
  --serif: Georgia, 'Times New Roman', serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px max(16px, env(safe-area-inset-left)) 14px max(16px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raised);
}

.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
}

header.site nav a {
  color: var(--ink-dim);
  text-decoration: none;
}

header.site nav a:hover,
header.site nav a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-faint);
}

.crumbs li + li::before {
  content: '›';
  margin-right: 6px;
}

.crumbs a {
  color: var(--ink-faint);
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 6vw, 38px);
}

h2 {
  margin: 36px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 22px;
}

h2 a {
  color: var(--ink);
}

.era {
  margin: 24px 0 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.lead {
  font-size: 17px;
  color: var(--ink-dim);
}

.cta {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
}

.cta:hover {
  background: rgba(232, 134, 107, 0.12);
}

ul,
ol {
  padding-left: 0;
  list-style: none;
}

.plain li,
.people li,
.dated li {
  margin: 0 0 14px;
}

.people p,
.dated p {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--ink-dim);
}

.dated li {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 0 12px;
}

.years,
.year {
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

.year {
  font-weight: 600;
  color: var(--accent);
}

.people .years {
  display: inline-block;
  min-width: 6.5em;
}

.tag,
.date,
.aside {
  font-size: 13px;
  color: var(--ink-faint);
}

.tag {
  white-space: nowrap;
}

.tag::before {
  content: '· ';
}

.aside {
  margin-left: 4px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

footer.site {
  padding: 20px 16px 32px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
}

@media (max-width: 480px) {
  .dated li {
    grid-template-columns: 1fr;
  }

  .people .years {
    display: block;
  }
}
