/* Page-scoped overrides. Component look lives in static/ui_system/.
 * Anything here is either a page-only utility or a tweak that the
 * design tokens / Pico defaults don't already cover. */

.u-footer-pad {
    padding-top: var(--ds-space-5);
    padding-bottom: var(--ds-space-3);
}

.hero-actions {
    display: flex;
    gap: var(--ds-space-2);
    flex-wrap: wrap;
    margin-top: var(--ds-space-3);
}

.feature-controls {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--ds-space-3);
    align-items: end;
    margin-bottom: var(--ds-space-3);
}

.feature-controls label {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
    font-size: var(--ds-font-md);
}

.feature-picker {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
}

.feature-picker select {
    margin-bottom: 0;
}

/* `visibility` rather than `display`: the slot keeps its width, so the
 * tooltip beside it does not jump when tiles start loading. */
.feature-spinner {
    visibility: hidden;
}

.feature-spinner[data-busy] {
    visibility: visible;
}

.feature-spinner::after {
    content: "";
    display: block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--pico-muted-border-color);
    border-top-color: var(--pico-primary);
    border-radius: 50%;
    animation: feature-spin 0.7s linear infinite;
}

@keyframes feature-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .feature-spinner::after { animation-duration: 3s; }
}

.feature-map-row {
    display: flex;
    gap: var(--ds-space-3);
    align-items: stretch;
    margin-bottom: var(--ds-space-3);
}

/* Sized to its content: a fixed column leaves a wide empty strip
 * beside the swatches, whose labels are only a few characters. */
.feature-legends {
    flex: 0 0 auto;
    min-width: 0;
}

/* The legend column collapses under the map on narrow viewports; the
 * map keeps its fixed height either way. */
@media (max-width: 48rem) {
    .feature-map-row { flex-direction: column; }
    .feature-legends { flex: none; }
}

#map_root {
    /* MapLibre's canvas takes its container's box height literally —
     * with no explicit height the map renders 0px tall. */
    height: 24rem;
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--ds-radius-sm);
}

.feature-legend {
    font-family: var(--pico-font-family-monospace);
}

.legend-title {
    display: block;
    font-weight: 600;
}

.feature-legend-caption {
    font-family: var(--pico-font-family-monospace);
}

.legend-swatches {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-1);
    margin-top: var(--ds-space-1);
}

.legend-swatch {
    display: flex;
    align-items: center;
    gap: var(--ds-space-1);
}

.legend-chip {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: var(--ds-radius-sm);
    border: 1px solid var(--pico-muted-border-color);
}
