:root {
  --site: #7c1d2b;
  --bank: #1f7f73;
  --feb: #c9731e;
  --mar: #1f3fa0;
  --ink: #181b22;
  --muted: #4c5560;
  --paper: #fafbf9;
  --rule: #d9ded8;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: #244487;
  text-underline-offset: 0.18em;
}

.brief-header,
main {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 20px 15px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}

.brief-header a:first-child {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

main { padding-block: 40px 64px; }

h1, h2, h3, p, figure { margin: 0; }

h1 {
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.07;
  font-weight: 650;
  letter-spacing: -0.04em;
  max-width: 23ch;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: -0.018em;
}

h3 { font-size: 0.9rem; }

.brief-date {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.brief-intro { margin-top: 20px; }

.findings {
  max-width: 865px;
  margin-block: 24px 34px;
  padding: 19px 22px;
  border-left: 3px solid var(--mar);
  background: #eef2fa;
}

.findings h2 { font-size: 1.1rem; }

.findings p,
.explanation p,
#smith > p,
.method-body h2 + p { margin-top: 9px; }

#figure1 { max-width: 865px; }

.regional-panels,
.smith-halves {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.regional-panels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.regional-panels h3 { margin-bottom: 5px; }

.regional-panels svg,
.smith-halves > svg {
  display: block;
  width: 100%;
  height: auto;
}

.marker-label { paint-order: stroke; stroke: #fff; stroke-width: 1.8px; }

#figure1 > svg {
  display: block;
  width: calc((100% - 28px) / 3);
  height: auto;
  margin-top: 6px;
}

figcaption, .map-key {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.rankings, .explanation, #smith, #method { margin-top: 40px; }

.site-table {
  width: 100%;
  margin-top: 12px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.42;
}

.number-col { width: 4%; }
.address-col { width: 16%; }
.utility-col { width: 12%; }
.figure-col { width: 17%; }
.change-col { width: 15%; }
.verdict-col { width: 13%; }
.question-col { width: 23%; }

.site-table th,
.site-table td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.site-table thead {
  background: #eef0eb;
  border-block: 1px solid var(--rule);
}

.site-table tbody tr { border-bottom: 1px solid var(--rule); }
.site-table .site-address { font-weight: 400; }

.site-table :is(.site-address, [data-label="Nearest published figure"]) > :is(strong, span, small) {
  display: block;
}

.site-table small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84em;
}

.site-number {
  color: var(--site);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.verdict {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--verdict-background);
  color: var(--verdict-text);
  font-weight: 650;
  line-height: 1.25;
}

.room { --verdict-background: #e5f2eb; --verdict-text: #174932; }
.tight { --verdict-background: #f6efd9; --verdict-text: #65450d; }
.little { --verdict-background: #f6e8e5; --verdict-text: #772f2a; }
.unknown { --verdict-background: #e8edf5; --verdict-text: #2e4766; }

.explanation, #smith, #method { max-width: 865px; }

.explanation p,
#smith > p,
.method-body > p,
.definition-list dd { max-width: 76ch; }

.smith-halves {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 730px;
  gap: 18px;
  align-items: start;
}

.map-key {
  display: flex;
  gap: 5px;
  align-items: baseline;
  flex-wrap: wrap;
}

.key-symbol { flex: none; align-self: center; }
.map-key > span:first-of-type { margin-right: 8px; }

#smith > p:last-child { margin-top: 14px; }

#method { border-block: 1px solid var(--rule); }

#method summary {
  cursor: pointer;
  padding-block: 14px;
  font-size: 1.15rem;
  font-weight: 650;
}

.method-body { padding-bottom: 16px; }
.method-body h2 { font-size: 1.1rem; }
.method-body h2:not(:first-child) { margin-top: 19px; }
.method-body p + p { margin-top: 10px; }
.method-body ul { margin-block: 8px 0; padding-left: 22px; }
.definition-list { margin-block: 12px 0; }
.definition-list dt { margin-top: 11px; font-weight: 700; }
.definition-list dd { margin: 2px 0 0; }
.definition-list + p { margin-top: 12px; }

.closing { margin-top: 22px; font-weight: 650; }

@media screen and (width < 700px) {
  .site-table, .site-table tbody { display: block; }
  .site-table colgroup { display: none; }

  .site-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .site-table tbody tr {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 7px 9px;
    padding: 13px 12px 15px;
    margin-bottom: 9px;
    border: 1px solid var(--rule);
    border-radius: 6px;
  }

  .site-table tbody th, .site-table tbody td { padding: 0; }

  .site-table tbody td[data-label] {
    grid-column: 2;
    display: block;
  }

  .site-table tbody .verdict-cell { grid-row: 2; }

  .site-table tbody td[data-label]:not(.verdict-cell)::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 650;
  }

  .verdict { margin-top: 2px; }
}

@media screen and (max-width: 560px) {
  .brief-header, main { width: calc(100% - 36px); }
  main { padding-top: 29px; }
  .findings { padding: 14px 15px; }

  .regional-panels, .smith-halves { grid-template-columns: minmax(0, 1fr); }

  .regional-panels > div, #figure1 > svg { width: min(100%, 270px); }
}

@page {
  size: Letter;
  margin: 0.62in 0.54in 0.59in;
  @top-left {
    content: "Substation Capacity | Research brief | November 19, 2026";
    font: 8pt Arial, sans-serif;
    color: #4c5560;
  }
  @bottom-left { content: "substationcapacity.com"; font: 8pt Arial, sans-serif; }
  @bottom-right { content: counter(page); font: 8pt Arial, sans-serif; }
}

@media print {
  body { background: white; font: 10pt/1.35 Arial, sans-serif; print-color-adjust: exact; }
  .brief-header, .site-header, .pdf-download-row, .brief-request, .site-footer { display: none; }
  main { width: auto; padding: 0; }
  h1 { font-size: 28pt; max-width: none; }
  h2 { font-size: 15pt; }
  .brief-date { font-size: 9pt; }
  .brief-intro { margin-top: 12pt; }
  .findings { margin-block: 15pt 19pt; padding: 11pt 13pt; }
  .regional-panels, .smith-halves { gap: 10pt; }
  #figure1 > svg { width: calc((100% - 20pt) / 3); }
  .rankings, #method { break-before: page; margin-top: 0; }
  .explanation { break-inside: avoid; margin-top: 12pt; }
  #smith { margin-top: 16pt; }
  .site-table { font-size: 8.5pt; line-height: 1.18; }
  .site-table th, .site-table td { padding: 2.75pt 4pt; }
  .site-table small { margin-top: 2pt; font-size: 0.92em; }
  .site-table tr, #figure1, #figure2, .findings { break-inside: avoid; }
  .verdict { padding: 2pt 4pt; }
  .method-body { padding-bottom: 6pt; }
  .method-body > p, .definition-list dd { max-width: none; }
  .definition-list + p { margin-top: 8pt; }
  #method summary { padding-block: 9pt; font-size: 14pt; }
  .closing { margin-top: 12pt; }
}

/* Screen: match the site homepage (header, footer and type values copied from /index.html).
   Every rule is inside @media screen, so print and the PDF keep the layout above. */
@media screen {
  :root { --paper: #fff; --serif: Georgia, 'Times New Roman', serif; --ink: #181b22; }
  body { background: #fff; color: #181b22; font-size: 17px; line-height: 1.6; }
  a { color: #1F3FA0; }

  /* Header and footer: homepage chrome */
  .site-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; min-height: 60px; padding: 0 16px; background: #fff; }
  .site-header .logo { color: #181b22; font: 600 17px/1.5 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: -.025em; text-decoration: none; }
  .top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
  .top-nav a { display: inline-flex; align-items: center; height: 41px; padding: 10px 18px; border-radius: 24px; background: #f4f4f4; color: #181b22; font-weight: 400; text-decoration: none; line-height: 1; }
  .top-nav a:hover { background: #eaeaea; }
  .site-footer { width: min(100% - 48px, 912px); margin: 72px auto 0; padding: 32px 0; border-top: 1px solid var(--rule); }
  .site-footer p { margin: 0; max-width: none; font-size: 15px; color: #3a413b; }
  .site-footer a { color: #1F3FA0; }

  /* Main area: max 960px with 56px on top; sections 72px apart */
  main { box-sizing: border-box; width: 100%; max-width: 960px; padding: 56px 24px 64px; }
  main .pdf-download-row { margin: 8px 0 12px; font-size: 15px; }
  .brief-request { margin-top: 0; }
  main > section + section { margin-top: 72px; }

  /* Type */
  h1, h2 { font-family: var(--serif); font-weight: 400; color: #181b22; }
  h1 { font-size: 56px; letter-spacing: -0.025em; line-height: 1.08; }
  h2 { font-size: 36px; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 24px; }
  h3 { font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 20px; font-weight: 600; line-height: 1.4; margin: 32px 0 16px; }
  main p { font-size: 17px; color: #181b22; max-width: 62ch; margin-bottom: 24px; }
  main li, main dd, main dt { max-width: 62ch; }
  .findings h2 { font: 400 24px/1.2 var(--serif); }
  .findings p:last-child { margin-bottom: 0; }
  #method summary { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; }

  /* Maps and tables use the full width; only text is held to 62ch */
  main figure, main table, .regional-panels, .smith-halves { max-width: none; }
  main figure p, main figcaption, main table p { max-width: none; }
  .site-table thead th { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

  @media (width < 720px) {
    h1 { font-size: 43px; letter-spacing: -.03em; }
    h2 { font-size: 30px; }
    main { padding: 16px 24px 48px; }
  }
}
@media screen and (width < 720px) {
  .site-header { padding: 16px 24px; gap: 12px; }
  .top-nav { gap: 6px; }
  .top-nav a { padding: 8px 12px; height: 34px; font-size: 13px; }
  .site-footer { margin: 72px auto 0; }
}
