/* ============================================
   ToolScout — Clean SaaS Review Blog
   ============================================ */

:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-text-muted: #78716c;
  --color-accent: #2563eb;
  --color-accent-soft: #eff6ff;
  --color-border: #e7e5e4;
  --color-link: #dc2626;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --max-width: 1100px;
  --content-width: 720px;
}

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

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

a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-text);
  text-decoration: none;
}
.logo span { color: var(--color-accent); }

.site-header nav { display: flex; gap: 28px; }
.site-header nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
.site-header nav a:hover,
.site-header nav a.active {
  color: var(--color-text);
  text-decoration: none;
}

/* ---- Hero ---- */
.hero {
  padding: 80px 0 60px;
  max-width: var(--content-width);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.hero .accent { color: var(--color-accent); }
.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 520px;
}

/* ---- Grid / Cards ---- */
.posts-grid { padding-bottom: 80px; }
.posts-grid h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 24px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.card h3 { font-size: 1.1rem; margin-bottom: 8px; line-height: 1.35; }
.card h3 a { color: var(--color-text); }
.card h3 a:hover { color: var(--color-accent); text-decoration: none; }
.card p { font-size: 0.92rem; color: var(--color-text-muted); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.badge {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Post ---- */
.post {
  max-width: var(--content-width);
  padding: 60px 0 80px;
}
.post-header { margin-bottom: 40px; }
.post-header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.2;
  margin-top: 12px;
}
.post-description {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-top: 12px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.reading-time::before {
  content: "·";
  margin-right: 12px;
}

/* Table of Contents */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc h2 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 12px; }
.toc ul { list-style: none; padding-left: 0; }
.toc li { margin: 6px 0; }
.toc li a { color: var(--color-text-muted); font-size: 0.92rem; }
.toc li a:hover { color: var(--color-accent); }
.toc ul ul { padding-left: 16px; }

/* Post Content */
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 48px 0 16px;
}
.post-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 36px 0 12px;
}
.post-content p { margin-bottom: 20px; }
.post-content ul, .post-content ol {
  margin: 0 0 20px 24px;
}
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--color-accent-soft);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
}
.post-content th, .post-content td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
}
.post-content th {
  background: var(--color-bg);
  font-weight: 600;
}
.post-content a { text-decoration: underline; }

/* CTA box for affiliate links */
.cta-box {
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}
.cta-box h3 { margin-bottom: 8px; }
.cta-box .btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  margin-top: 12px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.cta-box .btn:hover { opacity: 0.9; text-decoration: none; }

/* Disclosure */
.disclosure {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 40px 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Post footer / tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.post-tags a {
  background: var(--color-bg);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Related */
.related-posts {
  max-width: var(--content-width);
  padding-bottom: 80px;
}
.related-posts h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 20px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  list-style: none;
}
.page-item a, .page-item span {
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 0.9rem;
}
.page-item.active span { background: var(--color-accent); color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .post-header h1 { font-size: 1.8rem; }
  .grid { grid-template-columns: 1fr; }
  .site-header nav { gap: 16px; }
  .site-header nav a { font-size: 0.82rem; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 36px; }
  .site-header nav { display: none; } /* hamburger would go here */
}
