/* =============================================================================
   Patterns and Signals — site styles
   Monochrome reader. Black chrome top + bottom. Inter throughout.
   No CSS framework — small file, no build step, no runtime dependency.
   ============================================================================= */

/* --- Reset + tokens ------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; }

:root {
  --ink: #0f0f0f;
  --ink-soft: #2b2b2b;
  --gray-900: #1a1a1a;
  --gray-700: #3f3f3f;
  --gray-500: #6b6b6b;
  --gray-400: #8a8a8a;
  --gray-300: #c5c5c5;
  --gray-200: #e2e2e2;
  --gray-100: #f3f3f3;
  --paper: #fafaf9;
  --rule: #e2e2e2;
  --rule-strong: #1a1a1a;
  --link: #1a1a1a;
  --link-underline: #8a8a8a;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --reader-max: 720px;
  --chrome-pad-x: 1.5rem;
}

/* --- Base type ----------------------------------------------------------- */

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

.skip-link {
  position: absolute; left: -10000px; top: 0;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem;
  z-index: 100; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --- Masthead (black bar) ----------------------------------------------- */

.masthead {
  background: #000;
  color: #fff;
  padding: 1.1rem var(--chrome-pad-x);
  border-bottom: 1px solid #000;
}
.masthead-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.masthead-logo img {
  height: 36px; width: auto;
}
.masthead-nav {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.92rem; font-weight: 500;
}
.cadence-pill {
  color: #fff; text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  letter-spacing: 0.01em;
  transition: background 120ms ease, border-color 120ms ease;
}
.cadence-pill:hover { background: #1a1a1a; }
.cadence-pill.is-active {
  background: #fff; color: #000;
  border-color: #fff;
}
.masthead-archive {
  color: #c5c5c5; text-decoration: none;
  font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
  margin-left: 0.6rem; padding: 0.4rem 0.5rem;
  border-bottom: 1px solid transparent;
}
.masthead-archive:hover { color: #fff; border-bottom-color: #6b6b6b; }

/* --- Footer (black bar) ------------------------------------------------- */

.footer {
  background: #000; color: #fff;
  padding: 1.6rem var(--chrome-pad-x) 1.4rem;
  margin-top: 5rem;
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.9rem;
  text-align: center;
}
.footer-copyright {
  margin: 0;
  font-size: 0.78rem;
  color: #8a8a8a;
  letter-spacing: 0.02em;
}
.footer-tag {
  display: block;
  height: 32px; width: auto;
  opacity: 0.95;
  margin: 0 auto;
}

/* --- Reader area -------------------------------------------------------- */

.reader {
  max-width: var(--reader-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
}
.reader p { font-size: 1.0625rem; line-height: 1.7; margin: 1.1rem 0; color: var(--ink); }
.reader strong { font-weight: 700; color: var(--ink); }
.reader em { font-style: italic; }
.reader a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gray-400); }
.reader a:hover { text-decoration-color: var(--ink); }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 600;
  margin: 0 0 0.6rem;
}
/* Thematic — the editorial point of the issue. Display weight, not italic;
   this is the headline, the page's hero line. Sized so a typical 1-2
   sentence dek lands on 2-3 lines without dropping a word to a fourth. */
.report-thematic {
  font-size: 1.85rem; line-height: 1.25; font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0.4rem 0 2.2rem;
  color: var(--ink);
  text-wrap: balance;
}

/* Legacy classes kept for backwards-compat with any older templates that
   might still render the report-title / report-dek shape. New issue.html
   uses .report-thematic instead. */
.report-title {
  font-size: 2rem; line-height: 1.15; font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.report-dek {
  font-style: italic;
  color: var(--gray-700);
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0 0 2rem;
}
.reader h2 {
  font-size: 1.55rem; line-height: 1.2; font-weight: 800;
  margin: 3rem 0 1.1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  letter-spacing: -0.005em;
  color: var(--ink);
}
.reader h3 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gray-500);
  margin: 2.4rem 0 0.8rem;
}
.section-aside { border-top: 1px solid var(--rule); padding-top: 1.6rem; margin-top: 2.4rem; }

.report-section { margin: 0; }

/* --- Hammer ------------------------------------------------------------- */

.section-hammer {
  margin-top: 1.5rem;
}
.section-hammer p { font-size: 1.125rem; }

