/*
 * greenfield.css — opt-in stylesheet for pages migrated from the
 * blog-base-template prototype. Loaded when a page sets
 * `useGreenfield: true` in frontmatter (see base.njk).
 *
 * Design tokens live in tokens.css (loaded before this file).
 * @font-face declarations duplicate bbs.css's but kept here so this
 * file is self-contained when applied to non-bbs pages later.
 */

/* --- Fonts (self-hosted IBM Plex) --------------------------------- */
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-serif-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-serif-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-serif-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-700-normal.woff2') format('woff2');
}

/* --- Visually-hidden utility (accessibility, screen-reader only) - */
.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;
}

/* --- Images: responsive ------------------------------------------- */
article img {
  max-width: 100%;
  height: auto;
}

/* --- Post meta (date + reading time) ------------------------------ */
article > header > p {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0;
}
article > header > p svg {
  vertical-align: -0.15em;
  margin-right: 0.25em;
  margin-left: 0.5em;
}
article > header > p svg:first-of-type {
  margin-left: 0;
}

/* --- End-of-article separator (3-mark "wind rose") --------------- */
svg[role="separator"] {
  display: block;
  margin: 2.5rem auto;
  width: 2rem;
  height: auto;
  color: var(--color-muted);
}

/* --- Tag nav (post page "filed under" tags) ---------------------- */
nav[aria-label="Tags"] {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 1.5rem 0 0;
}
nav[aria-label="Tags"] > svg {
  font-size: 1.5em;
  color: var(--color-accent);
  vertical-align: -0.25em;
  margin-right: 0.5em;
}
nav[aria-label="Tags"] a {
  color: var(--color-accent);
  text-decoration: none;
  margin-right: 0.6rem;
}
nav[aria-label="Tags"] a::before {
  content: "#";
}
nav[aria-label="Tags"] a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}
nav[aria-label="Tags"] a:last-of-type {
  margin-right: 0;
}

/* --- Skip link (uses base.njk's class="skip-link") --------------- */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  z-index: 100;
}
.skip-link:focus {
  top: 0.5rem;
}

/* --- Heading reset (headings inherit body unless overridden) ----- */
h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* --- Body baseline ------------------------------------------------ */
body {
  margin: 0 auto;
  max-width: 68ch;
  padding: 2rem 1.25rem 3rem;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
}
@media (min-width: 700px) {
  body { font-size: var(--text-lg); }
}

p { margin: 0.85rem 0; }

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

/* --- Headings ----------------------------------------------------- */
h1 {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0.25rem 0 0.75rem;
}

/* BBS-style section header: `── HEADING ─────────────────` */
h2 {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin: 2.75rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.7em;
}
h2::before { content: "──"; flex: 0 0 auto; }
h2::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px solid currentColor;
  opacity: 0.35;
}

/* Post-meta-zone h2s (after the article): smaller than content h2s. */
main > article ~ h2 {
  font-size: var(--text-sm);
}

h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  margin: 0.75rem 0 0.25rem;
}

/* Post body h2: content section header (larger than chrome h2) */
article > div h2 {
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
}

/* Post body code blocks */
article > div pre {
  font-size: var(--text-sm);
  line-height: 1.45;
  margin: 1rem 0;
  overflow-x: auto;
}

/* Post body h3: BBS subsection header, smaller sibling of h2 */
article > div h3 {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent-warm);
  margin: 1.75rem 0 0.75rem;
}
article > div h3::before {
  content: "─ ";
}

