/* Explore Data hub (/data/). Everything is scoped under .dh.
   Flat: no animations, no hover lifts. Colours follow the homepage hero
   (cream background, orange badge and accents) and the navbar ink. */

.dh {
  --dh-ink: #0f172a;
  --dh-body: #334155;
  --dh-muted: #64748b;
  --dh-line: #e2e8f0;
  --dh-soft: #f1f5f9;
  --dh-off: #94a3b8;
  --dh-brand: #0891b2;
  --dh-orange: #ea580c;
  color: var(--dh-ink);
  background: linear-gradient(180deg, #fff 0%, #fffbf5 160px, #fff7ed 320px, #f8fafc 620px);
  padding: 1.5rem 1.75rem 3rem;
}

.dh *,
.dh *::before,
.dh *::after { box-sizing: border-box; }

/* ── Header ─────────────────────────────────────────── */
.dh-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
  max-width: 1480px;
  margin: 0 auto 1.25rem;
}

.dh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.dh-badge__plus { color: #fdba74; }

.dh-title {
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--dh-ink);
  margin: 0.75rem 0 0.4rem;
}

.dh-title span {
  background: linear-gradient(135deg, #f59e0b, #ea580c, #dc2626);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dh-sub {
  font-size: 1rem;
  color: #475569;
  margin: 0;
}

.dh-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--dh-muted);
}

.dh-crumbs li[hidden] { display: none; }

.dh-crumbs li + li::before {
  content: "\203A";
  margin: 0 0.55rem;
  color: var(--dh-off);
}

.dh-crumbs .is-current { color: var(--dh-ink); font-weight: 600; }

.dh-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--dh-muted);
}

.dh-seg {
  display: flex;
  background: #fff;
  border: 1px solid var(--dh-line);
  border-radius: 999px;
  overflow: hidden;
}

.dh-seg button {
  border: 0;
  border-right: 1px solid var(--dh-line);
  background: transparent;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--dh-body);
  cursor: pointer;
}

.dh-seg button:last-child { border-right: 0; }

.dh-seg button.is-on {
  background: var(--dh-ink);
  color: #fff;
  font-weight: 600;
}

.dh-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--dh-line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  margin: 0;
  color: var(--dh-body);
}

.dh-pick[hidden] { display: none; }

.dh-pick select {
  border: 0;
  background: transparent;
  font-size: 0.82rem;
  color: var(--dh-body);
  max-width: 14rem;
  padding: 0.15rem 0;
}

.dh button:focus-visible,
.dh a:focus-visible,
.dh select:focus-visible {
  outline: 2px solid var(--dh-brand);
  outline-offset: 2px;
}

/* ── Layout ─────────────────────────────────────────── */
.dh-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 1rem;
  max-width: 1480px;
  margin: 0 auto;
  align-items: start;
}

.dh-card {
  background: #fff;
  border: 1px solid var(--dh-line);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.dh-viz { padding: 1rem; min-width: 0; }

.dh-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dh-toggle {
  display: flex;
  gap: 0.4rem;
}

/* "Show explanations" switch: off by default, folds every description and
   "what it means" line on the page (list and panel). */
.dh-explain {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0 auto;
  padding: 0.45rem 1rem 0.45rem 0.5rem;
  border: 1.5px solid #fdba74;
  border-radius: 999px;
  background: #fff7ed;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dh-ink);
  cursor: pointer;
  user-select: none;
}

.dh-explain:hover { border-color: var(--dh-orange); }

.dh-explain input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.dh-explain__track {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background-color 0.15s ease;
}

.dh-explain__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.dh-explain .bi { color: var(--dh-orange); }

.dh-explain:has(input:checked) {
  border-color: var(--dh-orange);
  background: #ffedd5;
}

.dh-explain input:checked + .dh-explain__track { background: var(--dh-orange); }
.dh-explain input:checked + .dh-explain__track .dh-explain__knob { transform: translateX(20px); }

.dh-explain:has(input:focus-visible) {
  outline: 2px solid var(--dh-brand);
  outline-offset: 2px;
}

.dh:has(#dh-explain:not(:checked)) :is(.dh-list__desc, .dh-takeaway, .dh-list__meaning, .dh-lead, .dh-meaning) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .dh-explain__track,
  .dh-explain__knob { transition: none; }
}

.dh-toggle[hidden] { display: none; }

.dh-toggle button {
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--dh-line);
  color: var(--dh-body);
  background: #fff;
  cursor: pointer;
}

.dh-toggle button.is-on {
  background: var(--dh-ink);
  border-color: var(--dh-ink);
  color: #fff;
  font-weight: 600;
}

/* ── Circle view (SVG) ──────────────────────────────── */
.dh-circle[hidden] { display: none; }

.dh-circle svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 860px;
  font-family: inherit;
}

.dh-node { cursor: pointer; text-decoration: none; }
.dh-circle a,
.dh-circle a:hover { text-decoration: none; }
.dh-node:focus { outline: none; }
.dh-node:focus-visible .dh-node__focus { stroke: var(--dh-brand); stroke-width: 3; }
.dh-node__focus { fill: none; stroke: transparent; }