/* --- Leaderboard table -------------------------------------------------- */

.leaderboard {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: #fff;
  margin: 0.6rem 0 2.4rem;
  overflow: hidden;
}
.leaderboard-head {
  background: var(--gray-100);
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--gray-200);
}
.leaderboard-eyebrow {
  margin: 0;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-500); font-weight: 700;
}
.leaderboard-title {
  margin: 0.15rem 0 0;
  font-size: 1rem; color: var(--ink); font-weight: 600;
}
.leaderboard-caption {
  margin: 0.4rem 0 0;
  font-size: 0.8rem; color: var(--gray-500);
}

/* Editorial funnel — read → cluster → rank. The visible work behind the
   leaderboard. Same shape on both register cards (Industry: Posts→Authors→
   Themes→Patterns; Community: Subreddits→Threads→Themes→Patterns). */
.lb-flow {
  display: flex; align-items: stretch; gap: 0.5rem; flex-wrap: nowrap;
  margin-top: 0.95rem;
  font-size: 0.78rem; color: var(--gray-700);
}
.lb-flow-step {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--ink);
  padding: 1.05rem 0.6rem 0.85rem; border-radius: 6px;
  min-width: 0;
}
.lb-flow-num {
  font-weight: 800; color: var(--ink);
  font-size: 1.85rem; line-height: 1; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.lb-flow-label {
  font-size: 0.7rem; color: var(--gray-700);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  margin-top: 0.5rem; text-align: center; line-height: 1.2;
}
.lb-flow-arrow {
  flex: 0 0 auto;
  display: flex; align-items: center;
  color: var(--gray-500); font-weight: 700;
}
@media (max-width: 640px) {
  .lb-flow { flex-wrap: wrap; }
  .lb-flow-arrow { display: none; }
  .lb-flow-step { flex: 1 1 calc(50% - 0.25rem); }
}
.leaderboard-table {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
}
.leaderboard-table thead th {
  text-align: left; padding: 0.55rem 0.9rem;
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-500); background: #fff; font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
}
.leaderboard-table td {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--gray-100);
  vertical-align: top;
}
.leaderboard-table .col-rank {
  width: 2.4rem; color: var(--gray-500);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.leaderboard-table .col-mentions {
  width: 4rem; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--gray-700);
}
.leaderboard-table tbody tr:nth-child(even) { background: var(--gray-100); }
.leaderboard-table .lb-title { font-weight: 600; color: var(--ink); }
.leaderboard-table .lb-title a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--gray-300); }
.leaderboard-table .lb-title a:hover { border-bottom-color: var(--ink); }
.leaderboard-table .lb-why {
  font-style: italic; color: var(--gray-500);
  font-size: 0.85rem; line-height: 1.45; margin-top: 0.2rem;
}

/* --- Scoring disclosure ("How we ranked these patterns") ----------------
   Native <details> below each leaderboard table; carries the per-position
   breakdown (publishers/pieces/mentions for industry; subreddits/threads
   for community) so readers can audit the rank. Show your work. */
.scoring-disclosure {
  margin: -0.6rem 0 2.4rem;
  font-size: 0.9rem;
}
.scoring-disclosure summary {
  cursor: pointer; padding: 0.7rem 0;
  font-size: 0.82rem; color: var(--gray-700); font-weight: 600;
  list-style: none; user-select: none;
}
.scoring-disclosure summary::-webkit-details-marker { display: none; }
.scoring-disclosure summary::before {
  content: "▸ "; color: var(--gray-400); margin-right: 0.15rem;
  font-size: 0.7rem;
}
.scoring-disclosure[open] summary::before { content: "▾ "; }
.scoring-disclosure .scoring-rule {
  font-size: 0.88rem; color: var(--gray-700); line-height: 1.6;
  margin: 0.2rem 0 0.9rem;
}
.scoring-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 6px;
  overflow: hidden;
}
.scoring-table thead th {
  text-align: left; padding: 0.5rem 0.7rem;
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-500); background: var(--gray-100); font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
}
.scoring-table tbody tr:nth-child(even) { background: var(--gray-100); }
.scoring-table tbody td {
  padding: 0.55rem 0.7rem; border-top: 1px solid var(--gray-200);
  vertical-align: top;
}
.scoring-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--gray-700); }
.scoring-table .col-rank-s { width: 2.4rem; }
.scoring-table .rank-cell { color: var(--gray-500); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.scoring-table .pattern-cell { color: var(--ink); font-weight: 500; }

/* --- Dissent block ------------------------------------------------------- */

.dissent {
  font-style: italic; color: var(--gray-700);
  font-size: 0.95rem; line-height: 1.6;
  margin: -0.25rem 0 1.4rem;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--gray-300);
  background: var(--gray-100);
}
.dissent::before {
  content: "Dissent · "; font-style: normal; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-size: 0.7rem; color: var(--gray-500); margin-right: 0.4rem;
}

