@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-600.woff2") format("woff2");
}

:root {
  --surface-0: #f0ebe3;
  --surface-1: #fdfbf7;
  --surface-2: #fff;
  --text-1: #1a1612;
  --text-2: #5c554b;
  --text-3: #706860;
  --border: #ddd8d0;
  --active: #2e2820;
  --positive: #18704b;
  --negative: #b3261e;
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.shell {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 32px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.header-inner {
  display: flex;
  padding-block: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: block;
  text-decoration: none;
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Source Serif 4", serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: -0.025em;
}

.brand small {
  display: block;
  margin-top: 6px;
  color: var(--text-3);
  font-size: 14px;
}

.logo,
.logo svg {
  display: block;
  width: 32px;
  height: 32px;
}

.logo rect {
  fill: var(--text-1);
}

.logo polyline {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo polyline:first-of-type {
  stroke: #aaa;
}

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

.breadcrumbs {
  margin-bottom: 28px;
  color: var(--text-3);
  font-size: 12px;
}

.breadcrumbs a {
  color: var(--text-2);
}

.breadcrumbs span {
  margin-inline: 5px;
}

.page-heading {
  max-width: 800px;
  margin-bottom: 28px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.page-meta,
.note {
  color: var(--text-3);
  font-size: 12px;
}

.card {
  margin-bottom: 20px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: 0 8px 24px rgb(50 40 30 / 5%);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.video-button {
  gap: 6px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.video-button svg {
  width: 15px;
  height: 15px;
}

.video-dialog {
  width: min(1100px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.video-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.video-dialog form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.video-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.video-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button-link,
.agency-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.table-scroll {
  margin-top: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

thead th {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  padding-left: 0;
  text-align: left;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.party-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--party-color);
}

.result-bar {
  display: block;
  width: 120px;
  height: 3px;
  margin-top: 5px;
  margin-left: auto;
  overflow: hidden;
  border-radius: 4px;
  background: var(--border);
}

.result-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--party-color);
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.note {
  margin: 17px 0 0;
}

.related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.related {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
}

.related a {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-1);
  text-decoration: none;
}

.related span,
.related strong {
  display: block;
}

.related span {
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: 11px;
}

.related strong {
  font-size: 13px;
}

.agency-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.archive-year > h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.poll-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.poll-link {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.poll-list li:last-child .poll-link {
  border-bottom: 0;
}

.poll-link:hover {
  background: rgb(125 139 122 / 6%);
}

.poll-link strong,
.poll-link small {
  display: block;
}

.poll-link small,
.poll-result {
  color: var(--text-3);
  font-size: 12px;
}

.text-link {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

footer {
  border-top: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-3);
  font-size: 12px;
}

footer a {
  color: var(--text-2);
  text-decoration: none;
}

.footer-inner {
  display: flex;
  padding-block: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.header-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.theme-toggle {
  display: inline-flex;
  padding: 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--border);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

:root .icon-sun,
:root.dark .icon-moon {
  display: none;
}

:root.dark .icon-sun {
  display: block;
}

.latest-poll {
  color: var(--text-3);
  font-size: 12px;
  text-align: right;
  text-decoration: none;
}

@media (max-width: 760px) {
  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    justify-content: center;
  }

  .latest-poll {
    max-width: 140px;
  }

  .shell {
    padding-inline: 16px;
  }

  .header-inner {
    padding-block: 16px;
  }

  .brand-name {
    gap: 8px;
    font-size: 20px;
    line-height: 28px;
  }

  .brand-name .logo,
  .brand-name .logo svg {
    width: 28px;
    height: 28px;
  }

  .brand small {
    font-size: 12px;
  }

  .card {
    padding: 19px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .related {
    grid-template-columns: 1fr;
  }

  .poll-link {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
  }

  .poll-result {
    grid-column: 1 / -1;
  }

  .poll-link > [aria-hidden="true"] {
    grid-row: 1;
    grid-column: 2;
    align-self: center;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .result-bar {
    width: 85px;
  }
}

:root.dark {
  --surface-0: #1a1612;
  --surface-1: #2a2420;
  --surface-2: #3d3628;
  --text-1: #f5f0e8;
  --text-2: #d4ccc0;
  --text-3: #b8b0a8;
  --border: #4a4238;
  --active: #3d362f;
  --positive: #74d3a8;
  --negative: #ff8a82;
  color-scheme: dark;
}
