/* "Find your nearest" search block — entries_distance_finder */

.enc-distance-finder {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}

[data-theme="dark"] .enc-distance-finder {
    background: #1a2436;
    border-color: #334155;
}

.enc-distance-finder-heading {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
    color: var(--fg, #1f2937);
}

.enc-distance-finder-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.enc-distance-finder-input {
    flex: 1 1 220px;
    min-width: 200px;
}

.enc-distance-finder-input input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c0c0c6;
    border-radius: 4px;
    /* 16px = iOS Safari auto-zoom threshold; smaller values trigger a
       viewport zoom on focus that's hard to recover from on phones. */
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    background: #fff;
    color: inherit;
}

[data-theme="dark"] .enc-distance-finder-input input {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

.enc-distance-finder-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.enc-distance-finder-form .enc-btn {
    padding: 0.5rem 0.85rem;
    border: 1px solid #c0c0c6;
    border-radius: 4px;
    background: #fff;
    color: inherit;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
}

.enc-distance-finder-form .enc-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.enc-distance-finder-form .enc-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.enc-distance-finder-form .enc-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.enc-distance-finder-form .enc-btn-primary:hover:not(:disabled) {
    background: #1d4fcf;
    border-color: #1d4fcf;
}

.enc-distance-finder-form .enc-btn-link {
    background: transparent;
    border-color: transparent;
    color: #2563eb;
    text-decoration: underline;
}

.enc-distance-finder-form .enc-btn-link:hover:not(:disabled) {
    background: transparent;
    color: #1d4fcf;
}

[data-theme="dark"] .enc-distance-finder-form .enc-btn {
    background: #1f2937;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .enc-distance-finder-form .enc-btn:hover:not(:disabled) {
    background: #334155;
    border-color: #64748b;
}

.enc-distance-finder-unit {
    padding: 0.5rem 0.6rem;
    border: 1px solid #c0c0c6;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    color: inherit;
    cursor: pointer;
}

[data-theme="dark"] .enc-distance-finder-unit {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

.enc-distance-finder-status {
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    color: var(--muted, #6b7280);
}

.enc-distance-finder-status.is-error  { color: #b91c1c; }
.enc-distance-finder-status.is-warn   { color: #b45309; }
.enc-distance-finder-status.is-ok     { color: #166534; }

[data-theme="dark"] .enc-distance-finder-status.is-error { color: #fca5a5; }
[data-theme="dark"] .enc-distance-finder-status.is-warn  { color: #fcd34d; }
[data-theme="dark"] .enc-distance-finder-status.is-ok    { color: #86efac; }

/* Distance badge prepended to each card after a successful search. */
.enc-distance-badge {
    display: inline-block;
    margin: 0 0 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
}

[data-theme="dark"] .enc-distance-badge {
    background: #3b82f6;
}

/* Visually-hidden text for accessibility (used for the input's hidden label). */
.enc-distance-finder .enc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
