/* ==========================================================================
   lief.name — editorial blog styles
   ========================================================================== */

:root {
  --font-serif: "Erode", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-script: "Telma", "Snell Roundhand", "Apple Chancery", cursive;
  --font-sans: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale: 12px min, 17px body, 34px max (8px baseline grid). */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.75rem;
  --text-max: 2.125rem;
  --baseline: 1.5rem;
  --baseline-half: 0.75rem;
  --line-tight: 1rem;

  --paper: #ffffff;
  --paper-raised: #f7f9fc;
  --ink: #333333;
  --muted: #5f6b78;
  --line: #d8dfe6;
  --accent: #1a5fb4;
  --accent-dark: #12457f;
  --accent-soft: #e8f0fa;
  --footer-bg: #1f2933;
  --footer-fg: #f7f9fc;
  --footer-muted: #b9c4ce;

  --header-bg: #dbe9f8;
  --header-fg: var(--ink);
  --header-muted: #4c5a68;
  --header-line: #b9cfe5;

  --shell: 936px;
  --measure: 702px;
  --radius: 6px;
  --shadow: 0 18px 40px -28px rgba(16, 24, 32, 0.45);
  --transition: 180ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1319;
    --paper-raised: #151d25;
    --ink: #e7edf3;
    --muted: #a9b6c3;
    --line: #33404c;
    --accent: #6fb6e8;
    --accent-dark: #9bcdf0;
    --accent-soft: #1b2a36;
    --footer-bg: #080c10;
    --footer-fg: #e7edf3;
    --footer-muted: #aab6c2;
    --header-bg: #16324f;
    --header-fg: #e7edf3;
    --header-muted: #b9c9d8;
    --header-line: #0e2237;
    --shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.85);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size-adjust: 0.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

input,
select,
textarea,
button {
  font-size-adjust: 0.5;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--baseline);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Interface text stays sans-serif; reading text uses Erode. */
.site-nav a,
.search-form,
.button,
.chip,
.badge,
.breadcrumbs,
.eyebrow,
.card-meta,
.post-byline,
.pagination,
.count,
.tag-cloud a,
.category-tree a,
.subcategory-tree a,
.footer-links,
.footer-legal {
  font-family: var(--font-sans);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--paper);
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--line-tight);
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: var(--text-xs);
  line-height: var(--line-tight);
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--accent);
}

.breadcrumbs a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.badge {
  display: inline;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--line-tight);
  padding: 0;
  border: 0;
  color: var(--accent);
  text-decoration: none;
  vertical-align: middle;
}

.badge:hover {
  text-decoration: underline;
}

.button {
  display: inline;
  padding: 0;
  background: none;
  color: var(--accent);
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

.button:hover {
  background: none;
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.text-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  background: var(--header-bg);
  color: var(--header-fg);
  box-shadow: inset 0 -1px 0 var(--header-line);
}

.header-inner {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  min-height: 52px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
}

.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--line-tight);
  text-decoration: none;
  color: var(--header-muted);
  transition: color var(--transition);
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.75rem;
  left: 0;
  height: 1px;
  background: transparent;
  z-index: 1;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--header-fg);
}

.site-nav a:hover::after,
.site-nav a.is-active::after,
.nav-more.has-active .nav-more-toggle::after {
  background: var(--header-fg);
}

.nav-more {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-more[hidden] {
  display: none;
}

.nav-more-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--header-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--line-tight);
  cursor: pointer;
}

.nav-more-toggle::before {
  content: "";
  order: 2;
  width: 0;
  height: 0;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform var(--transition);
}

.nav-more-toggle[aria-expanded="true"]::before {
  transform: rotate(180deg);
}

.nav-more-toggle::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.75rem;
  left: 0;
  height: 1px;
  background: transparent;
  z-index: 1;
}

.nav-more-toggle:hover,
.nav-more.has-active .nav-more-toggle {
  color: var(--header-fg);
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  z-index: 50;
  width: max-content;
  max-width: min(260px, 80vw);
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem 0;
  background: var(--paper);
  border: 1px solid var(--line);
}