/* --- Primary signals lists ---------------------------------------------- */

.signal-list {
  list-style: disc; padding-left: 1.4rem;
  margin: 0.6rem 0 1.6rem;
}
.signal-list li {
  font-size: 0.98rem; line-height: 1.55; padding: 0.25rem 0;
}
.signal-list li::marker { color: var(--gray-400); }
.signal-author { color: var(--gray-500); font-size: 0.88rem; margin-left: 0.4rem; }

/* --- Take Away ---------------------------------------------------------- */

.notably-absent {
  font-style: italic; color: var(--gray-700);
  font-size: 0.95rem;
  margin-top: 1.4rem; padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}
.notably-absent-label {
  font-style: normal; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.72rem; color: var(--gray-500);
  margin-right: 0.35rem;
}
.closer {
  font-weight: 800; font-size: 1.2rem; line-height: 1.4;
  margin-top: 1.6rem;
  color: var(--ink);
}
.outro { color: var(--gray-700); font-style: italic; }

/* --- MitoPromo slot ----------------------------------------------------- */

.mitopromo-slot {
  margin: 3rem 0 0;
  min-height: 0;
}
.mitopromo-slot:not(:empty) {
  border-top: 1px solid var(--rule);
  padding-top: 1.6rem;
}

/* --- Archive list ------------------------------------------------------- */

.archive-list {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
}
.archive-item {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.archive-cadence {
  display: inline-block;
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--gray-100); color: var(--gray-700);
  border: 1px solid var(--gray-200);
  margin-right: 0.6rem;
}
.archive-cadence.cadence-monthly { background: #000; color: #fff; border-color: #000; }
.archive-title {
  font-size: 1.25rem; font-weight: 700; color: var(--ink);
  text-decoration: none; line-height: 1.3;
}
.archive-title:hover { text-decoration: underline; text-decoration-color: var(--ink); }
.archive-dek {
  font-style: italic; color: var(--gray-700);
  font-size: 1rem; line-height: 1.55; margin: 0.5rem 0 0.4rem;
}
.archive-meta {
  font-size: 0.78rem; color: var(--gray-500); margin: 0.2rem 0 0;
  letter-spacing: 0.02em;
}

.pagination {
  margin: 2.4rem 0 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.92rem;
}
.pagination a { color: var(--ink); text-decoration: none; font-weight: 600; }
.pagination a:hover { text-decoration: underline; }
.pagination-disabled { color: var(--gray-300); }
.pagination-status { color: var(--gray-500); font-size: 0.85rem; }

/* --- Empty state -------------------------------------------------------- */

.empty-state h1 { font-size: 1.8rem; margin-top: 0.5rem; }
.empty-state-line { color: var(--gray-500); font-style: italic; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 640px) {
  .reader { padding: 1.5rem 1.25rem 0.5rem; }
  .report-title { font-size: 1.85rem; }
  .reader h2 { font-size: 1.3rem; }
  .masthead-inner { gap: 0.6rem; }
  .masthead-logo img { height: 30px; }
  .masthead-archive { margin-left: 0.2rem; }
  /* Footer is already centered-column at all widths — no override needed. */
  .leaderboard-table { font-size: 0.86rem; }
  .leaderboard-table td, .leaderboard-table thead th { padding: 0.5rem 0.6rem; }
}

/* --- Focus visibility (508) -------------------------------------------- */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}
.cadence-pill:focus-visible {
  outline-color: #fff;
  outline-offset: 3px;
}

/* --- Print -------------------------------------------------------------- */

@media print {
  .masthead, .footer, .skip-link, .mitopromo-slot { display: none; }
  body { background: #fff; }
  .reader { padding: 0; max-width: none; }
  .leaderboard { border-color: #000; }
}
