/**
 * STYLESHEETS FOR hexmaps-d3.js MAPS
 * same visual language as the 2026 early-voting national map (2026-early-voting-national.css) -
 * class names prefixed hexmapd3- instead of hexmap- so this can load alongside that page's own
 * CSS without colliding.
 */

div.hexmapd3-wrapper {
    max-width: 100%;
}

div.hexmapd3 {
    position: relative;
    background: white;
    width: 100%;
}

div.hexmapd3-wrapper div.hexmapd3-after {
    text-align: left;
}

div.hexmapd3-wrapper div.hexmapd3-after button {
    float: right;
    margin: 0 0 1em 1em;
}

div.hexmapd3-wrapper div.hexmapd3-after .hexmapd3-caption {
    font-size: 90%;
    color: #52514e;
}

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

.hexmapd3-hex {
    stroke: #ffffff;
    stroke-width: 1px;
}

.hexmapd3-hex-group:hover .hexmapd3-hex,
.hexmapd3-hex-group:focus .hexmapd3-hex {
    stroke: #0b0b0b;
    stroke-width: 2px;
}

.hexmapd3-hex-group {
    outline: none;
}

.hexmapd3-label {
    /* fill is set per-hex inline by hexMapD3ContrastColor() in functions-hexmaps-d3.js,
       based on that hex's own fill color, not fixed here */
    font-size: 14px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.hexmapd3-tooltip {
    position: absolute;
    z-index: 10;
    max-width: 220px;
    padding: 0.5rem 0.65rem;
    background: rgba(11, 11, 11, 0.92);
    color: #ffffff;
    font-size: 0.8rem;
    line-height: 1.4;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.hexmapd3-tooltip.is-visible {
    opacity: 1;
}

.hexmapd3-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #52514e;
}

.hexmapd3-legend-title {
    font-weight: 600;
    color: #0b0b0b;
    width: 100%;
    text-align: center;
}

.hexmapd3-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hexmapd3-legend-swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 2px;
    flex: none;
}

.hexmapd3-credit {
    font-size: 90%;
    color: #333333;
    text-align: right;
}