.nav-more-menu[hidden] {
  display: none;
}

.nav-more-menu a {
  display: block;
  padding: 0.35rem 0.75rem;
  border: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: var(--line-tight);
  text-decoration: none;
}

.nav-more-menu a:hover,
.nav-more-menu a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-more-menu a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

.search-form {
  flex: 0 0 300px;
  align-self: center;
}

.header-inner .search-form {
  background: var(--paper);
  border-color: transparent;
}

.header-inner .search-form input {
  color: var(--ink);
}

.header-inner .search-form button {
  color: var(--muted);
}

.site-header :focus-visible {
  outline-color: var(--header-fg);
}

.search-form {
  display: flex;
  align-items: center;
  width: 300px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper-raised);
  overflow: hidden;
  transition: border-color var(--transition);
}

.search-form:focus-within {
  border-color: var(--accent);
}

.search-form input {
  flex: 1;
  width: auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: 0.5rem 0 0.5rem 0.9rem;
  outline: none;
}

.search-form input::placeholder {
  color: var(--muted);
}

.search-form button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

.search-form button:hover {
  color: var(--accent);
}

.search-form-large {
  width: 540px;
  max-width: 100%;
  margin: 0 0 1.5rem;
  border-radius: 0;
}

.search-form-large input {
  flex: 1;
  width: auto;
  font-size: var(--text-base);
  padding: 0.85rem 1rem;
}

.search-form-large button {
  padding: 0.85rem 1.4rem;
  background: var(--accent);
  color: #fff;
  line-height: var(--baseline);
}

.search-form-large button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.messages {
  margin-top: 1.5rem;
}

.message {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--paper-raised);
  padding: 0.75rem 1rem;
  font-size: var(--text-md);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Main
   -------------------------------------------------------------------------- */

main {
  padding-top: 0;
  min-height: 60vh;
}

main.shell {
  flex: 1 0 auto;
  padding-bottom: 2rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.page-head {
  padding: 1.25rem 0 0.75rem;
}

.page-head-no-border {
  border-bottom: 0;
}

.page-head h1 {
  font-size: clamp(1.75rem, 3.5vw, var(--text-max));
  line-height: 2.5rem;
  margin: 0.5rem 0 0.5rem;
}

.lede {
  max-width: 702px;
  font-size: var(--text-base);
  line-height: var(--baseline);
  color: var(--muted);
  margin-bottom: 0;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.chip {
  display: inline;
  padding: 0;
  border: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color var(--transition);
}

.chip:hover {
  color: var(--accent);
}

.subcategory-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  margin-top: 0.75rem;
}

.subcategory-nav .chip-list {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: 540px 300px;
  gap: 56px;
  margin-top: 1rem;
  align-items: baseline;
}

.layout-with-head {
  margin-top: 0;
}

.layout-with-head .page-head {
  margin-bottom: 1rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h1,
.section-heading h2 {
  font-size: var(--text-lg);
  line-height: var(--baseline);
}

.content-column {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Post cards
   -------------------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0;
}

.post-card {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0;
}

.post-card:first-child {
  padding-top: 0;
}

.post-card:last-child {
  padding-bottom: 0;
  box-shadow: none;
}

.card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 0.6rem;
  background: var(--accent-soft);
  text-decoration: none;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
}

.card-title {
  font-family: var(--font-script);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 2rem;
  margin-bottom: 0.25rem;
}

.card-title a {
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-excerpt {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: var(--baseline);
  color: var(--muted);
  margin-bottom: 0;
}

.card-content.prose {
  max-width: 100%;
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--baseline);
}

.card-content.prose.prose-large {
  font-size: var(--text-lg);
  line-height: 2rem;
}

.card-content.prose > * + * {
  margin-top: 0.75rem;
}

.card-content.prose h2 {
  font-size: var(--text-lg);
  line-height: var(--baseline);
  margin-top: var(--baseline);
}

.card-content.prose h3 {
  font-size: var(--text-base);
  line-height: var(--baseline);
  margin-top: var(--baseline);
}

.card-content.prose.prose-large h2 {
  font-size: var(--text-xl);
  line-height: 2rem;
  margin-top: 2rem;
}

.card-content.prose.prose-large h3 {
  font-size: var(--text-lg);
  line-height: 2rem;
  margin-top: 1.5rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-xs);
  line-height: var(--line-tight);
  color: var(--muted);
}

