/* ==========================================================================
   n8n Blog Theme - Post CSS
   Loaded on posts and pages on top of main.css (see default.hbs). Uses the design
   tokens from main.css; hero and related posts reuse its components.
   ========================================================================== */

:root {
  --font-size-article: 18px;
  --line-height-article: 28px;
  --border-subtle: var(--surface-image-placeholder);
}

/* Mono uppercase label (same recipe as main.css nav links and chips) */
.post-hero-chip,
.post-share-label,
.content-banner .global-button,
.workflow-button,
.workflows-button-link,
.post-workflows-card-btn,
.post-navigation-label,
.members-cta-button,
.post-content .kg-btn,
.post-content .kg-cta-button {
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
  font-family: var(--font-mono);
  letter-spacing: var(--letter-spacing-mono);
  text-transform: uppercase;
}

/* Pink pill button (same as .home-button) */
.content-banner .global-button,
.workflow-button,
.workflows-button-link,
.members-cta-button,
.post-content .kg-btn,
.post-content .kg-cta-button {
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  transition: background-color var(--transition-fast);
  border: 0;
  border-radius: var(--radius-full);
  background-color: var(--surface-button-primary);
  padding: var(--spacing-12) var(--spacing-16);
  height: 40px;
  /* Ghost sets inline white text on CTA buttons */
  color: var(--text-button) !important;
  text-decoration: none;
  white-space: nowrap;
}

.content-banner .global-button:hover,
.workflow-button:hover,
.workflows-button-link:hover,
.members-cta-button:hover,
.post-content .kg-btn:hover,
.post-content .kg-cta-button:hover {
  background-color: var(--surface-button-primary-hover);
}

/* Hover underline: always drawn but transparent, so its colour can fade in */
.workflow-details-name a,
.post-navigation-title,
.post-workflows-card-title {
  transition: text-decoration-color var(--transition-fast);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.workflow-details-name a:hover,
.post-navigation-card:hover .post-navigation-title,
.post-workflows-card:hover .post-workflows-card-title {
  text-decoration-color: currentColor;
}

/* ==========================================================================
   READING PROGRESS
   ========================================================================== */
.post-progress {
  position: fixed;
  top: 0;
  left: 0;
  appearance: none;
  z-index: 20;
  border: 0;
  background: transparent;
  width: 100%;
  height: 3px;
  color: var(--surface-button-primary-hover);
}

.post-progress::-webkit-progress-bar {
  background: transparent;
}

.post-progress::-webkit-progress-value {
  background: var(--surface-button-primary-hover);
}

.post-progress::-moz-progress-bar {
  background: var(--surface-button-primary-hover);
}

/* ==========================================================================
   HERO (layout comes from the homepage hero in main.css)
   ========================================================================== */
.post-hero {
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--spacing-48) 0 var(--spacing-64);
}

.post-hero .hero-content-left {
  flex-basis: 512px;
}

/* No feature image: let the copy use the full width */
.post-hero .hero-container:not(:has(.hero-image-box)) .hero-content-left {
  flex-basis: 720px;
}

.post-hero .hero-title-gradient {
  padding-bottom: 0;
  font-size: 40px;
  line-height: 44px;
}

.post-hero .hero-description {
  padding-bottom: 0;
  min-height: 0;
  color: var(--text-secondary);
}

.post-hero-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  transition: background-color var(--transition-fast);
  border-radius: var(--radius-full);
  background-color: var(--surface-capsule);
  padding: var(--spacing-8) var(--spacing-16);
  height: 32px;
  color: var(--text-primary);
}

.post-hero-chip:hover {
  background-color: var(--surface-capsule-active);
}

/* Static pages: listing header (main.css) narrowed to the text column */
.page-header {
  margin: 0 auto;
  max-width: 720px;
}

/* ==========================================================================
   ARTICLE LAYOUT + TABLE OF CONTENTS
   ========================================================================== */
.post-article {
  padding: var(--spacing-64) 0;
}

