/*
  WyoVote styles.

  Home hero photo — change it in this one place.
  The 1920 image is used above 1280px. The 1280 image is used at that width and below.

  Example:
    --hero-background-image: url("../assets/img/backgrounds/red-barn-black-hills-1920.jpg");
*/

:root {
  --color-green: #3a9b4f;
  --color-green-dark: #146b31;
  --color-green-deep: #0e2a18;
  --color-ink: #142117;
  --color-paper: #f4f3ee;
  --color-white: #ffffff;
  --color-hero-text: #f6fbf7;
  --color-line: #ddd9ce;
  --font-sans: "Segoe UI", Candara, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --content-width: 72rem;
  --hero-background-image: url("../assets/img/backgrounds/red-barn-black-hills-1920.jpg");
}

@media (max-width: 1280px) {
  :root {
    --hero-background-image: url("../assets/img/backgrounds/red-barn-black-hills-1280.jpg");
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 125%;
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-paper);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-green-dark);
}

a:hover {
  color: #0d4e22;
}

:focus-visible {
  outline: 3px solid var(--color-green);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--color-white);
  color: var(--color-ink);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(var(--content-width), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  background: var(--color-white);
  border-bottom: 6px solid var(--color-green);
}

.header-inner {
  padding-top: 1rem;
  padding-bottom: 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--color-ink);
  text-decoration: none;
}

.brand img {
  display: block;
  height: 4.75rem;
  width: auto;
}

.site-name {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #163322;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.7rem 0.75rem;
  border-radius: 0.35rem 0.35rem 0 0;
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: #e7f5eb;
  color: var(--color-green-dark);
}

.site-nav a[aria-current="page"] {
  background: #e7f5eb;
  box-shadow: inset 0 -4px 0 var(--color-green);
  color: var(--color-green-dark);
  font-weight: 700;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero,
.page-hero {
  color: var(--color-hero-text);
  background-color: var(--color-green-deep);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.page-hero {
  background-image: linear-gradient(160deg, rgba(8, 28, 16, 0.94) 0%, rgba(18, 64, 34, 0.9) 52%, rgba(8, 30, 16, 0.94) 100%);
}

.hero {
  flex: 0 0 auto;
  min-height: 24rem;
  background-image:
    linear-gradient(105deg, rgba(6, 18, 12, 0.88) 0%, rgba(8, 26, 16, 0.74) 42%, rgba(8, 22, 14, 0.5) 100%),
    var(--hero-background-image);
  background-position: center 62%;
}

.hero-copy {
  max-width: 42rem;
  padding: 3.4rem 0 3.8rem;
}

.page-hero .wrap {
  padding: 2.4rem 0 2.5rem;
}

h1 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.4rem 0 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  margin: 1.6rem 0 0.45rem;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.3;
}

.lede {
  margin: 0;
  max-width: 40rem;
  color: var(--color-hero-text);
  font-size: 1.32rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.scale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  margin: 1.85rem 0 0;
  font-size: 1.2rem;
}

.scale strong {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
}

.scale-rule {
  flex: 1 1 6rem;
  height: 4px;
  min-width: 4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(246, 251, 247, 0.78);
}

.page-body {
  padding: 2.4rem 0 3.6rem;
}

.page-body > .wrap > h2:first-child,
.home-block:first-child h2 {
  margin-top: 0;
}

.intro {
  margin-top: 0;
  max-width: 46rem;
}

.home-block + .home-block {
  margin-top: 2.5rem;
}

.rating-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 0.85rem;
}

.rating-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 9.5rem;
  padding: 1.25rem 1.35rem 1.15rem;
  border: 1px solid var(--color-line);
  border-left: 6px solid var(--color-green);
  border-radius: 0.55rem;
  background: var(--color-white);
  color: var(--color-ink);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(20, 33, 23, 0.04);
}

.rating-card:hover {
  border-color: var(--color-green-dark);
  color: var(--color-ink);
  background: #f7fbf8;
}

.card-kicker {
  color: var(--color-green-dark);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.15;
}

.card-meta {
  margin-top: auto;
  color: #3d5244;
  font-size: 0.95rem;
}

.placeholder-card,
.more-coming {
  margin: 0.85rem 0 0;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--color-line);
  border-radius: 0.55rem;
  background: var(--color-white);
}

.placeholder-card p,
.more-coming p {
  margin: 0;
}

.more-coming {
  max-width: 22rem;
  padding: 0.75rem 1rem;
  background: #e9e7df;
  color: #3d5244;
  font-size: 1rem;
}

.table-wrap {
  margin-top: 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: 0.55rem;
  background: var(--color-white);
}

table {
  width: 100%;
  border-collapse: collapse;
}

td a {
  white-space: nowrap;
}

caption {
  padding: 0.9rem 1rem 0.2rem;
  caption-side: top;
  text-align: left;
  font-weight: 700;
}

th,
td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: #e7f5eb;
}

tbody th {
  font-weight: 700;
}

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

.on-this-page {
  margin: 1.2rem 0 0.4rem;
  padding: 0.9rem 1.1rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: 0.55rem;
  background: var(--color-white);
}

.on-this-page ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.25rem 1.25rem;
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.pdf-list {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: 0.55rem;
}

.pdf-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  align-items: baseline;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--color-line);
}

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

.file-note {
  color: #3d5244;
  font-size: 0.98rem;
}

.note {
  margin: 0.7rem 0 0;
  color: #3d5244;
  font-size: 1rem;
}

.contact-email {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.site-footer {
  background: #102416;
  color: #e8f4eb;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
}

.footer-logo {
  flex: 0 0 auto;
  height: 3.4rem;
  width: auto;
  padding: 0.28rem;
  border-radius: 0.4rem;
  background: var(--color-white);
}

.footer-text p {
  margin: 0;
}

.footer-text p + p {
  margin-top: 0.2rem;
}

.photo-credit {
  color: #c9e0d0;
  font-size: 0.95rem;
}

.site-footer a {
  color: #e7f8ec;
}

.site-footer a:hover {
  color: #ffffff;
}

@media (max-width: 900px) {
  html {
    font-size: 112%;
  }

  .wrap {
    width: min(var(--content-width), calc(100% - 1.75rem));
  }

  .site-name {
    font-size: 2.05rem;
  }

  .brand img {
    height: 4.1rem;
  }

  .hero {
    min-height: 0;
  }

  .hero-copy {
    padding: 2.4rem 0 2.8rem;
  }

  .lede {
    font-size: 1.18rem;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    margin-top: 0.85rem;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0.9rem;
    border-radius: 0.4rem;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 5px 0 0 var(--color-green);
  }

  .scale {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .scale-rule {
    flex: none;
    width: 8.5rem;
    min-width: 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

}

@media (max-width: 640px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  caption {
    display: block;
    width: 100%;
    padding: 0 0 0.7rem;
    text-align: left;
  }

  tbody tr {
    margin: 0 0 0.85rem;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 0.55rem;
    background: var(--color-white);
  }

  tbody tr:last-child th,
  tbody tr:last-child td,
  tbody th,
  tbody td {
    border-bottom: 1px solid var(--color-line);
  }

  tbody th {
    background: #e7f5eb;
  }

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

  tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.1rem;
    color: #3d5244;
    font-size: 0.85rem;
    font-weight: 700;
  }
}
