/*
  AIxEnergy Journal — Editorial Refinement Stylesheet (nio-v1.2.1)
  ----------------------------------------------------------------
  Loaded after {{ghost_head}} so editorial rules cleanly harmonize
  Ghost card assets, paywall styles, and theme components.
*/

:root {
  --aix-accent: #3675ce;
  --aix-accent-hover: #2b61b0;
  --aix-ink: #313131;
  --aix-ink-muted: #4b5563;
  --aix-hairline: #e5e7eb;
  --aix-hairline-strong: #d1d5db;
  --aix-measure: 65ch;
}

[data-color-scheme="dark"] {
  --aix-ink: #f3f4f6;
  --aix-ink-muted: #b4b4bd;
  --aix-hairline: rgba(255, 255, 255, 0.14);
  --aix-hairline-strong: rgba(255, 255, 255, 0.24);
}

/* Allow position: sticky inside post templates without horizontal scrollbars */
html,
body.post-template {
  overflow-x: clip !important;
}

/* Brand italic-x (immediate render, zero flash of upright text) & single-line masthead */
em.aix-brand-x {
  font-style: italic;
  font-weight: inherit;
  font-synthesis: style;
}

.site-logo,
.site-title {
  white-space: nowrap;
}

.site-header .site-logo {
  min-width: auto;
}

/* Retire Nio's circular scroll indicator */
.scroll-indicator {
  display: none !important;
}

/* ================================================================
   4b. Fixed 2px top reading-progress bar (posts only)
   ================================================================ */
.aix-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 9998;
  pointer-events: none;
  background: transparent;
}

.aix-reading-progress-bar {
  width: 100%;
  height: 100%;
  background-color: var(--aix-accent);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

/* ================================================================
   8. Masthead double hairline, quiet edition bar & Subscribe CTA
   ================================================================ */
.aix-masthead-wrap {
  position: relative;
  background-color: var(--bg-color-0);
  margin-bottom: 0.5rem;
}

.aix-masthead-wrap::after {
  content: "";
  display: block;
  max-width: var(--content-max-width);
  margin: 0 auto;
  height: 5px;
  border-top: 1px solid var(--aix-hairline-strong);
  border-bottom: 1px solid var(--aix-hairline);
}

.aix-edition-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0.45rem var(--content-padding-x) 0;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aix-ink-muted);
  line-height: 1.2;
}

.aix-masthead-wrap .site-header {
  height: auto;
  min-height: 4.5rem;
  padding-top: 0.65rem;
  padding-bottom: 0.75rem;
}

.site-header .nav-action.button {
  background-color: var(--aix-accent);
  border-color: var(--aix-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.45rem 0.95rem;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.site-header .nav-action.button:hover {
  background-color: var(--aix-accent-hover);
  border-color: var(--aix-accent-hover);
}

/* Keep single Subscribe button reachable on mobile without duplicate nav links */
@media (width <= 768px) {
  .site-header .nav-actions .nav-action.aix-header-subscribe {
    display: inline-flex;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* ================================================================
   1. Article dateline unhidden & full editorial byline
   ================================================================ */
.post .post-header .post-date {
  display: inline;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: inherit;
}

.post .post-header .post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--aix-ink-muted);
  margin-top: -0.25rem;
}

.post .post-header .post-byline-author {
  color: var(--aix-ink);
  font-weight: 600;
  text-decoration: none;
}

.post .post-header .post-byline-author:hover {
  color: var(--aix-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.post .post-header .post-byline-sep {
  opacity: 0.6;
  user-select: none;
}

.post .post-header .post-reading-time:empty {
  display: none;
}

/* ================================================================
   2. Quiet inline Share & Cite controls
   ================================================================ */
.aix-article-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
}

.aix-action-wrap {
  position: relative;
}

.aix-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: auto !important;
  padding: 0.45rem 0.85rem !important;
  border: 1px solid var(--aix-hairline-strong) !important;
  border-radius: 4px !important;
  background: var(--bg-color-0) !important;
  color: var(--aix-ink) !important;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.aix-action-btn svg {
  color: currentColor;
  flex-shrink: 0;
}

.aix-action-btn:hover,
.aix-action-btn[aria-expanded="true"] {
  border-color: var(--aix-accent) !important;
  color: var(--aix-accent) !important;
  background: color-mix(in srgb, var(--aix-accent) 7%, var(--bg-color-0)) !important;
  filter: none;
}

.aix-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  background: var(--bg-color-0);
  border: 1px solid var(--aix-hairline-strong);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.aix-popover[hidden] {
  display: none !important;
}

.aix-share-menu {
  min-width: 11.5rem;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}

.aix-menu-item {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  gap: 0.6rem;
  width: 100% !important;
  height: auto !important;
  padding: 0.5rem 0.7rem !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: var(--aix-ink) !important;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.aix-menu-item svg {
  color: currentColor;
  flex-shrink: 0;
}

.aix-menu-item:hover {
  background: var(--bg-color-1) !important;
  color: var(--aix-accent) !important;
  filter: none;
}

.aix-cite-dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.aix-cite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--aix-hairline);
  padding-bottom: 0.5rem;
}

.aix-cite-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--aix-ink);
}

