/* =========================================================
   42electg.css
   Maryland Manual — General Election Returns
   ========================================================= */


/* =========================================================
   1. HEADING STYLES
   ========================================================= */

h3.smaller-h3-normal {
  font-size: 1rem !important;
  line-height: 1.35;
  font-weight: 400 !important;
}

h2.smaller-h3 {
  font-size: 1.25rem !important;
  line-height: 1.35;
  font-weight: 600 !important;
}

h2.smaller-h3-normal {
  font-size: 1rem !important;
  line-height: 1.35;
  font-weight: 500 !important;
}


/* Main organization or council title */

h3.smaller-h3.org-title {
  font-size: 0.9rem !important;
  line-height: 1.25;
  font-weight: 700 !important;
}

h2.smaller-h3.org-title {
  font-size: 0.9rem;
  line-height: 1.25;
  font-weight: 700 !important;
}

h3.smaller-h3.org-title a {
  font-weight: inherit;
}


/* Office, division, branch, and unit names */

h3.smaller-h3.org-heading {
  font-size: 0.9rem !important;
  line-height: 1.15;
  font-weight: 400 !important;
  margin: 1.5rem 0 0 !important;
  padding: 0 !important;
}

h3.smaller-h3.org-heading:first-child {
  margin-top: 0 !important;
}


/* Information directly below an organizational heading */

h3.smaller-h3.org-heading + p.org-details {
  margin-top: 0 !important;
  margin-bottom: 0.65rem !important;
  padding: 0 !important;
}


/* Election page headings */

#main-content h3.heading-tight {
  font-weight: 600;
}

#main-content .delegate-heading {
  margin-bottom: 1rem;
}


/* =========================================================
   2. ELECTION RESULTS TABLES
   ========================================================= */

/*
   Base election-results table.

   Individual pages may use a narrower or wider table when
   their content requires it. Do not force every election
   results table to the same percentage width.
*/

#main-content .election-results {
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
}

#main-content .election-results th {
  color: #000;
  font-weight: bold;
}

#main-content .election-results th,
#main-content .election-results td {
  padding: 4px;
  border: 1px solid #343e41;
}


/* County/city row headings remain normal weight */

#main-content .election-results tbody th[scope="row"] {
  font-weight: normal;
}


/*
   Keep jurisdiction names together when space permits.

   This is especially important for names such as:
   Prince George's Co.
   Queen Anne's Co.
   Anne Arundel Co.
*/

#main-content .election-results tbody th[scope="row"].county,
#main-content .election-results .county-nowrap {
  white-space: nowrap;
}


/* District labels */

#main-content .election-results th[scope="rowgroup"] {
  font-weight: 600;
  text-align: left;
  vertical-align: middle;
}


/* Candidate names */

#main-content .election-results td.candidate {
  text-align: left;
}


/* Numeric columns */

#main-content .election-results .num {
  text-align: right;
}


/* Explicit right alignment */

#main-content .election-results th.text-right,
#main-content .election-results td.text-right {
  text-align: right !important;
}


/* Emphasize totals */

/* TOTAL label only */
#main-content .election-results .total-row th[scope="row"] {
  font-weight: 700;
}

/* Total numbers remain normal */
#main-content .election-results .total-row td {
  font-weight: 400;
}


/* Candidate or jurisdiction text kept on one line */

#main-content .election-results .keep-one-line {
  white-space: nowrap;
}


/* Candidate names displayed above election results tables */

#main-content .election-candidates p {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem !important;
}


/* =========================================================
   3. ELECTION TABLE WIDTH OPTIONS
   ========================================================= */

/*
   Narrow election table.

   Use for result tables containing relatively few columns.
   The table remains content-sized instead of being stretched
   to an arbitrary percentage of the page.
*/

#main-content .election-results-narrow {
  width: auto;
  max-width: 100%;
}


/*
   Wider election table.

   Use when several candidate/result columns need additional
   horizontal room.
*/

#main-content .election-results-wide {
  width: 80%;
  max-width: 100%;
}


