/* Warm paper, forest ink, and antique gold. */
html {
  --wm-canvas: #f7f4eb;
  --wm-surface: #fffdfa;
  --wm-ink: #202e27;
  --wm-muted: #485e53;
  --wm-link: #245440;
  --wm-header: #fdfbf3;
  --wm-rule: #dcd7c4;
  --wm-detail: #a98232;
  --wm-card-outline: #e1dac5;
  --wm-card-radius: 16px;
  --wm-card-padding: clamp(1rem, 2.6vw, 1.65rem);
  --wm-card-gap: 1.1rem;
  --wm-headline: Georgia, 'Times New Roman', serif;
  --wm-text: Metropolis, system-ui, sans-serif;
  --wm-title-weight: 600;
  --wm-title-tracking: -.025em;
}

html.home .posts > .post_item:first-child {
  border-block-start: 3px solid var(--wm-detail);
}

html[data-mode='dim'] {
  --wm-canvas: #17211d;
  --wm-surface: #212e28;
  --wm-ink: #f0ead9;
  --wm-muted: #c1ccbd;
  --wm-link: #a2d6b4;
  --wm-header: #202b24;
  --wm-rule: #415146;
  --wm-card-outline: #415146;
}

html,
html.page,
html[data-mode='dim'],
html:not([data-mode='lit']) {
  --font: var(--wm-text);
  --text: var(--wm-ink);
  --header-text: var(--wm-ink);
  --theme: var(--wm-link);
  --choice-bg: var(--wm-canvas);
  --post-bg: var(--wm-surface);
  --footer-bg: var(--wm-header);
  --accent: var(--wm-link);
  --table-border: var(--wm-rule);
  --light: var(--wm-ink);
}

body {
  background: var(--wm-canvas);
  color: var(--wm-ink);
  font-size: 1rem;
  line-height: 1.6;
}

.nav_header {
  background: var(--wm-header);
  border-block-end: 1px solid var(--wm-rule);
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.nav {
  align-items: center;
  min-block-size: 68px;
  color: var(--wm-ink);
}

.nav_brand img {
  width: 152px !important;
  height: auto;
}

html[data-mode='dim'] .nav_brand img {
  background: #fffdf6 !important;
  border-radius: 4px;
}

.nav_item {
  min-block-size: 44px;
  color: inherit;
  font-size: .94rem;
}

.nav_item:hover,
.post_link a:hover,
.sidebar a:hover,
.wm-footer-links a:hover {
  color: var(--wm-link);
  text-decoration: underline;
  text-underline-offset: .18em;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--wm-link);
  outline-offset: 4px;
}

h1, h2, h3, h4, h5,
.post_link {
  font-family: var(--wm-headline);
  letter-spacing: var(--wm-title-tracking);
}

body main .content {
  max-width: 74rem;
  padding: 6rem clamp(1rem, 3.5vw, 2rem) 1.5rem;
}

body main .content + .content {
  padding-block-start: 0;
}