.post-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-48);
  margin: 0 auto;
  max-width: 720px;
}

.post-content,
#toc {
  width: 100%;
  min-width: 0;
  max-width: 720px;
}

@media (min-width: 1280px) {
  .post-content-wrapper:not(.no-toc) {
    display: grid;
    grid-template-columns: 320px minmax(0, 720px);
    justify-content: space-between;
    align-items: start;
    gap: var(--spacing-64);
    max-width: none;
  }

  #toc {
    position: sticky;
    top: var(--spacing-24);
    max-height: calc(100vh - 2 * var(--spacing-24));
    overflow-y: auto;
  }
}

#toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

#toc li {
  position: relative;
}

/* Nested h3 links: hidden on small screens, expand with the active h2 on desktop */
#toc nav > ol > li > ol {
  display: none;
}

@media (min-width: 1280px) {
  #toc nav > ol > li > ol {
    display: block;
    transition: max-height 0.3s ease;
    max-height: 0;
    overflow: hidden;
  }

  #toc nav > ol > li.is-expanded > ol {
    max-height: 1000px;
  }
}

.toc-link {
  display: block;
  transition: color var(--transition-fast);
  padding: var(--spacing-8) var(--spacing-24);
  color: var(--text-secondary);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
}

.toc-link::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transition: background-color var(--transition-fast);
  background-color: var(--border-subtle);
  width: 2px;
  content: '';
}

#toc nav > ol > li > ol > li > .toc-link {
  padding-left: var(--spacing-48);
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.is-active {
  color: var(--text-primary);
}

.toc-link.is-active::before {
  background-color: var(--surface-button-primary-hover);
}

/* ==========================================================================
   ARTICLE CONTENT
   Element defaults use :where() so component rules below win without
   specificity fights.
   ========================================================================== */
.post-content {
  /* Ghost cards (CTA, button, signup…) use the site accent colour; match the redesign */
  --ghost-accent-color: var(--surface-button-primary);
  color: var(--text-secondary);
  font-size: var(--font-size-article);
  line-height: var(--line-height-article);
  overflow-wrap: break-word;
}

:where(.post-content) :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: var(--spacing-24);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

/* Vertical rhythm between top-level blocks (beats the margin reset in main.css) */
.post-content > * + * {
  margin-top: var(--spacing-24);
}

.post-content > h1,
.post-content > h2 {
  margin-top: 56px;
}

.post-content > h3 {
  margin-top: 40px;
}

.post-content > :is(h4, h5, h6) {
  margin-top: var(--spacing-32);
}

.post-content > :is(h1, h2, h3, h4, h5, h6) + * {
  margin-top: var(--spacing-16);
}

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

/* Ghost leaves empty paragraphs around HTML cards */
.post-content > p:empty {
  display: none;
}

:where(.post-content) h1 {
  font-size: 40px;
  line-height: 44px;
}

:where(.post-content) h2 {
  font-size: var(--font-size-heading-md);
  line-height: var(--line-height-heading-md);
}

:where(.post-content) h3 {
  font-size: var(--font-size-heading-xs);
  line-height: 28px;
}

:where(.post-content) h4 {
  font-size: 20px;
  line-height: 24px;
}

:where(.post-content) :is(h5, h6) {
  font-size: var(--font-size-article);
  line-height: 24px;
}

:where(.post-content) :is(strong, b) {
  color: var(--text-primary);
}

