/* ============================================================
   LighterMind blog theme
   Sections 1-6 mirror /styles.css on the landing page (tokens, base,
   buttons, nav, footer, error page). If you change them there, change
   them here too; scripts/package-theme.sh warns when the tokens drift.
   ============================================================ */

/* ============================================================
   1. Tokens (verbatim from /styles.css)
   ============================================================ */

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

:root {
  --color-brand: #7B7EB8;
  --color-brand-light: #9B9DD0;
  --color-brand-pale: #E8E9F3;
  --color-brand-deep: #5C5F94;
  --color-bg: #FAFAFE;
  --color-surface: #FFFFFF;
  --color-text: #1A1A2E;
  --color-text-secondary: #555570;
  --color-text-muted: #8888A0;
  --color-border: #E4E4EE;

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;

  --container: 1120px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.1);
  --shadow-device: 0 20px 60px rgba(0,0,0,.15);

  --frame-background: #393a49;

  /* Blog-only tokens, derived from the ones above.
     --gh-font-body / --gh-font-heading are only set if a custom font is picked in
     Ghost Admin > Design; otherwise the blog uses the landing page's system stack. */
  --font-body: var(--gh-font-body, var(--font-sans));
  --font-heading: var(--gh-font-heading, var(--font-sans));
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
  --color-link: var(--color-brand-deep);
  --color-code-bg: #F2F2F8;
  --measure: 68ch;

  /* Tag palette from the landing page (#tags, @people, !events) */
  --chip-topic-bg: #E8E9F3;
  --chip-topic-fg: #5C5F94;
  --chip-person-bg: #E5F0E8;
  --chip-person-fg: #3D7A4E;
  --chip-event-bg: #FFF0E0;
  --chip-event-fg: #9A5F1E;
  --chip-plain-bg: #F0EDE8;
  --chip-plain-fg: #6B6355;
}

[data-theme="dark"] {
  --color-brand: #9B9DD0;
  --color-brand-light: #B0B2E0;
  --color-brand-pale: #1E1F2E;
  --color-brand-deep: #B0B2E0;
  --color-bg: #121218;
  --color-surface: #1A1A24;
  --color-text: #E8E8F0;
  --color-text-secondary: #A0A0B8;
  --color-text-muted: #6E6E88;
  --color-border: #2A2A38;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.4);
  --shadow-device: 0 20px 60px rgba(0,0,0,.4);

  --frame-background: #2A2A38;

  --color-code-bg: #1A1A24;

  --chip-topic-bg: #2A2A3E;
  --chip-topic-fg: #B0B2E0;
  --chip-person-bg: #1E2E22;
  --chip-person-fg: #6BBF7E;
  --chip-event-bg: #2E2618;
  --chip-event-fg: #D4A04E;
  --chip-plain-bg: #2A2820;
  --chip-plain-fg: #A09880;
}

/* Ghost's card assets read the accent color. Pin it to the brand so cards
   match even if the accent in Ghost Admin is left at its default.
   (html[data-theme] outranks the :root rule that {{ghost_head}} prints.) */
html[data-theme] {
  --ghost-accent-color: var(--color-brand);
}

/* ============================================================
   2. Base (verbatim from /styles.css)
   ============================================================ */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color .2s;
}

a:hover {
  color: var(--color-brand-deep);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-text);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   3. Buttons (verbatim from /styles.css)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-sm {
  font-size: 14px;
  padding: 8px 18px;
  background: var(--color-brand);
  color: #fff;
}

.btn-sm:hover {
  background: var(--color-brand-deep);
  color: #fff;
}

.btn-primary {
  background: var(--color-text);
  color: #fff;
  font-size: 16px;
  padding: 14px 32px;
}

.btn-primary:hover {
  background: #2A2A44;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.apple-logo {
  flex-shrink: 0;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  font-size: 15px;
  padding: 13px 28px;
}

.btn-secondary:hover {
  background: var(--color-brand-pale);
  color: var(--color-brand-deep);
  border-color: var(--color-brand);
}

[data-theme="dark"] .btn-secondary:hover {
  color: var(--color-brand);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-sm {
  background: var(--color-brand);
  color: #121218;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-sm:hover {
  background: var(--color-brand-light);
  color: #121218;
}

/* ============================================================
   4. Navigation (verbatim from /styles.css, plus .nav-link)
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 254, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .nav {
  background: rgba(18, 18, 24, .85);
}

/* The nav is wrapped in <header> here; keep it sticky against the page */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-brand);
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.nav-brand:hover {
  color: var(--color-brand-deep);
}

.nav-icon {
  border-radius: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 7px 12px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}

.nav-link:hover {
  background: var(--color-brand-pale);
  color: var(--color-brand);
}

