/* Shared stylesheet for content pages (blog articles, tool landing
   pages, about, terms). Uses the same dark design tokens as the main
   SPA in index.html but optimised for long-form reading.
   ---------------------------------------------------------------- */

:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel2: #1d2230;
  --border: #2a3142;
  --text: #e6e9ef;
  --muted: #8a93a6;
  --accent: #4f8cff;
  --accent2: #7a5cff;
  --ok: #3ecf8e;
  --warn: #ffb454;
  --err: #ff6b6b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Site header (shared with main SPA in visual feel) ---- */
.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: linear-gradient(180deg, #1a1f2b, #141823);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.2px;
}
.site-header .brand:hover { color: var(--accent); }
.site-header nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.12s;
}
.site-header nav a:hover,
.site-header nav a.active {
  color: var(--text);
}
.site-header .grow { flex: 1; }

/* ---- Main content layout ---- */
main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
@media (max-width: 720px) {
  main { padding: 32px 18px 56px; }
}

article.post,
.page {
  font-size: 17px;
  line-height: 1.7;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.25;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-top: 0;
  letter-spacing: -0.02em;
}
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 20px; }
h4 { font-size: 17px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

p { margin: 1em 0; color: var(--text); }
p.lead {
  font-size: 19px;
  color: var(--muted);
  margin: 0.6em 0 1.8em;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 140, 255, 0.35);
  transition: color 0.12s, border-color 0.12s;
}
a:hover {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
}

ul, ol { padding-left: 1.4em; margin: 1em 0; }
li { margin: 0.4em 0; }

strong { color: var(--text); font-weight: 700; }
em { color: var(--text); }

/* ---- Code blocks ---- */
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: #c7d2fe;
}
pre {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 1.4em 0;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* ---- Blockquote ---- */
blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  color: var(--muted);
  font-style: normal;
  border-radius: 0 8px 8px 0;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--panel2);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: 0; }

/* ---- Meta line (author, date, reading time) ---- */
.post-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  margin: 0.4em 0 2em;
}
.post-meta .dot { color: var(--border); }

/* ---- Card grid (for blog index & tools index) ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.card {
  display: block;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel2);
  color: var(--text);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--text);
  letter-spacing: 0;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.card .tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

/* ---- Callout boxes ---- */
.callout {
  margin: 1.6em 0;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.callout.info { border-left: 3px solid var(--accent); }
.callout.warn { border-left: 3px solid var(--warn); }
.callout.tip  { border-left: 3px solid var(--ok); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child  { margin-bottom: 0; }

/* ---- Tool embed link (CTA in tool pages) ---- */
.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0b0f1a;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 0;
  margin: 12px 0;
  transition: transform 0.12s, background 0.12s;
}
.tool-cta:hover {
  background: #7aabff;
  color: #0b0f1a;
  border-bottom: 0;
  transform: translateY(-1px);
}
.tool-cta::after { content: "→"; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  background: var(--panel);
}
.site-footer nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
  justify-content: center;
}
.site-footer nav a { color: var(--muted); border-bottom: 0; }
.site-footer nav a:hover { color: var(--text); }
.site-footer .copy { display: block; margin-top: 4px; }

/* ---- Misc helpers ---- */
.tag-pill {
  display: inline-block;
  padding: 2px 10px;
  background: var(--panel2);
  color: var(--muted);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--mono);
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}
.toc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 22px;
  margin: 1.8em 0;
  font-size: 15px;
}
.toc h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: 4px 0; }
.toc a { border-bottom: 0; color: var(--accent); }
.toc a:hover { color: var(--accent2); }