.dh-node__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 26px;
  line-height: 1;
}

.dh-node--hub .dh-node__icon { font-size: 28px; color: #fff; }

.dh-label { font-size: 13px; font-weight: 700; fill: var(--dh-ink); }
.dh-label__sub { font-size: 12px; font-weight: 400; fill: var(--dh-muted); }
.dh-node.is-off .dh-label { fill: var(--dh-muted); }
.dh-node.is-off .dh-node__icon { color: var(--dh-off) !important; }

/* ── List view ──────────────────────────────────────── */
.dh-list[hidden] { display: none; }

.dh-list__hub + .dh-list__hub { margin-top: 1.25rem; }

.dh-list h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--dh-ink);
}

.dh-list__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hub);
  color: #fff;
  font-size: 0.95rem;
}

.dh-list__desc {
  font-size: 0.85rem;
  color: var(--dh-muted);
  margin: 0.25rem 0 0.5rem 2.4rem;
}

.dh-takeaway {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--dh-body);
  margin: 0 0 0.75rem 2.4rem;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--hub);
  background: var(--hub-tint);
  border-radius: 0 8px 8px 0;
}
.dh-takeaway strong { color: var(--hub-text); font-weight: 700; }

.dh-list ul { list-style: none; margin: 0; padding: 0; }

.dh-list li a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon name    value"
    "icon geo     value"
    "icon meaning meaning";
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--dh-soft);
  color: var(--dh-ink);
  text-decoration: none;
}

.dh-list li a:hover .dh-list__name { text-decoration: underline; }

.dh-list__icon {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hub-tint);
  color: var(--hub-text);
  font-size: 1rem;
}

.dh-list__name { grid-area: name; font-weight: 600; font-size: 0.92rem; }
.dh-list__also { font-weight: 500; font-size: 0.75rem; color: var(--dh-muted); }
.dh-list__geo { grid-area: geo; font-size: 0.78rem; color: var(--dh-muted); }
.dh-list__meaning { grid-area: meaning; font-size: 0.82rem; line-height: 1.45; color: var(--dh-body); margin-top: 0.25rem; }
.dh-list__meaning[hidden] { display: none; }
.dh-list li.is-off .dh-list__meaning { display: none; }

.dh-list__value {
  grid-area: value;
  text-align: right;
  font-size: 0.8rem;
  color: var(--dh-muted);
  max-width: 13rem;
}

.dh-list__value strong { display: block; font-size: 0.95rem; color: var(--hub-text); }

.dh-list li.is-off .dh-list__icon {
  background: #fff;
  border: 1.5px dashed var(--dh-off);
  color: var(--dh-off);
}

.dh-list li.is-off .dh-list__name,
.dh-list li.is-off .dh-list__value strong { color: var(--dh-muted); }

/* High-impact figures (inflation and interest rates, dam levels): a red glow. */
.dh-list li.is-hot a {
  margin: 0.4rem 0;
  border: 1px solid rgba(220, 38, 38, 0.45);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 0 22px rgba(220, 38, 38, 0.45);
}

.dh-list li.is-hot .dh-list__icon { box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(220, 38, 38, 0.55); }
.dh-list li.is-hot.is-off a { border-color: var(--dh-soft); box-shadow: none; }
.dh-list li.is-hot.is-off .dh-list__icon { box-shadow: none; }

.dh-kpi.dh-kpi--hot,
.dh-big.dh-big--hot {
  border: 1px solid rgba(220, 38, 38, 0.45);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12), 0 0 16px rgba(220, 38, 38, 0.3);
}

.dh-big.dh-big--hot { padding: 0.6rem 0.75rem; }

/* Narrow-screen mini orbit (drawn by JS; never shown without it) */
.dh-mini[hidden] { display: none !important; }
.dh-mini { margin: 0 0 1rem; }
.dh-mini svg { display: block; width: 100%; height: auto; max-width: 420px; margin: 0 auto; }
.dh-mini__hub,
.dh-mini__centre { cursor: pointer; }
.dh-mini__hub:focus,
.dh-mini__centre:focus { outline: none; }
.dh-mini__hub:focus-visible .dh-node__focus,
.dh-mini__centre:focus-visible .dh-node__focus { stroke: var(--dh-brand); stroke-width: 2.5; }
.dh-node__icon.dh-mini__icon { font-size: 17px; }
.dh-list__hub[hidden] { display: none; }
.dh-list__borrowed[hidden] { display: none; }
.dh-list__borrowed h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dh-muted);
  margin: 0.85rem 0 0.25rem;
}

/* ── Footer row of the left card ────────────────────── */
.dh-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--dh-muted);
}

.dh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dh-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }

.dh-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #16a34a;
}

.dh-legend__dot--off { background: #fff; border: 1.5px dashed var(--dh-off); }
.dh-legend__dash { width: 24px; border-top: 2px dashed var(--dh-muted); }

.dh-listlink {
  font-weight: 600;
  color: #0e7490;
  text-decoration: none;
}

.dh-listlink:hover { text-decoration: underline; }

/* ── Panel ──────────────────────────────────────────── */
.dh-panel { padding: 1.25rem 1.35rem; min-width: 0; }

.dh-panel__head { display: flex; gap: 0.85rem; align-items: center; }

.dh-panel__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--hub, var(--dh-ink));
  color: #fff;
  font-size: 1.4rem;
}

