/* =========================================================
   includes/locator.css — World Locator (Adventure - Labs).
   Single-screen shell from adventure.css (body -> 100dvh flex column).
   Map fills the left; the right rail pins the search and scrolls the dossier.
   ========================================================= */

.locator {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  padding: clamp(12px, 2.4vh, 24px) 0;          /* override .section's tall padding */
}
.locator .container { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.locator-header { flex: 0 0 auto; margin-bottom: clamp(10px, 1.8vh, 18px); }
.locator-header h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem); color: var(--mist);
  letter-spacing: -.015em; margin-top: 4px;
}

/* ---- the two-column stage ---- */
.locator-stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; gap: clamp(14px, 2vw, 26px);
}

/* ---- map (left) ---- */
.map-stage {
  flex: 1 1 auto; min-width: 0;
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 0%, #0e1530 0%, #080b1a 70%, #05060f 100%);
  border: 1px solid var(--border-secondary); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.map-stage svg { width: 100%; height: 100%; display: block; }

/* land / ocean / highlight — scoped to beat the SVG's own inline .country{fill:#444} */
.map-stage .country { fill: #2a3357; transition: fill .25s ease; }
.map-stage .country.is-active { fill: var(--violet-bright); }

.capital-marker {
  fill: var(--violet-bright); stroke: #fff; stroke-opacity: .92;
  paint-order: stroke; pointer-events: none;
}

.map-missing { color: var(--haze); text-align: center; font-size: .95rem; line-height: 1.6; }
.map-missing span { color: var(--text-secondary); font-size: .82rem; }
.map-missing code { color: var(--violet-bright); font-family: var(--mono); }

/* ---- right rail: pinned search + scrolling dossier ---- */
.locator-rail {
  flex: 0 0 clamp(300px, 31%, 384px);
  display: flex; flex-direction: column; min-height: 0;
}

.locator-search { flex: 0 0 auto; position: relative; }      /* stays put */
.search-row { display: flex; gap: .5rem; }
#country-search {
  flex: 1 1 auto; min-width: 0;
  background: var(--bg-panel-strong); color: var(--mist);
  border: 1px solid var(--border-active); border-radius: var(--radius-sm);
  padding: .8rem 1rem; font-family: var(--body, inherit); font-size: .95rem;
  transition: border-color var(--transition-fast);
}
#country-search:focus { outline: none; border-color: var(--violet-bright); }
#country-search::placeholder { color: var(--haze); }

#reset-view {
  flex: 0 0 auto; width: 44px;
  background: transparent; color: var(--mist);
  border: 1px solid var(--border-secondary); border-radius: var(--radius-sm);
  font-size: 1.1rem; cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
#reset-view:hover { border-color: var(--violet-bright); color: var(--violet-bright); }

/* search dropdown */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--bg-panel-strong);
  border: 1px solid var(--border-active); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.search-hit {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--mist); border: 0;
  padding: .65rem 1rem; font-size: .92rem; cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.search-hit:hover, .search-hit:focus-visible {
  background: var(--violet); color: var(--void); outline: none;
}

/* the dossier scrolls in its own box; the search above never moves */
.locator-result {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  margin-top: 14px; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--border-active) transparent;
}
.locator-result::-webkit-scrollbar { width: 8px; }
.locator-result::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 4px; }

.dossier-empty { color: var(--haze); font-size: .92rem; line-height: 1.6; padding: 1rem 0; }
.dossier-empty-sub { color: var(--text-secondary); font-size: .8rem; margin-top: .4rem; }

/* ---- the country card ---- */
.dossier-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.dossier-flag {
  flex: 0 0 auto; width: 46px; height: 32px; border-radius: 3px; overflow: hidden;
  position: relative; background: var(--bg-panel-strong);
  border: 1px solid var(--border-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.dossier-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dossier-flag::before {              /* ISO fallback shows if the flag img is absent/removed */
  content: attr(data-iso); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .72rem; color: var(--haze); letter-spacing: .05em;
}
.dossier-flag img { position: relative; z-index: 1; }

.dossier-title h2 {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  color: var(--mist); line-height: 1.1;
}
.dossier-cap { color: var(--violet-bright); font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; margin-top: 3px; }

.dossier-stats { display: flex; flex-direction: column; gap: 0; margin-bottom: 1.1rem; }
.dossier-stats > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border-primary);
}
.dossier-stats dt {
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--haze); flex: 0 0 auto;
}
.dossier-stats dd { color: var(--mist); font-size: .9rem; text-align: right; }

.dossier-history h3 {
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--haze); margin-bottom: .5rem;
}
.dossier-history p { color: var(--text-secondary); font-size: .92rem; line-height: 1.62; }

/* ---- phone: map on top, rail below; page may scroll here by design ---- */
@media (max-width: 760px) {
  .locator { padding: 12px 0; }
  .locator-stage { flex-direction: column; }
  .map-stage { flex: 0 0 auto; aspect-ratio: 2 / 1; width: 100%; }
  .locator-rail { flex: 1 1 auto; }
}
