/* ────────────────────────────────────────────────────────────────
   Bible Publisher Ghost theme — pass 1.

   Source-of-truth for tokens: src/app/globals.css in the publisher
   repo. Keep this file in lockstep with that file when palette /
   typography tokens change.

   Pass 1 scope: chrome (header, footer, body backdrop) + post-page
   container. No homepage cards, no BorderGlow, no topic indexes —
   those land in pass 2.
   ──────────────────────────────────────────────────────────────── */

:root {
  /* Color — deep, rich, saturated navy/royal. Not muted. */
  --chrome-bg: #050a2c;
  --chrome-bg-deep: #020414;
  --chrome-fg: #ffffff;
  --chrome-fg-soft: rgba(255, 255, 255, 0.86);
  --chrome-fg-dim: rgba(255, 255, 255, 0.62);
  --chrome-fg-faint: rgba(255, 255, 255, 0.36);
  --chrome-rule: rgba(255, 255, 255, 0.14);
  --chrome-rule-soft: rgba(255, 255, 255, 0.07);
  --chrome-surface: rgba(255, 255, 255, 0.05);

  /* Type */
  --chrome-font-display: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  --chrome-font-body: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  --chrome-font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* Spacing (8pt) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Layout */
  --chrome-max-width: 1200px;        /* outer chrome (topbar, footer) */
  --prose-max: 800px;                /* readable post-chrome column */
  --chrome-topbar-height: 57px;
}

/* Body backdrop — same radial gradient anchored at top center as the
   publisher uses, falling off to deep navy at edges/bottom. */
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background-color: var(--chrome-bg-deep);
  background-image: radial-gradient(
    ellipse 90% 65% at 50% 0%,
    #0d1a55 0%,
    var(--chrome-bg) 45%,
    var(--chrome-bg-deep) 90%
  );
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--chrome-fg);
  font-family: var(--chrome-font-body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  color: var(--chrome-fg);
  text-decoration: none;
  border-bottom: 1px solid var(--chrome-rule);
  transition: border-color 0.15s ease;
}
a:hover {
  border-bottom-color: var(--chrome-fg);
}

/* ────────────────────────────────────────────────────────────────
   Top bar — mirrors src/components/chrome/TopBar.tsx
   ──────────────────────────────────────────────────────────────── */
.bp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 10, 44, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--chrome-rule);
  min-height: var(--chrome-topbar-height);
  display: flex;
  align-items: center;
}
.bp-topbar__inner {
  max-width: var(--chrome-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.bp-topbar__wordmark {
  font-family: var(--chrome-font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: none;
}
.bp-topbar__wordmark:hover {
  border-bottom: none;
}
.bp-topbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.bp-topbar__nav a {
  font-size: 14px;
  color: var(--chrome-fg-soft);
  border-bottom: none;
}
.bp-topbar__nav a:hover {
  color: var(--chrome-fg);
  border-bottom: none;
}
.bp-topbar__action a {
  font-family: var(--chrome-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--chrome-rule);
  border-radius: 2px;
  color: var(--chrome-fg);
}
.bp-topbar__action a:hover {
  border-color: var(--chrome-fg);
  background: rgba(255, 255, 255, 0.06);
}

/* ────────────────────────────────────────────────────────────────
   Post-page chrome — minimal because research artifacts ship their
   own hero (kicker, title, lede, stats line) inside the HTML card.
   The theme provides only:
     1. A thin breadcrumb at the top — navigation context.
     2. A conditional feature image — renders when set in Ghost
        admin per-post, does nothing when unset. Operators leave
        this unset on artifact-format posts whose own hero would
        otherwise compete; they set it on Ghost-native blog posts
        and so that listing-view cards (homepage / topic indexes)
        have a thumbnail regardless of detail-page rendering.
   Title, excerpt, date, reading time are intentionally omitted to
   avoid redundancy with the artifact's own hero band.
   ──────────────────────────────────────────────────────────────── */
.bp-post {
  max-width: var(--prose-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) var(--space-6);
}
.bp-post__crumbs {
  font-family: var(--chrome-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--chrome-fg-dim);
  margin: 0;
}
.bp-post__crumbs a {
  color: var(--chrome-fg-soft);
  border-bottom: none;
}
.bp-post__crumbs a:hover {
  color: var(--chrome-fg);
}

/* Feature image (Ghost post.feature_image) — sits in the prose column
   below the breadcrumb, above the artifact body. Capped at 60vh to
   prevent oversized heroes that crowd out the artifact. */
.bp-feature {
  max-width: var(--prose-max);
  margin: var(--space-5) auto var(--space-6);
  border-radius: 4px;
  overflow: hidden;
}
.bp-feature img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: cover;
}
.bp-feature figcaption {
  margin-top: var(--space-3);
  padding: 0 var(--space-2);
  font-family: var(--chrome-font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--chrome-fg-dim);
}

.bp-post__content {
  font-size: 17px;
  line-height: 1.62;
  color: var(--chrome-fg);
}

/* ────────────────────────────────────────────────────────────────
   Footer — horizontal nav, matches src/components/chrome/Footer.tsx
   ──────────────────────────────────────────────────────────────── */
.bp-footer {
  background: var(--chrome-bg-deep);
  border-top: 1px solid var(--chrome-rule);
  margin-top: var(--space-8);
}
.bp-footer__inner {
  max-width: var(--chrome-max-width);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-5);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.bp-footer__identity .bp-footer__wordmark {
  font-family: var(--chrome-font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
}
.bp-footer__identity p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--chrome-fg-soft);
  max-width: 36ch;
  margin: 0;
}
.bp-footer__nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}
.bp-footer__nav a {
  font-size: 14px;
  color: var(--chrome-fg-soft);
  border-bottom: none;
}
.bp-footer__nav a:hover {
  color: var(--chrome-fg);
}
.bp-footer__bottom {
  max-width: var(--chrome-max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--chrome-rule-soft);
  font-family: var(--chrome-font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--chrome-fg-faint);
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .bp-footer__inner {
    align-items: flex-start;
    gap: var(--space-5);
  }
}

/* ────────────────────────────────────────────────────────────────
   Accessibility: respect reduce-motion preference
   ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
