/* Reformed Work: a quiet, bookish theme.
   EB Garamond for reading, Cormorant SC for headings and labels, oxblood accent. */

:root {
  --paper: #FAF7F0;
  --paper-2: #F2ECE0;
  --ink: #1E1A16;
  --ink-2: #4A423A;
  --muted: #7A6F63;
  --rule: #D9CFBF;
  --accent: #6B1D1D;
  --accent-soft: #6B1D1D1A;
  --mark: #EFD9A8;
  --measure: 40rem;   /* ~80 characters of Garamond per line, the top of the comfortable reading range */
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --caps: "Cormorant SC", "EB Garamond", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1A1714; --paper-2: #231F1B; --ink: #EAE2D4; --ink-2: #CFC5B5; --muted: #9C9080;
    --rule: #3A332C; --accent: #D08F84; --accent-soft: #D08F841F; --mark: #5A4524;
  }
}
:root[data-theme="dark"] {
  --paper: #1A1714; --paper-2: #231F1B; --ink: #EAE2D4; --ink-2: #CFC5B5; --muted: #9C9080;
  --rule: #3A332C; --accent: #D08F84; --accent-soft: #D08F841F; --mark: #5A4524;
}

*, *::before, *::after { box-sizing: border-box; }
/* Fluid type: everything is sized in rem, so scaling the root scales the whole page:
   16px on phones up to 20px on large monitors; the text column widens with it. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: clamp(100%, 0.75rem + 0.45vw, 125%); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum"; font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
a:hover { text-decoration-color: var(--accent); }
::selection { background: var(--accent-soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.sep { margin: 0 .55em; color: var(--rule); }

/* ---------- masthead ---------- */
.masthead {
  text-align: center; padding: 3.25rem 1rem 0; max-width: 64rem; margin: 0 auto;
}
.site-title { margin: 0; font-family: var(--caps); font-weight: 600; font-size: clamp(2.1rem, 6vw, 3.1rem); letter-spacing: .08em; line-height: 1.1; }
.site-title a { color: var(--ink); text-decoration: none; }
.tagline { margin: .35rem 0 0; font-style: italic; color: var(--muted); font-size: 1.05rem; }
.tagline:empty { display: none; }
.nav {
  list-style: none; padding: .9rem 0 .8rem; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem 1.6rem;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  box-shadow: 0 -4px 0 -3px var(--ink), 0 4px 0 -3px var(--ink);
  outline: 1px solid var(--ink); outline-offset: 3px; clip-path: inset(-4px 0);
}
.nav a { font-family: var(--caps); font-weight: 600; font-size: 1.1rem; letter-spacing: .09em; color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--accent); }
.nav .nav-search a { color: var(--muted); }

main { max-width: var(--measure); margin: 0 auto; padding: 3rem 1rem 2rem; }

/* ---------- headings & page chrome ---------- */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.page-header { text-align: center; margin-bottom: 2.25rem; }
.page-header h1 { font-size: clamp(2rem, 5.2vw, 2.75rem); margin: .2rem 0 .4rem; letter-spacing: -.005em; }
.kicker, .page-meta, .byline, .entry-meta, .group-title, .label, .entry-section {
  font-family: var(--caps); letter-spacing: .08em; font-weight: 600;
}
.kicker { margin: 0; font-size: 1rem; color: var(--accent); }
.kicker a { color: inherit; text-decoration: none; }
.byline { margin: 0; color: var(--ink-2); font-size: 1.15rem; }
.page-meta { margin: 0; color: var(--muted); font-size: 1rem; }
.dek { margin: .3rem auto 0; font-style: italic; color: var(--ink-2); max-width: 32rem; }
.group-title { font-size: 1.2rem; text-align: center; color: var(--ink-2); margin: 0 0 1.4rem; }
.group-title a { color: inherit; text-decoration: none; }
.ornament { text-align: center; color: var(--accent); font-size: 1.1rem; margin: 2.75rem 0; letter-spacing: 1em; padding-left: 1em; }
.ornament::before, .ornament::after { content: "❖"; opacity: .45; font-size: .7em; vertical-align: middle; }
.ornament::before { margin-right: 0; }

/* ---------- prose ---------- */
.prose { hyphens: auto; -webkit-hyphens: auto; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { font-size: 1.6rem; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 .5em; font-style: italic; }
.prose h4 { font-family: var(--caps); letter-spacing: .06em; font-size: 1.1rem; margin: 1.6em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--accent); }
.prose hr { border: 0; text-align: center; margin: 2.5rem 0; }
.prose hr::after { content: "❖"; color: var(--accent); }
.prose blockquote { margin: 1.5em 0; padding: 0 0 0 1.25em; border-left: 2px solid var(--rule); color: var(--ink-2); font-style: italic; }
.prose mark { background: var(--mark); color: inherit; padding: 0 .1em; }
.prose code { font-size: .85em; background: var(--paper-2); padding: .1em .3em; border-radius: 3px; }
.prose pre { background: var(--paper-2); padding: 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.5em 0; font-size: 1.05rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .45em .6em; text-align: left; vertical-align: top; }
.prose th { font-family: var(--caps); letter-spacing: .06em; font-weight: 600; border-bottom-color: var(--ink); }
.prose strong { font-weight: 600; }
.intro { font-size: 1.3rem; }

