/* Reusable publication theme: clean minimal long-form analysis.
   Usage: <link rel="stylesheet" href="blog_theme_newspaper_ascii.css"> */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #636a74;
  --accent: #b43a2f;
  --accent-soft: #f8ecea;
  --border: #e3e6eb;
  --line: #ced4dc;
  --table-head: #f3f5f8;
  --row-alt: #fafbfd;
  --highlight: #eef4ff;
  --mono: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, Georgia, Cambria, "Times New Roman", serif;
  --sans: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(15.6px, 0.95vw, 16.8px);
  line-height: 1.56;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 812px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: relative;
  counter-reset: section;
}

.container::before {
  content: "==============================================================";
  display: block;
  margin-bottom: 14px;
  color: #b8bfc9;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
}

h1 {
  font-size: clamp(1.86rem, 3.3vw, 2.52rem);
  line-height: 1.06;
  margin-bottom: 6px;
  letter-spacing: -0.012em;
  text-wrap: balance;
  max-width: 26ch;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.08vw, 1.05rem);
  margin-bottom: 6px;
  font-style: italic;
  max-width: 72ch;
}

.byline {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 7px 0;
}

h2 {
  counter-increment: section;
  font-size: clamp(1.2rem, 1.75vw, 1.4rem);
  line-height: 1.26;
  margin-top: 38px;
  margin-bottom: 10px;
  padding-top: 6px;
  padding-bottom: 6px;
  border-top: 2px solid #d8dde5;
  border-bottom: 1px solid var(--border);
  text-wrap: balance;
}

h2::before {
  content: "SECTION " counter(section, decimal-leading-zero) " // ";
  font-family: var(--mono);
  font-size: 0.54em;
  letter-spacing: 0.08em;
  color: #7a3f39;
  font-weight: 600;
}

h3 {
  font-size: clamp(1.01rem, 1.45vw, 1.12rem);
  margin-top: 22px;
  margin-bottom: 6px;
  color: #20242a;
}

h3::before {
  content: ">> ";
  font-family: var(--mono);
  color: #7a3f39;
  font-size: 0.82em;
}

p {
  margin-bottom: 11px;
  text-align: justify;
  text-justify: inter-word;
}

strong {
  font-weight: 700;
}

a {
  color: #1f4d86;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: #12355e;
}

figure {
  margin: 22px 0;
  padding: 8px 0 7px;
  border-top: 1px dashed #dde2e9;
  border-bottom: 1px dashed #dde2e9;
}

figure.wide {
  margin-left: -84px;
  margin-right: -84px;
}

figure.wide figcaption {
  margin-left: 84px;
  margin-right: 84px;
}

figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.58;
  max-width: 760px;
  border-top: 1px dotted #dde2e9;
  padding-top: 9px;
}

figcaption strong {
  color: #333a44;
}

.pullquote {
  margin: 22px 0;
  padding: 11px 13px;
  background: var(--accent-soft);
  border: 1px solid #f0d8d5;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  font-size: 0.98em;
  line-height: 1.5;
}

.pullquote::before {
  content: "[ KEY FINDING ]";
  display: inline-block;
  margin-bottom: 8px;
  color: #7a3f39;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.pullquote p {
  margin-bottom: 0;
}

.note {
  margin: 22px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 4px solid #7b8798;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.82rem;
  font-family: var(--mono);
  line-height: 1.48;
}

.note p {
  margin-bottom: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 0.9rem;
  background: #fff;
}

th,
td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  background: var(--table-head);
  color: #3b4450;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr.reference td,
tr.reference td.num {
  color: #6e7782;
}

.cost-table {
  border-radius: 8px;
}

.cost-table th {
  background: #eef1f6;
  color: #3a4655;
}

.cost-table .route-name {
  font-weight: 600;
}

.cost-table td.total {
  font-weight: 700;
}

.cost-table tr.highlight {
  background: var(--highlight);
}

.cost-table tr.highlight .route-name {
  color: #1f4d86;
}

.cost-table tr.reference:first-of-type td {
  border-top: 2px solid #cfd6df;
}

.hftd-badge {
  display: inline-block;
  min-width: 42px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.hftd-low {
  background: #e7f4e8;
  color: #23622a;
  border-color: #c9e8cc;
}

.hftd-med {
  background: #fff2dd;
  color: #8a530d;
  border-color: #f6deb5;
}

.hftd-high {
  background: #ffe9e4;
  color: #983022;
  border-color: #f2c9c1;
}

.hftd-extreme {
  background: #ffe3e3;
  color: #7f1f1f;
  border-color: #efc0c0;
}

ul,
ol {
  margin-bottom: 10px;
  padding-left: 1.22em;
}

li {
  margin-bottom: 4px;
  text-align: justify;
  text-justify: inter-word;
}

details {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

summary {
  background: #f6f8fb;
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3f4a58;
}

summary:hover {
  background: #edf2f8;
}

.detail-content {
  padding: 12px;
}

.detail-content figure.wide {
  margin-left: 0;
  margin-right: 0;
}

.detail-content figure.wide figcaption {
  margin-left: 0;
  margin-right: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.table-note {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--sans);
  margin-top: -10px;
  margin-bottom: 12px;
}

.data-sources th {
  font-size: 0.74rem;
}

.data-sources td {
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  .container {
    border-left: none;
    border-right: none;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  figure.wide {
    margin-left: -20px;
    margin-right: -20px;
  }

  figure.wide figcaption {
    margin-left: 20px;
    margin-right: 20px;
  }
}

@media (max-width: 700px) {
  body {
    line-height: 1.52;
  }

  .container {
    padding-top: 18px;
    padding-bottom: 44px;
  }

  h2 {
    margin-top: 28px;
  }

  th,
  td {
    padding: 8px 8px;
  }
}