.nav-link.is-active {
  color: var(--color-brand-deep); /* brand-deep: 5.7:1 on the light nav, brand alone is 3.6:1 */
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.theme-toggle:hover {
  background: var(--color-brand-pale);
  color: var(--color-brand);
}

.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }

/* ============================================================
   5. Footer (verbatim from /styles.css)
   ============================================================ */

.footer {
  padding: 40px 0;
  background: var(--color-brand-pale);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 300;
  font-size: 15px;
  color: var(--color-brand);
}

.footer-brand img {
  border-radius: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.footer-links a:hover {
  color: var(--color-brand);
}

/* ============================================================
   6. Error pages (verbatim from /styles.css)
   ============================================================ */

.error-page {
  min-height: calc(100vh - 64px - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0;
}

.error-page .container {
  max-width: 560px;
}

.error-logo {
  margin: 0 auto 24px;
  opacity: 0.6;
  border-radius: 16px;
}

.error-code {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 12px;
}

.error-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.error-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   7. Accessibility helpers
   ============================================================ */

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 980px;
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: 600;
  font-size: 14px;
}

.skip-link:focus {
  top: 12px;
  color: var(--color-bg);
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 6px;
}

main:focus {
  outline: none;
}

/* ============================================================
   8. Tag chips (the landing page's .tag pills)
   ============================================================ */

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.tag-topic {
  background: var(--chip-topic-bg);
  color: var(--chip-topic-fg);
}

a.tag-topic:hover {
  background: var(--color-brand);
  color: #fff;
}

[data-theme="dark"] a.tag-topic:hover {
  color: #121218;
}

.tag-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chips .tag {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  padding: 3px 10px;
}

/* ============================================================
   9. Blog header and section switcher
   ============================================================ */

.blog-hero {
  padding: 72px 0 48px;
}

.blog-hero-compact {
  padding: 64px 0 40px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-brand-deep);
  margin-bottom: 14px;
}

.blog-title {
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  max-width: 760px;
  margin-bottom: 16px;
  text-wrap: balance;
}

.blog-hero-compact .blog-title {
  font-size: clamp(32px, 4vw, 48px);
}

.blog-title-hash {
  color: var(--color-brand);
  font-weight: 500;
}

.blog-title-page {
  font-size: .5em;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: 0;
  margin-left: 8px;
}

.blog-intro {
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: 28px;
}

.blog-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: background .2s, color .2s, border-color .2s;
}

.chip:hover {
  border-color: var(--color-brand);
  color: var(--color-brand-deep);
}

.chip.is-current {
  background: var(--color-brand-pale);
  border-color: var(--color-brand);
  color: var(--color-brand-deep);
  font-weight: 600;
}

.chip-quiet {
  background: transparent;
}

.author-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.author-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   10. Post feed and cards (modelled on the landing .grid-card)
   ============================================================ */

.feed-section {
  padding-bottom: 100px;
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-card:focus-within {
  border-color: var(--color-brand);
}

.post-card-media {
  aspect-ratio: 16 / 10;
  background: var(--color-brand-pale);
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-brand-pale) 100%);
}

.post-card-placeholder img {
  border-radius: 14px;
  opacity: .85;
  box-shadow: var(--shadow-md);
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  flex: 1;
}

.post-card-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.post-card-link {
  color: var(--color-text);
}

.post-card-link:hover {
  color: var(--color-brand-deep);
}

/* Make the whole card clickable while keeping a single link per card */
.post-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.post-card-link:focus-visible {
  outline: none;
}

.post-card-link:focus-visible::after {
  outline: 2px solid var(--color-brand);
  outline-offset: -2px;
  border-radius: var(--radius);
}

.post-card-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Newest post on the blog home: wide, horizontal card */
.post-card-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
}

.post-card-feature .post-card-media {
  aspect-ratio: auto;
  min-height: 340px;
  border-bottom: 0;
  border-right: 1px solid var(--color-border);
}

.post-card-feature .post-card-body {
  padding: 40px;
  justify-content: center;
  gap: 16px;
}

.post-card-feature .post-card-title {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.post-card-feature .post-card-excerpt {
  font-size: 17px;
  -webkit-line-clamp: 4;
}

.post-card-feature .post-card-meta {
  margin-top: 4px;
}

.empty-state {
  padding: 40px 0;
  color: var(--color-text-secondary);
}

/* ============================================================
   11. Pagination
   ============================================================ */

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 56px;
}

.pagination > :last-child {
  justify-self: end;
}