/* --- Site header + BBS-frame brand ------------------------------- */
body > header {
  border-bottom: 1px solid var(--color-rule);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
body > header > p {
  margin: 0;
  font-size: var(--text-base);
  font-weight: normal;
  line-height: 1;
  letter-spacing: 0;
}
body > header > p svg {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  color: var(--color-accent);
  font-family: var(--font-mono);
  overflow: visible;
}
.brand-frame {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.brand-cutout {
  fill: var(--color-bg);
}
.brand-name {
  font-size: 17px;
  font-weight: 500;
  fill: var(--color-accent-loud);
}
body > header > p svg a { cursor: pointer; }
body > header > p svg a:hover .brand-name,
body > header > p svg a:focus-visible .brand-name {
  text-decoration: underline;
}
.brand-tag {
  font-size: 14px;
  fill: currentColor;
}

/* --- Site nav (top header nav + theme toggle) -------------------- */
nav[aria-label="Site"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-top: 1rem;
}
nav[aria-label="Site"] > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
nav[aria-label="Site"] a,
nav[aria-label="Site"] button {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.15rem 0;
  border-bottom: 1px dotted transparent;
}
nav[aria-label="Site"] a:hover,
nav[aria-label="Site"] button:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
nav[aria-label="Site"] button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted transparent;
  font: inherit;
  cursor: pointer;
  border-radius: 0;
}
nav[aria-label="Site"] kbd {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-accent-warm);
  font-weight: 700;
}
nav[aria-label="Site"] svg[data-icon] {
  color: var(--color-accent-warm);
  flex: 0 0 auto;
}

/* Theme toggle: show the icon + label for the theme you can SWITCH TO. */
button [data-icon="sun"],
button [data-theme-label="light"] { display: none; }

:root[data-theme="dark"] button [data-icon="moon"],
:root[data-theme="dark"] button [data-theme-label="dark"] { display: none; }
:root[data-theme="dark"] button [data-icon="sun"],
:root[data-theme="dark"] button [data-theme-label="light"] { display: revert; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button [data-icon="moon"],
  :root:not([data-theme="light"]) button [data-theme-label="dark"] { display: none; }
  :root:not([data-theme="light"]) button [data-icon="sun"],
  :root:not([data-theme="light"]) button [data-theme-label="light"] { display: revert; }
}

/* --- Sections nav (homepage main menu panel) --------------------- */
nav[aria-labelledby] {
  background: var(--color-bg-alt);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
nav[aria-labelledby] > ul {
  counter-reset: menu;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
nav[aria-labelledby] > ul > li {
  counter-increment: menu;
}
nav[aria-labelledby] a {
  color: var(--color-text);
  text-decoration: none;
}
nav[aria-labelledby] a:hover {
  color: var(--color-accent);
}
nav[aria-labelledby] a::before {
  content: "[" counter(menu) "] ";
  color: var(--color-accent-warm);
  font-weight: 700;
}
nav[aria-labelledby] small {
  font-size: inherit;
  color: var(--color-muted);
  margin-left: 0.4rem;
}

/* --- Archive title feed icon ------------------------------------- */
h1 a[aria-label*="feed"] > svg {
  width: 0.6em;
  height: 0.6em;
  vertical-align: 0.05em;
  margin-left: 0.15em;
}

/* --- Card list (homepage Recent Posts + archives) ---------------- */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}
.cards > li {
  position: relative;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-accent);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.cards > li:hover {
  border-color: var(--color-link-hover);
  box-shadow: 0 2px 0 var(--color-rule);
  transform: translateY(-1px);
}
.cards > li:hover :is(h2, h3) a {
  color: var(--color-link-hover);
}
.cards > li:has(:focus-visible) {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.cards > li > :is(h2, h3) {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-text);
  display: block;
  margin: 0;
}
.cards > li > :is(h2, h3)::before,
.cards > li > :is(h2, h3)::after {
  content: none;
}
.cards > li > :is(h2, h3) a {
  color: var(--color-accent);
  text-decoration: none;
}
.cards > li > :is(h2, h3) a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.cards > li > p {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.cards > li > p + p {
  margin-top: 0.5rem;
  font-family: var(--font-body);
  color: var(--color-text);
}
.cards > li > p > svg {
  vertical-align: -0.15em;
  margin-right: 0.25em;
}

/* --- Photo/video grid override (photos + videos archives) ------- */
.photo-feed {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem;
}
.photo-feed > li {
  background: transparent;
  padding: 0;
  cursor: default;
}
.photo-feed > li > a {
  display: block;
  background: var(--color-bg-alt);
  padding: 0.4rem;
  text-decoration: none;
  color: inherit;
}
.photo-feed > li > a img,
.photo-feed > li > a picture {
  display: block;
  width: 100%;
  height: auto;
}
.photo-feed > li > a::after { content: none; }
.photo-feed > li:hover {
  outline: 2px solid var(--color-link-hover);
  outline-offset: 2px;
}
.photo-feed > li > p {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.photo-feed > li > p time { color: inherit; }

/* --- Video embed (video detail page) ---------------------------- */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-alt);
  margin: 1.5rem 0;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Star ratings + favorite heart ------------------------------- */
.icon-star,
.icon-star-half { color: #00e054; }
.icon-heart { color: #ff8000; margin-left: 0.25em; }
[aria-label*="out of 5 stars"] {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  line-height: 1;
  vertical-align: middle;
}

/* --- Book grid (books archive) ----------------------------------- */
.book-feed {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 1rem;
}
.book-feed > li {
  background: transparent;
  padding: 0;
  cursor: default;
}
.book-feed > li > a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.book-feed > li > a img,
.book-feed > li > a picture {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-bg-alt);
}
.book-feed > li > a::after { content: none; }
.book-feed > li:hover {
  outline: 2px solid var(--color-link-hover);
  outline-offset: 2px;
}
.book-feed > li .book-no-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2 / 3;
  background: var(--color-bg-alt);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: center;
  color: var(--color-muted);
}
.book-feed > li > p {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.book-feed > li > p strong {
  color: var(--color-text);
  font-weight: 600;
}

/* --- Book/watch detail page ------------------------------------- */
.book-detail-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 200px) 1fr;
  align-items: start;
  margin: 1rem 0 2rem;
}
@media (max-width: 32rem) {
  .book-detail-grid { grid-template-columns: 1fr; }
}
.book-detail-grid .book-cover {
  margin: 0;
  background: var(--color-bg-alt);
}
.book-detail-grid .book-cover img,
.book-detail-grid .book-cover picture {
  display: block;
  width: 100%;
  height: auto;
}
.book-detail-grid .book-info > header h1 {
  margin: 0 0 0.25rem;
}
.book-detail-grid .book-info > header p {
  margin: 0;
  color: var(--color-muted);
}

/* Subdued metadata rows (cert/date/genres/runtime, director credits) */
.book-info .meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.5;
}
.book-info .meta a { color: var(--color-accent); }
.book-info .meta strong { color: var(--color-text); font-weight: 600; }