/*
   Full-width election results tables.

   Use only for tables with enough columns/content to require
   the available content width.
*/

#main-content .election-results-full-width {
  width: 100%;
}


/* =========================================================
   4. CONGRESSIONAL DISTRICT HEADINGS
   ========================================================= */

#main-content .congressional-district-heading {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

#main-content .congressional-district-heading + p {
  margin-top: 0;
}


/* =========================================================
   5. ELECTION SECTION NAVIGATION
   ========================================================= */

/*
   District and question navigation.

   Editor-approved treatment:
   - bulleted
   - indented
   - tight vertical spacing
   - plain links rather than buttons
*/

#main-content nav.election-section-nav {
  border: 0;
  margin: 1rem 0 0.75rem;
  padding: 0;
}

#main-content .election-section-list {
  display: block;
  width: auto;
  margin: 0;
  padding-left: 2.5rem;
  list-style: disc;
  border: 0;
  background: transparent;
}

#main-content .election-section-list > li {
  display: list-item;
  margin: 0 0 0.1rem;
  padding: 0;
  border: 0;
  background: transparent;
}

#main-content .election-section-list > li > a {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #000080;
  text-align: left;
  text-decoration: none;
}

#main-content .election-section-list > li > a:hover {
  text-decoration: underline;
}

#main-content .election-section-list > li > a:focus-visible {
  outline: 2px solid #000080;
  outline-offset: 2px;
  text-decoration: underline;
}


/* =========================================================
   6. NARROW ELECTION NAVIGATION
   ========================================================= */

/*
   Retained for existing pages that currently use this class.

   Do not combine this class with the standard question or
   district navigation unless a centered 400px navigation
   block is intentionally required.
*/

#main-content .election-nav-narrow {
  width: 400px;
  max-width: 100%;
  margin: 0.75rem auto !important;
}

#main-content .election-nav-narrow .mm-section-nav-list {
  display: block;
}


/* =========================================================
   7. ELECTION OFFICE HEADINGS
   ========================================================= */

#main-content .election-content-heading {
  margin-bottom: 0.25rem !important;
}

#main-content .election-office-heading + .centerContent p {
  margin-top: 0 !important;
}


/* =========================================================
   8. CONSTITUTIONAL AMENDMENT QUESTIONS
   ========================================================= */

#main-content .question-block {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

#main-content .question-block > p.centerContent {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}


/*
   Question headings.

   Question headings should not be artificially bolded by
   42electg.css. Their weight should follow the site's normal
   heading treatment.
*/

#main-content .question-block h4 {
  margin-top: 0 !important;
  margin-bottom: 0.25rem !important;
}


/* Reduce spacing below question result tables */

#main-content .question-block .mdgov_OverflowTable {
  margin-bottom: 0 !important;
}


/* =========================================================
   9. BACK TO TOP
   ========================================================= */

/*
   Election pages should use one Back to Top link at the
   bottom of the page rather than repeating the link after
   individual sections.
*/

#main-content > .back-to-top,
#main-content .election-bottom-back-to-top {
  margin-top: 1rem;
  margin-bottom: 1rem;
}


/* =========================================================
   10. JUDGE ELECTION RESULTS
   ========================================================= */

/* Spacing between individual judge/circuit result sections */

#main-content .judge-section {
  margin-bottom: 2rem;
}


/* Keep judge result tables close to candidate information */

#main-content .judge-section .mdgov_OverflowTable {
  margin-top: 0;
}


/* Additional county grouping within the same judicial circuit */

#main-content .judge-subsection {
  margin-top: 1.25rem;
}


/* Space between a judicial circuit heading and its details */

#main-content .judge-section h4 + p {
  margin-top: 0.65rem;
  margin-bottom: 0.45rem;
}


/* Judicial circuit headings */

#main-content .judge-section h4.smaller-h3-normal {
  font-weight: 600;
}


/* =========================================================
   11. QUICK LINKS
   ========================================================= */

/*
   Quick Links should use the same font size as normal body
   text. The Quick Links heading remains visually hidden in
   the HTML.
*/

