/* ==========================================================================
   Objectuve Blog — theme stylesheet (v4.80 Phase 3a, THEME-01)
   --------------------------------------------------------------------------
   Ported from the reference implementation behind
   docs/ui-specs/v4.80-blog-theme.md
   (.planning/phases/v4.80-phase-2b-blog-theme-spec/mockups/src/blog.css).

   Token rule (D9): every colour is a packages/design_system token, copied as a CSS
   custom property with the SAME NAME and value as packages/design_system/css/tokens.css.
   No build coupling, no new hues. The only aliases are the four --footer-*
   properties, which name existing dark-theme values (see § Footer).
   ========================================================================== */

/* ---- Fonts: self-hosted, shipped in this theme's assets/fonts (no Google Fonts) */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../fonts/outfit-variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* ---- Tokens, light (packages/design_system/css/tokens.css :root) ------------------ */
:root {
  color-scheme: light dark;
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 40%;
  --border: 214 32% 91%;
  --primary: 203 78% 41%;
  --primary-accessible: 203 78% 35%;
  --primary-ink: 203 78% 34%;
  --primary-ink-foreground: 0 0% 100%;
  --focus-ring: var(--primary-accessible);
  --shadow-card: 0 2px 8px -2px hsl(222 47% 11% / 0.08), 0 1px 2px hsl(222 47% 11% / 0.04);
  --radius: 1rem;
  /* Footer: always the dark ground, like objectuve.com's footer. Aliases of the
     dark-theme values below — not new colours. */
  --footer-background: 222 47% 8%;   /* = .dark --background */
  --footer-foreground: 210 40% 98%;  /* = .dark --foreground */
  --footer-muted: 215 20% 65%;       /* = .dark --muted-foreground */
  --footer-border: 217 33% 17%;      /* = .dark --border */

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Tokens, dark (packages/design_system/css/tokens.css html.dark) --------------
   THEME-SPEC-06: the blog follows the reader's system setting. No toggle,
   no stored preference, no script. */
@media (prefers-color-scheme: dark) {
  :root {
    --background: 222 47% 8%;
    --foreground: 210 40% 98%;
    --card: 222 47% 11%;
    --muted: 203 33% 17%;
    --muted-foreground: 215 20% 65%;
    --border: 217 33% 17%;
    --primary: 203 78% 61%;
    --primary-accessible: 203 78% 61%;
    --primary-ink: 203 78% 61%;
    --primary-ink-foreground: 222 47% 8%;
    --shadow-card: 0 2px 8px -2px hsl(0 0% 0% / 0.45), 0 1px 2px hsl(0 0% 0% / 0.30);
    --footer-background: 222 47% 11%; /* = .dark --card, one step up from the page */
  }
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid hsl(var(--focus-ring)); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 12px 16px; border-radius: 12px; background: hsl(var(--card)); font-weight: 600; }
.skip-link:focus { top: 8px; }

.gh-container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.gh-measure { max-width: 42rem; margin-left: auto; margin-right: auto; }
@media (min-width: 640px) { .gh-container { padding: 0 24px; } }
@media (min-width: 1024px) { .gh-container { padding: 0 32px; } }

/* ---- Header (THEME-SPEC-03) --------------------------------------------- */
.gh-head { border-bottom: 1px solid hsl(var(--border)); }
.gh-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.gh-head-brand { display: flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; }
.gh-head-logo { display: flex; align-items: center; min-height: 44px; }
.gh-head-logo img { height: 28px; width: auto; }
@media (min-width: 640px) { .gh-head-logo img { height: 36px; } }
.gh-head-divider { width: 1px; height: 24px; background: hsl(var(--border)); }
.gh-head-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: hsl(var(--muted-foreground)); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.gh-head-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; font-size: 0.875rem; font-weight: 600; color: hsl(var(--muted-foreground)); text-decoration: none; }
.gh-head-link:hover { color: hsl(var(--foreground)); }
.gh-head-link svg { width: 16px; height: 16px; }

/* ---- Page intro (index / tag / author) ---------------------------------- */
.gh-intro { padding: 48px 0 32px; }
@media (min-width: 768px) { .gh-intro { padding: 64px 0 48px; } }
.gh-eyebrow { font-size: 0.75rem; line-height: 1rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: hsl(var(--primary-accessible)); text-decoration: none; }
.gh-eyebrow--muted { color: hsl(var(--muted-foreground)); }
.gh-intro-title { margin: 8px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.875rem; line-height: 1.15; letter-spacing: -0.025em; }
@media (min-width: 768px) { .gh-intro-title { font-size: 2.25rem; } }
.gh-intro-deck { margin: 12px 0 0; font-size: 1.125rem; color: hsl(var(--muted-foreground)); }
.gh-intro-meta { margin: 12px 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.gh-author-avatar { width: 64px; height: 64px; border-radius: 999px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); display: grid; place-items: center; margin-bottom: 16px; }
.gh-author-avatar img { width: 36px; height: 36px; }

