@import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400&display=fallback");
body {
  margin: 0;
  padding: 0;
  border-top: 5px solid #0d4aaa;
  font-family: "Source Sans Pro", sans-serif;
  color: #555;
  font-size: 11pt;
}

/* Layout */

.container {
  margin: 20px auto;
  max-width: 600px;
  padding: 0 12px;
}

.yearSection h2 {
  padding-right: 20px;
}

.title strong {
  display: block;
}

.row {
  margin-bottom: 60px;
}

.row:last-child {
  margin-bottom: 0;
}

@media (min-width: 1100px) {
  .container.wide {
    max-width: 1000px;
  }

  .row {
    display: flex;
    flex-direction: row;
  }

  .leftCol {
    width: 350px;
  }

  .leftCol p {
    text-align: justify;
  }

  .rightCol {
    width: 650px;
    margin-left: 40px;
  }

  .title strong {
    display: inline;
  }

  .yearSection h2 {
    padding-left: 30px;
  }
}

.rightCol :first-child,
.leftCol :first-child {
  margin-top: 0;
}

li {
  margin-bottom: 10px;
}

/* Style */

p {
  margin: 16px 0;
  line-height: 1.4;
}

.description {
  font-size: 16pt;
  color: black;
}

.description h1 {
  display: inline;
  font-size: 16pt;
}

a {
  color: #0d4aaa;
  text-decoration: none;
}

h2 {
  margin: 0;
  font-size: 16pt;
  color: #7a8593;
}

h3 {
  margin: 0;
  font-size: 16pt;
  font-weight: normal;
  color: #7a8593;
}

h3 a {
  font-weight: bold;
  color: black;
}

h3 strong {
  color: #0d4aaa;
}

.meta {
  color: #7a8593;
}

.yearSection {
  display: flex;
}

.rightCol .electionHeader {
  margin-bottom: 10px;
  margin-top: 22px;
  padding: 0;
}

.electionHeader:first-child {
  margin-top: 0;
}

.yearSection {
  margin-top: 22px;
}

.yearSection:first-child {
  margin-top: 0;
}

.electionSection {
  flex: 1;
}

.race a {
  display: flex;
  align-items: center;
  color: #7a8593;
  padding: 5px;
  margin: 0 -5px;
  text-decoration: none;
}

.race a:hover {
  background: #eee;
}

.race a .title strong {
  color: black;
}

.race a .title {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink below content size */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race a .meta {
  text-align: right;
  flex: 0 0 auto; /* Don't grow or shrink, maintain natural size */
  margin-left: 10px;
}

hr {
  border: none;
  border-bottom: 1px dotted #ddd;
}

/* Interesting Election Highlighting (non-Condorcet winner or exhausted > winner) */
.race.interesting {
  border-left: 4px solid #0d4aaa;
  background-color: #f2f5fd;
  margin-left: -5px;
  padding-left: 5px;
}

/* Subtle highlight for elections where winner didn't lead in round 1 */
.race.winner-not-first {
  border-left: 2px solid #88a0dd;
  background-color: #f8faff;
  margin-left: -5px;
  padding-left: 5px;
}

/* If both interesting and winner-not-first, use interesting styling */
.race.interesting.winner-not-first {
  border-left: 4px solid #0d4aaa;
  background-color: #f2f5fd;
}

.interesting-badge {
  display: inline-block;
  background-color: #0d4aaa;
  color: white;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  font-weight: 600;
}

.condorcet-info {
  display: block;
  font-size: 0.9em;
  color: #666;
  font-style: italic;
  margin-top: 2px;
}


/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: black;
    color: #e3e3e3;
  }

  .description {
    color: #e3e3e3;
  }

  h2 {
    color: #a5adb8;
  }

  h3 {
    color: #a5adb8;
  }

  h3 a {
    color: #e3e3e3;
  }

  .meta {
    color: #a5adb8;
  }

  .race a {
    color: #a5adb8;
  }

  .race a:hover {
    background: #2d2d2f;
  }

  .race a .title strong {
    color: #e3e3e3;
  }

  hr {
    border-bottom-color: #444;
  }

  .race.interesting {
    background-color: #1f1f2d;
    border-left-color: #0d4aaa;
  }

  .race.winner-not-first {
    background-color: #25252d;
    border-left-color: #6688cc;
  }

  .race.interesting.winner-not-first {
    background-color: #1f1f2d;
    border-left-color: #0d4aaa;
  }

  .condorcet-info {
    color: #999;
  }

  /* Make links brighter blue in dark mode */
  a {
    color: #4a8fff;
  }

  h3 strong {
    color: #4a8fff;
  }

  /* Make visited links muted blue in dark mode */
  a:visited {
    color: #8080d0;
  }

  h3 a:visited {
    color: #a5adb8;
  }
}