/* Drop cap on dated articles */
.page.dated .prose > p:first-of-type::first-letter {
  float: left; font-size: 4.1em; line-height: .82; padding: .07em .09em 0 0; color: var(--accent); font-weight: 500;
}

/* ---------- figures, quotes, callouts ---------- */
.figure { margin: 2rem 0; text-align: center; }
.figure img { display: block; margin: 0 auto; border-radius: 2px; }
.figure figcaption, .quote figcaption { font-size: 1rem; color: var(--muted); font-style: italic; margin-top: .6rem; }
.quote { margin: 2rem 0; padding: 0 1.5rem; position: relative; }
.quote blockquote { margin: 0; font-style: italic; font-size: 1.2rem; color: var(--ink); border: 0; padding: 0; }
.quote blockquote p { margin: 0 0 .7em; }
.quote blockquote p:last-child { margin-bottom: 0; }
.quote blockquote strong { font-style: normal; font-weight: 600; }
.quote::before { content: "“"; position: absolute; left: -.2rem; top: -.9rem; font-size: 3.4rem; color: var(--accent); opacity: .5; line-height: 1; }
.quote figcaption { text-align: right; font-style: normal; font-family: var(--caps); letter-spacing: .06em; font-weight: 600; color: var(--ink-2); font-size: 1.02rem; }
.quote figcaption cite { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none; }
.quote figcaption a { color: inherit; text-decoration: none; }
.callout { margin: 1.75rem 0; padding: 1rem 1.25rem; background: var(--paper-2); border-left: 2px solid var(--accent); }
.callout-title { font-family: var(--caps); letter-spacing: .07em; font-weight: 600; color: var(--accent); margin: 0 0 .4rem !important; }
.callout > :last-child { margin-bottom: 0; }
.embed { margin: 2rem 0; padding: 1rem 1.25rem; border: 1px solid var(--rule); }
.embed-title { font-family: var(--caps); letter-spacing: .06em; font-weight: 600; margin: 0 0 .5rem !important; }
.attachment { font-style: italic; }
.prose ul:has(> li > .attachment:first-child) { list-style: none; padding-left: 0; }
.pdf { margin: 1.5rem 0 2rem; }
.pdf .attachment-block { text-align: center; margin: 0 0 1rem; }
.pdf object { display: block; width: 100%; height: 85vh; border: 1px solid var(--rule); background: var(--paper-2); }
@media (max-width: 600px) { .pdf object { height: 60vh; } }
.entries li[hidden], .resources li[hidden], .series[hidden], .res-group[hidden] { display: none; }
.tag-filter { margin-top: -.5rem; }
.attachment::before { content: "❧ "; font-style: normal; color: var(--accent); }
.footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 1rem; color: var(--ink-2); }
.fnref a { text-decoration: none; font-size: .75em; padding: 0 .1em; }
.fnback { text-decoration: none; }