#main-content #quick-links,
#main-content #quick-links ul,
#main-content #quick-links li,
#main-content #quick-links a {
  font-size: 1rem;
}


/* =========================================================
   12. RESPONSIVE ELECTION TABLES
   ========================================================= */

/*
   mdgov_OverflowTable provides horizontal scrolling when
   a table genuinely requires more room than the available
   content width.
*/

#main-content .mdgov_OverflowTable {
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 1rem;
}


/* =========================================================
   13. TWO-CANDIDATE ELECTION RESULTS
   ========================================================= */

/*
   County + two candidate columns.

   Used for offices such as Attorney General and Comptroller.
*/

#main-content .election-results-two-candidates {
  width: 330px;
  max-width: 100%;
  table-layout: fixed;
}

#main-content .election-results-two-candidates th:first-child,
#main-content .election-results-two-candidates td:first-child {
  width: 150px;
  white-space: nowrap;
}

#main-content .election-results-two-candidates th:nth-child(2),
#main-content .election-results-two-candidates td:nth-child(2),
#main-content .election-results-two-candidates th:nth-child(3),
#main-content .election-results-two-candidates td:nth-child(3) {
  width: 90px;
}


/* =========================================================
   14. STATE DELEGATE ELECTION RESULTS
   ========================================================= */

#main-content .delegate-results {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}



/* =========================================================
   15. GOVERNOR ELECTION RESULTS
   ========================================================= */

/* Governor results with three candidate tickets */

#main-content .governor-results-three-tickets {
  width: 550px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

#main-content .governor-results-three-tickets th:first-child,
#main-content .governor-results-three-tickets td:first-child {
  width: 145px;
  min-width: 145px;
  white-space: nowrap;
}

#main-content .governor-results-three-tickets th:nth-child(n+2),
#main-content .governor-results-three-tickets td:nth-child(n+2) {
  width: 135px;
  min-width: 135px;
}


/* Governor results with four candidate tickets */

#main-content .governor-results-four-tickets {
  width: 605px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

#main-content .governor-results-four-tickets th:first-child,
#main-content .governor-results-four-tickets td:first-child {
  width: 145px;
  min-width: 145px;
  white-space: nowrap;
}

#main-content .governor-results-four-tickets th:nth-child(n+2),
#main-content .governor-results-four-tickets td:nth-child(n+2) {
  width: 115px;
  min-width: 115px;
}


/* =========================================================
   16. JUDICIAL PARTY RESULTS
   ========================================================= */

#main-content .judge-party-results {
  width: 360px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

#main-content .judge-party-results th:first-child,
#main-content .judge-party-results td:first-child {
  width: 240px;
}

#main-content .judge-party-results th:nth-child(2),
#main-content .judge-party-results td:nth-child(2),
#main-content .judge-party-results th:nth-child(3),
#main-content .judge-party-results td:nth-child(3) {
  width: 60px;
}


/* =========================================================
   17. JUDICIAL RESULTS
   ========================================================= */

/* Judge retention results */

#main-content .judge-retention-results {
  width: 370px;
  max-width: 100%;
  margin: 0.4rem auto 0;
  table-layout: fixed;
}

#main-content .judge-retention-results th:first-child,
#main-content .judge-retention-results td:first-child {
  width: 160px;
  min-width: 160px;
  white-space: nowrap;
}

#main-content .judge-retention-results th:nth-child(2),
#main-content .judge-retention-results td:nth-child(2),
#main-content .judge-retention-results th:nth-child(3),
#main-content .judge-retention-results td:nth-child(3) {
  width: 95px;
  min-width: 95px;
}


/* Circuit Court judge results */

#main-content .circuit-judge-results {
  width: 380px;
  max-width: 100%;
  margin: 0.4rem auto 0.75rem;
  table-layout: fixed;
}

#main-content .circuit-judge-results th:first-child,
#main-content .circuit-judge-results td:first-child {
  width: 220px;
}

#main-content .circuit-judge-results th:nth-child(2),
#main-content .circuit-judge-results td:nth-child(2),
#main-content .circuit-judge-results th:nth-child(3),
#main-content .circuit-judge-results td:nth-child(3) {
  width: 80px;
}