:where(.post-content) a {
  transition: text-decoration-color var(--transition-fast);
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--surface-button-primary-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:where(.post-content) a:hover {
  text-decoration-color: currentColor;
}

/* Keep the aspect ratio when max-width shrinks an image with width/height attributes */
:where(.post-content) img {
  height: auto;
}

/* Editors sometimes wrap link text in <u>, which doubles the underline */
:where(.post-content) a u {
  text-decoration: none;
}

/* Lists (main.css resets ul for navigation) */
:where(.post-content) :is(ul, ol) {
  padding-left: var(--spacing-24);
}

:where(.post-content) ul {
  list-style: disc;
}

:where(.post-content) ol {
  list-style: decimal;
}

:where(.post-content) ul ul {
  list-style: circle;
}

:where(.post-content) ol ol {
  list-style: lower-alpha;
}

:where(.post-content) li + li,
:where(.post-content) li > :is(ul, ol) {
  margin-top: var(--spacing-8);
}

:where(.post-content) li::marker {
  color: var(--text-primary);
}

:where(.post-content) blockquote {
  margin-right: 0;
  margin-left: 0;
  border-left: 2px solid var(--surface-button-primary-hover);
  padding-left: var(--spacing-24);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 30px;
}

.post-content .kg-blockquote-alt {
  border-left: 0;
  padding: 0 var(--spacing-32);
  font-size: var(--font-size-heading-xs);
  line-height: 34px;
  text-align: center;
}

:where(.post-content) hr {
  margin: var(--spacing-48) 0;
  border: 0;
  border-top: 1px solid var(--border-subtle);
}

/* Code */
:where(.post-content) code {
  border-radius: 6px;
  background-color: var(--surface-secondary);
  padding: 2px 6px;
  color: var(--text-primary);
  font-size: 0.875em;
  font-family: var(--font-mono);
}

:where(.post-content) pre {
  border-radius: var(--radius-md);
  background-color: var(--surface-footer);
  padding: var(--spacing-24);
  overflow-x: auto;
  color: var(--text-inverse);
  font-size: var(--font-size-body-md);
  line-height: 22px;
  font-family: var(--font-mono);
}

:where(.post-content) pre code {
  border-radius: 0;
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Tables fill the column and take the width their content needs. Below the
   two-column breakpoint post.js's .post-table-scroll wrapper scrolls wide ones;
   from 1280px they grow past the column instead (no scroll).
   Tables with inline styles are hand-designed HTML cards and keep their own look. */
.post-content .post-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1280px) {
  .post-content .post-table-scroll {
    overflow-x: visible;
  }

  :where(.post-content) table:not([style]) {
    display: inline-table;
  }
}

:where(.post-content) table:not([style]) {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  overflow: hidden;
  font-size: var(--font-size-body-lg);
  line-height: 24px;
}

:where(.post-content) table:not([style]) :is(th, td) {
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--spacing-12) var(--spacing-16);
  text-align: left;
}

:where(.post-content) table:not([style]) :is(th, td) + :is(th, td) {
  border-left: 1px solid var(--border-subtle);
}

:where(.post-content) table:not([style]) tr:last-child > td {
  border-bottom: 0;
}