.card-meta a {
  color: inherit;
  text-decoration: none;
}

.card-meta a:hover {
  color: var(--accent);
}

.card-meta .eyebrow {
  font-size: inherit;
}

.card-footer .badge {
  flex-shrink: 0;
}

.post-card.is-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

/* Without artwork, a featured card reads better at normal card width. */
.post-card.is-featured.no-cover {
  grid-column: auto;
  display: flex;
}

.post-card.is-featured .card-media {
  aspect-ratio: auto;
  height: 100%;
  min-height: 220px;
  margin-bottom: 0;
}

.post-card.is-featured .card-body {
  justify-content: center;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Empty state, pagination, lists
   -------------------------------------------------------------------------- */

.empty-state {
  padding: 1.25rem 0;
  text-align: left;
}

.empty-state h1,
.empty-state h2 {
  font-size: var(--text-2xl);
  line-height: 2rem;
  margin: 0.25rem 0 0.75rem;
}

.empty-state p {
  color: var(--muted);
  max-width: 48ch;
  margin: 0 0 0.75rem;
}

.empty-state.standalone {
  margin: 2rem 0;
  max-width: 720px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.5rem;
  font-size: var(--text-sm);
  line-height: var(--line-tight);
}

.pagination-link {
  font-weight: 600;
  text-decoration: none;
}

.pagination-link.is-disabled {
  color: var(--muted);
  opacity: 0.5;
}

.pagination-status {
  color: var(--muted);
  font-size: var(--text-xs);
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-list li {
  padding: 0.5rem 0;
}

.link-list a {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--baseline);
  text-decoration: none;
}

.link-list a:hover {
  color: var(--accent);
}

.link-list p {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--baseline);
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.link-feed {
  list-style: none;
  max-width: var(--measure);
  margin: 1.25rem 0 0;
  padding: 0;
}

.link-entry {
  padding: 1rem 0;
}

.link-entry:first-child {
  padding-top: 0;
}

.link-entry-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--baseline);
  text-decoration: none;
}

.link-entry-title:hover {
  color: var(--accent);
}

.link-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--baseline);
}

.link-entry-comment {
  max-width: 65ch;
  margin: 0.35rem 0 0;
  line-height: var(--baseline);
}

.page-results {
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar {
  font-size: var(--text-md);
}

.sidebar-block {
  padding: 0.65rem 0;
}

.sidebar-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.sidebar-block h2 {
  font-size: var(--text-lg);
  line-height: var(--baseline);
  margin-bottom: 0.35rem;
}

.sidebar-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.sidebar-heading h2 {
  margin: 0;
}

.about-text {
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--baseline);
  margin-bottom: 0.4rem;
}

.category-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem;
  border-left: 1px solid var(--line);
}

.category-tree li {
  margin: 0.1rem 0;
}

.category-tree a {
  display: inline-block;
  padding: 0.2rem 0;
  color: var(--muted);
  font-family: var(--font-sans);
  text-decoration: none;
  font-size: var(--text-sm);
}

.category-tree a:hover {
  color: var(--ink);
}

.category-tree a.is-current {
  color: var(--accent);
  font-weight: 600;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color var(--transition);
}

.tag-cloud a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Single post / page
   -------------------------------------------------------------------------- */

.post {
  max-width: var(--measure);
  margin: 0;
  padding-top: 1.25rem;
}

.post.post-untitled {
  padding-top: 1.5rem;
}

.post-header {
  margin-bottom: 0.75rem;
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, var(--text-max));
  font-weight: 600;
  line-height: 2.5rem;
  margin: 0.25rem 0 0.5rem;
  max-width: 24ch;
}

