/* explore.css — Explore/map page. Full-height split app (sidebar + Leaflet map).
   global.css supplies nav/banner. This page has no footer. */

body.page-explore { overflow: hidden; }

.explore-app {
  display: flex;
  height: calc(100vh - var(--nav-h) - var(--banner-h));
  background: var(--navy);
  color: var(--white);
}

/* ── SIDEBAR ── */
.sidebar {
  width: 370px; flex-shrink: 0;
  background: var(--navy-mid);
  display: flex; flex-direction: column; overflow: hidden;
  border-right: 2px solid rgba(178,34,52,0.2);
}
.sidebar-header { padding: 18px 22px 0; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.sidebar-eyebrow { font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--crimson); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.sidebar-eyebrow::before { content: '★'; font-size: 8px; }
.sidebar-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.sidebar-sub { font-size: 12px; color: var(--text-muted); font-weight: 300; margin-bottom: 14px; }

.search-wrap { position: relative; margin-bottom: 12px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--crimson); font-size: 13px; }
.search-input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(178,34,52,0.25); border-radius: 2px; padding: 10px 12px 10px 34px; color: var(--white); font-family: var(--font-body); font-size: 14px; outline: none; transition: border-color 0.2s; }
.search-input::placeholder { color: rgba(255,255,255,0.28); }
.search-input:focus { border-color: var(--crimson); }

.chip-row { display: flex; gap: 5px; flex-wrap: wrap; padding-bottom: 14px; }
.chip { background: rgba(178,34,52,0.1); border: 1px solid rgba(178,34,52,0.2); border-radius: 1px; padding: 3px 10px; font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.2s; }
.chip:hover, .chip.active { background: rgba(178,34,52,0.22); border-color: rgba(178,34,52,0.6); color: rgba(255,255,255,0.9); }

.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 22px; flex-shrink: 0; }
.filter-label { display: block; font-family: var(--font-ui); font-size: 9px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--crimson); margin-bottom: 4px; }
.filter-wrap { position: relative; }
.filter-wrap::after { content: '▾'; position: absolute; right: 10px; bottom: 9px; color: var(--crimson); pointer-events: none; font-size: 11px; }
.filter-select { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(178,34,52,0.18); border-radius: 2px; padding: 8px 26px 8px 10px; color: rgba(255,255,255,0.65); font-family: var(--font-body); font-size: 13px; outline: none; appearance: none; cursor: pointer; }

.results-bar { padding: 9px 22px; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; background: rgba(0,0,0,0.12); }
.results-count { font-family: var(--font-ui); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.results-count strong { color: rgba(255,255,255,0.85); font-size: 14px; }

.results-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(178,34,52,0.3) transparent; }
.results-list::-webkit-scrollbar { width: 4px; }
.results-list::-webkit-scrollbar-thumb { background: rgba(178,34,52,0.35); border-radius: 2px; }
.results-empty { padding: 30px 22px; color: var(--text-muted); font-size: 13px; font-weight: 300; text-align: center; }

.result-item { display: flex; gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer; transition: background 0.15s; text-decoration: none; color: inherit; }
.result-item:hover { background: rgba(178,34,52,0.07); }
.result-item.selected { background: rgba(178,34,52,0.1); border-left: 3px solid var(--crimson); }
.result-icon { width: 42px; height: 42px; border-radius: 2px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; color: rgba(255,255,255,0.7); }
.ri-nps { background: linear-gradient(135deg,#1E3352,#0D1B2A); }
.ri-usfs { background: linear-gradient(135deg,#1a3a1a,#0d2010); }
.ri-fws { background: linear-gradient(135deg,#0d1a3a,#0a1020); }
.ri-blm { background: linear-gradient(135deg,#3a2010,#1a0e08); }
.ri-bor { background: linear-gradient(135deg,#1E3352,#0d1a2a); }
.ri-usace { background: linear-gradient(135deg,#3a3320,#1a1608); }
.result-info { flex: 1; min-width: 0; }
.result-name { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.result-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); }
.result-agency { font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; padding: 1px 6px; border: 1px solid currentColor; border-radius: 1px; opacity: 0.9; }
.result-arrow { color: rgba(255,255,255,0.18); font-size: 13px; flex-shrink: 0; transition: color 0.2s; }
.result-item:hover .result-arrow { color: var(--crimson); }

/* ── MAP ── */
.map-area { flex: 1; position: relative; overflow: hidden; }
.map-canvas { position: absolute; inset: 0; background: #162437; }

/* Leaflet overrides for RWB theme */
.leaflet-container { background: #162437; font-family: var(--font-body); }
.leaflet-popup-content-wrapper { background: var(--navy-mid); color: var(--white); border: 1px solid rgba(178,34,52,0.4); border-radius: 2px; box-shadow: 0 16px 40px rgba(0,0,0,0.55); }
.leaflet-popup-tip { background: var(--navy-mid); border: 1px solid rgba(178,34,52,0.4); }
.leaflet-popup-content { margin: 0; width: 240px !important; }
.leaflet-popup-close-button { color: rgba(255,255,255,0.5) !important; }
.atb-popup-stripe { height: 5px; background: repeating-linear-gradient(90deg,var(--crimson) 0,var(--crimson) 25px,var(--navy-light) 25px,var(--navy-light) 50px); }
.atb-popup-body { padding: 14px 16px; }
.atb-popup-agency { display: inline-block; background: var(--crimson); padding: 2px 8px; font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: 0.15em; color: var(--white); margin-bottom: 8px; }
.atb-popup-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--white); line-height: 1.2; margin-bottom: 4px; }
.atb-popup-loc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.atb-popup-actions { display: flex; gap: 7px; }
.atb-popup-btn { flex: 1; background: var(--crimson); color: var(--white); border-radius: 2px; padding: 9px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; text-decoration: none; }
.atb-popup-btn.sec { flex: 0 0 auto; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.12); }

/* Cluster color to match theme */
.marker-cluster { background: rgba(178,34,52,0.25); }
.marker-cluster div { background: rgba(178,34,52,0.65); color: #fff; font-family: var(--font-ui); font-weight: 700; }

.breadcrumb { position: absolute; top: 15px; left: 15px; z-index: 500; background: rgba(13,27,42,0.92); border: 1px solid rgba(178,34,52,0.2); border-radius: 2px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: rgba(255,100,120,0.9); }
.bc-active { color: rgba(255,100,120,0.9); }

.legend { position: absolute; bottom: 18px; left: 15px; z-index: 500; background: rgba(13,27,42,0.95); border: 1px solid rgba(178,34,52,0.22); border-radius: 2px; padding: 12px 16px; max-width: 280px; }
.legend-title { font-family: var(--font-ui); font-size: 9px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--crimson); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.legend-title::before { content: '★'; font-size: 8px; }
.legend-items { display: flex; flex-direction: column; gap: 5px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(255,255,255,0.65); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-note { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 10px; color: rgba(255,255,255,0.3); }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  .explore-app { flex-direction: column; height: auto; }
  body.page-explore { overflow: auto; }
  .sidebar { width: 100%; height: auto; max-height: 55vh; }
  .map-area { height: 60vh; min-height: 360px; }
}
