/* Shared accessibility helpers for d20/ pages */
.d20-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #123b6c;
    border: 2px solid #246bce;
    text-decoration: none;
}
.d20-skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}
#main-content a:focus-visible,
#main-content button:focus-visible {
    outline: 3px solid #246bce;
    outline-offset: 2px;
}

/* Geo / election sub-nav: stronger text and control contrast on pale panel */
#main-content .data_options_nav {
    color: #1a1a1a;
    background-color: #f1f5f9;
    border-color: #94a3b8;
}
#main-content .data_options_nav .form-group > label,
#main-content .data_options_nav .redistricting-fieldset-legend {
    color: #0f172a;
}
#main-content .data_options_nav .radio:not(.disabled) label {
    color: #1a1a1a;
}
#main-content .data_options_nav select.form-control {
    color: #0f172a;
    background-color: #fff;
    border-color: #64748b;
}
#main-content .data_options_nav .disabled label {
    color: #4b5563;
}
#main-content .data_options_nav input[type="radio"]:focus-visible,
#main-content .data_options_nav select:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* Screen-reader-only labels (e.g. empty column headers) */
.d20-visually-hidden:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
}

/*
 * Data tables on d20 pages: strong text/background contrast, clear borders,
 * and zebra via td / td.alt (not color alone for meaning).
 */
#main-content table.d20-data-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    color: #1a1a1a;
}

#main-content table.d20-data-table caption.d20-table-caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    color: #0f172a;
    padding: 0.75rem 0.25rem 1rem;
    line-height: 1.45;
}

#main-content table.d20-data-table thead th {
    background: #fde68a;
    color: #0f172a;
    border: 1px solid #64748b;
    padding: 0.5rem 0.45rem;
    vertical-align: bottom;
    text-align: center;
}

#main-content table.d20-data-table tbody th[scope="row"] {
    background: #fef3c7;
    color: #0f172a;
    border: 1px solid #64748b;
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.5rem;
    vertical-align: top;
}

#main-content table.d20-data-table tbody td {
    color: #1a1a1a;
    border: 1px solid #94a3b8;
    padding: 0.5rem 0.5rem;
    vertical-align: top;
    text-align: center;
}

/* Zebra rows (election tables); geo tables use td.alt on alternating rows instead */
#main-content table.d20-data-table tbody tr:nth-child(odd) td:not(.alt) {
    background: #ffffff;
}

#main-content table.d20-data-table tbody tr:nth-child(even) td:not(.alt) {
    background: #f1f5f9;
}

#main-content table.d20-data-table tbody td.alt {
    background: #e8eef5;
    color: #1a1a1a;
}

#main-content table.d20-data-table td a,
#main-content table.d20-data-table th a {
    color: #0b4f9c;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#main-content table.d20-data-table td a:visited,
#main-content table.d20-data-table th a:visited {
    color: #5b21b6;
}

#main-content table.d20-data-table .county-num {
    color: #334155;
    font-weight: 700;
}

#main-content table.d20-data-table tfoot .edt-table-footnotes {
    border-top: 2px solid #64748b;
    background: #f8fafc;
    color: #1e293b;
    text-align: left;
    vertical-align: top;
    padding: 0.75rem 0.65rem;
}

#main-content table.d20-data-table tfoot .edt-footnote-p {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.45;
}

#main-content table.d20-data-table tfoot .edt-footnote-p:last-child {
    margin-bottom: 0;
}