body main .grid-inverse {
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

@media (min-width: 62rem) {
  body main .grid-inverse {
    grid-template-columns: minmax(0, 2.65fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

.posts {
  padding: 0;
}

.posts > .post_item,
.wm-search-result {
  margin: 0 0 var(--wm-card-gap) !important;
  padding: var(--wm-card-padding);
  background-color: var(--wm-surface);
  border: 1px solid var(--wm-card-outline);
  border-radius: var(--wm-card-radius);
}

.excerpt_header,
.excerpt_footer,
.post_link {
  padding: 0 !important;
}

.post_link a {
  margin: 0 0 .6rem !important;
  color: var(--wm-ink);
  font-size: clamp(1.22rem, 2.05vw, 1.64rem);
  line-height: 1.23;
  font-weight: var(--wm-title-weight);
}

.post_meta,
.post_meta .post_date,
.post_meta .post_time {
  color: var(--wm-muted);
  font-size: .83rem;
}

.post_meta .icon {
  height: .9rem;
  width: .9rem;
}

.excerpt_footer.partition {
  grid-template-columns: minmax(0, 1fr);
  gap: .75rem;
}

.excerpt_thumbnail {
  display: block;
  min-height: 0;
}

.excerpt_thumbnail figure {
  display: block;
  overflow: hidden;
  margin: 0;
  border-radius: calc(var(--wm-card-radius) / 2);
}

.excerpt_thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.15;
  object-fit: cover;
}

@media (min-width: 42rem) {
  .excerpt_footer.partition {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.35fr);
    align-items: start;
  }

  .excerpt_thumbnail img {
    aspect-ratio: 1.5;
  }
}

.excerpt_footer .pale {
  opacity: 1;
  color: var(--wm-muted);
}

.excerpt .excerpt_more {
  min-height: 44px;
  margin-top: .4rem;
  border-radius: var(--wm-card-radius);
  background: var(--wm-link);
  color: var(--wm-canvas);
  border-color: var(--wm-link);
}

.excerpt .excerpt_more:hover,
.excerpt .excerpt_more:focus-visible {
  background: var(--wm-ink);
  color: var(--wm-canvas);
  border-color: var(--wm-ink);
}

.post_content {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.post_content .post_title {
  color: var(--wm-ink);
  margin: 0 0 .8rem;
  font-size: clamp(1.9rem, 4.6vw, 2.8rem);
  line-height: 1.15;
  font-weight: var(--wm-title-weight);
}

.post_content .post_body {
  color: var(--wm-ink);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.72;
}

.post_content .post_body h2 {
  margin-block-start: 1.7rem;
  color: var(--wm-ink);
  font-weight: var(--wm-title-weight);
}

.post_content a:not(.button),
.sidebar a,
.wm-search-result a,
.wm-footer-links a {
  color: var(--wm-link);
}

.footer_inner .to_top {
  background: var(--wm-link);
}

.footer_inner .to_top svg {
  fill: var(--wm-canvas);
  opacity: 1;
}

.sidebar_inner {
  padding: 0 0 .65rem;
}

.sidebar_inner::before {
  background: var(--wm-rule);
  left: -1.5rem;
}

.sidebar_inner a {
  display: inline-block;
  padding-block: .2rem;
}

.wm-ad,
body main .wm-ad-footer {
  box-sizing: border-box;
}

.wm-ad {
  justify-content: center;
  inline-size: 100%;
  margin-block: 3rem;
}

.wm-ad-item {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wm-ad-item,
.wm-ad-footer,
.wm-ad {
  display: none;
}

html[data-wm-ads] .wm-ad-item {
  display: flow-root;
}

html[data-wm-ads] .wm-ad-footer {
  display: block;
}

html[data-wm-ads] .wm-ad {
  display: flex;
}

html[data-wm-ads] :is(.wm-ad-item, .wm-ad-footer, .wm-ad):has(.adsbygoogle[data-ad-status='unfilled']) {
  display: none;
}

.wm-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  grid-column: 1 / -1;
  padding-block-start: .75rem;
}

.wm-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.wm-search label {
  display: block;
  margin-bottom: .45rem;
  font-weight: 700;
}

.wm-search > div {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: stretch;
}

.wm-search input,
.wm-search button {
  border-radius: var(--wm-card-radius);
  min-height: 44px;
  padding: .55rem .8rem;
  font: inherit;
}

.wm-search input {
  flex: 1;
  min-width: 10rem;
  border: 1px solid var(--wm-rule);
  background: var(--wm-surface);
  color: var(--wm-ink);
}

.wm-search button {
  cursor: pointer;
  border: 1px solid var(--wm-link);
  background: var(--wm-link);
  color: var(--wm-canvas);
}

.wm-search-result a {
  font-weight: 700;
}

.wm-trust {
  max-width: 68ch;
}

@media (max-width: 769px) {
  .nav {
    flex-direction: row;
  }

  .nav_brand {
    padding: .6rem 0;
    width: auto;
  }

  .nav_brand img {
    width: 132px !important;
  }

  .nav_close {
    position: relative;
    inset: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    color: var(--wm-ink);
    border: 1px solid var(--wm-rule);
    border-radius: 7px;
    background: var(--wm-surface);
  }

  .nav_close svg {
    fill: currentColor;
  }

  .nav_body {
    background: var(--wm-header);
    visibility: hidden;
    overflow: auto;
  }

  .jsopen .nav_body {
    visibility: visible;
  }

  .sidebar_inner::before {
    display: none;
  }

  .sidebar_inner a {
    padding-block: .45rem;
  }

  .footer_inner {
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    column-gap: .5rem;
  }

  .footer_inner .to_top {
    position: static;
  }

  body main .content {
    padding-inline: clamp(10px, 4.1vw, 1.4rem);
  }
}

@media (max-width: 340px) {
  body main .content { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body, html { scroll-behavior: auto; }
  .nav_body { transition: none; }
}
