/* ============================================================
   GROKTOPUS THEME — screen.css
   Design system → layout → components → utilities
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300&display=swap');

/* ── OpenDyslexic (not used by default but available) ──────── */
/* Uncomment if you switch to OpenDyslexic body font */
/*
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/otf/OpenDyslexic-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/otf/OpenDyslexic-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal;
}
*/


/* ── Design Tokens: Dark (default) ───────────────────────── */
:root {
  /* Surfaces */
  --color-bg:       #0d0b1a;
  --color-surface:  #16132b;
  --color-surface-2:#1e1a38;
  --color-border:   #2a2247;

  /* Text */
  --color-text-1:   #f0eafa;
  --color-text-2:   #9d8ec4;
  --color-text-3:   #6b5f9e;

  /* Display accents — decorative, large text, gradients */
  --accent-violet:  #8b5cf6;
  --accent-pink:    #ec4899;
  --accent-blue:    #38bdf8;

  /* Interactive accents — buttons, small links (WCAG AA with white text) */
  --accent-violet-ui: #7c3aed;  /* 5.08:1 */
  --accent-pink-ui:   #db2777;  /* 5.74:1 */
  --accent-blue-ui:   #0369a1;  /* 7.43:1 */

  /* Link color — lightened violet for AA on dark surfaces */
  --color-link:     #a78bfa;    /* 5.53:1 on --color-surface */

  /* Gradient */
  --gradient:       linear-gradient(90deg, var(--accent-blue), var(--accent-violet), var(--accent-pink));

  /* Typography */
  --font-heading:   'Fraunces', Georgia, serif;
  --font-body:      'Atkinson Hyperlegible', Arial, sans-serif;
  --font-mono:      'Courier New', Courier, monospace;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1.125rem;   /* 18px */
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Layout */
  --container-wide:   1200px;
  --container-read:   680px;
  --header-height:    64px;

  /* Radii */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  /* Transitions */
  --transition: 200ms ease;
}

/* ── Design Tokens: Light mode ───────────────────────────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --color-bg:       #faf9ff;
    --color-surface:  #ffffff;
    --color-surface-2:#f0ecff;
    --color-border:   #ddd8f5;
    --color-text-1:   #1a1630;
    --color-text-2:   #4a4070;
    --color-text-3:   #8b80bc;
    --color-link:     #7c3aed;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  }
}

[data-theme="light"] {
  --color-bg:       #faf9ff;
  --color-surface:  #ffffff;
  --color-surface-2:#f0ecff;
  --color-border:   #ddd8f5;
  --color-text-1:   #1a1630;
  --color-text-2:   #4a4070;
  --color-text-3:   #8b80bc;
  --color-link:     #7c3aed;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}


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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text-1);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.8;
  transition: background var(--transition), color var(--transition);
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-pink); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  color: var(--color-text-1);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
}

p { margin: 0 0 var(--space-6); }
ul, ol { margin: 0 0 var(--space-6); padding-left: var(--space-8); }
li { margin-bottom: var(--space-2); }

figure { margin: 0; }
figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-2);
  text-align: center;
  margin-top: var(--space-2);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-2);
  color: var(--accent-blue);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  overflow-x: auto;
  margin: 0 0 var(--space-6);
}

pre code {
  background: none;
  padding: 0;
  color: var(--color-text-1);
  font-size: var(--text-sm);
}

blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--accent-violet);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-text-1);
  line-height: 1.5;
}

hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-12) 0;
}

:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 3px;
  border-radius: 3px;
}


/* ── Layout helpers ───────────────────────────────────────── */
.container {
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-read {
  max-width: var(--container-read);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}


/* ── Reading progress bar ─────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient);
  z-index: 1000;
  transition: width 100ms linear;
  pointer-events: none;
}


/* ── Site header ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  transition: transform 300ms ease, background var(--transition), border-color var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.site-header__logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}


/* ── Skip link (WCAG 2.4.1) ───────────────────────────────── */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--accent-violet-ui);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 10000;
  transform: translateY(-110%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--color-text-1);
  outline-offset: -4px;
  color: #fff;
}


/* ── Navigation ───────────────────────────────────────────── */
/* Ghost's {{navigation}} outputs <ul class="nav">; we style what it gives us */
.site-nav .nav,
.site-footer__nav .nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav .nav a {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-2);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.site-nav .nav a:hover,
.site-nav .nav .nav-current a { color: var(--color-text-1); }

.site-footer__nav .nav a {
  font-size: var(--text-sm);
  color: var(--color-text-3);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer__nav .nav a:hover { color: var(--color-text-1); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text-1);
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
  border-radius: 2px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: var(--color-bg);
  z-index: 99;
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border);
}

.nav-drawer.is-open { display: block; }

.nav-drawer .nav {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
}

.nav-drawer .nav a {
  font-size: var(--text-lg);
}


/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-2);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: border-color var(--transition), color var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent-violet);
  color: var(--color-text-1);
}

