/* ── Variables ───────────────────────────────────────────────────────────────── */
:root {
  --accent:      #f59e0b;
  --accent-dark: #fbbf24;
  --accent-light:rgba(245,158,11,0.12);
  --bg:          #0f1117;
  --bg-card:     #181e2a;
  --bg-surface:  #1e2535;
  --bg-nav:      #0a0d14;
  --text:        #d1d5db;
  --text-strong: #f1f5f9;
  --text-mid:    #9ca3af;
  --text-dim:    #6b7280;
  --border:      rgba(255,255,255,0.08);
  --border-mid:  rgba(255,255,255,0.14);
  --radius:      8px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-ui:     var(--font);

  --money-color:  #4ade80;
  --health-color: #38bdf8;
  --family-color: #a78bfa;
  --hacks-color:  #f59e0b;
}

/* ── Reset ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 1rem; }
img { max-width: 100%; display: block; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.site-nav {
  background: var(--bg-nav);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--accent);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; height: 56px;
  position: relative;
}
.nav-logo {
  font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em;
  color: #fff; text-decoration: none; white-space: nowrap;
}
.nav-logo span { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 4px;
  margin-left: auto;
}
.bar {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu { margin-left: 2rem; }
.nav-links {
  display: flex; list-style: none; gap: 0.25rem; align-items: center;
}
.nav-links a {
  display: block; padding: 0.35rem 0.75rem; border-radius: 5px;
  font-size: 0.88rem; font-weight: 600;
  color: #d6d3d1; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  background: rgba(245,158,11,0.15); color: var(--accent);
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-nav);
    border-top: 1px solid rgba(255,255,255,0.08);
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 0;
  }
  .nav-menu.open { max-height: 320px; }
  .nav-links { flex-direction: column; align-items: stretch; padding: 0.5rem 1rem 1rem; gap: 0; }
  .nav-links a {
    padding: 0.7rem 0.75rem;
    border-left: 3px solid transparent;
    border-radius: 0;
  }
  .nav-links a.nav-money:hover,  .nav-links a.nav-money[aria-current="page"]  { border-color: var(--money-color);  background: rgba(22,163,74,0.1);  color: #4ade80; }
  .nav-links a.nav-health:hover, .nav-links a.nav-health[aria-current="page"] { border-color: var(--health-color); background: rgba(14,165,233,0.1); color: #38bdf8; }
  .nav-links a.nav-family:hover, .nav-links a.nav-family[aria-current="page"] { border-color: var(--family-color); background: rgba(139,92,246,0.1); color: #a78bfa; }
  .nav-links a.nav-hacks:hover,  .nav-links a.nav-hacks[aria-current="page"]  { border-color: var(--hacks-color);  background: rgba(245,158,11,0.1); color: var(--accent); }
}

/* ── Page shell ──────────────────────────────────────────────────────────────── */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--bg-nav);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900; color: #fff;
  line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { font-size: 1.05rem; color: var(--text-mid); line-height: 1.7; max-width: 560px; margin: 0 auto 1.5rem; }
.hero-cta {
  display: inline-block;
  background: var(--accent); color: #0f1117;
  font-weight: 700; font-size: 0.9rem;
  padding: 0.65rem 1.5rem; border-radius: 6px;
  text-decoration: none; transition: background 0.15s;
}
.hero-cta:hover { background: var(--accent-dark); color: #fff; }

/* ── Category pills ──────────────────────────────────────────────────────────── */
.cat-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 0.2rem 0.6rem; border-radius: 4px; text-decoration: none;
  margin-bottom: 0.5rem;
}
.cat-tag.money   { background: rgba(74,222,128,0.12);  color: #4ade80; }
.cat-tag.health  { background: rgba(56,189,248,0.12);  color: #38bdf8; }
.cat-tag.family  { background: rgba(167,139,250,0.12); color: #a78bfa; }
.cat-tag.hacks   { background: rgba(245,158,11,0.15);  color: #fbbf24; }

/* ── Category section nav ────────────────────────────────────────────────────── */
.cat-nav {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin: 2rem 0;
}
@media (max-width: 640px) { .cat-nav { grid-template-columns: repeat(2, 1fr); } }
.cat-card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 1.2rem 1.4rem; border-radius: var(--radius);
  text-decoration: none; border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.cat-card .cat-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.cat-card .cat-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.cat-card .cat-desc { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.2rem; }

/* ── Article grid ────────────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-dim);
  margin: 2.5rem 0 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.article-grid-home {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card-img { width: 100%; height: 180px; background: var(--bg-surface); }
.card-img:not(:has(img)) { display: none; }
.card-body { padding: 1.2rem; }
.card-body h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.4rem; }
.card-body h3 a { color: var(--text); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent-dark); }
.card-body p { font-size: 0.85rem; color: var(--text-mid); line-height: 1.6; }
.card-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.75rem; display: flex; gap: 0.75rem; }
.card-meta span + span::before { content: "·"; margin-right: 0.75rem; }
.s-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ── Article page layout ─────────────────────────────────────────────────────── */
.article-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }

.breadcrumb {
  font-size: 0.78rem; color: var(--text-dim);
  margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-dark); }

.article-grid {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 2.5rem; align-items: start;
}
@media (max-width: 900px) { .article-grid { grid-template-columns: 1fr; } }

.article-header { margin-bottom: 1.5rem; }
.article-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900; line-height: 1.2;
  letter-spacing: -0.02em; margin-bottom: 0.75rem;
}
.deck {
  font-size: 1.1rem; color: var(--text-mid); line-height: 1.6;
  margin-bottom: 1rem; font-weight: 400;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem;
  font-size: 0.78rem; color: var(--text-dim);
  padding: 0.75rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.disclaimer-notice {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius); padding: 0.85rem 1rem;
  font-size: 0.83rem; color: #fcd34d; margin: 1.25rem 0;
  line-height: 1.6;
}
.article-featured-img {
  width: 100%; height: 320px; background: var(--bg-surface);
  border-radius: var(--radius); margin-bottom: 1.5rem;
}
.article-featured-img:not(:has(img)) { display: none; }

.article-body { font-size: 1rem; line-height: 1.8; color: var(--text); }
.article-body h2 {
  font-size: 1.3rem; font-weight: 800; margin: 2rem 0 0.75rem;
  color: var(--text); letter-spacing: -0.01em;
}
.article-body h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body a { color: var(--accent-dark); }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0; padding: 0.75rem 1.25rem;
  background: var(--accent-light); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text-mid); font-size: 1.05rem;
}
.article-body strong { color: var(--text-strong); }
.article-disclaimer {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius); padding: 0.85rem 1rem;
  font-size: 0.83rem; color: #fcd34d; margin: 2rem 0 1rem;
  line-height: 1.6;
}
.article-disclaimer a { color: #fcd34d; }
.sources-box {
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-dim);
}
.sources-box h3 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.75rem; color: var(--text-dim); }
.sources-box ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.sources-box a { color: var(--text-dim); }
.sources-box a:hover { color: var(--accent); }

