/* KeepRule Blog - Dark Investment Theme */
:root {
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #60a5fa;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --green: #10b981;
  --border: #1f2937;
  --border-light: #374151;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }

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

/* Header */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(17, 24, 39, 0.95);
}

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

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo span { color: var(--accent); }

.header-nav { display: flex; gap: 1.5rem; align-items: center; }
.header-nav a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.header-nav a:hover { color: var(--text-primary); }

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff !important;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.cta-btn:hover { background: var(--accent-hover); transform: translateY(-1px); color: #fff !important; }

.cta-btn-gold {
  background: linear-gradient(135deg, var(--gold), #d97706);
}
.cta-btn-gold:hover { background: linear-gradient(135deg, #d97706, #b45309); }

/* Article Layout */
.article-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
}

@media (max-width: 900px) {
  .article-container { grid-template-columns: 1fr; padding: 1rem; }
}

/* Table of Contents Sidebar */
.toc-sidebar {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-right: 1rem;
}

.toc-sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.toc-sidebar ul { list-style: none; }
.toc-sidebar li { margin-bottom: 0.4rem; }
.toc-sidebar a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  padding: 0.3rem 0.75rem;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
.toc-sidebar a:hover,
.toc-sidebar a.active {
  color: var(--accent-light);
  border-left-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.toc-sidebar .toc-h3 { padding-left: 1.5rem; font-size: 0.8rem; }

@media (max-width: 900px) {
  .toc-sidebar { display: none; }
  .toc-mobile { display: block !important; }
}

.toc-mobile {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}
.toc-mobile summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
}
.toc-mobile ul { list-style: none; margin-top: 0.75rem; }
.toc-mobile li { margin-bottom: 0.3rem; }
.toc-mobile a { color: var(--text-secondary); font-size: 0.9rem; }

/* Article Content */
.article-content { min-width: 0; }

.article-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.article-breadcrumb a { color: var(--text-muted); }
.article-breadcrumb a:hover { color: var(--accent-light); }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-meta span { display: flex; align-items: center; gap: 0.3rem; }

.article-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 3rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.article-content p { margin-bottom: 1.25rem; color: var(--text-secondary); }

.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}
.article-content li { margin-bottom: 0.5rem; }

.article-content strong { color: var(--text-primary); }

.article-content blockquote {
  border-left: 4px solid var(--gold);
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-weight: 600;
  color: var(--gold);
  font-size: 0.9rem;
}

/* Info Boxes */
.info-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.info-box.tip { border-left: 4px solid var(--green); }
.info-box.warning { border-left: 4px solid var(--gold); }
.info-box.cta-box { border-left: 4px solid var(--accent); background: rgba(59, 130, 246, 0.05); }

.info-box h4 { color: var(--text-primary); margin-bottom: 0.75rem; font-size: 1.05rem; }
.info-box p { margin-bottom: 0.5rem; }

/* CTA Sections */
.cta-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 2rem;
  margin: 2.5rem 0;
  text-align: center;
}

.cta-section h3 { color: var(--text-primary); margin-bottom: 0.75rem; }
.cta-section p { color: var(--text-secondary); margin-bottom: 1.25rem; }

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.article-content th, .article-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-content th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.article-content td { color: var(--text-secondary); }

.article-content tr:hover td { background: rgba(59, 130, 246, 0.03); }

/* Related Articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-articles h2 { border-top: none; padding-top: 0; margin-top: 0; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.related-card h4 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.related-card h4 a { color: var(--text-primary); }
.related-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-col h4 { color: var(--text-primary); margin-bottom: 1rem; font-size: 0.95rem; }
.footer-col p { color: var(--text-muted); font-size: 0.85rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-col a:hover { color: var(--accent-light); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Index Page */
.hero-section {
  text-align: center;
  padding: 5rem 2rem 4rem;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-section p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.articles-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-tag {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-card h2 a { color: var(--text-primary); }
.article-card h2 a:hover { color: var(--accent-light); }

.article-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* FAQ Schema Styling */
.faq-section { margin-top: 2rem; }

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '-';
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 600px) {
  .hero-section h1 { font-size: 2rem; }
  .article-content h1 { font-size: 1.8rem; }
  .article-content h2 { font-size: 1.4rem; }
  .articles-grid { grid-template-columns: 1fr; padding: 1rem; }
  .header-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Number list styling */
.numbered-list { counter-reset: item; list-style: none; padding-left: 0; }
.numbered-list li { counter-increment: item; padding-left: 2.5rem; position: relative; margin-bottom: 1rem; }
.numbered-list li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--accent);
  color: #fff;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Book/Strategy Cards */
.book-card, .strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.book-card:hover, .strategy-card:hover { border-color: var(--accent); }
.book-card h4, .strategy-card h4 { margin-bottom: 0.5rem; color: var(--text-primary); }
.book-card .author { color: var(--gold); font-size: 0.9rem; margin-bottom: 0.5rem; }