.theme-toggle__icon-dark  { display: block; }
.theme-toggle__icon-light { display: none; }

[data-theme="light"] .theme-toggle__icon-dark  { display: none; }
[data-theme="light"] .theme-toggle__icon-light { display: block; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle__icon-dark  { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle__icon-light { display: block; }
}


/* ── Homepage hero header ─────────────────────────────────── */
.home-hero-header {
  padding: var(--space-24) var(--space-6) var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-hero-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.home-hero-header__title {
  font-size: clamp(var(--text-3xl), 6vw, 5rem);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  line-height: 1.1;
}

.home-hero-header__tagline {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-2);
  max-width: 520px;
  margin: 0 auto var(--space-8);
}

.home-hero-header__divider {
  width: 60px;
  height: 3px;
  background: var(--gradient);
  border-radius: var(--radius-pill);
  margin: 0 auto;
}


/* ── Featured post hero ───────────────────────────────────── */
.post-hero {
  margin-bottom: var(--space-12);
}

.post-hero__inner {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.post-hero__image {
  display: block;
  overflow: hidden;
  /* No aspect-ratio — let the art show at its natural dimensions */
}

.post-hero__image img {
  display: block;
  width: 100%;
  height: auto;
  /* No object-fit — no cropping */
  transition: transform 400ms ease;
}

.post-hero__inner:hover .post-hero__image img {
  transform: scale(1.02);
}

.post-hero__content {
  padding: var(--space-8) var(--space-10, 2.5rem);
  max-width: 860px;
  margin: 0 auto;
}

.post-hero__tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(139,92,246,0.15);
  color: var(--accent-violet);
  margin-bottom: var(--space-4);
  text-decoration: none;
}

.post-hero__title {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 700;
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.post-hero__title a {
  color: var(--color-text-1);
  text-decoration: none;
}

.post-hero__title a:hover { color: var(--accent-violet); }

.post-hero__excerpt {
  color: var(--color-text-2);
  font-size: var(--text-base);
  margin-bottom: var(--space-6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-3);
}

.post-hero__meta a {
  color: var(--color-text-2);
  text-decoration: none;
}


/* ── Post card grid ───────────────────────────────────────── */
.post-feed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

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

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

.post-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.post-card:hover .post-card__image img {
  transform: scale(1.04);
}

.post-card__body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card__tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(139,92,246,0.12);
  color: var(--accent-violet);
  margin-bottom: var(--space-3);
  text-decoration: none;
  align-self: flex-start;
}

.post-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-3);
}

.post-card__title a {
  color: var(--color-text-1);
  text-decoration: none;
}

.post-card__title a:hover { color: var(--accent-violet); }

.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-2);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  display: flex;
  gap: var(--space-3);
  margin-top: auto;
}


/* ── Load more ────────────────────────────────────────────── */
.load-more {
  text-align: center;
  margin-bottom: var(--space-16);
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-load-more:hover {
  border-color: var(--accent-violet);
  color: var(--color-text-1);
  background: rgba(139,92,246,0.08);
}

.btn-load-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ── Single post ──────────────────────────────────────────── */
.post-full {
  padding-top: var(--space-12);
}

.post-full__header {
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.post-full__tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(139,92,246,0.12);
  color: var(--accent-violet);
  margin-bottom: var(--space-4);
  text-decoration: none;
}

.post-full__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-6);
}

.post-full__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-3);
}

.post-full__meta a {
  color: var(--color-text-2);
  text-decoration: none;
}

.post-full__feature-image {
  margin: var(--space-8) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-full__feature-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

/* Post content with TOC layout */
.post-full__layout {
  display: grid;
  grid-template-columns: var(--container-read) 1fr;
  gap: var(--space-12);
  max-width: calc(var(--container-read) + 320px + var(--space-12));
  margin: 0 auto;
}

/* When no TOC sidebar, just center the content */
.post-full__layout--no-toc {
  display: block;
}

/* ── Post content typography ──────────────────────────────── */
.gh-content {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text-1);
}

.gh-content h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  scroll-margin-top: calc(var(--header-height) + var(--space-8));
}

.gh-content h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  scroll-margin-top: calc(var(--header-height) + var(--space-8));
}

.gh-content h4 {
  font-size: var(--text-lg);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  scroll-margin-top: calc(var(--header-height) + var(--space-8));
}

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

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

.gh-content img {
  border-radius: var(--radius-md);
  margin: var(--space-8) auto;
}

.gh-content figure.kg-image-card {
  margin: var(--space-8) 0;
}

.gh-content figure.kg-image-card.kg-width-wide {
  margin-left: calc(-1 * var(--space-8));
  margin-right: calc(-1 * var(--space-8));
}