/* Judicial circuit and county headings */

#main-content .judicial-circuit-heading {
  font-size: 1rem;
  font-weight: 600;
}


/* Judicial party headings */

#main-content .judicial-party-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}


/* =========================================================
   18. U.S. REPRESENTATIVE RESULTS
   ========================================================= */

#main-content .usrep-results {
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

#main-content .usrep-results th:first-child,
#main-content .usrep-results td:first-child {
  width: 170px;
  min-width: 170px !important;
  white-space: nowrap;
}

#main-content .usrep-results th:not(:first-child),
#main-content .usrep-results td:not(:first-child) {
  width: 90px;
  min-width: 90px !important;
  white-space: nowrap;
}

#main-content .usrep-results-2 {
  width: 350px;
}

#main-content .usrep-results-3 {
  width: 440px;
}

#main-content .usrep-results-4 {
  width: 530px;
}

#main-content .usrep-results-5 {
  width: 620px;
}

#main-content .congressional-heading {
  margin-bottom: 2rem;
}

#main-content .district-block {
  margin-bottom: 2.5rem;
}


/* =========================================================
   19. CONSTITUTIONAL AMENDMENT RESULTS
   ========================================================= */

#main-content .constitutional-results {
  width: 400px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

#main-content .constitutional-results th:first-child,
#main-content .constitutional-results td:first-child {
  width: 200px;
  min-width: 200px !important;
  white-space: nowrap;
}

#main-content .constitutional-results th:nth-child(2),
#main-content .constitutional-results td:nth-child(2),
#main-content .constitutional-results th:nth-child(3),
#main-content .constitutional-results td:nth-child(3) {
  width: 100px;
  min-width: 100px;
}

   /* =========================================================
   PRESIDENTIAL ELECTION RESULTS
   ========================================================= */

#main-content .presidential-results {
  width: 700px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

/* County / City */
#main-content .presidential-results th:first-child,
#main-content .presidential-results td:first-child {
  width: 22%;
  white-space: nowrap;
}

/* All candidate columns — equal widths */
#main-content .presidential-results th:nth-child(n+2),
#main-content .presidential-results td:nth-child(n+2) {
  width: 13%;
}
/* =========================================================
   PRESIDENTIAL WRITE-IN ELECTION RESULTS
   ========================================================= */

#main-content .presidential-writein-results {
  width: 850px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

/* County column */
#main-content .presidential-writein-results th:first-child,
#main-content .presidential-writein-results td:first-child {
  width: 22%;
  white-space: nowrap;
}

/* All nine candidate columns — equal widths */
#main-content .presidential-writein-results th:nth-child(n+2),
#main-content .presidential-writein-results td:nth-child(n+2) {
  width: 8.666%;
}
/* =========================================================
   ELECTION SECTION NAVIGATION
   Question / District links
   ========================================================= */

#main-content .mm-secondary-nav.election-section-nav
.election-section-list {
  display: block;
  list-style-type: disc;
  list-style-position: outside;
  padding-left: 2.5rem;
  margin: 0.5rem 0 1rem;
}

#main-content .mm-secondary-nav.election-section-nav
.election-section-list li {
  display: list-item;
  list-style-type: disc;
  margin: 0.1rem 0;
  padding: 0;
}
/* =========================================================
   U.S. REPRESENTATIVE DISTRICT SPACING
   ========================================================= */

#main-content .congressional-heading {
  margin-bottom: 2rem;
}

#main-content .district-block {
  margin-bottom: 2.5rem;
}

#main-content .congressional-district-heading {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Candidate list directly below district heading */
#main-content .congressional-candidates {
  margin: 0;
  padding: 0;
}

#main-content .congressional-candidates p {
  margin: 0;
  padding: 0;
}

/* Small gap between candidate list and results table */
#main-content .congressional-candidates + .mdgov_OverflowTable {
  margin-top: 0.5rem;
  padding-top: 0;
}