.dh-panel__title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
  color: var(--dh-ink);
}

.dh-panel__lead { font-size: 0.88rem; color: var(--dh-muted); margin: 0.2rem 0 0; }

.dh-panel h3 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 1.25rem 0 0.55rem;
  color: var(--dh-ink);
}

.dh-back {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #0e7490;
  font-weight: 600;
  cursor: pointer;
}

.dh-tiles {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.dh-tile {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas: "icon name" "icon count";
  column-gap: 0.6rem;
  align-items: center;
  border: 1px solid var(--dh-line);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem;
  color: var(--dh-ink);
  text-decoration: none;
}

.dh-tile:hover { border-color: var(--hub); color: var(--dh-ink); }

.dh-tiles__icon {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hub);
  color: #fff;
}

.dh-tiles__name { grid-area: name; font-weight: 700; font-size: 0.9rem; }
.dh-tiles__count { grid-area: count; font-size: 0.78rem; color: var(--dh-muted); }

.dh-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.dh-kpi { border: 1px solid var(--dh-line); border-radius: 10px; padding: 0.7rem; min-width: 0; }
.dh-kpi b { display: block; font-size: 1.05rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; color: var(--hub-text, var(--dh-ink)); overflow-wrap: anywhere; }
.dh-kpi span { display: block; font-size: 0.78rem; color: var(--dh-body); margin-top: 0.15rem; }
.dh-kpi em { display: block; font-style: normal; font-size: 0.72rem; color: var(--dh-muted); margin-top: 0.35rem; }

.dh-rows { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }

.dh-rows li { border-bottom: 1px solid var(--dh-soft); }

.dh-rows button {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: none;
  padding: 0.5rem 0;
  text-align: left;
  color: var(--dh-ink);
  cursor: pointer;
}

.dh-rows button:hover span:first-child { text-decoration: underline; }
.dh-rows span:last-child { color: var(--dh-muted); text-align: right; }
.dh-rows li.is-off span:first-child { color: var(--dh-muted); }

.dh-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; margin: 0; padding: 0; }

.dh-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--chip-bg, var(--dh-soft));
  color: var(--chip-fg, var(--dh-body));
  border: 0;
  cursor: default;
}

button.dh-chip { cursor: pointer; }

.dh-chip--off {
  background: #fff;
  color: var(--dh-off);
  border: 1.5px dashed var(--dh-off);
  font-weight: 500;
}

.dh-lead {
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  background: var(--hub-tint);
  border-left: 3px solid var(--hub);
}
.dh-lead h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--hub-text); margin: 0 0 0.3rem; }
.dh-lead p { font-size: 0.88rem; line-height: 1.5; color: var(--dh-body); margin: 0; }

.dh-meaning { font-size: 0.88rem; line-height: 1.5; color: var(--dh-body); margin: 0.6rem 0 0; }
.dh-meaning strong { color: var(--hub-text); font-weight: 700; }

.dh-big { margin-top: 1rem; }
.dh-big b { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--hub-text, var(--dh-ink)); }
.dh-big span { display: block; font-size: 0.88rem; color: var(--dh-body); margin-top: 0.2rem; }

.dh-meta { list-style: none; margin: 0.9rem 0 0; padding: 0; font-size: 0.85rem; color: var(--dh-body); }
.dh-meta li { padding: 0.35rem 0; border-bottom: 1px solid var(--dh-soft); }
.dh-meta strong { font-weight: 600; color: var(--dh-ink); }

.dh-note {
  font-size: 0.82rem;
  color: var(--dh-muted);
  margin: 0.75rem 0 0;
}

.dh-note--off {
  color: #475569;
  background: var(--dh-soft);
  border: 1px dashed var(--dh-off);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

.dh-links { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.9rem; font-size: 0.86rem; }
.dh-links a { color: #0e7490; font-weight: 600; text-decoration: none; }
.dh-links a:hover { text-decoration: underline; }

.dh-go {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.dh-go:hover { color: #fff; box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35); }

/* ── Narrow screens: list only, panel below ─────────── */
@media (max-width: 991.98px) {
  .dh-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
  .dh { padding: 1rem 1rem 2.5rem; }
  .dh-head { align-items: flex-start; }
  .dh-toggle,
  .dh-circle { display: none !important; }
  .dh-list { display: block !important; }
  .dh-seg button { padding: 0.45rem 0.7rem; }
  .dh-list li a {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas: "icon name" "icon value" "icon meaning" "icon geo";
  }
  .dh-list__value { text-align: left; max-width: none; }
  .dh-list__value strong { display: inline; }
  .dh-tiles { grid-template-columns: minmax(0, 1fr); }
  /* The list carries every page here; the panel only shows a chosen neighbourhood's links. */
  .dh-panel { display: none; }
  .dh.is-nb .dh-panel { display: block; }
}
