/* ─────────────────────────────────────────────────────────────────
   CU Wire Data — Enterprise Design System
   Bloomberg/PitchBook aesthetic: data-dense, utility-first

   Used by: app.html, dashboard.html, market.html, scorecard.html,
   targeting.html, map.html, login.html, index.html, about.html,
   privacy.html, terms.html, set-password.html, 404.html,
   report.html, cu-network.html, cuso.html, cuso-graph.html

   NOT used by: Wire pages (thecreditunionwire.html, wire-article.html)
   ───────────────────────────────────────────────────────────────── */

/* Reset */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* Keep the basemap subdued without filtering branch markers or attribution. */
.cu-basemap{filter:grayscale(1)}
.dark .cu-basemap{filter:grayscale(1) invert(1) brightness(.8)}

/* ── CSS Variables — Dark Mode Default ── */
:root{
  --font:'IBM Plex Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --display:var(--font);
  --serif:'Newsreader',Georgia,serif;
  /* numeric figures = the mono — Spline Sans Mono has a true plain zero (JetBrains/Plex Mono dot the 0) */
  --num:var(--mono);
  --mono:'Spline Sans Mono','SF Mono',Consolas,monospace;

  --bg:#0b0e11;
  --surface:#141720;
  --surface2:#1a1e2a;
  --surface3:#212636;
  --border:#2a2f3d;
  --border2:#333a4a;
  --text:#e1e4ea;
  --text2:#a8adb8;
  --text3:#6b7280;
  --text4:#4b5060;

  --accent:#5b2b54;
  --accent-dim:rgba(91,43,84,.1);
  --accent-hover:#43203d;
  --gold:#5b2b54;
  --gold-dim:rgba(91,43,84,.08);

  --green:#10b981;
  --green-dim:rgba(16,185,129,.1);
  --red:#ef4444;
  --red-dim:rgba(239,68,68,.1);
  --yellow:#f59e0b;
  --yellow-dim:rgba(245,158,11,.1);
  --blue:#8a5a82;

  --glass:rgba(20,23,32,.97);
  --glow:rgba(91,43,84,.08);
  --r:3px;
}

/* ── Light Mode ── */
.light{
  --bg:#f7f3ec;
  --surface:#fbf8f1;
  --surface2:#efe9de;
  --surface3:#e8ddc6;
  --border:#d9ceba;
  --border2:#e8ddc6;
  --text:#1c1814;
  --text2:#4a4239;
  --text3:#8a7f6f;
  --text4:#b8ad9a;

  --accent:#5b2b54;
  --accent-dim:rgba(91,43,84,.07);
  --accent-hover:#43203d;
  --gold:#5b2b54;
  --gold-dim:rgba(91,43,84,.07);

  --green:#4a6b3f;
  --green-dim:rgba(74,107,63,.10);
  --red:#a33d3d;
  --red-dim:rgba(163,61,61,.08);
  --yellow:#7a5a2a;
  --yellow-dim:rgba(122,90,42,.10);
  --blue:#5b2b54;

  --glass:rgba(251,248,241,.92);
  --glow:rgba(91,43,84,.06);
  --r:6px;
}

/* ── Backward Compatibility — light-default pages ── */
[data-theme="light-default"]{
  --bg:#f7f3ec;--surface:#fbf8f1;--surface2:#efe9de;--surface3:#e8ddc6;
  --border:#d9ceba;--border2:#e8ddc6;
  --text:#1c1814;--text2:#4a4239;--text3:#8a7f6f;--text4:#b8ad9a;
  --accent:#5b2b54;--accent-dim:rgba(91,43,84,.07);--accent-hover:#43203d;
  --gold:#5b2b54;--gold-dim:rgba(91,43,84,.07);
  --green:#4a6b3f;--red:#a33d3d;--yellow:#7a5a2a;--blue:#5b2b54;
  --glass:rgba(251,248,241,.92);--glow:rgba(91,43,84,.06);--r:6px;
}
[data-theme="light-default"].dark{
  --bg:#16110c;--surface:#1f1813;--surface2:#261d17;--surface3:#2e231b;
  --border:#332a1f;--border2:#3d3225;
  --text:#efe7d8;--text2:#c9bfac;--text3:#8a7f6f;--text4:#5e5547;
  --accent:#c4a5be;--accent-dim:rgba(196,165,190,.12);--accent-hover:#d8c0d2;
  --gold:#c4a5be;--gold-dim:rgba(196,165,190,.1);
  --green:#7fa06f;--red:#cf7a7a;--yellow:#c3a06a;--blue:#c4a5be;
  --glass:rgba(31,24,19,.95);--glow:rgba(196,165,190,.1);
}

