/* Live layout. Same rules as preview/preview.css.
   The owner will style it later. */

.preview-banner {
  margin: 0;
  padding: 0.55rem 1rem;
  background: #8a1c1c;
  color: #ffffff;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(14rem, 1fr) minmax(11rem, 0.85fr);
  gap: 1.75rem;
  align-items: start;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.home-columns h1,
.home-columns h2 {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.reports-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-line, #ddd9ce);
  border-radius: 0.35rem;
  background: #ffffff;
}

.reports-table th,
.reports-table td {
  padding: 0.45rem 0.55rem;
  vertical-align: middle;
}

.reports-table thead th:nth-child(n + 3),
.reports-table td {
  text-align: center;
}

#reports-note {
  margin: 0 0 0.55rem;
}

.report-link,
.coming {
  display: inline-block;
  min-width: 4.75rem;
  padding: 0.28rem 0.65rem;
  border-radius: 0.25rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.report-link {
  border: 1px solid var(--color-green-dark, #146b31);
  background: #ffffff;
  text-decoration: none;
}

.report-link:hover,
.report-link:focus-visible {
  background: #e7f5eb;
}

.report-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
}

.report-link.one-page {
  min-width: 0;
  padding: 0.12rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.coming {
  border: 1px solid #c5c1b6;
  background: #e6e4dc;
  color: #6a655c;
}

.historical-link {
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
}

.year-rows {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.year-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.85rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-line, #ddd9ce);
  border-bottom: 0;
  background: #ffffff;
}

.year-row:first-child {
  border-radius: 0.35rem 0.35rem 0 0;
}

.year-row:last-child {
  border-bottom: 1px solid var(--color-line, #ddd9ce);
  border-radius: 0 0 0.35rem 0.35rem;
}

.year-row-current {
  background: #e7f5eb;
  border-color: var(--color-green-dark, #146b31);
}

.year-row-current + .year-row {
  border-top-color: var(--color-green-dark, #146b31);
}

.year-label {
  margin: 0;
  min-width: 3.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.year-row-current .year-label {
  font-size: 1.35rem;
  color: var(--color-green-dark, #146b31);
}

.year-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.year-links .report-link {
  min-width: 0;
}


.article-list,
.primary-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-list h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.article-list p {
  margin: 0;
}

.article-list li + li,
.primary-links li + li {
  margin-top: 0.85rem;
}

/* Home column only: title, date, one description line. Four of these
   stay inside the middle column on a tablet. */
.home-columns .article-list h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.home-columns .article-list li + li {
  margin-top: 0.55rem;
}

.home-columns .article-date,
.home-columns .article-excerpt {
  color: var(--color-ink, #142117);
}

.home-columns .article-date {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.home-columns .article-excerpt {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.home-columns .column-foot {
  margin: 0.7rem 0 0;
}

.primary-links a {
  font-weight: 700;
}

.column-foot {
  margin: 1.25rem 0 0;
}

.archive-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

.archive-section {
  margin: 0 0 1.75rem;
  scroll-margin-top: 1rem;
}

.archive-section h2 {
  margin: 0 0 0.55rem;
}

.archive-year {
  grid-column: 1 / -1;
  margin: 0.85rem 0 0;
}

.archive-year h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--color-ink, #142117);
}

.archive-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 600px) {
  .archive-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .archive-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Four legislator reports a year, in two pairs. */
#ratings .archive-year > .archive-list {
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  #ratings .archive-year > .archive-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.archive-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.3rem 0 0.45rem;
  border-bottom: 1px solid var(--color-line, #ddd9ce);
  color: var(--color-ink, #142117);
  line-height: 1.3;
}

.archive-item a {
  font-weight: 700;
}

.archive-meta {
  color: var(--color-ink, #142117);
  font-size: 0.92rem;
}

@media (max-width: 820px) {
  .archive-jump .jump-btn {
    min-width: 0;
    flex: 1 1 8.5rem;
    font-size: 1.05rem;
    padding: 0.65rem 0.8rem;
  }
}

.article-via {
  margin-top: 0.35rem;
  font-size: 0.92rem;
}

.article-byline {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.article-credit {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.article-downloads {
  margin: 0 0 1rem;
}

.article-body .deck {
  font-size: 1.15rem;
}

.article-body .source {
  font-style: italic;
}

.article-body ol.credits {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.article-kicker {
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.article-figure {
  margin: 0 0 1.25rem;
}

.article-figure img {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
}

.article-figure figcaption {
  margin-top: 0.35rem;
  font-size: 0.92rem;
}

.article-body h2 {
  margin-top: 1.6rem;
}

.page-body section:first-child h2 {
  margin-top: 0;
}

.site-footer .footer-inner {
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer .footer-inner p {
  margin: 0;
}

@media (max-width: 860px) {
  .home-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-columns > section {
    min-width: 0;
  }
}

/* The shared stylesheet turns every table into stacked blocks on a phone.
   Keep this ratings table a table so the year rowspan stays intact, and
   scroll it sideways instead. */
@media (max-width: 640px) {
  .reports-scroll {
    overflow-x: auto;
    border: 1px solid var(--color-line, #ddd9ce);
    background: #ffffff;
  }

  .reports-scroll table {
    display: table;
    width: max-content;
    min-width: 0;
  }

  .report-link,
  .coming {
    min-width: 0;
  }

  .reports-scroll thead {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }

  .reports-scroll tbody {
    display: table-row-group;
  }

  .reports-scroll tr {
    display: table-row;
    width: auto;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .reports-scroll th,
  .reports-scroll td {
    display: table-cell;
    width: auto;
  }

  .reports-scroll tbody td::before {
    content: none;
  }
}
/* Officials page — new classes only. Append to preview/preview.css (or site.css on publish). */

.officials-asof {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.page-body .intro {
  margin: 0 0 0.65rem;
}

.officials-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.officials-jump .jump-btn {
  display: inline-block;
  min-width: 9rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.4rem;
  background: #1f5d34;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.officials-jump .jump-btn:hover,
.officials-jump .jump-btn:focus {
  background: #164427;
  color: #ffffff;
}

.officials-jump .jump-link {
  font-weight: 700;
  text-decoration: underline;
}

.officials-section { scroll-margin-top: 1rem; }

.officials-section {
  margin: 0 0 0.85rem;
}

.officials-section h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  line-height: 1.15;
}

.officials-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.officials-grid-general {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.official-btn {
  display: block;
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--color-green-dark, #146b31);
  border-radius: 0.25rem;
  background: #ffffff;
  color: var(--color-ink, #142117);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
}

.official-btn:hover,
.official-btn:focus-visible {
  background: #e7f5eb;
  color: var(--color-green-dark, #146b31);
}

.official-btn.party-d {
  border-color: #1a4a8a;
}

.official-btn.party-d:hover,
.official-btn.party-d:focus-visible {
  background: #e8eef8;
  color: #1a4a8a;
}

.official-btn.general {
  border-color: #555;
}

.official-btn.general:hover,
.official-btn.general:focus-visible {
  background: #f0f0ec;
  color: #222;
}

@media (max-width: 1100px) {
  .officials-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .officials-grid,
  .officials-grid-general { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .officials-grid,
  .officials-grid-general { grid-template-columns: 1fr; }
}
/* How Ratings Work page — new classes only. Append to preview/preview.css (or site.css on publish). */

.method-asof {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.method-page .intro,
.method-page > .method-section > p {
  margin: 0 0 0.75rem;
  max-width: 52rem;
}

.method-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.method-jump .jump-btn {
  display: inline-block;
  min-width: 9rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.4rem;
  background: #1f5d34;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.method-jump .jump-btn:hover,
.method-jump .jump-btn:focus {
  background: #164427;
  color: #ffffff;
}

.method-section {
  margin: 0 0 1.75rem;
  scroll-margin-top: 1rem;
}

.method-section h2 {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.method-section h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.25;
}

.method-list {
  margin: 0.25rem 0 0.75rem 1.25rem;
  padding: 0;
  max-width: 52rem;
}

.method-list li {
  margin: 0 0 0.35rem;
}

ol.method-steps {
  margin: 0.25rem 0 0.75rem;
  padding: 0 0 0 1.6rem;
  max-width: 52rem;
  list-style: decimal;
}

ol.method-steps li {
  margin: 0 0 0.55rem;
  padding-left: 0.25rem;
}

.score-table-wrap {
  overflow-x: auto;
  margin: 0.55rem 0 0.7rem;
  max-width: 36rem;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: max(1rem, 12pt);
  line-height: 1.35;
  background: #fff;
}

.score-table th,
.score-table td {
  border: 1px solid #222;
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.score-table thead th {
  background: #e8efe9;
  font-weight: 700;
}

.score-table tbody tr:nth-child(even) td {
  background: #f7faf7;
}

.score-table td:last-child,
.score-table th:last-child {
  width: 5.5rem;
  white-space: nowrap;
}

.guide-table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: max(0.92rem, 12pt);
  line-height: 1.35;
  background: #fff;
}

.guide-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.guide-table th,
.guide-table td {
  border: 1px solid #222;
  padding: 0.45rem 0.55rem;
  vertical-align: top;
  text-align: left;
}

.guide-table thead th {
  background: #e8efe9;
  font-weight: 700;
}

.guide-table tbody th {
  width: 4.5rem;
  white-space: nowrap;
  background: #f4f6f4;
  font-weight: 700;
}

.guide-table tbody tr:nth-child(even) td,
.guide-table tbody tr:nth-child(even) th {
  background: #f7faf7;
}

.flow-figure {
  margin: 0.75rem 0 1rem;
  padding: 0.5rem;
  border: 1px solid #222;
  background: #fff;
  overflow-x: auto;
}

.flow-svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.method-sources {
  border-top: 1px solid #ccc;
  padding-top: 0.75rem;
  font-size: 0.9rem;
}

/* Home: How the Ratings Work button (top of Reports column) */
.how-ratings-btn {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.4rem;
  background: #1f5d34;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.how-ratings-btn:hover,
.how-ratings-btn:focus {
  background: #164427;
  color: #ffffff;
}

@media (max-width: 640px) {
  table.score-table {
    display: table;
    width: 100%;
  }

  .score-table thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .score-table tbody { display: table-row-group; }

  .score-table tr {
    display: table-row;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .score-table th,
  .score-table td {
    display: table-cell;
    width: auto;
  }

  .score-table td:last-child,
  .score-table th:last-child {
    width: 5.5rem;
  }

  .score-table td::before,
  .score-table th::before {
    content: none;
  }
}

@media print {
  .preview-banner { display: none; }
  .flow-figure { border: none; padding: 0; }
  .guide-table th,
  .guide-table td { border-color: #000; }
  .method-jump .jump-btn,
  .how-ratings-btn {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000;
  }
}
