/*
 * Backed brand overlay for the self-hosted Ghost blog (Casper theme).
 *
 * Loaded by the /blog/* proxy (app/blog/[[...slug]]/route.ts) as an extra
 * stylesheet on top of Casper's own screen.css — it never replaces Casper's
 * CSS, only overrides a handful of its custom properties and layers a few
 * new rules on top. Keep it additive: if a selector below doesn't exist in
 * the live theme, it should just be inert, not break layout.
 *
 * Casper is light-only by default; we deliberately keep it that way even in
 * dark OS/browser mode so the guard below is a no-op unless Casper itself
 * grows a dark variant later.
 */

:root {
  --color-primary-text: #1c1c1e;
  --color-secondary-text: #71727a;
  --color-light-gray: #e6e8ec;
  --color-mid-gray: #d6d9e0;
  --primary-text-color: #1c1c1e;
  --secondary-text-color: #71727a;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --bk-accent: #006fFD;
  --bk-accent-ink: #ffffff;
  --bk-panel-bg: #f6f8fb;
  --bk-border: #e6e8ec;
  --bk-radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    /* Casper ships light-only; keep the same light palette regardless of
       the visitor's OS theme so nothing renders half-styled. */
    --color-primary-text: #1c1c1e;
    --color-secondary-text: #71727a;
    --bk-panel-bg: #f6f8fb;
    --bk-border: #e6e8ec;
  }
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-primary-text);
  background: #ffffff;
}

/* Header */
.gh-head {
  border-bottom: 1px solid var(--bk-border);
}

.gh-head-menu a,
.gh-head-menu .nav a {
  font-weight: 500;
  color: var(--color-primary-text);
}

.gh-head-logo {
  color: var(--color-primary-text);
}

/* Links */
a {
  color: var(--bk-accent);
}

a:hover {
  color: var(--bk-accent);
  opacity: 0.85;
}

/* Post cards on the index / tag pages */
.post-card,
.post-feed > article.post {
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover,
.post-feed > article.post:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(28, 28, 30, 0.08);
}

.post-card-image,
.post-media img,
.post-image {
  border-radius: var(--bk-radius);
}

/* Placeholder feature images: make the empty state look intentional
   instead of a bare gray box. */
.u-placeholder {
  background: linear-gradient(135deg, #eaf2ff 0%, #dbe9ff 55%, rgba(0, 111, 253, 0.18) 100%);
  border-radius: var(--bk-radius);
}

/* Article body */
/* Casper lays the article out on a named CSS grid; narrow the measure through its own
   --content-width variable instead of a max-width (which would break the grid). */
.gh-canvas,
.article-header.gh-canvas {
  --content-width: 720px;
}

.post-title,
.article-title {
  letter-spacing: -0.01em;
  color: var(--color-primary-text);
}

.gh-content,
.gh-content.gh-canvas {
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-primary-text);
}

.gh-content h2,
.gh-content h3,
.gh-content h4 {
  letter-spacing: -0.01em;
  color: var(--color-primary-text);
}

.gh-content blockquote {
  border-left: 3px solid var(--bk-accent);
  padding-left: 1.2em;
  color: var(--color-secondary-text);
  font-style: normal;
}

.gh-content table {
  border-collapse: collapse;
  width: 100%;
}

.gh-content table th,
.gh-content table td {
  border: 1px solid var(--bk-border);
  padding: 0.6em 0.9em;
}

.gh-content table th {
  background: var(--bk-panel-bg);
  font-weight: 600;
}

/* Footer */
.gh-foot {
  border-top: 1px solid var(--bk-border);
  background: #fff;
}

.gh-foot .gh-foot-inner {
  padding-top: 24px;
  padding-bottom: 24px;
}

/* Posture-guides cross-link block injected on post pages */
.bk-guides {
  margin: 3rem 0 1.5rem;
  padding: 24px;
  background: var(--bk-panel-bg);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
}

.bk-guides-heading {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-primary-text);
}

.bk-guides-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

@media (max-width: 640px) {
  .bk-guides-list {
    grid-template-columns: 1fr;
  }
}

.bk-guides-list li a {
  display: block;
  padding: 4px 0;
  color: var(--bk-accent);
  font-weight: 500;
  text-decoration: none;
}

.bk-guides-list li a:hover {
  text-decoration: underline;
}

.bk-guides-cta {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--bk-border);
  color: var(--color-secondary-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.bk-guides-cta-link {
  display: inline-block;
  margin-left: 8px;
  padding: 6px 16px;
  background: var(--bk-accent);
  color: var(--bk-accent-ink);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.bk-guides-cta-link:hover {
  opacity: 0.9;
}
