/* Backyard Ledger — practical fixes for house, yard and garden.
   The idea: a gardener's field ledger. Ruled pages, a plum margin line,
   entries dated down the left like a notebook kept by the back door.
   - One memorable thing: the masthead is a strip of ledger paper — green
     rules, a double plum margin line — and the same margin line runs down
     the home page's list of entries. Everything else stays quiet.
   - One family, Alegreya (a calligraphic old-style made for long reading):
     800 for headlines, italic for deks, 500 for body.
   - Leaf-white paper (green-tinted, not cream), moss ink, leaf green, and
     plum as the unexpected second colour.
   Font: Alegreya, SIL Open Font License, self-hosted. */

@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../../fonts/moss-alegreya.woff2") format("woff2");
}
@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 500 800;
  font-display: swap;
  src: url("../../fonts/moss-alegreya-italic.woff2") format("woff2");
}

.theme-moss {
  --paper:   #f2f5ee;   /* leaf-white */
  --surface: #f8faf5;
  --ink:     #1d3326;   /* moss ink */
  --muted:   #586a5c;
  --rule:    #c9d8c4;   /* ledger line */
  --leaf:    #3e7748;
  --plum:    #6b2d5c;   /* margin line, links */
  --accent:  #3e7748;
  --accent-d:#6b2d5c;
  --serif:   "Alegreya", Georgia, "Times New Roman", serif;
  --sans:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --lines:   repeating-linear-gradient(to bottom, transparent 0 27px, #b4c9ad 27px 28px);
  --margin:  linear-gradient(to right, var(--plum) 0 1px, transparent 1px 4px, var(--plum) 4px 5px, transparent 5px);
}

body.theme-moss { font-size: 1.25rem; line-height: 1.6; font-weight: 500; }

/* ---------- masthead: a strip of ledger paper ---------- */
.theme-moss .masthead {
  background-color: var(--surface);
  background-image: var(--lines);
  border-bottom: 2px solid var(--ink);
}
.theme-moss .bar {
  position: relative; padding: 2.1rem 1.25rem 1.75rem 2.4rem;
}
.theme-moss .bar::before {          /* the margin line */
  content: ""; position: absolute; top: 0; bottom: 0; left: 1.25rem; width: 5px;
  background: var(--margin);
}
.theme-moss .brand { gap: .65rem; color: var(--ink); }
.theme-moss .mark { width: 40px; height: 40px; color: var(--leaf); }
.theme-moss .mark path[stroke] { stroke: var(--surface); }
.theme-moss .wordmark { font-family: var(--serif); font-size: 2.3rem; letter-spacing: -.01em; }
.theme-moss .wordmark .w-first,
.theme-moss .wordmark .w-key { font-weight: 800; color: var(--ink); margin-right: .2em; }
.theme-moss .wordmark .w-last { font-weight: 500; font-style: italic; color: var(--leaf); }
.theme-moss .tagline {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--muted);
}
.theme-moss .sections { background: var(--ink); border-top: 0; }
.theme-moss .sections .inner { padding: .5rem 1.25rem .55rem 2.4rem; }
.theme-moss .sections a { color: #e5ede2; font-weight: 600; }
.theme-moss .sections a:hover { color: #fff; text-decoration: underline; text-underline-offset: .2em; }

/* ---------- article ---------- */
.theme-moss .article { padding-top: 2.75rem; }
.theme-moss .article h1,
.theme-moss .bl-lead h1 { font-weight: 800; letter-spacing: -.012em; line-height: 1.05; }
.theme-moss .article h1 { font-size: clamp(2.3rem, 4.8vw, 3.3rem); margin-bottom: .6rem; }
.theme-moss .dek { font-style: italic; color: var(--muted); font-size: 1.42rem; line-height: 1.4; }
.theme-moss .byline {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.theme-moss .byline strong { color: var(--ink); }
.theme-moss .body h2 {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.008em; line-height: 1.15;
  margin-top: 2.5rem; color: var(--ink);
}
.theme-moss .body h3 { font-size: 1.35rem; font-weight: 700; font-style: italic; }
.theme-moss .body strong { font-weight: 800; color: var(--ink); }
.theme-moss .body a { color: var(--plum); text-decoration-thickness: 1px; }
.theme-moss .body ul li::marker { color: var(--leaf); }
.theme-moss .body ol li::marker { color: var(--plum); font-weight: 700; }
.theme-moss figure img { border-radius: 0; }
.theme-moss figcaption { font-family: var(--serif); font-style: italic; font-size: .95rem; }
.theme-moss .chart { background: var(--surface); border-color: var(--rule); }
.theme-moss .inseries a, .theme-moss .cluster a, .theme-moss .sources a { color: var(--plum); }
.theme-moss .cluster, .theme-moss .sources { border-top: 2px solid var(--ink); }
.theme-moss .cluster h2, .theme-moss .sources h2 { font-size: 1.3rem; font-weight: 800; }
.theme-moss .cluster li, .theme-moss .sources li { font-size: .95rem; }
.theme-moss .pager .next { background: var(--leaf); border-radius: 0; }

/* ---------- rail: notes in the margin ---------- */
.theme-moss .railbox {
  background: transparent; border: 0; border-radius: 0; padding: 0 0 0 1rem;
  margin-bottom: 2rem; border-left: 2px solid var(--leaf);
}
.theme-moss .railbox h2 {
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.15rem;
  color: var(--leaf); border-bottom: 0; padding-bottom: 0; margin-bottom: .6rem;
}
.theme-moss .railbox a { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.theme-moss .railbox a:hover { color: var(--plum); }
.theme-moss .toc li::before { color: var(--plum); font-family: var(--serif); font-size: .9rem; top: .05rem; }
.theme-moss .standards { border-left-color: var(--plum); }
.theme-moss .standards h2 { color: var(--plum); }
.theme-moss .standards a { color: var(--plum); }

/* ---------- home ---------- */
.bl-home { max-width: 68rem; margin: 0 auto; padding: 2.6rem 1.25rem 1rem; }
.bl-lead a {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2.4rem;
  align-items: center; color: inherit; text-decoration: none;
}
.bl-plate { margin: 0; padding: .6rem; background: var(--surface); border: 1px solid var(--rule); }
.bl-plate img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.bl-note { margin: 0 0 .6rem; font-style: italic; color: var(--plum); font-size: 1.1rem; }
.bl-lead h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin: 0 0 .9rem; }
.bl-lead .dek { margin: 0 0 1.4rem; font-size: 1.3rem; }
.bl-go {
  font-weight: 700; color: var(--leaf); font-size: 1.15rem;
  border-bottom: 2px solid var(--leaf); padding-bottom: .1rem;
}
.bl-lead a:hover .bl-go { color: var(--plum); border-color: var(--plum); }
.bl-lead a:hover h1 { color: var(--leaf); }

.bl-entries { margin-top: 3.6rem; }
.bl-entries > h2 {
  font-size: 1.6rem; font-weight: 800; margin: 0; padding: 0 0 .5rem;
  border-bottom: 2px solid var(--ink);
}
.bl-rows {
  list-style: none; margin: 0 0 2rem; padding: 0; position: relative;
}
.bl-rows::before {                 /* the same margin line, down the list */
  content: ""; position: absolute; top: 0; bottom: 0; left: 5.4rem; width: 5px;
  background: var(--margin);
}
.bl-rows li { border-bottom: 1px solid var(--rule); }
.bl-rows a {
  display: grid; grid-template-columns: 5.4rem minmax(0, 1fr) 9.5rem; gap: 0 1.6rem;
  align-items: start; padding: 1.15rem 0; color: inherit; text-decoration: none;
}
.bl-rows time, .bl-nodate {
  font-style: italic; color: var(--plum); font-size: 1.05rem; padding-right: 1rem; text-align: right;
  padding-top: .25rem;
}
.bl-row-txt { padding-left: .6rem; }
.bl-rows h3 { font-size: 1.45rem; font-weight: 800; line-height: 1.15; margin: 0 0 .3rem; }
.bl-rows p { margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.45; max-width: 44rem; }
.bl-rows img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.bl-rows a:hover h3 { color: var(--leaf); }

/* ---------- footer ---------- */
.theme-moss .foot {
  background: var(--ink); color: #c6d3c7; border-top: 0; font-size: .875rem;
}
.theme-moss .foot .legal a { color: #fff; }

/* ---------- focus + small screens ---------- */
.theme-moss a:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; }
@media (max-width: 900px) {
  .bl-lead a { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
}
@media (max-width: 620px) {
  body.theme-moss { font-size: 1.15rem; }
  .theme-moss .wordmark { font-size: 1.85rem; }
  .theme-moss .bar { padding-left: 2.2rem; }
  .bl-entries > h2 { padding-left: 0; }
  .bl-rows::before { left: 3.6rem; }
  .bl-rows a { grid-template-columns: 3.6rem minmax(0, 1fr) 5.5rem; gap: 0 .9rem; }
  .bl-rows time, .bl-nodate { font-size: .9rem; padding-right: .6rem; }
  .bl-rows h3 { font-size: 1.15rem; }
  .bl-rows p { display: none; }
}
