/* ============================================================
   Finance Analyst Hub — Global Stylesheet
   Dark professional theme — deep navy, clean typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  /* Dark foundation */
  --bg: #0B1120;
  --bg-alt: #111827;
  --bg-hero: #0F172A;

  /* Text */
  --text: #F1F5F9;
  --text-secondary: #CBD5E1;
  --muted: #94A3B8;
  --muted-light: #64748B;

  /* Accent palette */
  --primary: #38BDF8;
  --primary-hover: #7DD3FC;
  --primary-light: rgba(56, 189, 248, 0.1);
  --primary-border: rgba(56, 189, 248, 0.25);

  --accent: #A78BFA;
  --accent-light: rgba(167, 139, 250, 0.1);
  --accent-border: rgba(167, 139, 250, 0.25);

  --success: #34D399;
  --success-light: rgba(52, 211, 153, 0.1);
  --warning: #FBBF24;
  --warning-light: rgba(251, 191, 36, 0.1);

  /* Borders & surfaces */
  --line: #1E293B;
  --line-hover: #334155;
  --panel: #151D2E;
  --panel-hover: #1A2332;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.2);
  --shadow-md: 0 8px 24px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.2);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.25);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

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

html{ scroll-behavior: smooth; }

body{
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{ color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover{ color: var(--primary-hover); }

img{ max-width: 100%; height: auto; }

.container{ max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Top nav ───────────────────────────────── */
header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}
.brand img{
  width: 177px;
  height: 45px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.brand .name{
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand .name strong{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--text);
}
.brand .name span{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.navlinks{
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill{
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.pill:hover{
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Hero sections ─────────────────────────── */
.hero{
  background: var(--bg-hero);
  padding: 56px 0 40px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover{
  border-color: var(--line-hover);
  box-shadow: var(--shadow);
}

.heroMain{
  padding: 36px 32px;
}
.heroMain h1{
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.5px;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kicker{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--primary);
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.sub{
  font-size: 17px;
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 540px;
  line-height: 1.6;
}

/* ── Breadcrumb ────────────────────────────── */
.breadcrumb{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
.breadcrumb .chip{
  font-size: 12px;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-xs);
}
.breadcrumb .sep{ color: var(--muted-light); }

/* ── Chips & badges ────────────────────────── */
.chip{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  background: var(--bg-alt);
  color: var(--muted);
  border: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.chip:hover{
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Section layout ────────────────────────── */
.section{ padding: 48px 0; }

.sectionHead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.sectionHead h2{
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
}

/* ── Content grid ──────────────────────────── */
.heroGrid{
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

/* ── Category cards ────────────────────────── */
.catGrid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.cat{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  overflow: hidden;
  word-break: break-word;
}
.cat:hover{
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.cat h3{
  font-size: 15px;
  font-weight: 600;
}
.cat p{
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.cat .count{
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-top: auto;
}

/* ── Post cards ────────────────────────────── */
.postGrid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.postCard{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  overflow: hidden;
  word-break: break-word;
}
.postCard:hover{
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.postCard h3{
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.postCard p{
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.postCard .meta{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-light);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ── Sidebar ───────────────────────────────── */
.side{
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
}
.side h2{
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* TOC */
.toc ul{ list-style: none; padding-left: 0; }
.toc li{ margin: 6px 0; }
.toc a{
  font-size: 13px;
  color: var(--muted);
  transition: color .15s;
}
.toc a:hover{ color: var(--primary); }
.toc ul ul{ padding-left: 14px; }

/* ── Buttons ───────────────────────────────── */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover{
  background: var(--primary-hover);
  color: var(--bg);
  transform: translateY(-1px);
}
.btn .arrow{ font-size: 16px; }

.btn-outline{
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary-border);
}
.btn-outline:hover{
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Search ────────────────────────────────── */
.search{
  display: flex;
  gap: 8px;
}
.search input{
  flex: 1;
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.search input:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search .btn{ padding: 8px 14px; }

/* ── Article body ──────────────────────────── */
.article-body{ font-size: 16px; line-height: 1.8; color: var(--text-secondary); }
.article-body h2{
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
  letter-spacing: -.2px;
}
.article-body h3{
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}
.article-body p{ margin-bottom: 16px; }
.article-body ul, .article-body ol{ margin: 12px 0 16px 24px; }
.article-body li{ margin-bottom: 6px; }
.article-body blockquote{
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.article-body code{
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 2px 6px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--primary);
}
.article-body pre{
  margin: 16px 0;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.article-body pre code{
  padding: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
}
.article-body table{
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.article-body th, .article-body td{
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}
.article-body th{
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text);
}
.article-body a{ color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover{ color: var(--primary-hover); }

/* ── Masthead image ────────────────────────── */
.masthead-image{
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.masthead-image img{
  display: block;
  width: 100%;
  height: auto;
}

/* ── Author row on post page ──────────────── */
.post-author-row{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.author-avatar{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  flex-shrink: 0;
}
.post-author-info{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.author-name{
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.author-meta{
  font-size: 13px;
  color: var(--muted);
}

/* ── FAQ ───────────────────────────────────── */
.faq h2{
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
details{
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
summary{
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--text);
  background: var(--bg-alt);
  transition: background .15s;
}
summary:hover{ background: var(--panel-hover); }
summary::-webkit-details-marker{ display: none; }
details p{
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Footer ────────────────────────────────── */
footer{
  border-top: 1px solid var(--line);
  padding: 36px 0;
  margin-top: 48px;
  background: var(--bg-alt);
}
.foot{
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
}
.foot div{ display: flex; flex-direction: column; gap: 6px; }
.foot strong{ font-size: 16px; color: var(--text); }
.foot small{ font-size: 13px; color: var(--muted); }
.foot small a{ color: var(--muted); }
.foot small a:hover{ color: var(--primary); }

/* ── Authors page ──────────────────────────── */
.authorGrid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.authorCard{
  display: flex;
  gap: 20px;
  padding: 28px;
}
.authorCard img{
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--line);
}
.authorCard h3{ font-size: 18px; font-weight: 700; }
.authorCard .role{
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.authorCard p{
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px){
  .catGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .postGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heroGrid{ grid-template-columns: 1fr; }
  .side{ position: static; }
}

@media (max-width: 768px){
  .nav{ padding: 12px 0; }
  .brand img{ width: 140px; height: 35px; }
  .brand .name strong{ font-size: 16px; }
  .hero{ padding: 48px 0 24px; }
  .heroMain{ padding: 28px 24px; }
  .heroMain h1{ font-size: 26px; }
  .side{ padding: 20px; }
  .sectionHead{ flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px){
  .catGrid{ grid-template-columns: 1fr; }
  .postGrid{ grid-template-columns: 1fr; }
  .navlinks{ gap: 2px; }
  .pill{ padding: 6px 10px; font-size: 13px; }
  .brand .name{ display: none; }
  .foot{ flex-direction: column; }
  .authorGrid{ grid-template-columns: 1fr; }
  .authorCard{ flex-direction: column; align-items: center; text-align: center; }
}

/* ── Permalink anchors ─────────────────────── */
.toc-link{ font-size: 14px; color: var(--muted-light); margin-left: 6px; text-decoration: none; }
.toc-link:hover{ color: var(--primary); }
