/* ============================================================
   Eagle Scout Projects — Explorer (map-first layout)
   ============================================================ */

.esp-explorer {
    display: flex;
    width: 100%;
    border: 1px solid var(--esp-border, #DDD8CC);
    border-radius: var(--esp-radius, 10px);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
    background: #fff;
    font-family: Arial, sans-serif;
    position: relative;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.esp-ex-sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--esp-border, #DDD8CC);
    background: #fff;
    min-height: 0;
}

/* ── Search + filters ──────────────────────────────────── */

.esp-ex-search-wrap {
    padding: 12px 14px;
    border-bottom: 1px solid var(--esp-border, #DDD8CC);
    background: var(--esp-navy, #1B2A4A);
}

.esp-ex-search-field {
    position: relative;
    margin-bottom: 8px;
}

.esp-ex-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.esp-ex-kw {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px 9px 34px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 0.88rem;
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    transition: background 0.15s, border-color 0.15s;
}

.esp-ex-kw::placeholder { color: rgba(255,255,255,0.5); }

.esp-ex-kw:focus {
    background: rgba(255,255,255,0.18);
    border-color: var(--esp-gold, #B8860B);
}

.esp-ex-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.esp-ex-filter {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    outline: none;
}

.esp-ex-filter option { background: #1B2A4A; color: #fff; }

.esp-ex-filter:focus {
    border-color: var(--esp-gold, #B8860B);
}

/* ── Results header ─────────────────────────────────────── */

.esp-ex-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--esp-border, #DDD8CC);
    background: var(--esp-bg, #F8F6F1);
}

.esp-ex-result-count {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--esp-muted, #888);
}

.esp-ex-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--esp-navy, #1B2A4A);
    background: none;
    border: 1px solid var(--esp-border, #DDD8CC);
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.esp-ex-clear:hover {
    background: var(--esp-border, #DDD8CC);
}

/* ── Results list ────────────────────────────────────────── */

.esp-ex-results {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 0;
    min-height: 0;
}

.esp-ex-no-results {
    padding: 24px 16px;
    text-align: center;
    color: var(--esp-muted, #888);
    font-size: 0.88rem;
    font-style: italic;
}

.esp-ex-result {
    border-bottom: 1px solid var(--esp-border, #DDD8CC);
    cursor: pointer;
    transition: background 0.12s;
}

.esp-ex-result:last-child { border-bottom: none; }

.esp-ex-result:hover {
    background: var(--esp-bg, #F8F6F1);
}

.esp-ex-result-active {
    background: #EEF2FA !important;
    border-left: 3px solid var(--esp-navy, #1B2A4A);
}

.esp-ex-result:focus {
    outline: 2px solid var(--esp-gold, #B8860B);
    outline-offset: -2px;
}

.esp-ex-result-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.esp-ex-result-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--esp-border, #DDD8CC);
}

.esp-ex-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--esp-bg, #F8F6F1);
    color: var(--esp-gold, #B8860B);
}

.esp-ex-result-body {
    flex: 1;
    min-width: 0;
}

.esp-ex-result-title {
    display: block;
    font-size: 0.87rem;
    color: var(--esp-navy, #1B2A4A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    margin-bottom: 3px;
}

.esp-ex-result-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.esp-ex-meta-scout,
.esp-ex-meta-loc,
.esp-ex-meta-date {
    font-size: 0.75rem;
    color: var(--esp-muted, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.esp-ex-meta-scout { color: var(--esp-gold, #B8860B); font-weight: 600; }

.esp-ex-result-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--esp-bg, #F8F6F1);
    color: var(--esp-navy, #1B2A4A);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border: 1px solid var(--esp-border, #DDD8CC);
}

.esp-ex-result-link:hover {
    background: var(--esp-navy, #1B2A4A);
    color: #fff;
}

/* ── Map pane ────────────────────────────────────────────── */

.esp-ex-map-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}

.esp-ex-map {
    width:  100%;
    height: 100%;
}

.esp-ex-reset-view {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    color: var(--esp-navy, #1B2A4A);
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0,0,0,0.25);
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.02em;
}

.esp-ex-reset-view:hover {
    background: var(--esp-navy, #1B2A4A);
    color: #fff;
}

.esp-ex-map-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27,42,74,0.82);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 800;
    backdrop-filter: blur(4px);
}

/* Popup CTA link */
.esp-popup-cta {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--esp-navy, #1B2A4A);
    text-decoration: none;
    border-bottom: 1px solid var(--esp-gold, #B8860B);
    padding-bottom: 1px;
}

.esp-popup-cta:hover { color: var(--esp-gold, #B8860B); }

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 700px) {
    .esp-explorer {
        flex-direction: column;
        height: auto !important; /* override inline style */
    }

    .esp-ex-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--esp-border, #DDD8CC);
        max-height: 320px;
    }

    .esp-ex-map-wrap {
        height: 340px;
        flex: none;
    }
}