.pagination-location {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* ============================================================
   12. Article
   ============================================================ */

.article-header,
.article-footer {
  font-size: 18px; /* sets the ch unit so the measure matches the body column */
  max-width: calc(var(--measure) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

.article-header {
  padding-top: 72px;
}

.article-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-brand-deep);
  margin-bottom: 16px;
}

.article-kicker:hover {
  color: var(--color-brand);
}

.article-title {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 18px;
  text-wrap: balance;
}

.article-excerpt {
  font-size: 20px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.article-meta a {
  color: var(--color-text);
}

.article-meta a:hover {
  color: var(--color-brand-deep);
}

.article-image {
  max-width: 1040px;
  margin: 48px auto 0;
  padding: 0 24px;
}

.article-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.article-image figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Body column: a centred measure with wide and full breakout tracks for Koenig cards */
.article-content {
  font-size: 18px;
  line-height: 1.75;
  padding: 48px 0 0;
  display: grid;
  grid-template-columns:
    [full-start] minmax(24px, 1fr)
    [wide-start] minmax(0, 160px)
    [main-start] min(var(--measure), calc(100% - 48px))
    [main-end] minmax(0, 160px)
    [wide-end] minmax(24px, 1fr)
    [full-end];
}

.article-content > * {
  grid-column: main-start / main-end;
  min-width: 0;
}

.article-content > .kg-width-wide {
  grid-column: wide-start / wide-end;
}

.article-content > .kg-width-full {
  grid-column: full-start / full-end;
}

.article-footer {
  padding-top: 48px;
  padding-bottom: 96px;
}

.article-footer .tag-chips {
  margin-bottom: 40px;
}

/* ============================================================
   13. Post content and Koenig cards
   ============================================================ */

.gh-content > * + * {
  margin-top: 1.2em;
}

.gh-content > :first-child {
  margin-top: 0;
}

.gh-content p,
.gh-content li {
  color: var(--color-text);
}

.gh-content h2 {
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 2em;
}

.gh-content h3 {
  font-size: 1.2em;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-top: 1.7em;
}

.gh-content h4 {
  font-size: 1em;
  font-weight: 700;
  margin-top: 1.6em;
}

.gh-content h2 + *,
.gh-content h3 + *,
.gh-content h4 + * {
  margin-top: .55em;
}

.gh-content a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.gh-content a:hover {
  color: var(--color-brand);
}

.gh-content strong {
  font-weight: 650;
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.35em;
}

.gh-content li + li {
  margin-top: .45em;
}

.gh-content li > ul,
.gh-content li > ol {
  margin-top: .45em;
}

.gh-content li::marker {
  color: var(--color-brand);
}

.gh-content ol li::marker {
  font-weight: 600;
}

.gh-content blockquote:not(.kg-blockquote-alt) {
  border-left: 3px solid var(--color-brand);
  padding: .1em 0 .1em 1.1em;
  font-size: 1.08em;
  color: var(--color-text-secondary);
}

.gh-content blockquote p {
  color: inherit;
}

.gh-content .kg-blockquote-alt {
  text-align: center;
  font-size: 1.35em;
  font-style: italic;
  line-height: 1.5;
  color: var(--color-text-secondary);
  padding: 0 1.5em;
}

.gh-content hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin-top: 2.5em;
  margin-bottom: 1.3em;
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: .84em;
  background: var(--color-brand-pale);
  color: var(--color-text);
  padding: .15em .4em;
  border-radius: 5px;
}

.gh-content pre {
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.65;
  background: var(--color-code-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  tab-size: 4;
}

.gh-content pre code {
  font-size: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
}

.gh-content figure {
  margin-top: 2em;
  margin-bottom: .8em;
}

.gh-content figure img,
.gh-content figure video {
  margin: 0 auto;
  border-radius: var(--radius);
}

.gh-content .kg-width-full img {
  width: 100%;
  border-radius: 0;
}

.gh-content figcaption {
  margin-top: .8em;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.gh-content figcaption a {
  color: inherit;
}

.gh-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .9em;
  width: 100%;
}

.gh-content th,
.gh-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.gh-content th {
  font-weight: 650;
  color: var(--color-text);
}

.gh-content iframe {
  max-width: 100%;
}

.gh-content .kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Gallery (Ghost card assets lay it out; we round the corners) */
.gh-content .kg-gallery-image img {
  border-radius: 8px;
}

/* Callout card. Colours reuse the landing page's tag palette. */
.gh-content .kg-callout-card {
  display: flex;
  gap: .75em;
  padding: 1.1em 1.35em;
  border-radius: var(--radius);
  background: var(--color-brand-pale);
  border: 1px solid transparent;
  font-size: .95em;
  line-height: 1.65;
}

.gh-content .kg-callout-emoji {
  font-size: 1.15em;
  line-height: 1.5;
}

.gh-content .kg-callout-text {
  color: var(--color-text);
}

.gh-content .kg-callout-card-grey,
.gh-content .kg-callout-card-white {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.gh-content .kg-callout-card-blue,
.gh-content .kg-callout-card-purple,
.gh-content .kg-callout-card-accent {
  background: var(--chip-topic-bg);
}

.gh-content .kg-callout-card-green {
  background: var(--chip-person-bg);
}

.gh-content .kg-callout-card-yellow {
  background: var(--chip-event-bg);
}

.gh-content .kg-callout-card-red,
.gh-content .kg-callout-card-pink {
  background: var(--chip-plain-bg);
}

.gh-content .kg-callout-card-accent .kg-callout-text {
  color: var(--color-text);
}

/* Bookmark, toggle, button, file and product cards: Ghost card assets
   provide the layout; these lines bring them onto the site tokens. */
.gh-content .kg-bookmark-container,
.gh-content .kg-toggle-card,
.gh-content .kg-file-card-container,
.gh-content .kg-product-card-container {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
}

.gh-content .kg-bookmark-title,
.gh-content .kg-toggle-heading-text {
  color: var(--color-text);
}

.gh-content .kg-bookmark-description,
.gh-content .kg-bookmark-metadata {
  color: var(--color-text-secondary);
}

.gh-content .kg-button-card .kg-btn,
.gh-content .kg-product-card-button {
  border-radius: 980px;
  font-weight: 600;
}

.gh-content .kg-header-card {
  border-radius: var(--radius-lg);
}

/* ============================================================
   14. App Store card at the end of posts
   ============================================================ */

.app-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-brand-pale) 100%);
}

