/* Listing pages (Blog, Talks) in the presentation style (2026-10-29).
   Tokens are the ones the talks in ~/Research/presentations use, so a
   listing and the talk it links to read as one register: warm paper,
   tan rules, burnt-orange mono labels, green kept for headings and links.
   Scoped to body.listing-page so the rest of the site keeps main.css.
   Nathan chose this over the green-outlined chips, which read as a
   dark-mode UI accent against the modern-retro goal. */

body.listing-page {
  --pl-bg: #f5f0e8;
  --pl-card: #fffdf9;
  --pl-ink: #141414;
  --pl-body: #2a2a2f;
  --pl-muted: #6b6b72;
  --pl-tan: #786c55;   /* text-safe on the card (was #8a7c62, 4.0:1); 2026-11-11 */
  --pl-rule: #e5ddd0;
  --pl-rule-strong: #d8cdb8;
  --pl-label: #bf5020;
  --pl-label-soft: #f9e9dd;
  --pl-head: #1a6b4a;
  --pl-accent: #17855a;
  --pl-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.05);
  --pl-shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 40px rgba(15, 23, 42, 0.08);
  background: var(--pl-bg);
}

body.listing-page .content-card {
  background: var(--pl-card);
  box-shadow: var(--pl-shadow);
}

/* The page's label strip: orange mono, like a talk's eyebrow. */
body.listing-page .utility-bar span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--pl-label);
  letter-spacing: 0.12em;
}

body.listing-page .hero-headline {
  color: var(--pl-ink);
}

/* Blog topic sidebar (2026-11-11; replaces the row of ~25 tag chips).
   The Portfolio skills sidebar's pattern (css/project-grid.css
   .pg-skill-category: a bordered box, mono uppercase heading, caret,
   square marker that fills when on) in this page's paper-and-tan
   tokens. One topic at a time. Desktop: a sticky column beside the
   posts. Below 900 px: folded behind one "Filter by topic" button. */
body.listing-page {
  --pl-quiet: #6b5f48;   /* quiet text, 6.2:1 on the card */
}

body.listing-page .blog-layout {
  margin-top: 2rem;
}

@media (min-width: 900px) {
  body.listing-page .blog-layout {
    display: grid;
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
  }
  body.listing-page .blog-topics {
    position: sticky;
    top: 5.5rem;
    /* "More topics" open makes the list long; keep all of it reachable
       while it sticks, instead of hiding its end below the screen. */
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}

body.listing-page .blog-topics-panel {
  border: 1px solid var(--pl-rule);
  border-radius: 8px;
  padding: 0.8rem 0.7rem 0.7rem;
  background: var(--pl-card);
}

body.listing-page .blog-topics-heading {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pl-label);
  margin: 0 0 0.5rem 0.3rem;
}

body.listing-page .blog-topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.listing-page .blog-topic,
body.listing-page .blog-topics-more,
body.listing-page .blog-topics-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2rem;
  padding: 0.3rem 0.4rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  text-align: left;
  color: var(--pl-body);
  cursor: pointer;
}

body.listing-page .blog-topic:hover {
  background: var(--pl-bg);
}

body.listing-page .blog-topic-mark {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--pl-tan);
  background: var(--pl-card);
}

body.listing-page .blog-topic-name {
  flex: 1;
  overflow-wrap: anywhere;
}

body.listing-page .blog-topic-count {
  font-size: 0.72rem;
  color: var(--pl-quiet);
}

body.listing-page .blog-topic.is-on {
  background: #e8f1ec;
  color: var(--pl-head);
  font-weight: 600;
}

body.listing-page .blog-topic.is-on .blog-topic-mark {
  background: var(--pl-head);
  border-color: var(--pl-head);
}

body.listing-page .blog-topic.is-on .blog-topic-count {
  color: var(--pl-head);
}

body.listing-page .blog-topics-more {
  margin-top: 0.35rem;
  border-top: 1px dashed var(--pl-rule);
  border-radius: 0;
  padding-top: 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--pl-quiet);
}

body.listing-page .blog-topics-more:hover,
body.listing-page .blog-topics-toggle:hover {
  color: var(--pl-label);
}

body.listing-page .blog-topics-caret {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.15s;
}