:where(.post-content) table:not([style]) th {
  background-color: var(--surface-secondary);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

/* Pasted tables with a fixed inline width (e.g. from Google Docs) must still fit */
.post-content table[style] {
  max-width: 100%;
}

/* details/summary used in HTML cards */
:where(.post-content) details {
  border-radius: var(--radius-md);
  background-color: var(--surface-secondary);
  padding: var(--spacing-16) var(--spacing-24);
}

:where(.post-content) summary {
  cursor: pointer;
  color: var(--text-primary);
}

:where(.post-content) details[open] > summary {
  margin-bottom: var(--spacing-16);
}

/* ==========================================================================
   GHOST CARDS
   Ghost's cards.min.css styles most cards; these align them with the design.
   Gallery, bookmark and blockquote card styles are excluded in package.json
   and fully styled here.
   ========================================================================== */
.post-content > .kg-card,
.post-content > figure {
  margin-top: 40px;
  margin-bottom: 40px;
}

/* Drop the browser's default 40px side margins on figure */
.post-content figure {
  margin-right: 0;
  margin-left: 0;
}

/* Wide/full cards stay within the text column (the TOC sits beside it) */
.post-content .kg-width-wide,
.post-content .kg-width-full {
  width: 100%;
  max-width: 100%;
}

.post-content .kg-image {
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.post-content figcaption {
  margin-top: var(--spacing-12);
  color: var(--text-secondary);
  font-size: var(--font-size-body-md);
  line-height: 20px;
  text-align: center;
}

.post-content .kg-embed-card {
  align-items: center;
}

.post-content .kg-video-card .kg-video-container,
.post-content .kg-embed-card iframe {
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Callout */
.post-content .kg-callout-card {
  border-radius: var(--radius-md);
  padding: var(--spacing-20) var(--spacing-24);
  color: var(--text-primary);
  font-size: var(--font-size-body-lg);
  line-height: 24px;
}

/* Beat Ghost's div.kg-callout-text font-size (cards.min.css loads later) */
.post-content .kg-callout-card .kg-callout-text {
  font-size: inherit;
  line-height: inherit;
}

.post-content .kg-callout-card-grey {
  background-color: var(--surface-secondary);
}

.post-content .kg-callout-card-accent {
  background-color: var(--surface-footer);
  color: var(--text-inverse);
}

.post-content .kg-callout-card-accent :is(a, strong, b, code) {
  color: var(--text-inverse);
}

.post-content .kg-callout-card-accent a {
  text-decoration-color: currentColor;
}

/* Toggle */
.post-content .kg-toggle-card {
  box-shadow: none;
  border: 0;
  border-radius: var(--radius-md);
  background-color: var(--surface-secondary);
  padding: var(--spacing-20) var(--spacing-24);
}

.post-content > .kg-toggle-card + .kg-toggle-card {
  margin-top: calc(-1 * var(--spacing-32));
}

.post-content .kg-toggle-card .kg-toggle-heading-text {
  margin: 0;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-lg);
  line-height: 24px;
}

.post-content .kg-toggle-content {
  font-size: var(--font-size-body-lg);
  line-height: 24px;
}

.post-content .kg-toggle-card .kg-toggle-content :is(p, ol, ul) {
  font-size: inherit;
  line-height: inherit;
}

.post-content .kg-toggle-card-icon svg {
  color: var(--text-primary);
}

/* Button and call-to-action */
.post-content .kg-button-card {
  margin-top: var(--spacing-32);
  margin-bottom: var(--spacing-32);
}

.post-content .kg-cta-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

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

.kg-gallery-row {
  display: flex;
  justify-content: center;
  gap: var(--spacing-8);
}

.kg-gallery-image img {
  display: block;
  border-radius: var(--radius-md);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bookmark */
.post-content a.kg-bookmark-container {
  display: flex;
  transition: border-color var(--transition-fast);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text-primary);
  text-decoration: none;
}

.post-content a.kg-bookmark-container:hover {
  border-color: var(--text-secondary);
}

.kg-bookmark-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--spacing-8);
  padding: var(--spacing-20) var(--spacing-24);
  min-width: 0;
}

.kg-bookmark-title {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-lg);
  line-height: 22px;
}

.kg-bookmark-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--font-size-body-md);
  line-height: 20px;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.kg-bookmark-metadata > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-bookmark-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.kg-bookmark-thumbnail {
  position: relative;
  flex: 0 0 33%;
  min-height: 140px;
}

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

/* Image zoom (Lightense in post.js) */
.lightense-backdrop {
  z-index: 99998 !important;
  background-color: var(--surface-primary) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.lightense-wrap ~ br,
.lightense-wrap ~ small {
  display: none;
}

.lightense-wrap img {
  border-radius: 0 !important;
}

.lightense-blur {
  filter: blur(8px) !important;
  transition: filter 0.3s ease !important;
}

/* ==========================================================================
   CONTENT BANNER (HTML card: .content-banner > div + .global-button)
   Same dark surface as the footer card.
   ========================================================================== */
.post-content > .content-banner {
  margin-top: 40px;
  margin-bottom: 40px;
}

.content-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-24);
  border-radius: var(--radius-xl);
  background-color: var(--surface-footer);
  padding: var(--spacing-32);
  color: var(--text-inverse);
}

.content-banner > div {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
}

.content-banner h3 {
  margin: 0;
  color: var(--text-inverse);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-heading-xs);
  line-height: 28px;
}