/* ---- Post list ---------------------------------------------------------- */
.gh-feed { list-style: none; margin: 0; padding: 0; }
.gh-card { border-top: 1px solid hsl(var(--border)); padding: 32px 0; display: grid; gap: 16px; }
.gh-card:last-child { border-bottom: 1px solid hsl(var(--border)); }
@media (min-width: 768px) { .gh-card--has-image { grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: start; } .gh-card--has-image .gh-card-image { order: 2; } }
.gh-card-image { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: hsl(var(--muted)); box-shadow: 0 0 0 1px hsl(var(--border)); }
.gh-card-image img { width: 100%; height: 100%; object-fit: cover; }
.gh-card-title { margin: 8px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; }
.gh-card-title a { text-decoration: none; }
.gh-card-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.gh-card-excerpt { margin: 8px 0 0; color: hsl(var(--muted-foreground)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gh-card-meta { margin: 12px 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

.gh-pagination span { white-space: nowrap; }
.gh-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 32px 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.gh-button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.gh-button svg { width: 16px; height: 16px; }
.gh-button--primary { background: hsl(var(--primary-ink)); color: hsl(var(--primary-ink-foreground)); }
.gh-button--primary:hover { background: hsl(var(--primary-accessible)); }
.gh-button--ghost { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); }
.gh-button--ghost:hover { border-color: hsl(var(--muted-foreground)); }
.gh-button[aria-disabled="true"] { visibility: hidden; }

/* ---- Post header -------------------------------------------------------- */
/* padding-top/-bottom only (not the `padding` shorthand): this class is combined
   with .gh-container on the same <header> element in post.hbs, and the shorthand
   would reset .gh-container's left/right gutter to 0, pinning the byline/title
   flush to the viewport edge at every width. */
.gh-article-head { padding-top: 40px; padding-bottom: 32px; }
@media (min-width: 768px) { .gh-article-head { padding-top: 64px; padding-bottom: 40px; } }
.gh-article-title { margin: 12px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.875rem; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
@media (min-width: 768px) { .gh-article-title { font-size: 2.25rem; } }
.gh-article-deck { margin: 16px 0 0; font-size: 1.125rem; line-height: 1.625; color: hsl(var(--muted-foreground)); }
@media (min-width: 768px) { .gh-article-deck { font-size: 1.25rem; } }
.gh-byline { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.gh-byline-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 999px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); display: grid; place-items: center; }
.gh-byline-avatar img { width: 22px; height: 22px; }
.gh-byline-name { font-size: 0.875rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.gh-byline-name:hover { text-decoration: underline; }
.gh-byline-meta { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.gh-feature { margin: 0 auto 40px; max-width: 60rem; }
.gh-feature-image { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: hsl(var(--muted)); box-shadow: 0 0 0 1px hsl(var(--border)); }
.gh-feature-image img { width: 100%; height: 100%; object-fit: cover; }
.gh-feature figcaption, .gh-content figcaption { margin-top: 12px; font-size: 0.875rem; color: hsl(var(--muted-foreground)); text-align: center; }

/* ---- Long-form typography (THEME-SPEC-02) ------------------------------- */
.gh-content { font-size: 1.125rem; line-height: 1.625; }
.gh-content > * { margin-top: 0; margin-bottom: 0; }
.gh-content > * + * { margin-top: 24px; }
.gh-content h2 { margin-top: 48px; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; }
.gh-content h3 { margin-top: 32px; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.35; }
.gh-content h2 + *, .gh-content h3 + * { margin-top: 12px; }
.gh-content a { color: hsl(var(--primary-accessible)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.gh-content a:hover { text-decoration-thickness: 2px; }
.gh-content strong { font-weight: 600; }
.gh-content ul, .gh-content ol { padding-left: 24px; }
.gh-content li + li { margin-top: 8px; }
.gh-content li::marker { color: hsl(var(--muted-foreground)); }
.gh-content blockquote { margin-left: 0; margin-right: 0; padding-left: 24px; border-left: 4px solid hsl(var(--primary)); font-size: 1.25rem; line-height: 1.5; }
.gh-content blockquote p { margin: 0; }
.gh-content code { font-family: var(--font-mono); font-size: 0.875em; background: hsl(var(--muted)); border-radius: 4px; padding: 2px 4px; }
.gh-content pre { background: hsl(var(--muted)); border-radius: var(--radius); padding: 16px 24px; overflow-x: auto; font-size: 0.875rem; line-height: 1.6; }
.gh-content pre code { background: none; padding: 0; font-size: inherit; }
.gh-content hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 48px 0; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content figure img { border-radius: var(--radius); }
/* Ghost editor card widths — gscan requires both classes to be styled. */
.gh-content .kg-width-wide { position: relative; width: min(60rem, 100vw - 32px); left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full img { border-radius: 0; }
/* Embed card: styled for when one exists. Editorial rule: link out instead (see spec § THEME-SPEC-02, embeds). */
.gh-content .kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.gh-content .kg-embed-card iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius); }
/* Bookmark card — the preferred way to point at a video or a post elsewhere. Ghost's generated
   markup: .kg-bookmark-card > a.kg-bookmark-container > (.kg-bookmark-content, .kg-bookmark-thumbnail). */
.gh-content .kg-bookmark-card { width: 100%; }
.gh-content .kg-bookmark-container { display: flex; gap: 16px; text-decoration: none; color: inherit; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); overflow: hidden; }
.gh-content .kg-bookmark-content { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 16px; flex: 1 1 auto; min-width: 0; }
.gh-content .kg-bookmark-title { font-weight: 600; font-size: 1rem; }
.gh-content .kg-bookmark-description { font-size: 0.875rem; color: hsl(var(--muted-foreground)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gh-content .kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.gh-content .kg-bookmark-icon { width: 16px; height: 16px; border-radius: 4px; }
.gh-content .kg-bookmark-author, .gh-content .kg-bookmark-publisher { }
.gh-content .kg-bookmark-thumbnail { flex: 0 0 33%; max-width: 12rem; background: hsl(var(--muted)); }
.gh-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.gh-content .kg-callout-card { display: flex; gap: 12px; border-radius: var(--radius); background: hsl(var(--muted)); padding: 16px 24px; font-size: 1rem; }

/* Gallery card — Ghost-generated markup, required by card_assets: true. */
.gh-content .kg-gallery-container { display: flex; flex-direction: column; gap: 4px; }
.gh-content .kg-gallery-row { display: flex; gap: 4px; }
.gh-content .kg-gallery-image { flex: 1 1 0; }
.gh-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

/* ---- Post footer -------------------------------------------------------- */
.gh-article-foot { padding: 48px 0 0; }
.gh-disclosure { margin: 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.gh-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.gh-tag { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid hsl(var(--border)); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.gh-tag:hover { border-color: hsl(var(--muted-foreground)); }
.gh-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: 32px; font-size: 0.875rem; font-weight: 600; color: hsl(var(--primary-accessible)); text-decoration: none; }
.gh-back svg { width: 16px; height: 16px; }

/* ---- App CTA (THEME-SPEC-04) ------------------------------------------- */
.gh-cta { margin: 48px 0 0; padding: 24px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: var(--shadow-card); }
@media (min-width: 640px) { .gh-cta { padding: 32px; } }
.gh-cta-mark { width: 40px; height: 40px; }
.gh-cta-title { margin: 16px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; }
.gh-cta-body { margin: 8px 0 0; color: hsl(var(--muted-foreground)); }
.gh-cta .gh-button { margin-top: 24px; }

/* ---- 404 ---------------------------------------------------------------- */
.gh-error { padding: 80px 0 96px; text-align: center; }
.gh-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---- Footer (THEME-SPEC-03) — mirrors objectuve.com --------------------- */
.gh-foot { margin-top: 96px; background: hsl(var(--footer-background)); color: hsl(var(--footer-muted)); padding: 48px 0 32px; font-size: 0.875rem; }
@media (min-width: 768px) { .gh-foot { padding: 64px 0 32px; } }
.gh-foot a { color: hsl(var(--footer-muted)); text-decoration: none; }
.gh-foot a:hover { color: hsl(var(--footer-foreground)); }
.gh-foot-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .gh-foot-grid { grid-template-columns: 1.5fr repeat(3, 1fr); gap: 48px; } }
.gh-foot-brand img { height: 32px; width: auto; }
.gh-foot-blurb { margin: 16px 0 0; max-width: 20rem; }
.gh-foot-social { display: flex; gap: 4px; margin-top: 16px; margin-left: -12px; }
.gh-foot-social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; }
.gh-foot-social svg { width: 18px; height: 18px; }
.gh-foot-col h2 { margin: 0 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: hsl(var(--footer-foreground)); }
.gh-foot-col ul { list-style: none; margin: 0; padding: 0; }
.gh-foot-col a { display: flex; align-items: center; min-height: 44px; }
.gh-foot-col a[aria-current="page"] { color: hsl(var(--footer-foreground)); }
.gh-foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid hsl(var(--footer-border)); }
.gh-foot-bottom p { margin: 0; }

/* ---- Motion: none beyond colour/decoration on hover. Reduced motion needs no
   override because nothing transforms or animates. ----------------------- */