/* ── Table of contents ────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  max-height: calc(100vh - var(--header-height) - var(--space-12));
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  align-self: start;
}

.toc-sidebar::-webkit-scrollbar { width: 4px; }
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.toc__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-3);
  margin-bottom: var(--space-4);
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc__item { margin-bottom: var(--space-2); }
.toc__item--h3 { padding-left: var(--space-4); }

.toc__link {
  font-size: var(--text-sm);
  color: var(--color-text-2);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  padding: var(--space-1) 0;
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
  transition: color var(--transition), border-color var(--transition);
}

.toc__link:hover { color: var(--color-text-1); }

.toc__link.is-active {
  color: var(--accent-violet);
  border-left-color: var(--accent-violet);
}

/* Mobile TOC dropdown */
.toc-dropdown {
  display: none;
  margin-bottom: var(--space-8);
}

.toc-dropdown__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-1);
  cursor: pointer;
  text-align: left;
}

.toc-dropdown__arrow {
  transition: transform var(--transition);
}

.toc-dropdown__toggle[aria-expanded="true"] .toc-dropdown__arrow {
  transform: rotate(180deg);
}

.toc-dropdown__panel {
  display: none;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.toc-dropdown__panel.is-open { display: block; }


/* ── Subscribe prompt ─────────────────────────────────────── */
.subscribe-prompt {
  margin: var(--space-16) 0 var(--space-12);
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.subscribe-prompt::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.subscribe-prompt__text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-1);
  margin-bottom: var(--space-6);
}

.subscribe-prompt__form {
  display: flex;
  gap: var(--space-3);
  max-width: 440px;
  margin: 0 auto;
}

.subscribe-prompt__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-1);
  outline: none;
  transition: border-color var(--transition);
}

.subscribe-prompt__input:focus {
  border-color: var(--accent-violet-ui);
}

.subscribe-prompt__input::placeholder { color: var(--color-text-3); }

.btn-subscribe {
  padding: var(--space-3) var(--space-6);
  background: var(--accent-violet-ui);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}

.btn-subscribe:hover { background: var(--accent-pink-ui); }

/* Hide subscribe prompt when already a member */
.is-member .subscribe-prompt { display: none; }


/* ── Post navigation ──────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-12) 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.post-nav__item {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.post-nav__item:hover {
  border-color: var(--accent-violet);
  transform: translateY(-2px);
}

.post-nav__item--next { text-align: right; }

.post-nav__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-3);
}

.post-nav__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: var(--color-text-1);
  line-height: 1.3;
}


/* ── Site footer ──────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0;
  margin-top: var(--space-16);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer__brand {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-footer__copy {
  font-size: var(--text-sm);
  color: var(--color-text-3);
}

/* Obsolete: .site-footer__links replaced by .site-footer__nav .nav (see navigation section) */


/* ── Ghost card assets ────────────────────────────────────── */
/* Wide/full cards break out slightly beyond reading column, up to ~860px */
.gh-content .kg-width-wide {
  width: min(860px, calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}

.gh-content .kg-width-full {
  width: calc(100vw - 1rem);
  margin-left: 50%;
  transform: translateX(-50%);
  max-width: none;
}

/* Ghost's embedded signup card — keep inside reading column */
.gh-content .kg-signup-card {
  width: 100%;
  margin-left: 0;
  transform: none;
  max-width: 100%;
  box-sizing: border-box;
}

/* Gallery */
.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-8) 0;
}

.kg-gallery-row {
  display: flex;
  gap: var(--space-2);
}

.kg-gallery-image {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Bookmark card */
.kg-bookmark-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-6) 0;
}

.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.kg-bookmark-content {
  flex: 1;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.kg-bookmark-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text-1);
  font-size: var(--text-base);
}

.kg-bookmark-description {
  font-size: var(--text-sm);
  color: var(--color-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin-top: auto;
}

.kg-bookmark-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

.kg-bookmark-author {
  font-weight: 600;
  color: var(--color-text-2);
}

.kg-bookmark-publisher {
  color: var(--color-text-3);
}

.kg-bookmark-thumbnail {
  width: 140px;
  flex-shrink: 0;
  overflow: hidden;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Callout */
.kg-callout-card {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--accent-violet);
  background: rgba(139,92,246,0.08);
  margin: var(--space-6) 0;
}

/* Toggle */
.kg-toggle-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  margin: var(--space-6) 0;
}


/* ── Utility classes ──────────────────────────────────────── */
.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;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-bar {
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--gradient);
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .post-full__layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar { display: none; }
  .toc-dropdown { display: block; }
}

@media (max-width: 768px) {
  :root { --header-height: 56px; }

  .post-hero__content {
    padding: var(--space-6);
  }

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

  .site-header .site-nav { display: none; }
  .nav-drawer.is-open .nav { display: flex; }
  .nav-toggle { display: flex; flex-direction: column; }

  .home-hero-header {
    padding: var(--space-16) var(--space-4) var(--space-12);
  }

  .subscribe-prompt__form {
    flex-direction: column;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__item--next { text-align: left; }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container, .container-read {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .post-card__body { padding: var(--space-4); }
  .post-hero__content { padding: var(--space-6); }
}
