/* =============================================================
   minwage-map.css — Interactive minimum-wage map for the
   "Minimum wage always helps workers" myth article.
   Red  = country has a statutory national minimum wage
   Blue = no statutory minimum wage (collective bargaining / none)
   Grey = no data
   ============================================================= */

.mw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  margin: 8px 0 40px;
  position: relative;
  overflow: hidden;
}
/* Let the interactive card break out wider than the 760px prose column */
@media (min-width: 880px) {
  #minWageMap {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, 94vw);
  }
}

/* Header / controls */
.mw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mw-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.15;
}
.mw-title strong { color: var(--gold-bright); font-style: italic; }
.mw-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
  margin-top: 6px;
  max-width: 560px;
  line-height: 1.5;
}
.mw-controls { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

.mw-seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.mw-seg button {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 11px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dimmer);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.mw-seg button:hover { color: var(--text-dim); }
.mw-seg button.active { background: var(--surface2); color: var(--text); }

/* View buttons: each region gets its own colour so the user can read the
   active view at a glance (gold = World, red = USA, blue = EU). */
.mw-seg button[data-view="world"]          { color: #c79544; }
.mw-seg button[data-view="us"]             { color: #c46b6b; }
.mw-seg button[data-view="eu"]             { color: #6b8fb8; }
.mw-seg button[data-view="world"]:hover    { color: #f4c970; }
.mw-seg button[data-view="us"]:hover       { color: #ef8a8a; }
.mw-seg button[data-view="eu"]:hover       { color: #8bbbe0; }
.mw-seg button[data-view="world"].active   { background: rgba(232,168,56,0.18); color: #f4c970; }
.mw-seg button[data-view="us"].active      { background: rgba(219,77,77,0.18); color: #ef8a8a; }
.mw-seg button[data-view="eu"].active      { background: rgba(94,166,207,0.22); color: #8bbbe0; }

/* SVG canvas */
.mw-svg-wrap {
  position: relative;
  width: 100%;
  background: radial-gradient(ellipse at center, rgba(200,146,42,0.04), transparent 70%);
  min-height: 220px;
}
.mw-svg { width: 100%; height: auto; display: block; }

.mw-geo {
  stroke: var(--bg);
  stroke-width: 0.4;
  vector-effect: non-scaling-stroke;
  transition: filter 0.12s, stroke 0.12s, stroke-width 0.12s, opacity 0.2s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
/* Fill is set per-country in JS via an inline style (so it wins over CSS). */
.mw-geo { cursor: pointer; }
.mw-geo.is-nodata { cursor: default; }
/* "Zero" countries (no statutory minimum wage) — dark green fill + subtle green halo */
.mw-geo.is-zero {
  stroke: #16a34a;
  stroke-width: 1.1;
  filter: drop-shadow(0 0 4px rgba(22, 163, 74, 0.55));
}
.mw-geo.dim { opacity: 0.26; }
.mw-geo:hover, .mw-geo.is-active {
  stroke: var(--gold-bright);
  stroke-width: 1.4;
  filter: brightness(1.18);
}
.mw-sphere { fill: none; stroke: var(--border); stroke-width: 0.6; pointer-events: none; }
.mw-grat   { fill: none; stroke: var(--border); stroke-width: 0.3; stroke-opacity: 0.4; pointer-events: none; }

/* Legend */
.mw-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.mw-legend .scale { display: inline-flex; align-items: center; gap: 9px; }
.mw-legend .scale .lab { color: var(--text-dimmer); letter-spacing: 0.1em; text-transform: uppercase; }
.mw-legend .bar {
  display: inline-flex; height: 10px; width: 220px; max-width: 46vw;
  border-radius: 3px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12);
}
.mw-legend .bar i { flex: 1; }
.mw-legend span.key { display: inline-flex; align-items: center; gap: 7px; }
.mw-legend span.key i {
  width: 14px; height: 10px; border-radius: 2px; display: inline-block;
  border: 1px solid rgba(255,255,255,0.12);
}
.mw-legend i.t5 { background: var(--mw-t5); }
.mw-legend i.t4 { background: var(--mw-t4); }
.mw-legend i.t3 { background: var(--mw-t3); }
.mw-legend i.t2 { background: var(--mw-t2); }
.mw-legend i.t1 { background: var(--mw-t1); }
.mw-legend i.k-zero { background: var(--mw-t0); }
.mw-legend i.k-nd   { background: var(--mw-nd); }

/* Tooltip */
.mw-tip {
  position: absolute;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 190px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  z-index: 10;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.12s;
}
.mw-tip.visible { opacity: 1; }
.mw-tip-name {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; margin-bottom: 2px;
}
.mw-tip-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 10px;
}
.mw-tip-tag.has  { color: #e88; }
.mw-tip-tag.none { color: var(--blue-a); }
.mw-tip-big {
  font-family: var(--font-mono); font-size: 25px; font-weight: 700;
  letter-spacing: -0.03em; color: var(--text); line-height: 1;
}
.mw-tip-big small { font-size: 12px; color: var(--text-dim); font-weight: 500; letter-spacing: 0; }
.mw-tip-row {
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--font-mono); font-size: 10px; margin-top: 7px;
  color: var(--text-dimmer); letter-spacing: 0.04em;
}
.mw-tip-row .v { color: var(--text-dim); font-weight: 600; }
.mw-tip-note {
  font-family: var(--font-mono); font-size: 10px; line-height: 1.5;
  color: var(--text-dim); margin-top: 6px; letter-spacing: 0.02em;
}

/* Table */
.mw-table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table.mw-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.mw-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: left; padding: 10px 12px; cursor: pointer; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.mw-table thead th:hover { color: var(--text); }
.mw-table thead th.num, .mw-table td.num { text-align: right; }
.mw-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.mw-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.mw-table td.country { color: var(--text); font-weight: 600; }
.mw-table td.zero { color: var(--text-dimmer); }
.mw-table a.src { color: var(--gold-dim); text-decoration: none; }
.mw-table a.src:hover { color: var(--gold-bright); }

.mw-loading {
  padding: 90px 0; text-align: center; color: var(--text-dimmer);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
}

:root {
  /* Higher min wage = red ("bad" for the article's frame); lower = green ("good"). */
  --mw-t5: #db4d4d;   /* highest minimum wage  */
  --mw-t4: #e8923f;
  --mw-t3: #e7c34b;
  --mw-t2: #9bcf57;
  --mw-t1: #4cb96b;   /* lowest minimum wage   */
  --mw-t0: #14532d;        /* 0 — no statutory minimum wage (very dark forest green) */
  --mw-t0-glow: #16a34a;   /* dark green for the halo (kept in the dark-green family, not lime) */
  --mw-nd: #1b2027;   /* no data */
}

@media (max-width: 700px) {
  .mw-card { padding: 14px 12px 12px; }
  .mw-title { font-size: 17px; }
  .mw-head { gap: 10px; }
  .mw-tip { min-width: 165px; padding: 10px 12px; }
  .mw-tip-big { font-size: 21px; }
  table.mw-table { font-size: 11px; }
  .mw-table thead th, .mw-table tbody td { padding: 8px 9px; }
}
