/*
 * Overrides for third-party widgets (OpenLayers, Select2). Select2 keeps its own z-index (1051) so it still
 * opens above legacy Bootstrap modals. !important is allowed only in this file, and only where a library
 * sets inline styles.
 */

/* OpenLayers controls */
.ol-control {
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    box-shadow: var(--shadow-sm);
}

.ol-control button {
    width: 30px;
    height: 30px;
    margin: 0;
    border-radius: 0;
    background: var(--surface);
    color: var(--fg);
    font: 600 var(--text-md)/1 var(--font-ui);
}

.ol-control button:hover,
.ol-control button:focus {
    background: var(--surface-2);
    color: var(--fg);
    outline: none;
}

.ol-control button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.ol-zoom {
    overflow: hidden;
}

.ol-zoom .ol-zoom-in {
    border-bottom: 1px solid var(--border);
}

.ol-attribution {
    font-size: var(--text-xs);
}

.ol-scale-line {
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
}

.ol-scale-line-inner {
    border-color: var(--fg);
    color: var(--fg);
    font: var(--text-xs) var(--font-ui);
}

/* Select2 (default theme) matched to .ui-select */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: var(--control-height);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: var(--text-base) var(--font-ui);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: var(--space-3);
    color: var(--fg);
    line-height: calc(var(--control-height) - 2px);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--control-height) - 2px);
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--fg);
    font-size: var(--text-sm);
}

.select2-dropdown {
    border-color: var(--border-strong);
    border-radius: var(--radius-sm);
    font: var(--text-base) var(--font-ui);
    box-shadow: var(--shadow-md);
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--brand);
    color: var(--on-brand);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border-color: var(--border-strong);
    border-radius: var(--radius-sm);
}

