/* ImpactMojo Maps — shared styles for the interactive graph pages.
   Reuses the topbar/footer chrome and the Data Dives palette. */
:root {
  --im-gradient: linear-gradient(135deg, #2563EB 0%, #4338CA 100%);
  --im-accent: #2563EB;
  --im-nav-bg: rgba(15, 23, 42, 0.95);
  --im-border: #334155;
  --im-text-primary: #F1F5F9;
  --im-text-secondary: #94A3B8;
  --im-text-muted: #64748B;
  --im-card-bg: #1E293B;
  --im-hover-bg: #334155;
  --im-secondary-bg: #1E293B;
  --mp-bg: #FAF7F2;
  --mp-surface: #FFFFFF;
  --mp-border: #E5DDD0;
  --mp-text: #1A1A1A;
  --mp-text-soft: #3F3F46;
  --mp-muted: #6B6560;
  --mp-accent: #2563EB;
  --mp-accent-soft: #EAF1FE;
  --mp-link: #9AA6B2;
  --mp-node-stroke: #FFFFFF;
  --mp-label-halo: rgba(250, 247, 242, 0.9);
}
html.dark {
  --mp-bg: #0F172A;
  --mp-surface: #1E293B;
  --mp-border: #334155;
  --mp-text: #F1F5F9;
  --mp-text-soft: #CBD5E1;
  --mp-muted: #94A3B8;
  --mp-accent: #60A5FA;
  --mp-accent-soft: rgba(96, 165, 250, 0.12);
  --mp-link: #475569;
  --mp-node-stroke: #0F172A;
  --mp-label-halo: rgba(15, 23, 42, 0.85);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--mp-bg); color: var(--mp-text); font-family: 'Amaranth', Arial, sans-serif; padding-top: 56px; line-height: 1.6; }

/* Topbar (matches site chrome) */
.im-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: var(--im-nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--im-border); padding: 0.5rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; font-family: 'Inter', sans-serif; }
.im-topbar a { text-decoration: none; }
.im-topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.im-topbar-home { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1rem; color: #2563EB; }
.im-topbar-home img { width: 24px; height: 24px; border-radius: 4px; }
.im-topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.im-premium-btn { background: var(--im-gradient); color: #fff; padding: 0.35rem 0.85rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.im-premium-btn svg { width: 14px; height: 14px; }
.im-browse-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #1C1917; background: #FFF; border: 1.5px solid #E2E8F0; padding: 0.5rem 1rem; border-radius: 0.5rem; }
.im-browse-btn svg { width: 14px; height: 14px; }
html.dark .im-browse-btn { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.18); }
.im-theme-selector { display: flex; gap: 2px; background: var(--im-card-bg); border: 1px solid var(--im-border); border-radius: 8px; padding: 2px; }
.im-theme-btn { background: transparent; border: none; color: var(--im-text-secondary); padding: 6px; border-radius: 5px; cursor: pointer; display: flex; width: 30px; height: 30px; align-items: center; justify-content: center; }
.im-theme-btn:hover { background: var(--im-hover-bg); color: var(--im-text-primary); }
.im-theme-btn.active { background: var(--im-accent); color: #fff; }
.im-theme-btn svg { width: 16px; height: 16px; }
.im-skip-link { position: absolute; top: -40px; left: 0; background: var(--im-accent); color: #fff; padding: 8px 16px; z-index: 10000; font-family: 'Inter', sans-serif; font-weight: 600; }
.im-skip-link:focus { top: 0; }

/* Page header */
.mp-head { max-width: 1180px; margin: 0 auto; padding: 2.25rem 1.25rem 1rem; }
.mp-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mp-accent); margin-bottom: .75rem; }
.mp-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--mp-accent); }
.mp-title { font-family: 'Inter', sans-serif; font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; color: var(--mp-text); margin-bottom: .6rem; }
.mp-lede { font-size: 1.1rem; color: var(--mp-text-soft); max-width: 760px; }
.mp-lede a { color: var(--mp-accent); text-decoration: none; border-bottom: 1px dotted; }
.mp-back { display: inline-block; font-family: 'Inter', sans-serif; font-size: .82rem; font-weight: 600; color: var(--mp-muted); text-decoration: none; margin-bottom: 1rem; }
.mp-back:hover { color: var(--mp-accent); }

/* Controls */
.mp-controls { max-width: 1180px; margin: 0 auto; padding: .5rem 1.25rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-family: 'Inter', sans-serif; }
.mp-search { flex: 1; min-width: 200px; max-width: 340px; padding: .55rem .9rem; border-radius: 8px; border: 1px solid var(--mp-border); background: var(--mp-surface); color: var(--mp-text); font-size: .9rem; font-family: inherit; }
.mp-filter { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--mp-text-soft); background: var(--mp-surface); border: 1.5px solid var(--mp-border); border-radius: 999px; padding: .35rem .85rem; cursor: pointer; transition: all .15s; }
.mp-filter[aria-pressed="false"] { opacity: .4; }
.mp-filter .dot { width: 10px; height: 10px; border-radius: 50%; }
.mp-btn { font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 600; color: var(--mp-text-soft); background: var(--mp-surface); border: 1.5px solid var(--mp-border); border-radius: 8px; padding: .45rem .9rem; cursor: pointer; }
.mp-btn:hover { border-color: var(--mp-accent); color: var(--mp-accent); }

