/* ════════════════════════════════════════════════════════════════════ */
/*  common.css — shared chrome and design system                         */
/*                                                                       */
/*  Loaded on every page via base.html. Contains:                        */
/*    - Design tokens (color palette, typography, severity, icon)        */
/*    - Reset & base body/anchor rules                                   */
/*    - Nav bar styles                                                   */
/*    - Term tooltip + popover styles                                    */
/*                                                                       */
/*  Page-specific styles live in search.css and report.css.              */
/* ════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════ */
/*  DESIGN TOKENS — Modern Slate          */
/* ═══════════════════════════════════════ */
:root {
  --primary:    #1B3A4B;
  --secondary:  #4A7C8F;
  --accent:     #E97132;
  --surface:    #FFFFFF;
  --muted:      #8899A4;
  --border:     #E0E7EB;
  --bg-subtle:  #F4F7F9;
  --bg-page:    #FFFFFF;
  --text:       #2D3A40;
  --text-light: #6B7B85;

  /* Grade colors */
  --grade-a-circle:  #C1E5F5;
  --grade-a-letter:  #E97132;
  --grade-b-circle:  #83CBEB;
  --grade-b-letter:  #78206E;
  --grade-c-circle:  #46B1E1;
  --grade-c-letter:  #0E2841;
  --grade-d-circle:  #104862;
  --grade-d-letter:  #D9D9D9;
  --grade-bd-circle: #595959;
  --grade-bd-letter: #FFFFFF;

  /* Severity dots */
  --sev-high:   #1B3A4B;
  --sev-medium: #4A7C8F;
  --sev-low:    #97B8C6;
  --sev-info:   #D0DDE3;

  /* Section icon badges — Editorial palette, dark → light */
  --icon-01: #0E2841;
  --icon-02: #1A3B5B;
  --icon-03: #264F74;
  --icon-04: #33628A;
  --icon-05: #3F7598;
  --icon-06: #4D84A2;
  --icon-07: #5C8FA6;
  --icon-08: #6B8D9E;
  --icon-09: #7A8B96;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body:    'IBM Plex Sans', sans-serif;
}

/* ═══════════════════════════════════════ */
/*  RESET & BASE                          */
/* ═══════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════ */
/*  NAV BAR                               */
/* ═══════════════════════════════════════ */
.nav-bar {
  background: var(--primary);
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: #FFFFFF;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
}
.nav-brand a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
}
.nav-brand-text {
  display: inline-block;
  /* sup positioning is handled below */
}
.nav-brand sup {
  font-size: 0.55em;
  vertical-align: super;
  font-weight: 400;
  opacity: 0.7;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: #FFFFFF; }
/* Active state: indicates the current page. Set by base.html via Jinja
   conditional comparing request.endpoint against each link's target.
   Visual: short vertical accent-orange bar in the gutter to the left
   of the link, plus full-white link text. The bar is a pseudo-element
   so it doesn't shift sibling layout. */
.nav-links a.active { color: #FFFFFF; }
.nav-links a.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 14px;
  background: var(--accent);
  border-radius: 1px;
}

/* Search-for-an-adviser pill CTA — scaled-down version of the
   .hook-cta pill from /fees ("Curious about your own adviser?"
   card). Sits as the FIRST child of .nav-links on every page EXCEPT
   /home (conditionally rendered in base.html via request.endpoint).
   Gives users on any non-home page a one-click path back to the
   firm search.

   Standalone class — no parent dependency — so it works wherever
   it's placed in the nav. text-decoration: none on :hover is
   explicit so it beats the global `a:hover { text-decoration:
   underline }` declaration. */
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.1px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s;
}
.nav-cta:hover {
  background: #D85F22;
  color: var(--primary);
  text-decoration: none;
}
@media (max-width: 760px) {
  .nav-cta {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

/* ═══════════════════════════════════════ */
/*  TERM TOOLTIP + POPOVER                */
/* ═══════════════════════════════════════ */
.term-tip {
  border-bottom: 1.5px dotted var(--primary);
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
#term-popover {
  display: none;
  position: absolute;
  z-index: 9999;
  width: 280px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  padding: 14px 16px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
#term-popover.visible { display: block; }
#term-popover-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 7px;
}
#term-popover-close {
  position: absolute;
  top: 8px; right: 10px;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
}
#term-popover-close:hover { color: var(--text); }

/* ═══════════════════════════════════════ */
/*  FOOTER (sitewide chrome)              */
/* ═══════════════════════════════════════ */
.footer {
  max-width: 1120px;
  margin: 80px auto 0;
  padding: 32px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
.footer-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 6px;
}
.footer-legal {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 400px;
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  text-align: center;
  padding: 20px 40px 32px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .footer { flex-direction: column; }
}
