/* =============================================================
   Ghost-specific overrides
   Ghost outputs content with kg-* cards (image, gallery, callout,
   bookmark, embed). Style them to match the journal aesthetic.
   ============================================================= */

/* Feature image at top of a post */
.j-feature-image {
  margin: 0 0 clamp(48px, 6vw, 80px);
}
.j-feature-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}
.j-feature-image figcaption {
  font-size: 13px;
  color: var(--cc-fg-muted);
  margin-top: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* In-prose images & figures (Ghost Koenig editor) */
.j-prose .kg-card,
.j-prose figure {
  margin: 2.5em 0;
  max-width: none;
}
.j-prose .kg-image-card img,
.j-prose figure img {
  display: block;
  width: 100%;
  height: auto;
}
.j-prose .kg-image-card figcaption,
.j-prose figure figcaption {
  font-size: 13px;
  color: var(--cc-fg-muted);
  margin-top: 12px;
  letter-spacing: 0.02em;
  font-weight: 500;
  text-align: left;
}

/* Wide / full-bleed images break out of the 64ch measure */
.j-prose .kg-width-wide  { max-width: 880px; margin-left: -8%; }
.j-prose .kg-width-full  { max-width: 1100px; margin-left: -20%; }
@media (max-width: 1100px) {
  .j-prose .kg-width-wide,
  .j-prose .kg-width-full { max-width: 100%; margin-left: 0; }
}

/* Lists in prose */
.j-prose ul,
.j-prose ol {
  padding-left: 1.4em;
  margin: 1.2em 0;
}
.j-prose li + li { margin-top: 0.4em; }
.j-prose ul li::marker { color: var(--cc-fg-meta); }
.j-prose ol li::marker { color: var(--cc-fg-meta); font-variant-numeric: tabular-nums; }

/* Inline code & code blocks */
.j-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--cc-ivory-muted);
  padding: 2px 6px;
  border-radius: 2px;
}
.j-prose pre {
  background: var(--cc-pine-tree);
  color: var(--cc-china-ivory);
  padding: 24px 28px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}
.j-prose pre code { background: transparent; padding: 0; color: inherit; }

/* Blockquote (Koenig outputs <blockquote>) */
.j-prose blockquote {
  margin: 2.5em 0;
  padding: 0 0 0 28px;
  border-left: 2px solid var(--cc-pine-tree);
  font-weight: 300;
  font-size: clamp(1.375rem, 1.1rem + 0.7vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--cc-pine-tree);
  max-width: 34ch;
}
.j-prose blockquote.kg-blockquote-alt {
  border-left: none;
  border-top: 1px solid var(--cc-pine-tree);
  border-bottom: 1px solid var(--cc-pine-tree);
  padding: 28px 0;
  margin: 3em 0;
}

/* Horizontal rule */
.j-prose hr {
  border: 0;
  border-top: 1px solid var(--cc-rule);
  margin: 3em 0;
}

/* Bookmark cards */
.j-prose .kg-bookmark-card {
  margin: 2em 0;
}
.j-prose .kg-bookmark-container {
  display: flex;
  border: 1px solid var(--cc-rule-strong);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  background: var(--cc-china-ivory);
}
.j-prose .kg-bookmark-content { padding: 24px; flex: 1; }
.j-prose .kg-bookmark-title {
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--cc-pine-tree);
  margin-bottom: 8px;
}
.j-prose .kg-bookmark-description {
  font-size: 14px;
  color: var(--cc-fg-muted);
  line-height: 1.5;
  margin: 0;
}
.j-prose .kg-bookmark-thumbnail img { width: 200px; height: 100%; object-fit: cover; }

/* Callout cards (Koenig) */
.j-prose .kg-callout-card {
  display: flex;
  gap: 16px;
  padding: 24px 28px;
  background: var(--cc-ivory-muted);
  border-radius: 4px;
  margin: 2em 0;
}
.j-prose .kg-callout-emoji { font-size: 1.5em; line-height: 1.2; }
.j-prose .kg-callout-text { font-size: 1rem; line-height: 1.5; margin: 0; }

/* Galleries */
.j-prose .kg-gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 2em 0;
}
.j-prose .kg-gallery-image img { width: 100%; height: auto; display: block; }

/* Pagination from Ghost's default partial */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--cc-rule);
  font-family: var(--cc-font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-fg-muted);
}
.pagination a {
  color: var(--cc-pine-tree);
  text-decoration: none;
  border-bottom: 1px solid var(--cc-rule-strong);
  padding-bottom: 2px;
}
.pagination a:hover { border-bottom-color: var(--cc-pine-tree); }

/* Wrap signoff to the prose measure */
.j-wrap-prose { max-width: 64ch; margin: 0; }

/* Make the `(eq ...)` Handlebars helper output sensible if missing */
.j-list-count strong { font-weight: 600; color: var(--cc-pine-tree); }