.content-banner p {
  margin: 0;
  color: var(--text-inverse);
  font-size: var(--font-size-body-lg);
  line-height: 24px;
}

.content-banner p:empty {
  display: none;
}

.content-banner--centered {
  flex-direction: column;
  text-align: center;
}

.content-banner .global-button:focus-visible {
  outline-color: var(--focus-ring-inverse);
}

/* ==========================================================================
   WORKFLOW BANNER (rendered by workflow-banner.js)
   ========================================================================== */
.post-content > .workflows {
  margin-top: 40px;
  margin-bottom: 40px;
}

.workflows {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  border-radius: var(--radius-xl);
  background-color: var(--surface-secondary);
  padding: var(--spacing-32);
}

.workflows h3 {
  margin: 0 0 var(--spacing-16);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-heading-xs);
  line-height: 28px;
}

.workflow {
  border-radius: var(--radius-md);
  background-color: var(--surface-primary);
  padding: var(--spacing-20) var(--spacing-24);
}

.workflow-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-16);
}

.workflow-details-name {
  margin: 0;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body-lg);
  line-height: 22px;
}

.workflow-details-name a {
  color: var(--text-primary);
}

.workflow-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-16);
}

.workflow-nodes {
  display: flex;
  gap: var(--spacing-8);
}

.workflow-node {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background-color: #ffffff;
  padding: 6px;
  width: 36px;
  height: 36px;
}

.workflow-node img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.workflow-node .fa {
  color: var(--text-primary);
  font-size: 18px;
}

.workflow-node-more span {
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-mono);
}

.workflow-details {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--spacing-8);
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
}

.workflow-details p {
  margin: 0;
}

.workflow-user-avatar-wrapper {
  display: flex;
  position: relative;
  flex-shrink: 0;
}

.workflow-user-avatar {
  border-radius: 50%;
  width: 24px;
  height: 24px;
}

.workflow-user-verified {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 12px;
  height: 12px;
}

.workflow-button {
  margin-left: auto;
  background-color: var(--surface-image-placeholder);
  padding: var(--spacing-8) var(--spacing-16);
  height: 32px;
}

.workflow-button:hover {
  background-color: color-mix(
    in srgb,
    var(--surface-image-placeholder) 50%,
    transparent
  );
}

.workflows-button {
  display: flex;
  justify-content: center;
  padding-top: var(--spacing-16);
}

/* ==========================================================================
   SHARE (end of article)
   ========================================================================== */
.post-content > .post-share-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-32);
  margin-top: var(--spacing-64);
}

.post-share-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-12);
  border-radius: var(--radius-xl);
  background-color: var(--surface-secondary);
  padding: var(--spacing-32);
}

.post-share-title {
  margin: 0;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-heading-xs);
  line-height: 28px;
}

.post-share-body p {
  font-size: var(--font-size-body-lg);
  line-height: 24px;
}

.post-share-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-16);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--spacing-24);
}

.post-share-label {
  color: var(--text-secondary);
}

.post-share-icons {
  display: flex;
  gap: var(--spacing-8);
}

.post-share-icons a {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color var(--transition-fast);
  border-radius: var(--radius-full);
  background-color: var(--surface-capsule);
  width: 40px;
  height: 40px;
  color: var(--text-primary);
}

.post-share-icons a:hover {
  background-color: var(--surface-capsule-active);
}

.post-share-icons svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   MEMBERS (paid/members-only posts)
   ========================================================================== */
.members-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-16);
  margin-top: var(--spacing-48);
  border-radius: var(--radius-xl);
  background-color: var(--surface-secondary);
  padding: var(--spacing-48) var(--spacing-32);
  text-align: center;
}

.members-cta h2 {
  margin: 0;
}

.members-cta .global-question {
  color: var(--text-secondary);
  font-size: var(--font-size-body-md);
}

/* ==========================================================================
   AFTER THE ARTICLE: next/prev, related posts, related workflows
   ========================================================================== */
