/* ================================================================
   The Market Brief Daily — Shared Site CSS
   Authoritative base styles, CSS variables, header/nav, footer.
   All pages link to this file; page-specific styles go inline.
   ================================================================ */

/* ── Google Fonts ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0b1220;
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── CSS Custom Properties ─────────────────────────────────────── */
:root {
  --accent:    #0066ff;
  --accent2:   #0ea5e9;
  --ink:       #0b1220;
  --muted:     rgba(11,18,32,.62);
  --muted2:    rgba(11,18,32,.42);
  --line:      rgba(11,18,32,.10);
  --scrollbar-thumb: rgba(11,18,32,.22);
  --mono:      ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  --shadow-md: 0 8px 22px rgba(2,8,23,.10);
  --shadow-lg: 0 18px 50px rgba(2,8,23,.12);
  --shadow-xl: 0 28px 80px rgba(2,8,23,.14);
  --ease:      cubic-bezier(.2,.9,.2,1);
  --max:       1200px;
  --headerH:   64px;
}
@media (max-width: 768px) { :root { --headerH: 56px; } }

/* ── Header / Nav ──────────────────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--headerH);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
  box-shadow: var(--shadow-md);
  padding: 0 48px;
}
.header-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s;
  cursor: pointer;
}
.brand:hover { opacity: .75; }

nav {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
nav a {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  cursor: pointer;
}
nav a:hover,
nav a.active { color: var(--ink); }
nav a.active  { font-weight: 900; }

/* ── Dropdown nav item ─────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown > .nav-drop-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  /* match anchor line-height */
  line-height: inherit;
  font-family: inherit;
}
.nav-dropdown > .nav-drop-toggle:hover,
.nav-dropdown > .nav-drop-toggle.active { color: var(--ink); }
.nav-dropdown > .nav-drop-toggle.active  { font-weight: 900; }
.nav-drop-toggle .drop-caret {
  display: inline-block;
  width: 10px;
  height: 10px;
  position: relative;
  flex-shrink: 0;
  transition: transform .2s;
}
.nav-drop-toggle .drop-caret::before {
  content: '';
  position: absolute;
  top: 2px; left: 1px;
  border: 4px solid transparent;
  border-top-color: currentColor;
}
/* rotate caret when open */
.nav-dropdown.open > .nav-drop-toggle .drop-caret {
  transform: rotate(-180deg);
}

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 190px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(2,8,23,.12), 0 2px 8px rgba(2,8,23,.06);
  padding: 6px;
  z-index: var(--z-dropdown, 100);
  /* pop-in animation */
  opacity: 0;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.nav-dropdown.open .nav-drop-menu {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-drop-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-drop-menu a:hover { background: rgba(0,102,255,.06); color: var(--ink); }
.nav-drop-menu a.active { color: var(--ink); font-weight: 900; }
.nav-drop-menu .drop-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(0,102,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-drop-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}

@media (max-width: 768px) {
  header { padding: 0 14px; }
  .header-inner { gap: 10px; }
  .brand {
    flex: 0 1 auto;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  nav {
    flex: 1 1 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    min-width: 0;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
  }
  nav::-webkit-scrollbar { height: 4px; }
  nav::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
  }
  .nav-dropdown > .nav-drop-toggle { display: none; }
  .nav-drop-menu {
    position: static;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-drop-menu a {
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    background: transparent;
  }
  .nav-drop-menu a:hover,
  .nav-drop-menu a.active {
    color: var(--ink);
    font-weight: 900;
  }
  .nav-drop-menu .drop-icon,
  .nav-drop-divider { display: none; }
}

/* ── Footer ────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  background: #f9fafb;
  padding: 48px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-col h4 {
  font-weight: 950;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color .2s;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  max-width: var(--max);
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 768px) {
  footer { padding: 48px 20px; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ── Common Utilities ──────────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; }

.kicker {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 950;
  text-decoration: none;
  transition: all .35s var(--ease);
  border: 1px solid var(--line);
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: #fff;
  border-color: rgba(0,102,255,.35);
  box-shadow: 0 14px 40px rgba(0,102,255,.25);
}
.btn.primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 60px rgba(0,102,255,.32);
}
.btn.ghost {
  background: rgba(255,255,255,.75);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(2,8,23,.10);
}
.btn.ghost:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(2,8,23,.14);
}
@media (max-width: 768px) { .btn { width: 100%; } }
