:root {
  /* Brand palette — mirrors --wyde-* on the parent site */
  --brand:         #00476c;
  --brand-accent:  #245e7e;
  --brand-mid:     #78D8CF;
  --brand-soft:    #E8F1F5;
  --brand-strong:  #003047;

  --sand:          #ECDCC8;
  --sand-dark:     #DEAB6C;
  --cream:         #F7F2ED;
  --paper:         #FBF8F4;

  --ink:           #14202B;
  --ink-mid:       #3F4E5C;
  --ink-soft:      #6E7B87;
  --ink-faint:     #98A2AC;

  --hair:          rgba(0, 71, 108, 0.18);
  --hair-strong:   rgba(0, 71, 108, 0.40);

  /* Typography — display work on top of avenir-lt-pro by leaning on
     weight, tracking, and case rather than introducing a second face. */
  --font-body: "avenir-lt-pro", sans-serif;

  /* Type scale */
  --t-eyebrow:    11px;
  --t-meta:       12px;
  --t-body:       14px;
  --t-lede:       15px;
  --t-h3:         18px;
  --t-h2:         clamp(22px, 1.2rem + 1.2vw, 30px);
  --t-display:    clamp(30px, 1.4rem + 2.4vw, 46px);

  --tracking-eyebrow: 0.18em;
  --tracking-headline: -0.01em;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: transparent; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
  position: relative;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
}

/* ============================================================
   MAP SURFACE
   ============================================================ */
.svg-host {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--cream);
  isolation: isolate;
}
.svg-host svg { display: block; width: 100%; height: auto; }

.country-base {
  fill: #ffffff;
  stroke: rgba(0, 71, 108, 0.18);
  stroke-width: 0.4;
}
.country-active {
  fill: var(--brand-mid);
  stroke: var(--brand);
  stroke-width: 0.7;
  cursor: pointer;
  transition: fill .18s ease;
}
.country-active:hover,
.country-active.hl { fill: var(--brand-accent); }

/* Markers — two visual tiers
   - single story: solid blue dot
   - multi story: white disc with brand ring + count in brand */
.marker {
  cursor: pointer;
  transition: r .18s ease, fill .18s ease, stroke-width .18s ease;
  stroke: var(--brand);
  stroke-width: 1.2;
}
.marker.single { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.marker.multi  { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.marker.single:hover, .marker.single.hl {
  fill: var(--brand-strong);
}
.marker.multi:hover, .marker.multi.hl {
  fill: var(--brand-mid);
  stroke-width: 2.5;
}
.marker-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  fill: var(--brand);
  pointer-events: none;
  text-anchor: middle;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

/* ============================================================
   CARD POP-UP — matches /wyde story-card style
   ============================================================ */
.card {
  position: absolute;
  width: 300px;
  background: #fff;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  border: 1px solid var(--brand-accent);
  overflow: hidden;
}
.card.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--cream);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, transparent 60%, rgba(0, 48, 71, 0.14) 100%);
  pointer-events: none;
}
.card-body { padding: 14px 16px 16px; }
.card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}
.card-title {
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
  /* Cap title at 4 lines */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-excerpt {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.55;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }
.card-link .arrow {
  display: inline-block;
  transition: transform .18s ease;
}
.card-link:hover .arrow { transform: translateX(3px); }

/* Multi-story list inside the card */
.card-multi {
  margin-top: 4px;
}
.card-multi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.card-multi ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: stories;
  border-top: 1px solid var(--hair);
}
.card-multi li {
  counter-increment: stories;
  border-bottom: 1px solid var(--hair);
}
.card-multi a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  align-items: start;
}
.card-multi a::before {
  content: counter(stories, decimal-leading-zero);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-feature-settings: "tnum" 1;
  padding-top: 2px;
}
.card-multi a:hover { color: var(--brand); }
.card-multi a:hover::before { color: var(--brand-strong); }

/* ============================================================
   COUNTRY INDEX — mirrors `is-style-wyde-button` on
   /wyde/about-the-partners/: square corners, leading → glyph,
   solid wyde-blue default, inverts to white on hover.
   ============================================================ */
.index {
  margin-top: clamp(20px, 3vw, 32px);
}
.country-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.country-pill {
  --pad-y: calc(.667em + 2px);
  --pad-x: calc(1.333em + 2px);
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--brand);
  padding: var(--pad-y) var(--pad-x);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background-color .18s ease, color .18s ease;
}
.country-pill:hover,
.country-pill:focus-visible,
.country-pill.hl {
  background: var(--brand);
  color: #fff;
}
.country-pill:focus-visible {
  outline: 2px solid var(--brand-mid);
  outline-offset: 2px;
}
.country-pill .name { white-space: nowrap; }
.country-pill .count {
  font-size: 12px;
  font-weight: 700;
  font-feature-settings: "tnum" 1;
  padding: 2px 7px;
  background: var(--brand-soft);
  color: var(--brand);
  line-height: 1;
  transition: background-color .18s ease, color .18s ease;
}
.country-pill:hover .count,
.country-pill:focus-visible .count,
.country-pill.hl .count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ============================================================
   STATUS / LOADING
   ============================================================ */
.status {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.status.error { color: #b1331f; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .card { width: 250px; }
  .meta-line .stat strong { font-size: 18px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .card, .country-row .name::after, .card-link .arrow, .marker { transition: none; }
}