#main-content .congressional-candidates + .mdgov_OverflowTable .usrep-results {
  margin-top: 0;
}
/* =========================================================
   VOTER PARTICIPATION NAVIGATION
   ========================================================= */

#main-content .voter-participation-nav {
  margin: 1rem 0 1.5rem;
  padding: 0;
}

#main-content .voter-participation-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  border: 1px solid #343e41;
}

#main-content .voter-participation-list:last-child {
  margin-bottom: 0;
}

#main-content .voter-participation-list > li {
  margin: 0;
  padding: 0;
  border-right: 1px solid #343e41;
}

#main-content .voter-participation-list > li:last-child {
  border-right: 0;
}

#main-content .voter-participation-list > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  text-align: center;
  text-decoration: underline;
  font-weight: 600;
}
#main-content .voter-participation-list > li > a:hover {
  background-color: #f2f2f2;
}

#main-content .voter-participation-list > li > a:focus-visible {
  outline: 2px solid #000080;
  outline-offset: -3px;
}


/* Tablet */

@media (max-width: 768px) {

  #main-content .voter-participation-list {
    grid-template-columns: repeat(2, 1fr);
  }

  #main-content .voter-participation-list > li {
    border-bottom: 1px solid #343e41;
  }

  #main-content .voter-participation-list > li:nth-child(2n) {
    border-right: 0;
  }

  #main-content .voter-participation-list > li:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}


/* Mobile */

@media (max-width: 480px) {

  #main-content .voter-participation-list {
    grid-template-columns: 1fr;
  }

  #main-content .voter-participation-list > li,
  #main-content .voter-participation-list > li:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid #343e41;
  }

  #main-content .voter-participation-list > li:last-child {
    border-bottom: 0;
  }
}
/* =========================================================
   VOTER PARTICIPATION RESULTS
   ========================================================= */

#main-content .voter-participation-results {
  width: 600px;
  max-width: 100%;
  margin: 0.75rem auto 0;
  table-layout: fixed;
}

/* Tighter cells */
#main-content .voter-participation-results th,
#main-content .voter-participation-results td {
  padding: 3px 4px;
}

/* County / City */
#main-content .voter-participation-results th:nth-child(1),
#main-content .voter-participation-results td:nth-child(1) {
  width: 145px;
  white-space: nowrap;
}

/* Registered */
#main-content .voter-participation-results th:nth-child(2),
#main-content .voter-participation-results td:nth-child(2) {
  width: 95px;
}

/* Voted at Polls */
#main-content .voter-participation-results th:nth-child(3),
#main-content .voter-participation-results td:nth-child(3) {
  width: 100px;
}

/* Voted Absentee */
#main-content .voter-participation-results th:nth-child(4),
#main-content .voter-participation-results td:nth-child(4) {
  width: 105px;
}

/* Total Voted */
#main-content .voter-participation-results th:nth-child(5),
#main-content .voter-participation-results td:nth-child(5) {
  width: 90px;
}

/* % Voted */
#main-content .voter-participation-results th:nth-child(6),
#main-content .voter-participation-results td:nth-child(6) {
  width: 65px;
}

/* Keep numeric headings and values right-aligned */
#main-content .voter-participation-results th.num,
#main-content .voter-participation-results td.num {
  text-align: right;
}

/* TOTAL label only */
#main-content .voter-participation-results .total-row th[scope="row"] {
  font-weight: 700;
}

/* Total numbers stay normal */
#main-content .voter-participation-results .total-row td {
  font-weight: 400;
}
#main-content .voter-party-heading {
  font-weight: 600;
}
#main-content .election-section-nav a {
  text-decoration: underline !important;
}
/* Single centered election landing-page link */
#main-content .election-single-link {
  width: 400px;
  max-width: 100%;
  margin: 0.5rem auto 1.5rem;
}

#main-content .election-single-link .voter-participation-list {
  margin: 0;
}

#main-content .election-single-link .voter-participation-list > li {
  grid-column: 1 / -1;
}
/* Hide Delegate table column headers visually while
   keeping them available to screen readers */
#main-content .delegate-results thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