/* ── Base ── */
html{scroll-behavior:smooth}
body{
  font-family:var(--font);
  color:var(--text);
  font-size:13px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  background:var(--bg);
}

/* ── Headings — editorial display (Fraunces) ── */
h1,h2,h3,h4{font-family:var(--display);font-weight:600;line-height:1.15;letter-spacing:-.01em}

/* ── Animations (minimal) ── */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* ── Focus (Accessibility) ── */
*:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:2px}

/* ── Skip Link ── */
.skip-link{
  position:absolute;top:-100%;left:8px;z-index:9999;
  padding:6px 14px;background:var(--accent);color:#fff;
  font-size:12px;font-weight:700;border-radius:0 0 3px 3px;
  text-decoration:none;transition:top .2s;
}
.skip-link:focus{top:0}

/* ─────────────────────────────────────────────────────────────────
   Navigation — Enterprise Terminal Toolbar
   ───────────────────────────────────────────────────────────────── */
nav{
  display:flex;justify-content:space-between;align-items:center;
  padding:0 24px;height:42px;
  position:sticky;top:0;z-index:100;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}

.site-header{
  display:flex;justify-content:space-between;align-items:center;
  padding:0 24px;height:42px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:100;
}

.logo{
  font-family:var(--display);
  font-size:17px;font-weight:600;
  color:var(--text);text-decoration:none;
  letter-spacing:-.2px;flex-shrink:0;
}
.logo span{color:var(--accent)}

/* Universal Search */
.site-header .header-search{position:relative;flex:1;max-width:400px;margin:0 16px}
.uni-search{width:100%;padding:5px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--r);color:var(--text);font-size:11px;font-family:var(--font);outline:none}
.uni-search:focus{border-color:var(--accent)}
.uni-search::placeholder{color:var(--text4)}
.uni-results{display:none;position:absolute;top:100%;left:0;right:0;margin-top:2px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r);max-height:400px;overflow-y:auto;z-index:200}
.uni-results.open{display:block}
.us-section{border-bottom:1px solid var(--border)}
.us-section:last-child{border-bottom:none}
.us-header{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;background:var(--surface2)}
.us-label{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--accent);font-family:var(--mono)}
.us-viewall{font-size:9px;font-weight:600;color:var(--text4);text-decoration:none}
.us-viewall:hover{color:var(--accent)}
.us-item{display:block;padding:6px 10px;text-decoration:none;transition:background .05s;border-bottom:1px solid var(--border)}
.us-item:last-child{border-bottom:none}
.us-item:hover{background:var(--accent-dim)}
.us-item-name{font-size:12px;font-weight:600;color:var(--text)}
.us-item-meta{font-size:10px;color:var(--text4)}

.nav-right,.header-nav-row{display:flex;align-items:center;gap:6px}

.header-right{display:flex;align-items:center;gap:2px}
.header-right a{
  font-size:11px;color:var(--text3);text-decoration:none;
  font-weight:600;text-transform:uppercase;letter-spacing:.4px;
  padding:10px 10px;border-bottom:2px solid transparent;
  transition:color .1s,border-color .1s;
}
.header-right a:hover{color:var(--text)}
.header-right a.active{color:var(--accent);border-bottom-color:var(--accent)}
.nav-account{font-size:10px!important;opacity:.6;text-transform:uppercase!important}
#signout{opacity:.5}
#signout:hover{opacity:1}
#adminLink{font-size:10px!important;opacity:.5}

.nav-links{display:flex;gap:2px;align-items:center}
.nav-links a{
  color:var(--text3);text-decoration:none;
  font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;
  padding:10px 10px;border-bottom:2px solid transparent;
  transition:color .1s,border-color .1s;
}
.nav-links a:hover{color:var(--text)}
.nav-links a.active{color:var(--accent);border-bottom-color:var(--accent)}

