/* ==================================================================
   Personal site chrome - shares the election map app's BBC-studio
   theme (see web/css/style.css) so Home / Blog / App feel like one
   product rather than three. Same tokens, same two fonts.
   ================================================================== */

:root {
  --bbc-blue: #1656d1;
  --bbc-blue-dark: #0c3fa0;
  --bbc-segments: #8a4fff;
  --bbc-segments-dark: #5c2fb8;
  --bbc-custom: #0c8f6e;
  --bbc-custom-dark: #075c47;
  --bbc-bg: #050507;
  --bbc-panel: #232327;
  --bbc-panel-2: #2c2c31;
  --bbc-line: #3a3a40;
  --text-1: #f2f2f4;
  --text-2: #cfd2da;
  --text-3: #9a9aa3;
  --font-head: "Archivo Black", "Arial Black", sans-serif;
  --font-body: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --font-mono: "Roboto Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bbc-bg);
  color: var(--text-1);
  font-family: var(--font-body);
  margin: 0;
  scroll-behavior: smooth;
}

a { color: inherit; }

::selection { background: var(--bbc-blue); color: #fff; }

/* ------------------------------------------------------------------
   Site nav - same visual language as #election-controls
   ------------------------------------------------------------------ */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  background: #101012;
  padding: 6px;
  border-bottom: 3px solid var(--bbc-blue);
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-nav .brand {
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #fff;
  padding: 9px 16px 9px 10px;
  margin-right: auto;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a.nav-link {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--text-2);
  background: #1a1a1d;
  border: none;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  text-transform: uppercase;
}

.site-nav a.nav-link:hover { background: #2a2a2f; color: #fff; }
.site-nav a.nav-link.active { background: var(--bbc-blue); color: #fff; }

.site-nav a.nav-link.app-link {
  background: #0f3d31;
  color: #a8ecd9;
  border-left: 3px solid var(--bbc-custom);
}
.site-nav a.nav-link.app-link:hover { background: #145243; color: #fff; }

/* ------------------------------------------------------------------
   Layout shell
   ------------------------------------------------------------------ */

.page {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ------------------------------------------------------------------
   Page header - plain, no gradient/hero treatment
   ------------------------------------------------------------------ */

.page-header {
  padding: 40px 24px 28px;
  border-bottom: 1px solid var(--bbc-line);
}

.page-header-inner {
  max-width: 740px;
  margin: 0 auto;
}

.page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  margin: 0 0 10px;
  color: #fff;
}

.page-header p.lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 640px;
  margin: 0;
}

/* ------------------------------------------------------------------
   Buttons / plain links (match .zoom-btn / election-controls language)
   ------------------------------------------------------------------ */

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 18px;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-primary { background: var(--bbc-blue); color: #fff; }
.btn-primary:hover { background: var(--bbc-blue-dark); }

.btn-ghost { background: var(--bbc-panel); color: var(--text-1); border: 1px solid var(--bbc-line); }
.btn-ghost:hover { background: var(--bbc-panel-2); }

/* ------------------------------------------------------------------
   Section headers
   ------------------------------------------------------------------ */

.section { padding: 32px 24px; max-width: 740px; margin: 0 auto; }
.section h2 {
  font-family: var(--font-head);
  font-size: 20px;
  color: #fff;
  margin: 0 0 16px;
}

/* ------------------------------------------------------------------
   Plain post list (home + blog index) - no cards, no hover animation
   ------------------------------------------------------------------ */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--bbc-line);
}
.post-list li:first-child { padding-top: 0; }

.post-list a.post-list-title {
  font-family: var(--font-head);
  font-size: 17px;
  color: #fff;
  text-decoration: none;
}
.post-list a.post-list-title:hover { color: var(--bbc-blue); }
.post-list a.post-list-title::before {
  content: "\2192  "; /* -> */
  color: var(--text-3);
}

.post-list .post-list-dek {
  color: var(--text-2);
  font-size: 14.5px;
  margin: 6px 0 6px;
}
.post-list .post-list-meta {
  font-size: 12.5px;
  color: var(--text-3);
}
.post-list .post-list-meta span + span::before { content: " \00b7 "; }

/* ------------------------------------------------------------------
   Blog post typography
   ------------------------------------------------------------------ */

.post-header {
  max-width: 740px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  border-bottom: 1px solid var(--bbc-line);
}
.post-header .series-tag {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, var(--bbc-blue));
  margin-bottom: 8px;
  display: block;
}
.post-header h1 {
  font-family: var(--font-head);
  font-size: clamp(24px, 4.5vw, 36px);
  color: #fff;
  line-height: 1.2;
  margin: 0 0 10px;
}
.post-header .dek {
  font-size: 15.5px;
  color: var(--text-2);
  max-width: 640px;
  margin: 0;
  line-height: 1.5;
}
.post-header .byline {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-3);
}
.post-header .series-crosslinks {
  margin-top: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-3);
}
.post-header .series-crosslinks a {
  color: var(--accent, var(--bbc-blue));
  text-decoration: none;
}
.post-header .series-crosslinks a:hover {
  text-decoration: underline;
}
.post-header .series-crosslinks .series-crosslink-current {
  color: var(--text-2);
  font-weight: 700;
}

