/* blog.css — shared styles for the HighRank blog. Reuses tokens from landing.css. */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --ink: #0e120f;
  --ink-soft: #3a3f3a;
  --ink-muted: #757870;
  --paper: #fbfaf6;
  --paper-card: #ffffff;
  --rule: #e4ddc9;
  --rule-soft: #ece7d5;
  --accent: #156b3b;
  --accent-deep: #0e5a30;
  --accent-soft: #e7f4eb;
  --sans: 'Inter', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

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

.blog-nav {
  padding: 24px clamp(20px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.blog-nav .brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.blog-nav .brand em { font-style: italic; color: var(--accent); }
.blog-nav .nav-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}
.blog-nav .nav-cta:hover { background: #000; text-decoration: none; }

.blog-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 24px) 96px;
}

.blog-kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-block;
}

article h1 {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 16px;
  color: var(--ink);
}
article h1 em { font-style: italic; color: var(--accent); }

article .meta {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

/* Hero image — Gemini-generated, sits at the top of the article */
article .blog-hero {
  margin: 0 0 40px 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper-card);
  border: 1px solid var(--rule);
}
article .blog-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

article p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 20px;
}
article h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 48px 0 12px;
  color: var(--ink);
}
article h2 em { font-style: italic; color: var(--accent); }
article h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 32px 0 8px;
  font-weight: 400;
}
article ul, article ol { padding-left: 24px; margin: 0 0 20px; }
article li { margin-bottom: 8px; }
article li::marker { color: var(--accent); }
article strong { font-weight: 600; color: var(--ink); }
article code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  padding: 2px 6px;
  border-radius: 4px;
}
article blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-soft);
}

/* Comparison tables — generator emits these when weighing tools/options */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.9375rem;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
article thead { background: var(--accent-soft); }
article th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
article td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink);
}
article tbody tr:last-child td { border-bottom: none; }
article tbody tr:hover { background: var(--paper); }

/* Mermaid diagrams render client-side; give the container some breathing room */
article pre.mermaid {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px;
  margin: 28px 0;
  text-align: center;
  overflow-x: auto;
}
article pre.mermaid svg { max-width: 100%; height: auto; }

/* Mobile: tables get a horizontal scroll wrapper instead of squishing */
@media (max-width: 600px) {
  article table { display: block; overflow-x: auto; white-space: nowrap; }
}

.faq-section {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.faq-section h2 { margin-top: 0; }
.faq-section details {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 8px;
}
.faq-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after { content: '+'; color: var(--accent); font-size: 1.5rem; line-height: 1; }
.faq-section details[open] summary::after { content: '−'; }
.faq-section details[open] summary { margin-bottom: 12px; }
.faq-section details p {
  font-size: 0.9375rem;
  margin: 0;
  color: var(--ink-soft);
}

.cta-card {
  margin-top: 56px;
  padding: 32px clamp(24px, 4vw, 40px);
  background: linear-gradient(135deg, #ffffff 0%, var(--paper) 100%);
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(21,107,59,0.08);
}
.cta-card h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.cta-card p { font-size: 0.9375rem; color: var(--ink-soft); margin-bottom: 16px; }
.cta-card a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
}
.cta-card a:hover { background: var(--accent-deep); text-decoration: none; }

.blog-foot {
  border-top: 1px solid var(--rule);
  padding: 24px clamp(20px, 4vw, 48px);
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.blog-foot a { color: var(--ink-muted); }

/* Blog index page */
.post-list {
  display: grid;
  gap: 14px;
  margin-top: 40px;
}
.post-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 24px 28px;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s, background 0.15s;
  position: relative;
  cursor: pointer;
}
.post-card:hover {
  border-color: var(--ink);
  background: #fffefa;
  box-shadow: 0 10px 28px rgba(14, 18, 15, 0.09);
  transform: translateY(-2px);
}
/* Subtle "→" affordance that fades in on hover */
.post-card::after {
  content: '→';
  position: absolute;
  top: 24px;
  right: 28px;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.post-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}
/* Make the whole card clickable via the title anchor expanding to fill it.
   This also removes any doubt about which post the metadata belongs to. */
.post-card h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
}
.post-card .meta-row {
  font-size: 0.6875rem;
  color: var(--ink-muted);
  margin-bottom: 10px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}
.post-card h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0 0 10px;
}
.post-card h2 a {
  color: var(--ink);
  position: relative;
  z-index: 1;
}
.post-card h2 a:hover { color: var(--accent); text-decoration: none; }
.post-card p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0;
}

/* Blog index header — give it room to breathe so it doesn't crowd the first card */
.blog-container > .blog-kicker { margin-bottom: 16px; }
.blog-container > h1 { margin-bottom: 16px; }
.blog-container > p { margin-bottom: 8px; }
