/* doc_mem_1: this post's own components. Shared post styles are in /engineering_blog/blog.css. */

/* ============================================
   Engineering Blog - matches example blog theme
   WSJ-inspired, single-column article layout
   ============================================ */

:root {
  --wsj-tan: #f5f1eb;
  --wsj-cream: #faf8f5;
  --wsj-dark: #1a1a1a;
  --wsj-nav: #352a21;
  --wsj-brown: #6b5b4f;
  --wsj-gold: #c4a35a;
  --wsj-blue: #0274b6;
  --wsj-border: #d4c8b8;

  --bg: var(--wsj-tan);
  --bg-elevated: var(--wsj-cream);
  --bg-code: #fefcf9;
  --text: var(--wsj-dark);
  --text-dim: var(--wsj-brown);
  --muted: var(--wsj-brown);
  --accent: var(--wsj-blue);
  --border: var(--wsj-border);

  --font-serif: "Libre Baskerville", Georgia, serif;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, Segoe UI,
    Roboto, sans-serif;
}

/* ============================================
   Body typography
   ============================================ */

.content p {
  margin: 0 0 20px;
}

.knobs-list {
  margin: 0 0 24px 0;
  padding-left: 24px;
  counter-reset: knob;
  list-style: none;
}

.knobs-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
  line-height: 1.7;
  counter-increment: knob;
}

.knobs-list li::before {
  content: counter(knob);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  width: 20px;
  text-align: right;
}

.compression-conditions {
  margin: 0 0 20px 0;
  padding-left: 28px;
}

.compression-conditions li {
  margin: 0 0 8px 0;
  padding-left: 4px;
  line-height: 1.7;
}

.compression-conditions li:last-child {
  margin-bottom: 0;
}

.content h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin: 48px 0 20px;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.content h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}

.content h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--text);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ============================================
   Code block (real intro format)
   ============================================ */

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  margin: 24px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--wsj-tan);
}