/* Stage: canvas + side panel */
.mp-stage { max-width: 1180px; margin: .5rem auto 0; padding: 0 1.25rem 2rem; display: grid; grid-template-columns: 1fr 330px; gap: 1rem; align-items: stretch; }
.mp-canvas-wrap { position: relative; background: var(--mp-surface); border: 1px solid var(--mp-border); border-radius: 14px; overflow: hidden; min-height: 60vh; height: 68vh; }
.mp-canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.mp-hint { position: absolute; left: 12px; bottom: 10px; font-family: 'Inter', sans-serif; font-size: .72rem; color: var(--mp-muted); background: var(--mp-accent-soft); padding: .3rem .6rem; border-radius: 6px; pointer-events: none; }
.mp-legend { position: absolute; right: 12px; top: 12px; background: var(--mp-surface); border: 1px solid var(--mp-border); border-radius: 10px; padding: .6rem .8rem; font-family: 'Inter', sans-serif; font-size: .74rem; color: var(--mp-text-soft); max-width: 210px; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.mp-legend .row { display: flex; align-items: center; gap: .45rem; margin: .2rem 0; }
.mp-legend .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }

/* Side panel */
.mp-panel { background: var(--mp-surface); border: 1px solid var(--mp-border); border-radius: 14px; padding: 1.25rem; font-family: 'Inter', sans-serif; overflow-y: auto; max-height: 68vh; }
.mp-panel-empty { color: var(--mp-muted); font-size: .9rem; }
.mp-panel h2 { font-size: 1.15rem; font-weight: 800; color: var(--mp-text); margin-bottom: .35rem; letter-spacing: -.01em; }
.mp-panel .sub { font-size: .78rem; color: var(--mp-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-bottom: .9rem; }
.mp-panel .meta { font-size: .9rem; color: var(--mp-text-soft); margin-bottom: 1rem; }
.mp-panel ul { list-style: none; }
.mp-panel li { padding: .5rem 0; border-bottom: 1px dashed var(--mp-border); }
.mp-panel li a { color: var(--mp-accent); text-decoration: none; font-weight: 600; font-size: .9rem; }
.mp-panel li a:hover { text-decoration: underline; }
.mp-panel li .t { font-size: .74rem; color: var(--mp-muted); display: block; }
.mp-pill { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .15rem .5rem; border-radius: 5px; background: var(--mp-accent-soft); color: var(--mp-accent); margin-bottom: .8rem; }

/* Notes / caveats */
.mp-notes { max-width: 1180px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.mp-method { background: var(--mp-accent-soft); border: 1px solid var(--mp-border); border-radius: 12px; padding: 1.4rem 1.6rem; }
.mp-method h3 { font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mp-accent); margin-bottom: .7rem; }
.mp-method ul { margin: 0 0 0 1.1rem; font-size: .92rem; color: var(--mp-text-soft); }
.mp-method li { margin-bottom: .5rem; }
.mp-method a { color: var(--mp-accent); }

/* Footer */
.im-footer { background: var(--im-secondary-bg); border-top: 1px solid var(--im-border); padding: 2rem 1rem; margin-top: 2rem; font-family: 'Inter', sans-serif; color: var(--im-text-secondary); }
.im-footer-content { max-width: 1180px; margin: 0 auto; }
.im-footer-made { text-align: center; margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--im-text-muted); }
.im-footer-made a { color: var(--im-accent); text-decoration: none; }
.im-footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.im-footer-section h4 { color: var(--im-text-primary); font-size: 0.9rem; margin-bottom: 0.75rem; font-weight: 600; }
.im-footer-section ul { list-style: none; }
.im-footer-section li { margin-bottom: 0.4rem; }
.im-footer-section a { color: var(--im-text-secondary); font-size: 0.85rem; text-decoration: none; }
.im-footer-section a:hover { color: var(--im-accent); }
.im-footer-bottom { text-align: center; padding-top: 1rem; border-top: 1px solid var(--im-border); font-size: 0.8rem; color: var(--im-text-muted); }
.im-footer-bottom a { color: var(--im-accent); text-decoration: none; }

@media (max-width: 820px) {
  .mp-stage { grid-template-columns: 1fr; }
  .mp-panel { max-height: none; order: 2; }
  .mp-canvas-wrap { height: 56vh; }
}