.book-info .tagline {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* Synopsis / overview: serif body font, slightly de-emphasized */
.book-info .overview {
  color: color-mix(in srgb, var(--color-text) 70%, var(--color-muted));
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* External-source attribution (TMDB logo, Open Library / Google Books) */
.book-info .attribution {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.book-info .attribution img {
  display: inline-block;
  vertical-align: middle;
  height: 0.9rem;
  width: auto;
}

/* Review section meta (date sits like an article header date) */
section[aria-label="Review"] > p {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
section[aria-label="Review"] > p svg {
  vertical-align: -0.15em;
  margin-right: 0.25em;
}

/* --- Breadcrumb -------------------------------------------------- */
nav[aria-label="Breadcrumb"] {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: 1rem;
}
nav[aria-label="Breadcrumb"] a {
  color: var(--color-accent);
}
nav[aria-label="Breadcrumb"] [aria-current="page"] {
  color: var(--color-text);
}

/* --- Article figure (photo posts, inline article images) --------- */
article > figure,
article .e-content figure {
  margin: 1.5rem 0;
}
article > figure img,
article > figure picture,
article .e-content figure img,
article .e-content figure picture {
  display: block;
  width: 100%;
  height: auto;
}
article > figure figcaption,
article .e-content figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
}
/* "All posts" link directly below the homepage feed list */
main > section > ul + p {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: right;
}
main > section > ul + p > a > svg {
  vertical-align: -0.15em;
  margin-left: 0.15em;
}

/* Collapse the Bubbles wrapper until/unless vote.js fills it in. */
.bubbles-wrap:has(.bubbles-vote:empty) { display: none; }

/* --- Code block copy button (JS in base.njk injects it) --------- */
article pre { position: relative; }
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: currentColor;
  padding: 0.25rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  line-height: 0;
}
article pre:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 0.6;
}
.copy-btn:hover { opacity: 1; }

/* --- Lightbox dialog (JS in base.njk opens it for content images) */
.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox img {
  display: block;
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}
.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  font-family: var(--font-mono);
}
.lightbox-close:hover { opacity: 0.7; }