.app-cta-icon {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.app-cta-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.app-cta-title {
  font-size: 17px;
  font-weight: 650;
  color: var(--color-text);
  margin-bottom: 2px;
}

.app-cta-button {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================================
   15. More posts
   ============================================================ */

.more-posts {
  padding: 80px 0 100px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

[data-theme="dark"] .more-posts {
  background: var(--color-bg);
}

[data-theme="dark"] .more-posts .post-card {
  background: var(--color-surface);
}

.more-posts-title {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* ============================================================
   16. Changelog
   ============================================================ */

.changelog {
  padding-bottom: 100px;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 180px minmax(0, 760px);
  gap: 40px;
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
}

.changelog-aside {
  position: sticky;
  top: 96px;
  align-self: start;
}

.changelog-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--chip-topic-fg);
  background: var(--chip-topic-bg);
  padding: 4px 10px;
  border-radius: 6px;
}

.changelog-version {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.changelog-version a {
  color: var(--color-text);
}

.changelog-version a:hover {
  color: var(--color-brand-deep);
}

.changelog-summary {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  max-width: 62ch;
}

.changelog-content {
  font-size: 16px;
  line-height: 1.65;
  max-width: 68ch;
}

.changelog-content h2,
.changelog-content h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-brand-deep);
  margin-top: 28px;
}

.changelog-content > h2:first-child,
.changelog-content > h3:first-child {
  margin-top: 0;
}

.changelog-content h2 + *,
.changelog-content h3 + * {
  margin-top: 10px;
}

.changelog-content li + li {
  margin-top: .35em;
}

.changelog-content figure {
  margin-top: 1.5em;
}

/* A single release opened from the changelog */
.tag-changelog .article-title {
  font-size: clamp(32px, 4.4vw, 46px);
}

/* ============================================================
   17. Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .post-card:hover,
  .btn-primary:hover {
    transform: none;
  }
}

/* ============================================================
   18. Responsive (breakpoints match /styles.css)
   ============================================================ */

@media (max-width: 1024px) {
  .post-feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .post-card-feature .post-card-body {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 48px 0 32px;
  }

  .post-feed {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-card-feature {
    display: flex;
  }

  .post-card-feature .post-card-media {
    aspect-ratio: 16 / 10;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .post-card-feature .post-card-body {
    padding: 24px;
  }

  .article-header {
    padding-top: 48px;
  }

  .article-content {
    font-size: 17px;
  }

  .changelog-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 36px 0;
  }

  .changelog-aside {
    position: static;
  }

  .app-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .pagination {
    grid-template-columns: 1fr 1fr;
  }

  .pagination-location {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .article-header,
  .article-footer,
  .article-image {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-content {
    grid-template-columns:
      [full-start] 16px
      [wide-start] 0
      [main-start] minmax(0, 1fr)
      [main-end] 0
      [wide-end] 16px
      [full-end];
  }

  .nav-link {
    padding: 7px 8px;
  }

  .nav-actions {
    gap: 4px;
  }

  .author-hero {
    flex-direction: column;
  }
}