.post-title-script {
  font-family: var(--font-script);
  font-size: clamp(1.75rem, 4.5vw, var(--text-max));
  font-weight: 400;
  line-height: 2.5rem;
}

.page-title {
  font-family: var(--font-sans);
}

.post-lede {
  font-family: var(--font-serif);
  font-size: clamp(1.0625rem, 1.6vw, 1.125rem);
  line-height: var(--baseline);
  color: var(--muted);
  max-width: 702px;
  margin-bottom: 0.5rem;
}

.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-xs);
  line-height: var(--line-tight);
  color: var(--muted);
}

.post-byline span + span::before,
.post-byline time + span::before,
.post-byline span + time::before {
  content: "·";
  margin-right: 0.6rem;
  color: var(--line);
}

.post-cover {
  margin: 0 0 1rem;
}

.post-cover img {
  width: 100%;
}

.post-cover figcaption {
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: left;
}

.prose {
  max-width: 702px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--baseline);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-serif);
}

.prose.prose-large {
  font-size: var(--text-lg);
  line-height: 2rem;
}

.prose.prose-large h2 {
  font-size: var(--text-xl);
  line-height: 2rem;
}

.prose.prose-large h3 {
  font-size: var(--text-lg);
  line-height: 2rem;
}

.prose > * + * {
  margin-top: 0.75rem;
}

.prose h2 {
  font-size: var(--text-2xl);
  line-height: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

.prose h3 {
  font-size: var(--text-lg);
  line-height: var(--baseline);
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
}

.prose h4 {
  font-size: var(--text-base);
  line-height: var(--baseline);
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.prose p {
  margin: unset;
}

.prose p + p {
  text-indent: 1lh;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--accent-dark);
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 1rem 0;
  padding: 0.2em 0 0.2em 1rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.2em;
  line-height: var(--baseline);
  font-style: italic;
  color: var(--muted);
}

.prose ul,
.prose ol {
  margin-block: 1lh;
  padding-left: 1.4em;
}

.prose li > ul,
.prose li > ol {
  margin-block: 0;
}

.prose li + li {
  margin-top: 0.15rem;
}

.prose img {
  margin: 1rem auto;
}

.post .prose img {
  max-height: calc(100vh - 6rem);
  max-height: calc(100dvh - 6rem);
  width: auto;
}

.prose figure {
  margin: 1rem 0;
}

/* CKEditor media / oEmbed embeds */
.prose .media {
  margin: 1.5rem 0;
}

.prose.prose-embed-only > .media,
.prose.prose-embed-only > figure,
.prose.prose-embed-only > oembed {
  margin-top: 0;
  margin-bottom: 0;
}

.prose .media [data-oembed-url] {
  width: 100%;
}

.prose .media iframe,
.prose iframe {
  max-width: 100%;
  border: 0;
}

.prose oembed {
  display: block;
  padding: 0.75rem 0;
  color: var(--muted);
}

.prose figcaption {
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  line-height: var(--line-tight);
  color: var(--muted);
  text-align: left;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: var(--baseline);
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem auto;
  width: 40%;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.3rem 0.5rem;
  text-align: left;
}

.prose th {
  background: var(--paper-raised);
  font-weight: 700;
}

.prose .todo-list {
  list-style: none;
  padding-left: 0;
}

.prose .todo-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.post-footer-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-footer .breadcrumbs,
.archive-footer .breadcrumbs {
  margin-bottom: 0;
}

.archive-footer {
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.post-meta-row .text-link {
  font-weight: 400;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
}

.post-tags .eyebrow {
  display: inline;
  margin: 0;
}

.post-footer .tag-cloud a,
.post-footer .text-link {
  font-size: var(--text-xs);
  line-height: var(--line-tight);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: var(--measure);
  margin: 1.5rem 0 0;
  padding: 0.75rem 0;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-decoration: none;
}

.post-nav-item.is-next {
  text-align: left;
  align-items: flex-start;
}

.post-nav-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--baseline);
}

