:root {
  /* Calm, academic-dark palette */
  --bg: #0b1020;
  --surface: #0f1730;
  --card: #121c39;
  --text: #e8ecff;
  --muted: #aab3d6;
  --muted-2: #7f8ab8;
  --border: rgba(255, 255, 255, 0.10);
  --border-2: rgba(255, 255, 255, 0.14);
  --accent: #7aa2ff;
  --accent-2: rgba(122, 162, 255, 0.18);
  --danger: #ff6b6b;
  --danger-2: rgba(255, 107, 107, 0.20);

  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);

  --container: 1120px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
.grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: var(--space-4); }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.88);
  backdrop-filter: blur(10px);
}

.site-header {
  padding: var(--space-3) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 240px;
}

.logo {
  height: 100px;
  width: auto;
  border-radius: 10px;
  display: block;
}

.brand-title {
  font-weight: 750;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-tagline {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Typography helpers */
h1, h2, h3 { margin: 0 0 var(--space-2) 0; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
small { color: var(--muted); }

.section {
  margin-top: var(--space-4);
}

/* Surfaces */
.card {
  background: linear-gradient(180deg, rgba(18,28,57,.95), rgba(18,28,57,.88));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-4) 0;
}

/* Forms */
label { font-size: 13px; color: var(--muted); }

.label { font-size: 12px; color: var(--muted); margin: var(--space-3) 0 var(--space-1); }

/* Style only text-like inputs, NOT checkboxes or radios */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  outline: none;
}
/* Ensure checkboxes & radios keep native sizing */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}


textarea { min-height: 110px; resize: vertical; }

input::placeholder, textarea::placeholder { color: rgba(170, 179, 214, 0.65); }

input:focus, textarea:focus, select:focus {
  border-color: rgba(122, 162, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.18);
}

/* Buttons */
button {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--accent-2);
  color: var(--text);
  cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}

button:hover { background: rgba(122, 162, 255, 0.25); }
button:active { transform: translateY(1px); }

button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}
button.secondary:hover { background: rgba(255, 255, 255, 0.10); }

button.danger {
  background: var(--danger-2);
  border-color: rgba(255, 107, 107, 0.35);
}
button.danger:hover { background: rgba(255, 107, 107, 0.26); }

button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(122, 162, 255, 0.30);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.badge.verified {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.35);
  color: #d1fae5;
  font-weight: 700;
}

.badge.verified::before {
  content: "✓";
  font-weight: 900;
}

/* Results & lists */
.results { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.results-tight { margin-top: 0; }

/* Stacked cards inside a grid column */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }


.result {
  padding: var(--space-3);
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.result h3 { margin: 0 0 6px 0; font-size: 16px; }
.result p { margin: 0; color: var(--muted); }

.result:hover {
  border-color: rgba(122, 162, 255, 0.30);
}

/* Simple 2-col key/value blocks */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } }

/* Map */
.map { height: calc(100vh - 190px); height: calc(100dvh - 190px); width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

/* Map layout helpers */
.map-layout { display: flex; gap: var(--space-4); align-items: flex-start; margin-top: var(--space-4); }
.map-side { width: 340px; max-width: 40vw; max-height: calc(100vh - 280px); overflow: auto; }
.map-main { flex: 1; min-height: 70vh; min-width: 0; }
@media (max-width: 900px) {
  .map-layout { flex-direction: column; }
  .map-side { width: 100%; max-width: 100%; max-height: none; }
  .map { height: 65vh; height: 65dvh; }
}

/* Tidy default <details> used for expertise taxonomy */
details { border-radius: 14px; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

details.exp-cat > summary {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

details.exp-cat[open] > summary {
  border-color: rgba(122, 162, 255, 0.30);
  background: rgba(122, 162, 255, 0.10);
}

/* Reduce top whitespace around main content */
main { padding: var(--space-4) 0 var(--space-5); }

/* Map CTA button */
.map-cta {
  text-decoration: none;
  display: inline-block;
}

.map-cta-inner {
  width: 300px;
  height: 200px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
  overflow: hidden;
}

.map-cta-inner svg {
  width: 80%;
  height: auto;
  fill: #ffffff;
  opacity: 0.9;
}

.map-cta-inner span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.map-cta-inner::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 42px;
  height: 42px;
  background: url("pin.png") no-repeat center / contain;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}

.map-cta-inner:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.45);
}

.map-cta-inner:hover::after {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.map-cta-inner:active {
  transform: translateY(0);
}

/* Map CTA button */
.map-cta {
  text-decoration: none;
  display: inline-block;
}

.map-cta-inner {
  width: 300px;
  height: 200px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
  overflow: hidden;
}

/* NEW: image instead of svg */
.map-cta-image {
  width: 88%;
  max-height: 130px;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.95;
}

/* NEW: target CTA text specifically (instead of all spans) */
.map-cta-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}




/* Expertise lists: show categories in multiple columns on desktop */
.exp-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1100px) {
  .exp-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .exp-list { grid-template-columns: 1fr; }
}

/* Remove extra vertical spacing when expList is a grid */
.exp-list details,
.exp-list .result {
  margin: 0;
}

/* Slightly tighter category headers */
.exp-list details.exp-cat > summary {
  padding: 8px 10px;
}

/* Map: keep coordinate picker compact */
.map-pick input#picked { max-width: 220px; }
@media (max-width: 520px) {
  .map-pick input#picked { max-width: 100%; }
}


/* Subcategory checkbox pills: checkbox + text must remain inside one pill */
.badge.subcat-pill{
  display: inline-flex !important;  /* override any inline/legacy styles */
  align-items: center;
  justify-content: flex-start;
  gap: 8px;

  /* size-to-content on desktop */
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;

  /* desktop: keep multi-word labels on one line */
  white-space: nowrap;
}

.badge.subcat-pill input[type="checkbox"]{
  margin: 0;
  flex: 0 0 auto;
}

.badge.subcat-pill .subcat-text{
  display: inline;
  line-height: 1.15;
  white-space: inherit; /* follows the pill’s wrap rules */
}

/* Mobile: wrapping is allowed, but keep checkbox aligned to the top-left of the pill */
@media (max-width: 720px){
  .badge.subcat-pill{
    white-space: normal;
    align-items: flex-start;   /* prevents “vertically centered checkbox” on wrap */
  }
  .badge.subcat-pill .subcat-text{
    white-space: normal;
  }
}
}