.sources-section {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-dim);
}
.sources-section h2 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.75rem; }
.sources-section ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.sources-section a { color: var(--text-dim); }
.sources-section a:hover { color: var(--accent-dark); }

.article-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.5rem; }
.tag {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  background: var(--bg-surface); color: var(--text-dim); text-decoration: none;
}
.tag:hover { background: var(--accent-light); color: var(--accent-dark); }

/* ── Related ─────────────────────────────────────────────────────────────────── */
.related { margin-top: 2.5rem; }
.related h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
@media (max-width: 900px) { .sidebar { display: none; } }
.sidebar-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
}
.widget-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim);
  margin-bottom: 0.85rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.sidebar-links a { font-size: 0.85rem; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.4; }
.sidebar-links a:hover { color: var(--accent-dark); }

/* ── Ad slots ────────────────────────────────────────────────────────────────── */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px dashed var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-dim); font-family: var(--font-ui); font-size: 0.75rem;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.ad-leaderboard { width: 100%; height: 90px; margin: 1.5rem 0; }
.ad-rectangle   { width: 300px; height: 250px; }
.ad-inline      { width: 100%; height: 90px; margin: 2rem auto; max-width: 728px; }
@media (max-width: 767px) { .ad-leaderboard, .ad-inline { height: 60px; } }

/* ── Static pages ────────────────────────────────────────────────────────────── */
.static-page {
  max-width: 720px; margin: 3rem auto;
  padding: 0 1.5rem 4rem;
}
.static-page h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 0.4rem; }
.static-page h2 { font-size: 1.15rem; font-weight: 800; margin: 2rem 0 0.6rem; }
.static-page p, .static-page li { font-size: 0.95rem; line-height: 1.8; color: var(--text-mid); margin-bottom: 0.75rem; }
.static-page ul, .static-page ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.static-page a { color: var(--accent-dark); }
.last-updated { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 2rem; }

/* ── Sitemap ─────────────────────────────────────────────────────────────────── */
.sitemap-section { margin-bottom: 2rem; }
.sitemap-section h2 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 0.75rem; }
.sitemap-links { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.sitemap-links a { font-size: 0.9rem; color: var(--text); text-decoration: none; }
.sitemap-links a:hover { color: var(--accent-dark); text-decoration: underline; }
.s-desc { color: var(--text-dim); font-size: 0.82rem; }

/* ── Section hero ────────────────────────────────────────────────────────────── */
.section-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.section-hero h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 0.4rem; color: var(--text-strong); }
.section-hero p { color: var(--text-mid); font-size: 0.95rem; }

/* ── Article list page ───────────────────────────────────────────────────────── */
.cat-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.cat-header h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 0.4rem; }
.cat-header p { color: var(--text-mid); font-size: 0.95rem; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-nav);
  color: var(--text-mid);
  margin-top: 4rem;
  font-size: 0.85rem;
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem 1.5rem; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; }
@media (max-width: 640px) {
  .footer-top { grid-template-columns: 1fr; }
}
.footer-brand p { font-size: 0.83rem; color: var(--text-dim); margin-top: 0.6rem; line-height: 1.6; max-width: 320px; }
.footer-col h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col a { color: var(--text-mid); text-decoration: none; font-size: 0.83rem; }
.footer-col a:hover { color: var(--accent); }
.footer-disclaimer {
  font-size: 0.78rem; color: var(--text-dim); line-height: 1.7;
  padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.footer-disclaimer a { color: var(--text-mid); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; color: var(--text-dim); }
.footer-bottom a { color: var(--text-mid); }

/* ── Sticky ad bar ───────────────────────────────────────────────────────────── */
#sticky-ad-bar { display: none; }
@media (max-width: 767px) {
  #sticky-ad-bar {
    display: flex; align-items: center; justify-content: center;
    position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
    background: var(--bg-nav); border-top: 1px solid var(--border);
    z-index: 50; padding: 0 0.5rem;
  }
  #sticky-ad-bar .ad-slot {
    border: none; background: transparent;
    height: 50px; width: 320px; max-width: 100%; margin: 0;
  }
}