/* Tools dropdown */
.nav-dropdown{position:relative;display:inline-block}
.nav-dropdown-trigger{cursor:pointer}
.nav-dropdown-menu{
  display:none;position:absolute;top:100%;right:0;margin-top:2px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r);
  padding:4px 0;min-width:280px;z-index:200;box-shadow:0 8px 24px rgba(0,0,0,.15);
  flex-direction:column;
}
.nav-dropdown-menu.open{display:flex}
.header-right .nav-dropdown-menu a,
.nav-dropdown-menu a{
  display:block;padding:6px 14px;font-size:11px;color:var(--text2);
  text-decoration:none;font-weight:600;text-transform:uppercase;letter-spacing:.3px;
  white-space:nowrap;border-bottom:none;
}
.header-right .nav-dropdown-menu a:hover,
.nav-dropdown-menu a:hover{background:var(--surface2);color:var(--accent)}
.nav-dropdown-menu .dd-label{display:block;font-size:11px;font-weight:700}
.nav-dropdown-menu .dd-desc{display:block;font-size:10px;font-weight:400;color:var(--text4);text-transform:none;letter-spacing:0;margin-top:1px}
.nav-dropdown-menu a:hover .dd-desc{color:var(--text3)}

.nav-btn{
  padding:6px 14px;background:var(--accent);border-radius:var(--r);
  font-size:11px;text-decoration:none;font-weight:700;color:#fff;
  text-transform:uppercase;letter-spacing:.3px;
  transition:background .15s;
}
.nav-btn:hover{background:var(--accent-hover)}

.dm-toggle{
  background:none;border:1px solid var(--border);border-radius:var(--r);
  min-width:40px;min-height:40px;padding:0 10px;cursor:pointer;font-size:13px;
  color:var(--text4);font-family:var(--font);transition:all .1s;
  display:inline-flex;align-items:center;justify-content:center;line-height:1;
}
.dm-toggle:hover{border-color:var(--accent);color:var(--text2)}

/* Hamburger Menu */
.hamburger{
  display:none;background:none;border:none;
  width:40px;height:40px;min-width:40px;font-size:18px;cursor:pointer;color:var(--text);padding:0;
  align-items:center;justify-content:center;
}
.hamburger.open{transform:rotate(90deg)}

/* ── Mobile Nav ── */
@media(max-width:768px){
  nav,.site-header{padding:0 14px;height:44px}
  .hamburger{display:flex}
  .header-search{display:none}

  .nav-links{
    display:none;position:absolute;top:100%;right:0;left:0;
    flex-direction:column;background:var(--surface);
    border-bottom:1px solid var(--border);padding:8px 14px;gap:0;z-index:99;
  }
  .nav-links.open{display:flex}
  .nav-links a{font-size:12px;padding:10px 0;border-bottom:1px solid var(--border);width:100%}
  .nav-links a:last-child{border-bottom:none}

  /* Mobile nav menu: a solid dropdown panel BELOW the header (was an in-flow wrap with
     no background, so it rendered as transparent text over the page content). */
  .site-header .header-right{
    display:none;position:absolute;top:100%;left:0;right:0;
    flex-direction:column;align-items:stretch;gap:0;background:var(--surface);
    border-bottom:1px solid var(--border);box-shadow:0 10px 22px rgba(28,24,20,.14);
    padding:6px 14px 10px;z-index:99;max-height:calc(100vh - 44px);overflow-y:auto;
  }
  .header-right.open{display:flex}
  .header-right a{justify-content:flex-start;text-align:left}
  .header-right a{
    padding:10px 0;font-size:12px;border-bottom:1px solid var(--border);
    min-height:40px;display:flex;align-items:center;
  }
  .header-right a:last-child{border-bottom:none}

  .nav-dropdown{display:block}
  .nav-dropdown-trigger{display:flex;align-items:center;padding:10px 0;font-size:12px;border-bottom:1px solid var(--border);min-height:40px}
  .nav-dropdown-menu{position:static;border:none;border-radius:0;margin:0;padding:0 0 0 14px;background:transparent;display:none}
  .nav-dropdown-menu.open{display:block}
  .nav-dropdown-menu a{padding:8px 0;font-size:11px;border-bottom:1px solid var(--border)}
  .nav-account{font-size:12px!important;opacity:1!important}
}

/* ── Footer ── */
footer{
  border-top:1px solid var(--border);
  padding:20px 24px;text-align:center;
  font-size:11px;color:var(--text4);
}
footer a{color:var(--text3);text-decoration:none}
footer a:hover{color:var(--accent)}
.footer-disclaimer{
  max-width:600px;margin:0 auto 8px;
  font-size:10px;color:var(--text4);line-height:1.5;
}

/* ── Responsive ── */
@media(max-width:480px){
  body{font-size:13px}
  footer{padding:16px 14px;font-size:10px}
}

/* ── Reduced Motion ── */
@media(prefers-reduced-motion:reduce){
  *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important}
}