body.listing-page [aria-expanded="true"] > .blog-topics-caret {
  transform: rotate(90deg);
}

body.listing-page .blog-topic:focus-visible,
body.listing-page .blog-topics-more:focus-visible,
body.listing-page .blog-topics-toggle:focus-visible,
body.listing-page .blog-sort:focus-visible {
  outline: 2px solid var(--pl-head);
  outline-offset: 2px;
}

/* Phones and tablets: one button; the list opens under it. */
@media (max-width: 899px) {
  body.listing-page .blog-topics {
    margin-bottom: 1rem;
  }
  body.listing-page .blog-topics-toggle {
    min-height: 2.75rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--pl-rule-strong);
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.04em;
  }
  body.listing-page .blog-topics-current {
    margin-left: 0.5rem;
    font-weight: 400;
    color: var(--pl-head);
  }
  body.listing-page .blog-topics-current::before {
    content: "· ";
    color: var(--pl-quiet);
  }
  body.listing-page .blog-topics-panel {
    display: none;
    margin-top: 0.5rem;
  }
  body.listing-page .blog-topics.is-open .blog-topics-panel {
    display: block;
  }
  body.listing-page .blog-topics-heading {
    display: none;
  }
}

/* Desktop: the list is always open, so its fold-up button goes. (Here,
   after the shared button rule above, so this display wins.) */
@media (min-width: 900px) {
  body.listing-page .blog-topics-toggle {
    display: none;
  }
}

body.listing-page .blog-controls {
  margin-top: 0;
}

body.listing-page .blog-showing {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--pl-quiet);
}

body.listing-page .blog-sort {
  color: var(--pl-quiet);
  border-bottom-color: var(--pl-rule-strong);
  min-height: 1.5rem;
}

body.listing-page .blog-sort:hover {
  color: var(--pl-label);
  border-color: var(--pl-label);
}

@media (prefers-reduced-motion: reduce) {
  body.listing-page .blog-topics-caret,
  body.listing-page .blog-post-preview {
    transition: none;
  }
  body.listing-page .blog-post-preview:hover {
    transform: none;
  }
}

/* Cards: the talks' cards — warm rule, soft shadow, rounded; hover lifts
   rather than turning green. */
body.listing-page .blog-post-preview {
  background: var(--pl-card);
  border: 1px solid var(--pl-rule);
  border-radius: 10px;
  box-shadow: var(--pl-shadow);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

body.listing-page .blog-post-preview:hover {
  border-color: var(--pl-rule-strong);
  box-shadow: var(--pl-shadow-lift);
  transform: translateY(-1px);
}

body.listing-page .blog-post-preview-thumb {
  background: var(--pl-rule);
  border-bottom: 1px solid var(--pl-rule);
}

body.listing-page .post-date {
  color: var(--pl-label);
  letter-spacing: 0.1em;
}

body.listing-page .post-reading-time {
  color: var(--pl-tan);
}

body.listing-page .post-title {
  color: var(--pl-head);
}

body.listing-page .blog-post-preview .post-title a:hover {
  color: var(--pl-accent);
  text-decoration: underline;
  text-decoration-color: var(--pl-rule-strong);
  text-underline-offset: 3px;
}

body.listing-page .post-excerpt {
  color: var(--pl-body);
}

body.listing-page .post-tag {
  border-color: var(--pl-rule-strong);
  color: var(--pl-tan);
  border-radius: 6px;
}

/* Talks only: the two links under each card, styled as the talks' .btn. */
body.listing-page .talk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

body.listing-page .talk-links a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--pl-head);
  border: 1px solid var(--pl-rule-strong);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
}

body.listing-page .talk-links a:hover {
  border-color: var(--pl-accent);
  color: var(--pl-accent);
}

body.listing-page .talk-links a.primary {
  border-color: var(--pl-label);
  color: var(--pl-label);
}

body.listing-page .talk-links a.primary:hover {
  background: var(--pl-label-soft);
}

body.listing-page .talks-empty {
  font-family: "IBM Plex Mono", monospace;
  color: var(--pl-muted);
}

/* Talks only: the topic line under each card's description (from the talk's
   skills in projects.json), so a card says what it covers in plain words. */
body.listing-page .talk-topics {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--pl-tan);
  margin: -0.4rem 0 0.9rem;
}
