/* Applimate Blog — shared stylesheet.
   Design tokens copied from web/index.html's :root to keep the blog
   visually consistent with the main site. Source file lives here in
   templates/; the build script copies it verbatim to
   web/blog/assets/blog.css (generated output, not hand-edited). */

:root {
  --void:         #0a0726;
  --deep:         #0d0530;
  --pulse:        #2d0a8c;
  --glow:         #7dd8ff;
  --bright:       #c4f0ff;
  --white:        #f0f8ff;
  --muted:        rgba(196, 240, 255, 0.45);
  --glass-bg:     rgba(125, 216, 255, 0.04);
  --glass-mid:    rgba(125, 216, 255, 0.07);
  --glass-border: rgba(125, 216, 255, 0.14);

  --font-display: 'Chakra Petch', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

/* ─── Header ─────────────────────────────────────────────────── */
.b-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  max-width: 860px;
  margin: 0 auto;
}
.b-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--white);
}
.b-logo:hover { text-decoration: none; color: var(--bright); }
.b-logo-icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.b-nav-link {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ─── Breadcrumbs ────────────────────────────────────────────── */
.b-breadcrumbs {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.b-breadcrumbs a { color: var(--muted); }
.b-breadcrumbs a:hover { color: var(--glow); }
.b-breadcrumbs .sep { margin: 0 0.4em; opacity: 0.5; }
.b-breadcrumbs [aria-current="page"] { color: var(--bright); }

/* ─── Article ────────────────────────────────────────────────── */
.b-article-main, .b-index-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}
.b-article-category a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--glow);
}
.b-article-main h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
}
.b-article-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.b-toc {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.b-toc-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bright);
  margin: 0 0 0.75rem;
}
.b-toc ul { list-style: none; margin: 0; padding: 0; }
.b-toc li { margin: 0.4rem 0; }
.b-toc li.b-toc-h3 { padding-left: 1.25rem; font-size: 0.9375rem; }

/* ─── Category banner ────────────────────────────────────────── */
.b-category-banner {
  margin: 0 0 1.5rem;
  height: 168px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 30%, rgba(125, 216, 255, 0.18), transparent 55%),
    linear-gradient(135deg, var(--pulse), var(--void) 75%);
}
.b-category-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(125, 216, 255, 0.05) 0px, rgba(125, 216, 255, 0.05) 1px, transparent 1px, transparent 28px);
}
.b-category-banner svg { position: relative; z-index: 1; width: 84px; height: 84px; color: var(--bright); }
.b-banner-cat {
  position: absolute;
  z-index: 1;
  bottom: 0.9rem;
  left: 1.25rem;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bright);
}

/* ─── Key takeaways ──────────────────────────────────────────── */
.b-takeaways {
  border: 1px solid var(--glass-border);
  background: var(--glass-mid);
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 2rem;
}
.b-takeaways-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  margin: 0 0 0.6rem;
}
.b-takeaways ul { margin: 0; padding-left: 1.1rem; }
.b-takeaways li { font-size: 0.9375rem; color: var(--bright); margin-bottom: 0.4rem; }
.b-takeaways li:last-child { margin-bottom: 0; }

/* ─── How Applimate helps ────────────────────────────────────── */
.b-content .b-applimate-helps {
  border: 1px solid var(--glass-border);
  background: var(--glass-mid);
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0;
}
.b-content .b-applimate-helps-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glow);
  margin: 0 0 0.6rem;
}
.b-content .b-applimate-helps p { font-size: 0.9375rem; margin: 0; }

.b-content { font-size: 1.0625rem; }
.b-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
}
.b-content h2:first-child { border-top: none; padding-top: 0; }
.b-content h3 {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  margin: 1.75rem 0 0.75rem;
}
.b-content p { margin: 0 0 1.25rem; color: var(--white); }
.b-content ul, .b-content ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.b-content li { margin: 0.4rem 0; }
.b-content li.task-item {
  list-style: none;
  margin-left: -1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.b-content li.task-item input[type="checkbox"] {
  order: -1;
  accent-color: var(--glow);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.b-content li.task-item .task-text { flex: 1; min-width: 0; }

/* Pull-quote: a highlighted line of our own writing, distinct from
   the plain blockquote above (used for quoting external source terms). */
.b-content p.pullquote {
  margin: 2rem 0;
  padding: 0 0 0 1.1rem;
  border-left: 3px solid var(--glow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--bright);
}
.b-content blockquote {
  border-left: 3px solid var(--glow);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--muted);
}
.b-content code {
  font-family: var(--font-mono);
  background: var(--glass-mid);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}
.b-content pre {
  background: var(--glass-mid);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
.b-content pre code { background: none; padding: 0; }
.b-content img { max-width: 100%; border-radius: 8px; }
.b-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; }
.b-content th, .b-content td {
  border: 1px solid var(--glass-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.9375rem;
}
.b-content th { background: var(--glass-bg); font-family: var(--font-display); }

/* ─── Share ──────────────────────────────────────────────────── */
.b-share {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
}
.b-share-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bright);
  margin: 0 0 0.75rem;
}
.b-share-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.b-share-btn {
  display: inline-block;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
}
.b-share-btn:hover { background: var(--glass-mid); text-decoration: none; color: var(--glow); }

/* ─── Related articles ───────────────────────────────────────── */
.b-related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}
.b-related-label {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bright);
  margin: 0 0 1rem;
}
.b-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.b-related-card {
  display: block;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  color: var(--white);
}
.b-related-card:hover { background: var(--glass-mid); text-decoration: none; }
.b-related-card .b-related-cat {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--glow);
}
.b-related-card h3 { font-size: 0.9375rem; margin: 0.4rem 0 0; line-height: 1.4; }

/* ─── Prev / next ────────────────────────────────────────────── */
.b-prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.9375rem;
}
.b-prev-next .b-nav-empty { flex: 1; }
.b-prev-next a { flex: 1; }
.b-prev-next .b-next { text-align: right; }
.b-prev-next .b-dir-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Blog index / category listing ─────────────────────────── */
.b-index-main h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0.5rem 0 0.5rem;
}
.b-index-intro { color: var(--muted); margin-bottom: 2rem; }

.b-cat-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2.5rem; padding: 0; list-style: none; }
.b-cat-list a {
  display: inline-block;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
  font-family: var(--font-display);
}
.b-cat-list a:hover { background: var(--glass-mid); text-decoration: none; }

.b-article-list { list-style: none; margin: 0; padding: 0; }
.b-article-list li {
  border-bottom: 1px solid var(--glass-border);
  padding: 1.5rem 0;
}
.b-article-list li:first-child { padding-top: 0; }
.b-article-list a.b-title-link {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--white);
}
.b-article-list a.b-title-link:hover { color: var(--glow); text-decoration: none; }
.b-article-list .b-list-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.35rem 0 0.5rem;
}
.b-article-list .b-list-desc { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.b-article-list .b-read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--glow);
}
.b-article-list .b-read-more:hover { text-decoration: underline; }

/* ─── Footer ─────────────────────────────────────────────────── */
.b-footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--glass-border);
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

@media (max-width: 600px) {
  .b-prev-next { flex-direction: column; }
  .b-prev-next .b-next { text-align: left; }
}
