/* Harlan Ferments
   Warm gray page, cream paper, deep green from the logo.
   The seal is already circular. The header does not add a frame. */

:root {
  --ink: #1c2b22;
  --green: #1b3328;
  --muted: #3e5146;
  --cream: #fff9e9;
  --paper: #fffdf8;
  --page: #f1eee6;
  --line: #e0d8cb;
  --header-text: #fff9e9;
  --tagline: #e7f0e4;
  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
}

h1,
h2 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--green);
  overflow-wrap: break-word;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 1.15rem + 2vw, 2.3rem);
}

p {
  margin: 0 0 0.9rem;
}

a {
  color: #1a4030;
}

a:visited {
  color: #1a4030;
}

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

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--cream);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-200%);
  background: var(--paper);
  color: var(--green);
  padding: 0.5rem 0.75rem;
  z-index: 30;
  border-radius: 4px;
}

.skip-link:focus {
  transform: none;
}

.site {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.wrap {
  width: min(70rem, calc(100% - 2rem));
  margin-inline: auto;
}

main {
  padding: 1.5rem 0 3rem;
}

main:focus {
  outline: none;
}

.site-header {
  background: var(--green);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.25rem;
  padding-block: 0.65rem;
}

.brand {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.65rem;
  color: var(--header-text);
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.brand-name,
.brand-tag {
  display: block;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.15;
  color: var(--cream);
}

.brand-name .tm {
  font-size: 0.45em;
  font-weight: 600;
  line-height: 0;
  margin-left: 0.12em;
  position: relative;
  top: -0.85em;
  color: var(--tagline);
}

@media (max-width: 23rem) {
  .wrap {
    width: min(70rem, calc(100% - 1.25rem));
  }

  .brand {
    column-gap: 0.45rem;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand-name {
    font-size: 0.95rem;
  }

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

  .nav-toggle {
    padding: 0.35rem 0.5rem;
  }
}

.brand-tag {
  margin-top: 0.12rem;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--tagline);
}

.nav-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(255, 249, 233, 0.55);
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
}

.nav-toggle-icon {
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.site-nav ul,
.footer-nav ul,
.archive-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav ul {
  display: grid;
}

.site-nav a {
  display: grid;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.15rem;
  color: var(--cream);
  text-decoration: none;
  border-radius: 4px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
}

@media (max-width: 47.99rem) {
  .site-nav {
    display: none;
  }

  .site-nav.is-open {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 0.4rem;
  }
}

@media (min-width: 48rem) {
  .wrap {
    width: min(70rem, calc(100% - 3rem));
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .brand-name {
    font-size: 1.35rem;
  }

  .brand-tag {
    font-size: 0.875rem;
  }

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

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .site-nav ul {
    grid-auto-flow: column;
    justify-content: end;
    align-items: center;
    gap: 0.15rem;
  }

  .site-nav a {
    padding: 0.35rem 0.7rem;
  }
}

.page-intro {
  max-width: 40rem;
  margin-bottom: 1.5rem;
}

.lede {
  font-size: 1.125rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 70rem) {
  .card-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  background: var(--paper);
  border: 1px solid var(--line);
  height: 100%;
}

.card img,
.card-fallback {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  display: block;
  background: #e7efe4;
}

.card-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.card h2 {
  margin: 0.9rem 1rem 0;
  font-size: 1.25rem;
}

.card h2 a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-date,
.card-excerpt,
.read-more {
  margin-left: 1rem;
  margin-right: 1rem;
}

.card-date {
  margin-top: 0.35rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-excerpt {
  margin-top: 0.6rem;
  margin-bottom: 0;
  display: grid;
  gap: 0.55rem;
}

.card-excerpt p,
.read-more,
.card-date {
  margin-bottom: 0;
}

.read-more {
  margin-top: 0.85rem;
  margin-bottom: 1rem;
  color: var(--green);
  font-weight: 700;
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--green);
  }
}

.card:focus-within {
  border-color: var(--green);
}

.post {
  display: grid;
  gap: 0.75rem;
  max-width: 42rem;
}

.post h1,
.post-date,
.post-body p,
.caption,
figcaption {
  margin: 0;
}

.post-date,
.caption,
figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.post-media {
  display: grid;
  gap: 0.75rem;
}

.post-figure {
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.post-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #e7efe4;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--green);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-body {
  display: grid;
  gap: 1rem;
}

.post-links {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  gap: 1rem;
  margin: 0.5rem 0 0;
}

.archive-form {
  display: grid;
  gap: 0.35rem;
  max-width: 28rem;
  margin: 0 0 0.75rem;
}

.archive-form label {
  font-weight: 700;
  color: var(--green);
}

.archive-form input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cfc6b8;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

.archive-form input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.archive-status {
  min-height: 1.6em;
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.archive-group h2 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.25rem;
}

.archive-group:first-child h2 {
  margin-top: 0.25rem;
}

.archive-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.archive-item time {
  color: var(--muted);
}

.archive-item a {
  color: var(--green);
  font-weight: 700;
}

@media (min-width: 40rem) {
  .archive-item {
    grid-template-columns: 11.5rem minmax(0, 1fr);
    align-items: baseline;
  }
}

.prose {
  max-width: 40rem;
}

.prose h2 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.28rem;
}

.review-banner {
  background: var(--cream);
  border: 1px solid #e0d2b0;
  border-left: 4px solid var(--green);
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  max-width: 42rem;
}

.review-banner p {
  margin: 0;
}

.noscript-note,
.empty {
  color: var(--muted);
}

.noscript-note {
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
}

code {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.92em;
  background: #f3eee2;
  padding: 0.05em 0.3em;
}

.facts {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.facts article {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1rem;
}

.facts h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.facts p {
  margin: 0;
}

@media (min-width: 48rem) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }

  .facts article:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .facts {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .facts article:last-child {
    grid-column: auto;
  }
}

.site-footer {
  background: var(--green);
  color: var(--cream);
  /* Extra bottom space so the floating Buy Me a Coffee button
     (bottom-right, 18px margin) does not cover the copyright line. */
  padding: 1.5rem 0 calc(1.25rem + 5.5rem);
}

.footer-grid {
  display: grid;
  gap: 1rem 1.5rem;
}

.footer-name {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--cream);
}

.footer-blurb {
  margin: 0;
  max-width: 36rem;
  color: var(--tagline);
}

.footer-nav a {
  display: inline-block;
  min-height: 44px;
  padding-block: 0.55rem;
  color: var(--cream);
}

.footer-nav a[aria-current="page"] {
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.coffee {
  margin: 1.25rem 0 0;
}

.coffee-link {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 249, 233, 0.7);
  border-radius: 4px;
  background: transparent;
  font-size: 0.95rem;
  text-decoration: none;
}

/* :visited on a plain link is dark green and would disappear on this
   footer. These states outrank that rule so the label stays cream. */
.coffee-link:link,
.coffee-link:visited,
.coffee-link:hover,
.coffee-link:focus,
.coffee-link:focus-visible,
.coffee-link:active {
  color: var(--cream);
}

.coffee-link:hover,
.coffee-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  background: rgba(255, 249, 233, 0.08);
}

.coffee-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

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

.copyright {
  border-top: 1px solid rgba(255, 249, 233, 0.28);
  margin: 1rem 0 0;
  padding-top: 1rem;
  color: var(--cream);
  font-size: 0.95rem;
}

.copyright a {
  color: var(--cream);
}

@media (min-width: 40rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) auto;
    align-items: start;
  }
}

@media (forced-colors: active) {
  .card,
  .facts article,
  .review-banner,
  .coffee-link {
    border: 1px solid CanvasText;
  }
}