/* --- Lede paragraph (intro text in flat content pages) --------- */
.lede {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-text);
}

/* --- Changelog (post footer) ------------------------------------ */
#changelog + ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
#changelog + ul > li {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 0 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--color-rule);
  align-items: baseline;
}
#changelog + ul > li:last-child { border-bottom: none; }
#changelog + ul > li > strong {
  color: var(--color-muted);
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 500px) {
  #changelog + ul > li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* --- Forms (base styles for inputs, selects, textareas, buttons) - */
fieldset {
  border: 1px solid var(--color-rule);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
legend {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  padding: 0 0.5rem;
}
label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-rule);
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-radius: 0;
  max-width: 100%;
}
textarea {
  min-height: 6rem;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
}
input[disabled],
textarea[disabled],
select[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
input[readonly],
textarea[readonly] {
  color: var(--color-muted);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-accent);
}
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--color-rule);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0;
}
button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
button[disabled],
input[type="submit"][disabled],
input[type="reset"][disabled],
input[type="button"][disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --- Footnotes (markdown-it-footnote) --------------------------- */
.footnotes-sep {
  margin: 3rem 0 1.5rem;
  border: 0;
  border-top: 1px solid var(--color-rule);
}
.footnotes {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.footnotes ol {
  list-style: decimal;
  padding-left: 1.75rem;
  margin: 0.5rem 0;
}
.footnotes li + li { margin-top: 0.5rem; }
.footnotes li p { margin: 0; }
.footnotes a {
  color: var(--color-accent);
  text-decoration: none;
}
.footnotes a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}
.footnote-ref a {
  color: var(--color-accent);
  text-decoration: none;
  padding: 0 0.15rem;
}
.footnote-ref a:hover { color: var(--color-link-hover); }
.footnote-backref {
  color: var(--color-accent);
  text-decoration: none;
  margin-left: 0.25rem;
}
.footnote-backref:hover { color: var(--color-link-hover); }

/* --- Update banner / inline callout ----------------------------- */
.update-banner {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  background: var(--color-bg-alt);
  border-left: 3px solid var(--color-accent-warm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.update-banner p { margin: 0; }
.update-banner p + p { margin-top: 0.5rem; }
.update-banner p:first-child::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.5em;
  vertical-align: -0.2em;
  background-color: var(--color-accent-warm);
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}
.update-banner strong {
  color: var(--color-accent-warm);
  font-weight: 600;
}
.update-banner a {
  color: var(--color-accent);
  text-decoration: underline;
}
.update-banner a:hover { color: var(--color-link-hover); }

/* --- Blockquote (article body) ---------------------------------- */
.e-content blockquote {
  margin: 1.5rem 0;
  padding: 0.4rem 0 0.4rem 1rem;
  border-left: 3px solid var(--color-accent-warm);
  color: color-mix(in srgb, var(--color-text) 75%, var(--color-muted));
  font-style: italic;
}
.e-content blockquote > :first-child { margin-top: 0; }
.e-content blockquote > :last-child { margin-bottom: 0; }
.e-content blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-muted);
}
.e-content blockquote cite::before { content: "— "; }

/* --- External link indicator (content body only) ---------------- */
.e-content a[href^="http"]:not([href*="michaelharley.net"])::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.15em;
  vertical-align: 0.05em;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  opacity: 0.6;
}

/* --- Email obfuscation spam trap --------------------------------- */
.oe { display: none; }

/* --- Sitemap (slash pages directory) ---------------------------- */
.slash-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.slash-list li {
  display: grid;
  grid-template-columns: 16ch 1fr;
  gap: 0 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--color-rule);
  align-items: baseline;
}
.slash-list li:last-child { border-bottom: none; }
.slash-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
}
.slash-name:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}
.slash-desc {
  color: var(--color-muted);
  font-size: var(--text-sm);
}
@media (max-width: 500px) {
  .slash-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* --- Listening page (Last.fm recent tracks + top artists) -------- */
.recent-tracks {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}
.recent-tracks li {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 0 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--color-rule);
  align-items: baseline;
}
.recent-tracks li:last-child { border-bottom: none; }
.recent-tracks time {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
}
.recent-tracks .artist {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-left: 0.5em;
}

