/* ============================================
   Finance FactBase — Global Stylesheet
   Colors: Navy #0f3460 | White #fff | Gray #f8f9fa | Red #e94560
   ============================================ */

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.7;
  color: #222;
  background: #fff;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #0f3460; text-decoration: underline; }
a:hover { color: #e94560; }

/* --- Layout --- */
.container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.wide-container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* --- Header --- */
.site-header {
  background: #0f3460;
  color: #fff;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.site-logo:hover { color: #e94560; }
.site-logo span { color: #e94560; }

/* Navigation */
.main-nav { display: none; }
.main-nav.active { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #0f3460; padding: 1rem; gap: 0.5rem; border-top: 1px solid rgba(255,255,255,0.15); }
.main-nav a { color: #fff; text-decoration: none; padding: 0.4rem 0; font-size: 0.95rem; }
.main-nav a:hover { color: #e94560; }

/* Dropdown "More" menu */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-dropdown-toggle:hover { color: #e94560; }
.nav-dropdown-toggle::after { content: " ▾"; font-size: 0.7rem; }
.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0 0.5rem 1rem;
}
.nav-dropdown.active .nav-dropdown-menu { display: flex; }

.hamburger {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* --- Ad Slots --- */
.ad-slot {
  border: 1px solid #e0e0e0;
  background: #fafafa;
  text-align: center;
  padding: 0.5rem;
  margin: 1.5rem auto;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 0.65rem;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}
.ad-slot-leaderboard { max-width: 728px; min-height: 90px; }
.ad-slot-rectangle { max-width: 300px; min-height: 250px; }

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: #666;
}
.breadcrumbs a { color: #0f3460; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .separator { margin: 0 0.4rem; color: #999; }

/* --- Article Content --- */
.article-header { margin-bottom: 1.5rem; }
.article-header h1 {
  font-size: 1.75rem;
  color: #0f3460;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.article-meta {
  font-size: 0.85rem;
  color: #666;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-body h2 {
  font-size: 1.4rem;
  color: #0f3460;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #e94560;
}
.article-body h3 {
  font-size: 1.15rem;
  color: #333;
  margin: 1.5rem 0 0.5rem;
}
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1rem 1.5rem; }
.article-body li { margin-bottom: 0.3rem; }
.article-body blockquote {
  border-left: 4px solid #e94560;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: #f8f9fa;
  font-style: italic;
  color: #555;
}

/* Feature image */
.feature-image {
  margin: 1rem 0 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}
.feature-image img { width: 100%; }
.feature-image figcaption {
  font-size: 0.8rem;
  color: #888;
  padding: 0.4rem 0;
  text-align: center;
}

/* --- Quick Answer / TL;DR Box --- */
.quick-answer {
  background: #eef4ff;
  border-left: 4px solid #0f3460;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  border-radius: 0 6px 6px 0;
}
.quick-answer strong {
  display: block;
  color: #0f3460;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

/* --- Key Takeaways Box --- */
.takeaways-box {
  background: #f0faf0;
  border: 1px solid #b8e6b8;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 2rem 0;
}
.takeaways-box h3 {
  color: #1a7a1a;
  margin: 0 0 0.75rem;
  border: none;
}
.takeaways-box ul { margin: 0 0 0 1.25rem; }
.takeaways-box li { margin-bottom: 0.4rem; }

/* --- Table of Contents --- */
.toc {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.toc-title {
  font-weight: 700;
  color: #0f3460;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toc-title::after { content: "▾"; font-size: 0.8rem; }
.toc.collapsed .toc-title::after { content: "▸"; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { padding: 0.2rem 0; }
.toc-list a {
  text-decoration: none;
  color: #0f3460;
  font-size: 0.9rem;
}
.toc-list a:hover { color: #e94560; text-decoration: underline; }
.toc.collapsed .toc-list { display: none; }

/* --- Tables --- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.comparison-table th {
  background: #0f3460;
  color: #fff;
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
}
.comparison-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}
.comparison-table tr:nth-child(even) td { background: #f8f9fa; }
.comparison-table tr:hover td { background: #eef4ff; }

/* Table responsive wrapper */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }

/* --- FAQ Accordion --- */
.faq-section { margin: 2rem 0; }
.faq-section h2 { margin-bottom: 1rem; }

.faq-item {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: #f8f9fa;
  border: none;
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f3460;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: inherit;
  line-height: 1.4;
}
.faq-question:hover { background: #eef4ff; }
.faq-question:focus { outline: 2px solid #0f3460; outline-offset: -2px; }
.faq-question:focus:not(:focus-visible) { outline: none; }
.faq-question:focus-visible { outline: 2px solid #0f3460; outline-offset: -2px; }
.faq-question::after { content: "+"; font-size: 1.2rem; flex-shrink: 0; }
.faq-item.active .faq-question::after { content: "−"; }
.faq-answer {
  display: none;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-item.active .faq-answer { display: block; }

/* --- Author Box --- */
.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 2rem 0;
}
.author-avatar {
  width: 56px;
  height: 56px;
  background: #0f3460;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.author-info h4 { color: #0f3460; margin-bottom: 0.2rem; font-size: 0.95rem; }
.author-info p { font-size: 0.85rem; color: #555; margin: 0; }

/* --- Homepage Hero & Section Headings --- */
.hero-section { text-align: center; padding: 2rem 0 1rem; }
.hero-description { max-width: 650px; margin: 0.75rem auto 0; color: #555; }
.section-heading-center { text-align: center; margin-bottom: 0.25rem; color: #0f3460; }
.section-subtext { text-align: center; color: #666; margin-bottom: 1.25rem; font-size: 0.9rem; }
.section-heading-accent { color: #0f3460; }

/* --- Homepage Cluster Cards --- */
.cluster-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.cluster-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: #222;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.cluster-card:hover {
  border-color: #0f3460;
  box-shadow: 0 4px 12px rgba(15,52,96,0.12);
  text-decoration: none;
  color: #222;
}
.cluster-card h3 {
  color: #0f3460;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.cluster-card p {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 0.4rem;
}
.cluster-card .card-meta {
  font-size: 0.78rem;
  color: #888;
}

/* Cluster article cards on pillar pages */
.cluster-articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.article-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.article-card:hover {
  border-color: #0f3460;
  box-shadow: 0 4px 12px rgba(15, 52, 96, 0.12);
}
.article-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: #0f3460;
}
.article-card h3 a {
  color: #0f3460;
  text-decoration: none;
}
.article-card h3 a:hover {
  color: #e94560;
}
.article-card p {
  font-size: 0.88rem;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

/* Featured articles list */
.featured-articles { margin: 2rem 0; }
.featured-articles h2 { margin-bottom: 1rem; }
.featured-list { list-style: none; padding: 0; }
.featured-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}
.featured-list a {
  text-decoration: none;
  color: #0f3460;
  font-weight: 600;
}
.featured-list a:hover { color: #e94560; }
.featured-list .article-snippet {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.2rem;
}

/* --- Pros/Cons --- */
.pros-cons { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.5rem 0; }
.pros, .cons {
  border-radius: 8px;
  padding: 1rem;
}
.pros { background: #f0faf0; border: 1px solid #b8e6b8; }
.cons { background: #fef0f0; border: 1px solid #f0b8b8; }
.pros h4 { color: #1a7a1a; margin-bottom: 0.5rem; }
.cons h4 { color: #c0392b; margin-bottom: 0.5rem; }
.pros ul, .cons ul { margin: 0 0 0 1.25rem; }

/* --- Footer --- */
.site-footer {
  background: #0f3460;
  color: #ccc;
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.88rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: #ccc; text-decoration: none; }
.footer-links a:hover { color: #e94560; }
.footer-copy { color: #888; }

/* --- Responsive: Tablet (768px) --- */
@media (min-width: 768px) {
  .article-header h1 { font-size: 2rem; }
  .cluster-grid { grid-template-columns: repeat(2, 1fr); }
  .cluster-articles { grid-template-columns: repeat(2, 1fr); }
  .pros-cons { grid-template-columns: 1fr 1fr; }
  .main-nav {
    display: flex;
    gap: 1.25rem;
    position: static;
    background: none;
    padding: 0;
    flex-direction: row;
    border: none;
  }
  .hamburger { display: none; }
  .nav-dropdown { position: relative; }
  .nav-dropdown-toggle { color: #fff; font-size: 0.95rem; }
  .nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #0f3460;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0 0 6px 6px;
    padding: 0.5rem 0;
    min-width: 200px;
    flex-direction: column;
    gap: 0;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .nav-dropdown-menu a { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .nav-dropdown-menu a:hover { background: rgba(255,255,255,0.08); }
  .nav-dropdown.active .nav-dropdown-menu { display: flex; }
}

/* --- Responsive: Desktop (1024px) --- */
@media (min-width: 1024px) {
  .article-header h1 { font-size: 2.25rem; }
  .cluster-grid { grid-template-columns: repeat(3, 1fr); }

  .toc {
    position: sticky;
    top: 4rem;
    float: right;
    max-width: 260px;
    margin: 0 0 1rem 1.5rem;
    font-size: 0.85rem;
  }
  .toc.collapsed .toc-list { display: block; }
}

/* --- Print Styles --- */
@media print {
  .site-header, .site-footer, .ad-slot, .hamburger, .toc, .author-box { display: none; }
  body { font-size: 11pt; line-height: 1.5; color: #000; }
  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
  .article-body h2 { border-color: #000; }
  .comparison-table th { background: #ddd; color: #000; }
}