/* Click-to-play video */
.video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video button { all: unset; cursor: pointer; position: absolute; inset: 0; background-size: cover; background-position: center; }
.video .play { position: absolute; left: 50%; top: 50%; width: 4.5rem; height: 4.5rem; transform: translate(-50%, -50%); border-radius: 50%; background: color-mix(in srgb, #6B1D1D 88%, transparent); box-shadow: 0 2px 18px rgba(0,0,0,.35); transition: transform .15s; }
.video .play::after { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: .75rem 0 .75rem 1.25rem; border-color: transparent transparent transparent #FAF7F0; }
.video button:hover .play, .video button:focus-visible .play { transform: translate(-50%, -50%) scale(1.07); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- lists of entries ---------- */
.entries { list-style: none; padding: 0; margin: 0 0 1rem; }
.entry { padding: 0 0 1.5rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry-title { font-size: 1.45rem; margin: 0 0 .2rem; }
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--accent); }
.entry-meta { margin: 0 0 .35rem; font-size: .95rem; color: var(--muted); }
.entry-section { color: var(--accent); }
.entry-excerpt { margin: 0; color: var(--ink-2); font-size: 1.12rem; }
.series { margin-top: 3rem; }
.series-desc { text-align: center; font-style: italic; color: var(--muted); margin: -1rem 0 1.5rem; }
.series .entry { padding-bottom: .9rem; margin-bottom: .9rem; }
.series .entry-title { font-size: 1.25rem; }
.more { margin: .35rem 0 0; font-size: 1rem; }
.more a { text-decoration: none; font-style: italic; }

/* ---------- home ---------- */
.home-intro { text-align: left; }
.home-intro > p:first-child::first-letter { float: left; font-size: 4.1em; line-height: .82; padding: .07em .09em 0 0; color: var(--accent); font-weight: 500; }
.section-list { list-style: none; padding: 0; margin: 0; }
.section-list li { display: grid; gap: .1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.section-list li:last-child { border-bottom: 0; }
.section-list a { font-family: var(--caps); font-weight: 600; letter-spacing: .08em; font-size: 1.25rem; text-decoration: none; }
.section-list span { color: var(--ink-2); font-style: italic; font-size: 1.1rem; }

/* ---------- resources ---------- */
.resources { list-style: none; padding: 0; margin: 0; }
.res-group:not([hidden]) ~ .res-group:not([hidden]) { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.resource { padding: 0 0 1.5rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--rule); }
.resource:last-child { border-bottom: 0; }
.citation { padding-left: 2em; text-indent: -2em; margin: 0 0 .5rem; font-size: 1.15rem; }
.page > .citation { text-align: left; margin: -1rem 0 2rem; padding: 1rem 1.25rem 1rem 3.25rem; background: var(--paper-2); border-left: 2px solid var(--accent); }
.citation cite { font-style: italic; }

/* ---------- tags ---------- */
.page-footer .ornament { margin: 2.5rem 0 1.25rem; }
.tags { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; justify-content: center; }
.tags a { font-family: var(--caps); letter-spacing: .07em; font-weight: 600; font-size: .98rem; text-decoration: none; }
.q .tags { justify-content: flex-end; margin-top: .3rem; }
.q .tags a { font-size: .88rem; color: var(--muted); }
.tag-cloud { list-style: none; padding: 0; margin: 0; columns: 2 14rem; column-gap: 2rem; }
.tag-cloud li { break-inside: avoid; padding: .3rem 0; }
.tag-cloud a { font-family: var(--caps); letter-spacing: .07em; font-weight: 600; text-decoration: none; font-size: 1.15rem; }
.count { color: var(--muted); font-size: .9rem; }
.tag-quotes { padding-left: 1.2em; }
.tag-quotes li { margin: 0 0 .9rem; }
.tag-quotes a { color: var(--ink); font-style: italic; text-decoration: none; }

/* ---------- quotes page ---------- */
.q-controls { display: grid; gap: .6rem; margin: 0 0 2.5rem; padding: 1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.q-controls[hidden] { display: none; }
.q-controls > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; }
.q-controls .label { color: var(--muted); font-size: .95rem; min-width: 5rem; }
.q-controls button {
  font: inherit; font-size: 1rem; background: none; border: 1px solid transparent; color: var(--ink-2); padding: .1rem .55rem; border-radius: 2px; cursor: pointer;
}
.q-controls button:hover { color: var(--accent); }
.q-controls button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.filter-select {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
  padding: .2rem 2rem .2rem .6rem; min-width: 14rem; max-width: 100%; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 1rem) 55%, calc(100% - .65rem) 55%; background-size: .35rem .35rem; background-repeat: no-repeat;
}
.filter-select:focus { outline: 1px solid var(--accent); outline-offset: 1px; }
.q { scroll-margin-top: 2rem; }
.q:target blockquote { background: var(--accent-soft); box-shadow: 0 0 0 .6rem var(--accent-soft); }
.q-link { opacity: 0; margin-left: .5rem; font-family: var(--serif); transition: opacity .15s; }
.q:hover .q-link, .q-link:focus { opacity: .6; }
.q-group-title { margin-top: 3rem; }
.q + .q { border-top: 1px solid var(--rule); padding-top: 2.25rem; }

/* ---------- search ---------- */
.search-form input {
  width: 100%; font: inherit; font-size: 1.3rem; padding: .6rem .2rem; background: transparent; color: var(--ink);
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; outline: none;
}
.search-form input:focus { border-bottom-color: var(--accent); }
.search-status { font-size: 1rem; margin: 1rem 0 1.5rem; }
.search-results mark { background: var(--mark); color: inherit; }

/* ---------- footer ---------- */
.colophon { text-align: center; padding: 1rem 1rem 3.5rem; color: var(--muted); font-size: 1rem; max-width: var(--measure); margin: 0 auto; }
.colophon .ornament { margin: 1rem 0 1.5rem; }
.colophon p { margin: .3rem 0; }
.motto { font-style: italic; color: var(--ink-2); }
.footer-links { font-family: var(--caps); letter-spacing: .08em; font-weight: 600; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-links span { margin: 0 .6em; color: var(--rule); }
.copyright { font-size: .95rem; }

@media (max-width: 600px) {
  body { font-size: 1.15rem; }
  .masthead { padding-top: 2.25rem; }
  .nav { gap: .1rem 1.1rem; }
  .nav a { font-size: 1.02rem; }
  main { padding-top: 2.25rem; }
  .quote { padding: 0 .5rem 0 1.25rem; }
  .quote::before { left: -.35rem; }
  .page > .citation { padding-left: 2.75rem; }
}
@media print {
  .masthead nav, .colophon, .q-controls, .skip { display: none; }
  body { background: #fff; color: #000; }
}