.aix-cite-close {
  border: 0 !important;
  background: transparent !important;
  color: var(--aix-ink-muted) !important;
  height: auto !important;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.15rem 0.4rem !important;
  cursor: pointer;
}

.aix-cite-close:hover {
  color: var(--aix-ink) !important;
  filter: none;
}

.aix-cite-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.aix-cite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.aix-cite-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aix-ink-muted);
}

.aix-copy-btn {
  border: 1px solid var(--aix-hairline-strong) !important;
  border-radius: 4px !important;
  background: var(--bg-color-0) !important;
  color: var(--aix-accent) !important;
  height: auto !important;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem !important;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aix-copy-btn:hover,
.aix-copy-btn.is-copied {
  background: var(--aix-accent) !important;
  border-color: var(--aix-accent) !important;
  color: #ffffff !important;
  filter: none;
}

.aix-cite-text {
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg-color-1);
  border-radius: 4px;
  font-family: var(--aix-serif, 'Source Serif 4', Georgia, serif);
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
  color: var(--aix-ink) !important;
  overflow-wrap: anywhere;
}

.aix-cite-code {
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg-color-1);
  border-radius: 4px;
  font-family: var(--font-family-monospace, ui-monospace, monospace);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--aix-ink);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ================================================================
   3. Slim single-row editorial audio-summary bar
   ================================================================ */
.post-body .kg-audio-card {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 0;
  margin: 1.5rem 0;
  padding: 0.6rem 0.9rem;
  background: var(--bg-color-0);
  border: 1px solid var(--aix-hairline);
  border-radius: 6px;
  box-shadow: none;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
}

.post-body .kg-audio-card .kg-audio-thumbnail,
.post-body .kg-audio-card .kg-audio-thumbnail.placeholder {
  display: none !important;
}

.post-body .kg-audio-card .kg-audio-player-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  width: 100%;
  padding: 0;
  background: transparent;
}

.post-body .kg-audio-card .kg-audio-title {
  width: auto !important;
  margin: 0;
  padding: 0;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--aix-ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-body .kg-audio-card .kg-audio-player {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 240px;
  min-width: 0;
  padding: 0;
  height: auto;
}

.post-body .kg-audio-card .kg-audio-play-icon,
.post-body .kg-audio-card .kg-audio-pause-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--aix-accent) !important;
  color: #ffffff !important;
  flex-shrink: 0;
  cursor: pointer;
}

.post-body .kg-audio-card .kg-audio-play-icon:hover,
.post-body .kg-audio-card .kg-audio-pause-icon:hover {
  background: var(--aix-accent-hover) !important;
  filter: none;
}

.post-body .kg-audio-card .kg-audio-play-icon svg,
.post-body .kg-audio-card .kg-audio-pause-icon svg {
  width: 11px;
  height: 11px;
  fill: #ffffff;
}

.post-body .kg-audio-card .kg-audio-hide {
  display: none !important;
}

.post-body .kg-audio-card .kg-audio-current-time,
.post-body .kg-audio-card .kg-audio-time,
.post-body .kg-audio-card .kg-audio-duration {
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--aix-ink-muted);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  width: auto !important;
  min-width: auto;
  margin: 0;
  padding: 0;
}

.post-body .kg-audio-card .kg-audio-seek-slider {
  flex: 1 1 80px;
  min-width: 60px;
  margin: 0 0.25rem;
  accent-color: var(--aix-accent);
}

.post-body .kg-audio-card .kg-audio-playback-rate {
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent !important;
  border: 0 !important;
  color: var(--aix-ink-muted) !important;
  height: auto !important;
  min-width: 2rem;
  padding: 0.2rem 0.35rem !important;
}

.post-body .kg-audio-card .kg-audio-playback-rate:hover {
  color: var(--aix-ink) !important;
  filter: none;
}

.post-body .kg-audio-card .kg-audio-unmute-icon,
.post-body .kg-audio-card .kg-audio-mute-icon {
  background: transparent !important;
  border: 0 !important;
  color: var(--aix-ink-muted) !important;
  height: auto !important;
  width: auto !important;
  padding: 0.2rem !important;
}

.post-body .kg-audio-card .kg-audio-unmute-icon svg,
.post-body .kg-audio-card .kg-audio-mute-icon svg {
  width: 15px;
  height: 15px;
  fill: var(--aix-ink-muted);
}

.post-body .kg-audio-card .kg-audio-volume-slider {
  width: 52px;
  accent-color: var(--aix-accent);
}