.post-navigation-section,
.post-related-section,
.post-workflows-section {
  border-top: 1px solid var(--border-subtle);
  padding: var(--spacing-64) 0;
}

.post-related-title,
.post-workflows-title {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-heading-md);
  line-height: var(--line-height-heading-md);
}

/* Related posts reuse the homepage .posts-grid and .item cards */
.post-related-grid.posts-grid {
  padding-top: var(--spacing-32);
  padding-bottom: 0;
}

/* Next / previous post */
.post-navigation-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-32);
}

.post-navigation-card {
  display: flex;
  border-radius: var(--radius-xl);
  background-color: var(--surface-secondary);
  overflow: hidden;
}

.post-navigation-thumbnail {
  flex: 0 0 40%;
  background-color: var(--surface-image-placeholder);
  min-height: 160px;
}

.post-navigation-image {
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
}

.post-navigation-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--spacing-16);
  padding: var(--spacing-24);
  min-width: 0;
}

.post-navigation-title {
  font-weight: var(--font-weight-medium);
  font-size: 20px;
  line-height: 24px;
}

.post-navigation-label {
  color: var(--text-secondary);
}

/* Related workflows */
.post-workflows-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing-32);
  padding-top: var(--spacing-32);
}

.post-workflows-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-24);
  border-radius: var(--radius-xl);
  background-color: var(--surface-secondary);
  padding: var(--spacing-32);
}

.post-workflows-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-12);
}

.post-workflows-card-title {
  font-weight: var(--font-weight-medium);
  font-size: 20px;
  line-height: 24px;
}

.post-workflows-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--font-size-body-md);
  line-height: 20px;
}

.post-workflows-card-btn {
  transition: background-color var(--transition-fast);
  border-radius: var(--radius-full);
  background-color: var(--surface-primary);
  padding: var(--spacing-8) var(--spacing-16);
  color: var(--text-primary);
}

.post-workflows-card:hover .post-workflows-card-btn {
  background-color: var(--surface-capsule-active);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1023px) {
  .post-hero {
    padding: var(--spacing-32) 0 var(--spacing-48);
  }

  .post-hero .hero-content-left,
  .post-hero .hero-container:not(:has(.hero-image-box)) .hero-content-left {
    flex-basis: auto;
    max-width: 720px;
  }

  .post-article,
  .post-navigation-section,
  .post-related-section,
  .post-workflows-section {
    padding: var(--spacing-48) 0;
  }

  .post-workflows-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-24);
  }
}

@media (max-width: 639px) {
  :root {
    --font-size-article: 16px;
    --line-height-article: 26px;
  }

  .post-hero .hero-title-gradient {
    font-size: 32px;
    line-height: 36px;
  }

  .post-article,
  .post-navigation-section,
  .post-related-section,
  .post-workflows-section {
    padding: var(--spacing-32) 0;
  }

  :where(.post-content) h1 {
    font-size: 32px;
    line-height: 36px;
  }

  .post-content > h2 {
    margin-top: var(--spacing-48);
  }

  :where(.post-content) h2 {
    font-size: 28px;
    line-height: 32px;
  }

  :where(.post-content) h3 {
    font-size: 22px;
    line-height: 26px;
  }

  :where(.post-content) table:not([style]) {
    font-size: var(--font-size-body-md);
    line-height: 20px;
  }

  :where(.post-content) table:not([style]) :is(th, td) {
    padding: var(--spacing-8) var(--spacing-12);
  }

  .content-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-24);
  }

  .content-banner--centered {
    align-items: center;
  }

  .workflows,
  .post-share-content {
    padding: var(--spacing-24);
  }

  .workflow {
    padding: var(--spacing-16);
  }

  .workflow-button {
    margin-left: 0;
  }

  .post-share-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-navigation-wrap,
  .post-workflows-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-16);
  }

  .post-navigation-thumbnail {
    min-height: 120px;
  }

  .post-workflows-card {
    padding: var(--spacing-24);
  }

  .kg-bookmark-thumbnail {
    display: none;
  }
}