.post-body {
  max-width: 740px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-2);
}

.post-body h2 {
  font-family: var(--font-head);
  font-size: 26px;
  color: #fff;
  margin: 52px 0 18px;
  padding-top: 10px;
  border-top: 1px solid var(--bbc-line);
}
.post-body h1 + h2, .post-body > h2:first-child { border-top: none; padding-top: 0; }
.post-body h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  margin: 34px 0 12px;
}
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body strong { color: #fff; }
.post-body em { color: var(--text-2); }
.post-body a { color: #7fb0ff; text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: #a8cbff; }
.post-body hr { border: none; border-top: 1px solid var(--bbc-line); margin: 40px 0; }
.post-body code {
  font-family: var(--font-mono);
  background: var(--bbc-panel);
  padding: 2px 6px;
  font-size: 15px;
  color: #d9c8ff;
}

/* plain ```fenced``` code blocks written directly in a markdown post
   (as opposed to .nb-code, which wraps a notebook code cell + its output) */
.post-body pre {
  background: #101012;
  border: 1px solid var(--bbc-line);
  border-left: 3px solid var(--accent, var(--bbc-blue));
  padding: 16px 18px;
  margin: 0 0 24px;
  overflow-x: auto;
}
.post-body pre code {
  background: none;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #e4e4e8;
}

.post-body blockquote {
  margin: 0 0 18px;
  padding: 4px 20px;
  border-left: 3px solid var(--accent, var(--bbc-blue));
  color: var(--text-2);
}

/* markdown tables inside prose */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}
.post-body th, .post-body td {
  border: 1px solid var(--bbc-line);
  padding: 9px 12px;
  text-align: left;
}
.post-body th {
  background: var(--bbc-panel);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.post-body tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* code cell + output */
.nb-code {
  background: #101012;
  border: 1px solid var(--bbc-line);
  border-left: 3px solid var(--accent, var(--bbc-blue));
  margin: 0 0 4px;
  overflow-x: auto;
}
.nb-code pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  color: #e4e4e8;
  white-space: pre;
}
.nb-output {
  background: var(--bbc-panel);
  border: 1px solid var(--bbc-line);
  border-top: none;
  margin: 0 0 24px;
  overflow-x: auto;
}
.nb-output .nb-output-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 18px 0;
}
.nb-output pre {
  margin: 0;
  padding: 6px 18px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* pandas DataFrame html output, reskinned dark */
.nb-output table.dataframe {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin: 10px 18px 18px;
  width: calc(100% - 36px);
}
.nb-output table.dataframe th, .nb-output table.dataframe td {
  border: 1px solid var(--bbc-line);
  padding: 6px 10px;
  text-align: right;
  white-space: nowrap;
}
.nb-output table.dataframe th { background: var(--bbc-panel-2); color: #fff; font-weight: 700; }
.nb-output table.dataframe tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
.nb-output table.dataframe td:first-child, .nb-output table.dataframe th:first-child { text-align: left; }

.post-nav {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 24px 90px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--bbc-line);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.site-footer a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 620px) {
  .page-header { padding: 28px 18px 20px; }
  .section { padding: 24px 18px; }
}