@media (max-width: 560px) {
  .post-body .kg-audio-card .kg-audio-volume-slider,
  .post-body .kg-audio-card .kg-audio-unmute-icon,
  .post-body .kg-audio-card .kg-audio-mute-icon {
    display: none;
  }
}

/* ================================================================
   5. Discreet desktop-only sticky section outline (>= 1280px, 6+ H2)
   ================================================================ */
.post .post-main {
  position: relative;
}

.aix-toc-rail {
  display: none;
}

@media (min-width: 1280px) {
  .aix-toc-rail {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(100% + 2.5rem);
    width: 13.5rem;
    pointer-events: none;
  }

  .aix-toc {
    position: sticky;
    top: 5.5rem;
    pointer-events: auto;
    font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
    border-left: 1px solid var(--aix-hairline);
    padding-left: 0.9rem;
  }

  .aix-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
  }

  .aix-toc-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--aix-ink-muted);
  }

  .aix-toc-toggle {
    border: 0 !important;
    background: transparent !important;
    color: var(--aix-ink-muted) !important;
    height: auto !important;
    font-size: 13px;
    line-height: 1;
    padding: 2px 6px !important;
    cursor: pointer;
  }

  .aix-toc-toggle:hover {
    color: var(--aix-ink) !important;
    filter: none;
  }

  .aix-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .aix-toc.is-collapsed .aix-toc-list {
    display: none;
  }

  .aix-toc-link {
    display: block;
    font-size: 12.5px;
    line-height: 1.38;
    color: var(--aix-ink-muted);
    text-decoration: none;
    transition: color 0.15s ease;
  }

  .aix-toc-link:hover {
    color: var(--aix-ink);
  }

  .aix-toc-link.is-active {
    color: var(--aix-accent);
    font-weight: 600;
  }
}

/* ================================================================
   7. Journal-grade subscribers badge & Economist-style paywall card
   ================================================================ */
.aix-subscribers-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  color: var(--aix-accent);
  border: 1px solid color-mix(in srgb, var(--aix-accent) 38%, transparent);
  background: color-mix(in srgb, var(--aix-accent) 6%, transparent);
  padding: 1px 6px;
  border-radius: 2px;
  line-height: 1.45;
  white-space: nowrap;
}

.post-card--full-image .aix-subscribers-badge {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(13, 17, 29, 0.45);
}

/* Gated post paywall */
.post-body .gh-post-upgrade-cta {
  position: relative;
  margin: 2.5rem 0 2rem;
  width: 100%;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
}

.post-body .gh-post-upgrade-cta::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 5.5rem;
  background: linear-gradient(to bottom, transparent, var(--bg-color-0));
  pointer-events: none;
}

.post-body .gh-post-upgrade-cta .gh-post-upgrade-cta-content {
  background: var(--bg-color-0) !important;
  color: var(--aix-ink) !important;
  border: 1px solid var(--aix-hairline-strong);
  border-top: 3px solid var(--aix-accent);
  border-radius: 4px;
  padding: 2.25rem 2rem;
  text-align: left;
  align-items: flex-start;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.post-body .gh-post-upgrade-cta .aix-paywall-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--aix-accent);
  margin: 0 0 0.65rem;
}

.post-body .gh-post-upgrade-cta h2 {
  font-family: var(--aix-serif, 'Source Serif 4', Georgia, serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--aix-ink) !important;
  margin: 0 0 0.65rem;
}

.post-body .gh-post-upgrade-cta .aix-paywall-deck {
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--aix-ink-muted);
  margin: 0 0 1.35rem;
  max-width: 48ch;
}

.post-body .gh-post-upgrade-cta .aix-paywall-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.35rem;
  margin-top: 0.25rem;
}

.post-body .gh-post-upgrade-cta a.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--aix-accent) !important;
  color: #ffffff !important;
  border: 1px solid var(--aix-accent);
  border-radius: 4px;
  padding: 0.65rem 1.35rem;
  margin: 0;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}

.post-body .gh-post-upgrade-cta a.gh-btn:hover {
  background: var(--aix-accent-hover) !important;
  opacity: 1;
}

.post-body .gh-post-upgrade-cta p {
  margin: 0.9rem 0 0;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  font-size: 0.875rem;
  color: var(--aix-ink-muted);
}

.post-body .gh-post-upgrade-cta p small {
  font-size: 0.875rem;
  letter-spacing: 0;
  color: var(--aix-ink-muted);
}

.post-body .gh-post-upgrade-cta p a {
  color: var(--aix-accent) !important;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ================================================================
   8b. Footer horizontal colophon row
   ================================================================ */
footer[data-footer] {
  border-top: 1px solid var(--aix-hairline-strong);
}

.aix-footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 2rem;
}

.aix-footer-colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--aix-hairline);
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
}