.post-nav-item:hover .post-nav-title {
  color: var(--accent);
}

.related {
  max-width: var(--measure);
  margin: 1.5rem 0 0;
}

.related > .eyebrow {
  display: block;
  margin: 0 0 0.5rem;
}

.related .post-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.related .post-card {
  padding: 0;
  border-bottom: 0;
}

.related .card-footer {
  margin-top: 0.5rem;
}

.related .card-footer .badge {
  display: none;
}

.related .card-title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--baseline);
}

.related .card-excerpt,
.related .card-media {
  display: none;
}

/* --------------------------------------------------------------------------
   Category index
   -------------------------------------------------------------------------- */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1rem;
  align-items: start;
}

.archive-section h2 {
  font-size: var(--text-lg);
  line-height: var(--baseline);
  margin-bottom: 0.5rem;
}

.archive-section h3 {
  font-size: var(--text-base);
  line-height: var(--baseline);
  margin: 1rem 0 0.25rem;
}

.archive-section h3 a,
.date-list a {
  color: var(--muted);
  text-decoration: none;
}

.archive-section h3 a:hover,
.date-list a:hover {
  color: var(--accent);
}

.date-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.date-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.category-card {
  padding-top: 0.5rem;
}

.category-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.category-card h2 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: var(--baseline);
}

.category-card h2 a {
  text-decoration: none;
}

.category-card h2 a:hover {
  color: var(--accent);
}

.count {
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
}

.count:hover {
  color: var(--accent);
}

.category-description {
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--baseline);
  margin: 0.25rem 0;
}

.subcategory-tree {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.subcategory-tree ul {
  list-style: none;
  padding: 0 0 0 1rem;
  margin: 0.2rem 0 0;
  border-left: 1px solid var(--line);
}

.subcategory-tree li {
  padding: 0.1rem 0;
}

.branch-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.subcategory-tree a {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
}

.subcategory-tree a:hover {
  color: var(--accent);
}

.subcategory-tree .count {
  font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--paper);
  color: var(--ink);
  padding: 2rem 0 1rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
}

.footer-brand {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  line-height: var(--baseline);
  margin-bottom: 0.15rem;
}

.footer-tagline {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--text-xs);
  line-height: var(--line-tight);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  font-size: var(--text-xs);
  line-height: var(--line-tight);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .related .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The fixed archive columns no longer fit below this width. */
@media (max-width: 940px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 4rem;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
    padding-top: 0.75rem;
  }

  .sidebar-block {
    border-top: 0;
    padding: 0 0 0.75rem;
  }

  .sidebar-block:first-child {
    padding-top: 0;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding-bottom: 0;
    min-height: 0;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: 0.75rem;
  }

  .site-nav a::after,
  .nav-more-toggle::after {
    bottom: 0;
  }

  .nav-more-menu {
    top: 100%;
  }

  .header-inner .search-form {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card.is-featured {
    display: flex;
  }

  .post-card.is-featured .card-media {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
    margin-bottom: 0.6rem;
  }

  .post-card.is-featured .card-body {
    padding: 0;
  }

}

@media (max-width: 620px) {
  .page-head {
    padding-top: 0.75rem;
  }

  .post-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .post {
    padding-top: 0.75rem;
  }

  .post-title {
    font-size: clamp(1.75rem, 6vw, var(--text-max));
  }

  .post-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .post-nav-item.is-next {
    text-align: left;
    align-items: flex-start;
  }

  .category-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .archive-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .related .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .related .card-excerpt,
  .related .card-media {
    display: block;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    flex-direction: column;
  }

  .prose {
    font-size: var(--text-base);
  }

}

/* Let tall images breathe naturally in phone landscape. */
@media (orientation: landscape) and (max-height: 500px) {
  .post .prose img {
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .post-nav,
  .related,
  .post-footer,
  .skip-link,
  .messages {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .post {
    padding-top: 0;
  }

  .prose a {
    color: #000;
  }
}
