/* Map key. Anchored top-right: the bottom-right corner belongs to the Leaflet
   and Mapbox attribution, which must stay legible. Laid out with flex rows --
   the previous version positioned each label absolutely with a negative
   margin, which clipped at some sizes and in print exports. */
.legend-row {
    display: flex;
    align-items: center;
    margin: 2px 0;
}

.legend .swatch {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid #999;
    flex: 0 0 auto;
}

.legend .label {
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
}

body {
    overflow-x: hidden;
}

.legend {
    background-color: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
    z-index: 1000;
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    padding: 7px 10px;
}

/* Subdivision labels. Halo rather than a box so they sit over aerial imagery
   without hiding it. Non-interactive so clicks reach the hit-test handler. */
.sub-label {
    pointer-events: none;
    white-space: nowrap;
    font: 600 12px/14px 'Helvetica Neue', Arial, Helvetica, sans-serif;
    color: #1a1a1a;
    text-shadow:
         1px  1px 2px #fff, -1px  1px 2px #fff,
         1px -1px 2px #fff, -1px -1px 2px #fff;
    text-align: center;
    /* divIcon anchors at its top-left corner, so shift half the width left */
    width: 120px !important;
    margin-left: -60px;
}

/* Timestamp, inside the legend so the print export captures it along with
   everything else in that box. */
.legend-stamp {
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid #ddd;
    font: 11px/15px 'Helvetica Neue', Arial, Helvetica, sans-serif;
    color: #555;
    text-align: center;
}