.aix-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.aix-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.5rem;
}

.aix-footer-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--aix-ink-muted);
  text-decoration: none;
}

.aix-footer-nav a:hover {
  color: var(--aix-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ================================================================
   9. Micro-typography, measure (64-66ch), bibliography & Journal CTA
   ================================================================ */
.post-main,
.post-header .post-header-content {
  max-width: min(65ch, 665px, 100%);
}

.post-body {
  font-feature-settings: "kern" 1, "liga" 1;
  hanging-punctuation: first last;
}

.post-body > p {
  max-width: 65ch;
}

table,
td,
th,
#aixt .t-v,
#aixt .t-d,
#aixt .t-wk {
  font-variant-numeric: tabular-nums lining-nums;
}

.aix-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Bibliography list aligned with refined 15px Inter muted notes styling */
.post-body #bibliography + ul,
.post-body #bibliography + ol,
.post-body .aix-bib {
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
  margin-top: 0.75rem;
  padding-left: 1.25rem;
}

.post-body #bibliography + ul > li,
.post-body #bibliography + ol > li,
.post-body .aix-bib > li {
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif) !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  color: var(--aix-ink-muted);
  overflow-wrap: anywhere;
  margin-bottom: 0.6rem;
}

/* Restrained end-of-article & homepage Journal subscription box */
.aix-subscribe-box {
  border: 1px solid var(--aix-hairline-strong);
  border-top: 2px solid var(--aix-accent);
  border-radius: 4px;
  background: var(--bg-color-0);
  padding: 1.85rem 2rem;
  margin: 1rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  font-family: var(--font-family-heading, Inter, system-ui, sans-serif);
}

.aix-subscribe-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aix-accent);
  margin: 0;
}

.aix-subscribe-heading {
  font-family: var(--aix-serif, 'Source Serif 4', Georgia, serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--aix-ink);
  margin: 0.2rem 0 0.35rem;
}

.aix-subscribe-copy {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--aix-ink-muted);
  margin: 0;
  max-width: 54ch;
}

.aix-subscribe-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}

.aix-subscribe-input {
  flex: 1 1 220px;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem !important;
  border: 1px solid var(--aix-hairline-strong);
  border-radius: 4px;
  background: var(--bg-color-0);
  color: var(--aix-ink);
  font-size: 0.9rem !important;
}

.aix-subscribe-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.35rem;
  border: 1px solid var(--aix-accent);
  border-radius: 4px;
  background-color: var(--aix-accent) !important;
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.aix-subscribe-submit:hover {
  background-color: var(--aix-accent-hover) !important;
  border-color: var(--aix-accent-hover);
}

/* Harmonize primary CTA accent across Ghost signup cards */
.kg-signup-card-button {
  background-color: var(--aix-accent) !important;
  color: #ffffff !important;
}

/* Print-only footer hidden on screen */
.aix-print-footer {
  display: none;
}

/* ================================================================
   4a. Dedicated @media print stylesheet
   ================================================================ */
@media print {
  @page {
    margin: 1.8cm 2cm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    padding-top: 0 !important;
  }

  .aix-masthead-wrap,
  .site-header,
  .aix-edition-bar,
  #aixt,
  footer[data-footer],
  .aix-article-actions,
  .kg-audio-card,
  .kg-signup-card,
  .gh-post-upgrade-cta,
  .aix-subscribe-box,
  [data-members-form],
  #ghost-portal-root,
  #sodo-search-root,
  iframe,
  .aix-reading-progress,
  .scroll-indicator,
  .aix-toc-rail,
  .aix-toc,
  #comments,
  .post > .section,
  .post .post-header hr,
  .post-main > hr {
    display: none !important;
  }

  .container,
  .post,
  .post .post-main,
  .post .post-header,
  .post .post-header .post-header-content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  .post .post-header figure {
    height: auto !important;
    max-height: 8cm !important;
    margin: 0 0 1rem !important;
    break-inside: avoid;
  }

  .post .post-header h1 {
    font-size: 20pt !important;
    line-height: 1.18 !important;
    color: #000000 !important;
    break-after: avoid;
  }

  .post-body,
  .post-body > p,
  .post-body li {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif !important;
    font-size: 11pt !important;
    line-height: 1.55 !important;
    color: #111111 !important;
    max-width: 100% !important;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #000000 !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  figure,
  table,
  blockquote,
  pre,
  .post-authors {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5pt !important;
  }

  th,
  td {
    border: 1px solid #9ca3af !important;
    padding: 4pt 6pt !important;
  }

  a {
    color: #111111 !important;
    text-decoration: none !important;
  }

  .aix-print-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 0.65rem;
    border-top: 1px solid #9ca3af;
    font-family: Inter, system-ui, sans-serif;
    font-size: 8.5pt;
    color: #4b5563;
  }
}