.listening-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.listening-toggle button[aria-selected="true"] {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.artist-list {
  padding-left: 2.5rem;
  margin: 0.75rem 0;
}
.artist-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--color-rule);
  align-items: baseline;
}
.artist-list li:last-child { border-bottom: none; }
.artist-list .playcount {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  white-space: nowrap;
}

@media (max-width: 500px) {
  .recent-tracks li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .recent-tracks .artist {
    margin-left: 0;
  }
}

/* --- 404 cat ----------------------------------------------------- */
.four-oh-four-cat {
  display: block;
  margin: 1rem auto;
}

/* --- Contact list (contact page) -------------------------------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.contact-list li {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 0 1.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px dotted var(--color-rule);
  align-items: baseline;
}
.contact-list li:last-child { border-bottom: none; }
.contact-method { color: var(--color-muted); }
.contact-handle { color: var(--color-text); overflow-wrap: anywhere; }
.contact-handle a { color: var(--color-accent); text-decoration: none; }
.contact-handle a:hover { color: var(--color-link-hover); text-decoration: underline; }
@media (max-width: 500px) {
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* --- Subscribe form (subscribe-email page) --------------------- */
.subscribe-form {
  margin: 1.5rem 0;
  max-width: 32em;
  background: var(--color-bg-alt);
  padding: 1.25rem;
}
.subscribe-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
/* In-panel overrides: input bg + button-hover bg use page color so they
   pop from the surrounding bg-alt panel (base values would blend). */
.subscribe-form input { background: var(--color-bg); }
.subscribe-form button:hover { background: var(--color-bg); }
.subscribe-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Webmention-send AJAX status (JS in base.njk inserts this) -- */
.wm-send-status {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.8rem;
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border-left: 3px solid var(--color-accent);
}
.wm-send-status.wm-send-error { border-left-color: var(--color-accent-loud); }
.wm-send-status strong {
  color: var(--color-accent-warm);
  margin-right: 0.3em;
}

/* --- Meta-zone panels (Signal, Comments) ------------------------- */
section[aria-labelledby] {
  margin: 0.5rem 0 1rem;
  background: var(--color-bg-alt);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  display: grid;
  gap: 0.5rem;
}

/* --- Webmention-send form (panel chrome details) ----------------- */
main > details {
  margin: 0.5rem 0 1rem;
  background: var(--color-bg-alt);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* --- Shared details marker treatment (BBS [+]/[-]) --------------- */
details > summary {
  cursor: pointer;
  color: var(--color-text);
  list-style: none;
  padding: 0.2rem 0;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "[+] ";
  color: var(--color-accent-warm);
  font-weight: 700;
}
details[open] > summary::before {
  content: "[-] ";
}
details > summary:hover {
  color: var(--color-accent);
}

/* --- Comments article (Signal/Comments section content) ---------- */
section[aria-labelledby] > article > p:first-child {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0 0 0.5rem;
  line-height: 1.6;
}
section[aria-labelledby] > article > p:last-child {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  margin: 0;
}
section[aria-labelledby] > article + article {
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-rule);
  padding-top: 1.5rem;
}
main > details > form {
  margin-top: 0.75rem;
  padding-left: 2ch;
  display: grid;
  gap: 0.75rem;
}
main > details > form > p {
  color: var(--color-muted);
  margin: 0;
}
main > details > form > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--color-muted);
}
main > details > form input[type="url"] {
  font: inherit;
  font-size: var(--text-base);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-accent);
  background: var(--color-bg-alt);
  color: var(--color-text);
  max-width: 32em;
}
main > details > form input[type="url"]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
main > details > form button {
  font: inherit;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  justify-self: start;
}
main > details > form button:hover {
  background: var(--color-bg);
  border-color: var(--color-accent-loud);
  color: var(--color-accent-loud);
}

/* --- Footer ------------------------------------------------------- */
footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
footer p {
  margin: 0.35rem 0;
}
footer a {
  color: inherit;
  text-decoration: none;
}
footer a:hover {
  color: var(--color-accent);
}
footer nav ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
footer nav svg {
  vertical-align: -0.15em;
  margin-right: 0.25em;
}
