/* ──────────────────────────────────────────────
   CourseHeist Blog — Light Clean Theme
   ────────────────────────────────────────────── */

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

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

:root {
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --accent: #e63946;
  --accent-hover: #c1121f;
  --accent-light: #fef2f2;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --article-width: 740px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s ease;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed; top: 0; left: 0;
  width: 0%; height: 3px;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
  z-index: 9999;
  transition: width 0.1s linear;
}

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

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo img { height: 36px; display: block; }
.logo:hover { opacity: 0.85; }

.nav-links {
  display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.nav-links a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-links a:hover { background: var(--border-light); color: var(--accent); }

.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--accent-hover) !important; }

.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px;
}
.hamburger svg { width: 24px; height: 24px; stroke: var(--text); }

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; opacity: 0.5; }

/* ── Article Page ── */
.article-container {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 0 24px 60px;
}

.article-header { margin-bottom: 36px; }

.article-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.article-tag {
  display: inline-flex; align-items: center;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.article-read-time {
  font-size: 13px; color: var(--text-muted);
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── Table of Contents ── */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc-title {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc ol {
  list-style: none; counter-reset: toc;
  padding-left: 0;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 8px;
}
.toc li::before {
  content: counter(toc) ".";
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
  font-size: 13px;
}
.toc a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}
.toc a:hover { color: var(--accent); }

/* ── Article Body ── */
.article-body {
  font-size: 16.5px;
  line-height: 1.75;
  color: #334155;
}
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}
.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.8rem 0 0.8rem;
  color: var(--text);
}
.article-body p { margin-bottom: 1.2rem; }
.article-body ul, .article-body ol {
  margin: 0.8rem 0 1.2rem 1.5rem;
}
.article-body li { margin-bottom: 0.5rem; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover { color: var(--accent-hover); }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 14px;
  overflow-x: auto;
  display: block;
}
.article-body th, .article-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.article-body th {
  background: var(--border-light);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.article-body tr:hover { background: var(--border-light); }

/* ── FAQ Accordion ── */
.faq-section { margin-top: 3rem; }
.faq-section > h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow-sm); }

.faq-question {
  width: 100%; border: none; background: var(--bg-card);
  padding: 16px 20px;
  font-size: 15px; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  text-align: left;
  font-family: var(--font);
  transition: background var(--transition);
}
.faq-question:hover { background: var(--border-light); }
.faq-question::after {
  content: "+";
  font-size: 20px; font-weight: 400;
  color: var(--accent);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 12px;
}
.faq-item.open .faq-question::after {
  content: "−";
}
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
}
.faq-answer-inner {
  padding: 0 20px 16px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Related Articles ── */
.related-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.related-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.related-card .card-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.related-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}
.related-card:hover .card-title { color: var(--accent); }

/* ── CTA Banner ── */
.cta-banner {
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-top: 2.5rem;
}
.cta-banner h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.cta-banner p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}
.cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 14px;
  transition: all var(--transition);
}
.cta-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
  color: var(--accent-hover);
}

/* ── Category Page ── */
.category-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 20px;
}
.category-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}
.category-hero p {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 15px;
}

.articles-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.article-card .card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.article-card .card-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.article-card .card-read {
  font-size: 12px;
  color: var(--text-light);
}
.article-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
  flex: 1;
}
.article-card:hover h2 { color: var(--accent); }
.article-card .card-excerpt {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Home Page ── */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px 40px;
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--accent); }
.hero p {
  max-width: 540px;
  margin: 12px auto 0;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.section-title {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.categories-grid {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}
.cat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.cat-card .cat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.cat-card:hover .cat-name { color: var(--accent); }
.cat-card .cat-count {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand img { height: 30px; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); }
.footer-links h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .header-inner { height: 56px; }
  .logo img { height: 28px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    box-shadow: var(--shadow-md);
  }
  .hamburger { display: block; }
  .hero h1 { font-size: 1.8rem; }
  .article-header h1 { font-size: 1.5rem; }
  .articles-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}