.code-content {
  padding: 16px 20px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

.code-content pre {
  margin: 0;
  padding: 0;
  background: transparent;
  overflow-x: auto;
}

.code-content code {
  display: block;
  white-space: pre;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
}

/* ============================================
   Inline example block (no code-header)
   ============================================ */

.inline-example {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.inline-example code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
}

.example-card {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.example-card-title {
  background: var(--wsj-tan);
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.example-card-body {
  padding: 12px 16px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.canonical-rules-card .example-card-body {
  font-family: var(--font-serif);
  font-size: 15px;
  white-space: normal;
  overflow-x: visible;
}

.canonical-rules-card ul {
  margin: 0;
  padding-left: 22px;
}

.canonical-rules-card li {
  margin: 0 0 8px;
  line-height: 1.65;
}

.canonical-rules-card li:last-child {
  margin-bottom: 0;
}

/* ============================================
   Inline links in body copy
   ============================================ */

.content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.content a:hover {
  text-decoration-thickness: 2px;
}

/* ============================================
   Chart figure (compression graph)
   ============================================ */

figure.chart {
  margin: 32px 0;
  padding: 20px 20px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

figure.chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 700px;
  margin: 0 auto;
}

figure.chart figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================
   Page excerpt (full-text source block)
   ============================================ */

.page-excerpt {
  margin: 32px 0;
  padding: 24px 28px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.page-excerpt-header {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.page-excerpt-section {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}

.page-excerpt-body p {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 14px 0;
  color: var(--text);
}

.page-excerpt-body p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Outline placeholder divider
   ============================================ */

.outline-divider {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 64px 0 24px;
}

.outline-note {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-dim);
  background: var(--wsj-cream);
  border: 1px solid var(--border);
  border-left: 3px solid var(--wsj-brown);
  padding: 12px 16px;
  margin-bottom: 32px;
}

/* ============================================
   Placeholder outline cards (NOT final format)
   These exist only so the outline survives while
   we replace sections one at a time.
   ============================================ */

.section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--wsj-brown);
  padding: 20px 22px;
  margin: 20px 0;
}

.section h2 {
  font-size: 20px;
  margin: 4px 0 12px;
  padding: 0;
  border: none;
  font-weight: 700;
}

.section h3 {
  font-size: 16px;
  margin: 20px 0 10px;
}

.section p {
  margin: 0 0 12px;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.bullets {
  margin: 8px 0 4px 20px;
  padding: 0;
}

.bullets li {
  margin: 4px 0;
}

.subsection {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

/* Stats grid (placeholder) */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  margin: 16px 0;
  border: 1px solid var(--border);
}

.stat-card {
  background: var(--bg-elevated);
  padding: 14px 12px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Metric callout (placeholder) */

.metric-callout {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  margin: 16px 0;
}

.metric-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* Comparison table (placeholder) */

.comparison-table {
  border: 1px solid var(--border);
  margin: 14px 0;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg-elevated);
}

.comparison-row {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr 1.6fr;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.comparison-table .comparison-row:first-child {
  border-top: none;
}

.comparison-table.columns-4 .comparison-row {
  grid-template-columns: 1.1fr 0.8fr 0.8fr 0.8fr;
}

.comparison-table.columns-2 .comparison-row {
  grid-template-columns: 1fr 1.4fr;
}

.comparison-table.columns-5 .comparison-row {
  grid-template-columns: 1.15fr 1.45fr 0.65fr 0.65fr 0.9fr;
}

.comparison-table.sweep-range-table .comparison-row {
  grid-template-columns: 1.6fr 0.7fr 0.7fr;
}

.comparison-table.text-training-table .comparison-row {
  grid-template-columns: 1.35fr 1fr 0.9fr;
}

.comparison-table.text-training-table .comparison-row > div:last-child {
  text-align: right;
}

.heatmap-table {
  border: 1px solid var(--border);
  margin: 14px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  background: var(--bg-elevated);
}

.heatmap-row {
  display: grid;
  grid-template-columns: 1.45fr repeat(5, 0.72fr);
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  align-items: stretch;
}

.level-heatmap .heatmap-row {
  grid-template-columns: 1.45fr repeat(3, 0.9fr);
}

.heatmap-row:first-child {
  border-top: none;
}

.heatmap-head {
  background: var(--wsj-tan);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.heatmap-row > div:not(:first-child) {
  border-radius: 3px;
  padding: 6px 4px;
  text-align: center;
}

.heat-0 { background: #8f4f43; color: #fffaf1; }

.heat-20 { background: #b77766; color: #fffaf1; }

.heat-40 { background: #d9b8a6; color: var(--text); }

.heat-60 { background: #c7c6a0; color: var(--text); }

.heat-70 { background: #a3ad82; color: var(--text); }

.heat-80 { background: #728c67; color: #fffaf1; }

.heat-90,
.heat-100 { background: #4d6f51; color: #fffaf1; }

.heat-na { background: #f7f3ec; color: var(--text-muted); }

.heat-na-inline {
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.question-examples {
  border: 1px solid var(--border);
  margin: 16px 0;
  background: var(--bg-elevated);
}

.question-example {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.question-example:first-child {
  border-top: none;
}

.question-example p {
  margin: 4px 0 0;
}

.adapter-answer-label {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.45px;
  margin-top: 10px;
  text-transform: uppercase;
}

.adapter-answer {
  color: var(--text-dim);
  font-style: italic;
}

.assessment-line {
  margin-top: 6px;
}

.assessment-badge {
  border-radius: 999px;
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  text-transform: uppercase;
}

.assessment-correct {
  background: rgba(57, 171, 100, 0.16);
  color: #2f8f56;
}

.assessment-partial {
  background: rgba(199, 137, 45, 0.16);
  color: #a46722;
}

.assessment-mostly {
  background: rgba(79, 124, 196, 0.16);
  color: #3d6ca8;
}

.question-type-label {
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 18px 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.flow-diagram > div {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  padding: 12px 8px;
  background: var(--bg-elevated);
  text-align: center;
}

.flow-diagram > div:not(:last-child)::after {
  content: ">";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.prompt-block {
  border-left: 3px solid var(--text-dim);
  margin: 18px 0;
  padding: 16px 18px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
}

.prompt-block p {
  margin: 0 0 8px;
}

.prompt-block p:last-child {
  margin-bottom: 0;
}

.question-quote {
  border-left: 3px solid var(--text-dim);
  margin: 16px 0;
  padding: 10px 16px;
  background: var(--bg-elevated);
  color: var(--text);
  font-style: italic;
}

.comparison-head {
  background: var(--wsj-tan);
  font-weight: 600;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
  .content h2 {
    font-size: 22px;
    margin: 36px 0 16px;
  }

  .content h3 {
    font-size: 17px;
  }

  .comparison-row {
    grid-template-columns: 1fr;
  }

  .comparison-table.columns-4 .comparison-row {
    grid-template-columns: 1fr;
  }

  .comparison-table.sweep-range-table .comparison-row {
    grid-template-columns: 1fr;
  }
}

/* This post predates the shared blog styles: its paragraphs take their line
   height from the page, and its one quote is styled by .question-quote alone. */
p { line-height: inherit; }
blockquote { margin: 0; padding: 0; border-left: 0; background: none; }
