/* ==========================================================================
   Post content (Koenig editor cards) styled as the magazine spread
   ========================================================================== */

.gh-content {
  font-family: var(--font-serif);
  font-size: var(--t-body-md-size);
  line-height: 1.625;
  color: var(--c-on-surface);
}

.gh-content > * + * { margin-top: 1.5rem; }
.gh-content > p + p { margin-top: 1.5rem; }

/* first paragraph = body-lg with a Syne drop cap spanning three lines */
.gh-content > p:first-child,
.article .gh-content > h2:first-child + p,
.article .gh-content > h6:first-child + h2 + p {
  font-size: var(--t-body-lg-size);
  line-height: 1.625;
}

.gh-content > p:first-child::first-letter,
.article .gh-content > h2:first-child + p::first-letter,
.article .gh-content > h6:first-child + h2 + p::first-letter {
  float: left;
  padding: 0.25rem 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: calc(var(--t-display-lg-size) * 1.6);
  line-height: 0.8;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--c-primary);
}

.gh-content.is-compact > p:first-child { font-size: var(--t-body-md-size); }
.gh-content.is-compact > p:first-child::first-letter { float: none; padding: 0; font: inherit; color: inherit; }
.gh-content.is-compact > * + * { margin-top: 0.75rem; }

.gh-content a:not(.kg-btn):not(.kg-bookmark-container):not(.kg-product-card-button) {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.gh-content a:not(.kg-btn):hover { color: var(--c-primary-container); }

.gh-content h1,
.gh-content h2,
.gh-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  text-transform: uppercase;
  color: var(--c-on-surface);
}

.gh-content h1 { font-size: var(--t-headline-lg-size); line-height: var(--t-headline-lg-lh); margin-top: 2.5rem; }
.gh-content h2 { font-size: var(--t-headline-md-size); line-height: var(--t-headline-md-lh); margin-top: 2.5rem; }
.gh-content h3 { font-size: 20px; line-height: 1.3; margin-top: 2rem; }
.gh-content h4,
.gh-content h5,
.gh-content h6 {
  font-family: var(--font-mono);
  font-size: var(--t-label-md-size);
  line-height: var(--t-label-md-lh);
  letter-spacing: var(--t-label-md-ls);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2rem;
}

.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: 0.75rem; }
.gh-content h6 + h2 { margin-top: 0.375rem; }

.gh-content strong { font-weight: 700; }
.gh-content em { font-style: italic; }
.gh-content small { font-family: var(--font-mono); font-size: var(--t-body-sm-size); }
.gh-content hr { border: 0; height: 2px; background: var(--c-on-surface); margin: 2.5rem 0; }
.gh-content hr + * { margin-top: 2.5rem; }

.gh-content ul, .gh-content ol { padding-left: 1.5rem; }
.gh-content ul { list-style: disc; }
.gh-content ol { list-style: decimal; }
.gh-content li + li { margin-top: 0.375rem; }
.gh-content li::marker { color: var(--c-primary); font-family: var(--font-mono); font-weight: 700; }

/* inline code, pre */
.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
  background: var(--c-surface-high);
  border-radius: var(--r);
}

.gh-content pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--c-inverse-surface);
  color: var(--c-inverse-on-surface);
  border-radius: var(--r-lg);
  font-family: var(--font-mono);
  font-size: var(--t-body-sm-size);
  line-height: 1.5;
}

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

/* quotes: default blockquote = tapri note; alt quote = oversized pull quote */
.gh-content blockquote:not(.kg-blockquote-alt) {
  display: flex;
  gap: 0.5rem;
  padding: var(--space-sm);
  background: var(--c-surface-container-low, var(--c-surface-low));
  font-style: italic;
  color: var(--c-on-surface-variant);
  border-left: 3px solid var(--c-primary);
}

.gh-content aside,
.gh-content blockquote.kg-blockquote-alt {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: var(--r-xl);
  background: var(--c-tertiary-container);
  color: var(--c-on-tertiary-container);
  box-shadow: var(--sh-md);
  font-family: var(--font-serif);
  font-size: var(--t-headline-sm-size);
  line-height: var(--t-headline-sm-lh);
  font-weight: 700;
  font-style: normal;
  letter-spacing: var(--ls-tight);
  text-align: left;
}

.gh-content aside::before,
.gh-content blockquote.kg-blockquote-alt::before {
  content: "”";
  position: absolute;
  right: -0.5rem;
  bottom: -2.5rem;
  font-family: var(--font-display);
  font-size: 110px;
  line-height: 1;
  font-weight: 800;
  opacity: 0.15;
  pointer-events: none;
}

.gh-content aside p, .gh-content blockquote.kg-blockquote-alt p { position: relative; z-index: 1; }
/* pull quote extras (main.js): a bold first line becomes the label, a last line starting with a dash the credit */
.gh-content .quote-label { display: table; margin-bottom: var(--space-xs); padding: 0.25rem 0.625rem; border-radius: var(--r); background: var(--c-tertiary); color: var(--c-on-tertiary); font-family: var(--font-mono); font-size: var(--t-label-sm-size); line-height: var(--t-label-sm-lh); letter-spacing: var(--ls-widest); font-weight: 700; text-transform: uppercase; }
.gh-content .quote-cite { display: block; margin-top: var(--space-sm); font-family: var(--font-mono); font-size: var(--t-label-md-size); line-height: var(--t-label-md-lh); letter-spacing: var(--ls-wider); font-weight: 600; text-transform: uppercase; opacity: 0.8; }
.gh-content aside { font-style: normal; text-align: left; }

/* ---- Data ledger: an HTML card authors paste in (markup in the README) ---- */
.gh-content .smc-ledger { padding: var(--space-md); border-radius: var(--r-xl); background: var(--c-surface-high); box-shadow: var(--sh-md); font-family: var(--font-mono); }
.gh-content .smc-ledger-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--c-surface-highest); }
.gh-content .smc-ledger h4 { margin: 0; font-family: var(--font-serif); font-size: var(--t-headline-sm-size); line-height: var(--t-headline-sm-lh); letter-spacing: 0; font-weight: 600; text-transform: none; color: var(--c-on-surface); }
.gh-content .smc-ledger p { margin: 0.25rem 0 0; font-family: var(--font-mono); font-size: var(--t-body-sm-size); line-height: var(--t-body-sm-lh); color: var(--c-on-surface-variant); }
.gh-content .smc-ledger-head > span { flex-shrink: 0; padding: 0.25rem 0.625rem; border-radius: var(--r); background: var(--c-primary-fixed); color: var(--c-on-primary-fixed); font-size: var(--t-label-sm-size); line-height: var(--t-label-sm-lh); letter-spacing: var(--ls-wider); font-weight: 700; text-transform: uppercase; }
.gh-content .smc-ledger-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); padding-top: var(--space-md); text-align: center; }
.gh-content .smc-ledger-stats > div { padding: var(--space-sm) 0.5rem; border-radius: var(--r-lg); background: var(--c-surface); box-shadow: var(--sh-sm); }
.gh-content .smc-ledger-stats b { display: block; font-family: var(--font-display); font-size: clamp(26px, 4vw, var(--t-display-lg-size)); line-height: 1; font-weight: 800; color: var(--c-primary); }
.gh-content .smc-ledger-stats > div:nth-child(3n+2) b { color: var(--c-tertiary); }
.gh-content .smc-ledger-stats > div:nth-child(3n) b { color: var(--c-on-surface); }
.gh-content .smc-ledger-stats span { display: block; margin-top: 0.25rem; font-size: var(--t-label-sm-size); line-height: var(--t-label-sm-lh); letter-spacing: var(--ls-wider); text-transform: uppercase; color: var(--c-on-surface-variant); }
.gh-content .smc-ledger .smc-ledger-note { margin-top: var(--space-md); font-size: var(--t-label-sm-size); line-height: var(--t-label-sm-lh); letter-spacing: var(--ls-wider); font-weight: 700; text-transform: uppercase; }
.gh-content .smc-ledger-bars { display: flex; align-items: flex-end; gap: 0.5rem; height: 8rem; margin: var(--space-xs) 0 0; padding: 0; list-style: none; }
.gh-content .smc-ledger-bars li { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; margin: 0; font-size: 10px; line-height: 14px; color: var(--c-on-surface-variant); }
.gh-content .smc-ledger-bars li::before { content: ""; width: 100%; height: var(--h, 10%); margin-bottom: 0.25rem; border-radius: var(--r) var(--r) 0 0; background: var(--c-surface-highest); }
.gh-content .smc-ledger-bars li.is-hot::before { background: var(--c-primary); }
.gh-content .smc-ledger-bars li.is-warm::before { background: var(--c-primary-fixed-dim); }
.gh-content .smc-ledger-bars li.is-pink::before { background: var(--c-tertiary); }

/* ---- Images, galleries, embeds ---------------------------------------- */
.gh-content .kg-image-card,
.gh-content .kg-gallery-card,
.gh-content .kg-embed-card,
.gh-content .kg-video-card,
.gh-content .kg-audio-card,
.gh-content .kg-file-card { margin-top: 2rem; }

.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img,
.gh-content .kg-video-container,
.gh-content .kg-embed-card > * { width: 100%; border-radius: var(--r); }

.gh-content figure.kg-card { background: var(--c-surface-lowest); padding: 0.875rem; border-radius: var(--r-lg); box-shadow: var(--sh-sm); }

.gh-content figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-family: var(--font-serif);
  font-size: var(--t-headline-sm-size);
  line-height: var(--t-headline-sm-lh);
  font-style: italic;
  font-weight: 600;
  color: var(--c-on-surface);
  text-align: left;
}

/* a bold last run in a caption is its note (exposure, location): a red label under the caption, right-aligned on desktop */
.gh-content figcaption > .caption-text { flex: 1 1 auto; min-width: 0; }
.gh-content figcaption:has(> :is(b, strong):last-child) { flex-wrap: wrap; }
.gh-content figcaption > :is(b, strong):last-child { flex: 1 0 100%; font-family: var(--font-mono); font-size: var(--t-label-sm-size); line-height: var(--t-label-sm-lh); letter-spacing: var(--t-label-sm-ls); font-style: normal; font-weight: 700; text-transform: uppercase; color: var(--c-primary); }

.gh-content figcaption small,
.gh-content figcaption .small {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-label-sm-size);
  line-height: var(--t-label-sm-lh);
  letter-spacing: var(--t-label-sm-ls);
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--c-secondary);
}

/* widths (full-bleed photography per DESIGN.md) */
.kg-width-wide { position: relative; width: 100%; }
.kg-width-full { position: relative; width: calc(100% + var(--margin) * 2); margin-left: calc(var(--margin) * -1); max-width: none; }
.kg-width-full.kg-card { border-radius: 0; padding: 0; }
.kg-width-full img { border-radius: 0; }

@media (min-width: 1024px) {
  .kg-width-wide { width: calc(100% + 12rem); margin-left: -6rem; }
  .kg-width-full { width: calc(100vw - var(--margin) * 2); margin-left: calc(50% - 50vw + var(--margin)); }
}

.kg-gallery-container { display: flex; flex-direction: column; gap: var(--space-sm); }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: var(--space-sm); }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kg-gallery-image { flex: 1 1 0; }

/* ---- Bookmark card: distro / outpost row ------------------------------- */
.kg-bookmark-card { width: 100%; }
.kg-bookmark-container {
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--c-surface-lowest);
  box-shadow: var(--sh-sm);
  color: inherit !important;
  text-decoration: none !important;
}
.kg-bookmark-content { display: flex; flex-direction: column; gap: 0.25rem; padding: var(--space-md); }
.kg-bookmark-title { font-family: var(--font-mono); font-size: var(--t-label-md-size); letter-spacing: var(--t-label-md-ls); font-weight: 700; text-transform: uppercase; }
.kg-bookmark-description { font-family: var(--font-serif); font-size: var(--t-body-sm-size); line-height: var(--t-body-sm-lh); color: var(--c-on-surface-variant); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; font-family: var(--font-mono); font-size: var(--t-label-sm-size); letter-spacing: var(--t-label-sm-ls); text-transform: uppercase; color: var(--c-secondary); }
.kg-bookmark-icon { width: 1rem; height: 1rem; }
.kg-bookmark-thumbnail { height: 10rem; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) {
  .kg-bookmark-container { flex-direction: row; }
  .kg-bookmark-content { flex: 1; }
  .kg-bookmark-thumbnail { width: 14rem; height: auto; flex-shrink: 0; }
}

/* ---- Callout card: the system banner from the Quad Confessions screen ----------
   Icon (the writer's emoji) on the left, a bold uppercase title set by the colour, then a short
   Space Grotesk line. Red follows the Survival tip card, purple the dark "Peer backlog" card. */
.gh-content .kg-callout-card {
  --callout-bg: var(--c-surface-high);
  --callout-title: var(--c-on-surface);
  --callout-text: var(--c-on-surface-variant);
  --callout-label: "Notes";
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--space-sm);
  row-gap: 0.125rem;
  margin-top: 1.5rem;
  padding: var(--space-md);
  border-radius: var(--r-xl);
  background: var(--callout-bg);
  box-shadow: var(--sh-sm);
}
/* "div." outranks Ghost's own cards.css rule for the emoji */
.gh-content .kg-callout-card div.kg-callout-emoji {
  grid-row: 1 / span 2;
  grid-column: 1;
  align-self: center;
  padding: 0 0.25rem 0 0;
  font-size: 1.5rem;
  line-height: 1;
}
.gh-content .kg-callout-card::before {
  content: var(--callout-label);
  grid-row: 1;
  grid-column: 2;
  align-self: end;
  font-family: var(--font-mono);
  font-size: var(--t-label-md-size);
  line-height: var(--t-label-md-lh);
  letter-spacing: var(--ls-wider);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--callout-title);
}
.gh-content .kg-callout-text {
  grid-row: 2;
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: var(--t-body-sm-size);
  line-height: var(--t-body-sm-lh);
  letter-spacing: var(--t-body-sm-ls);
  color: var(--callout-text);
}
.gh-content .kg-callout-text strong, .gh-content .kg-callout-text b { color: var(--callout-title); }
.gh-content .kg-callout-card a { color: inherit !important; text-decoration: underline; text-underline-offset: 0.15em; }

/* the colour sets the title and the tint (writer's guide: callout colours) */
.gh-content .kg-callout-card-white { --callout-bg: var(--c-surface-lowest); --callout-label: "Aside"; }
.gh-content .kg-callout-card-yellow { --callout-bg: var(--c-primary-fixed); --callout-label: "Update"; }
.gh-content .kg-callout-card-pink { --callout-bg: var(--c-tertiary-fixed); --callout-label: "Tip"; }
.gh-content .kg-callout-card-blue { --callout-bg: var(--c-lilac); --callout-label: "Context"; }
.gh-content .kg-callout-card-green { --callout-label: "Good news"; }
.gh-content .kg-callout-card-purple { --callout-bg: var(--c-inverse-surface); --callout-title: var(--c-surface-bright, #fff); --callout-text: var(--c-inverse-on-surface); --callout-label: "Extra"; box-shadow: var(--sh-md); }
.gh-content .kg-callout-card-red,
.gh-content .kg-callout-card-accent { --callout-bg: var(--c-primary); --callout-title: var(--c-on-primary); --callout-text: var(--c-on-primary); --callout-label: "Don\2019t miss"; box-shadow: var(--sh-md); }

/* no emoji: title and text take the full width (kept apart so older browsers keep the rules above) */
.gh-content .kg-callout-card:not(:has(.kg-callout-emoji))::before,
.gh-content .kg-callout-card:not(:has(.kg-callout-emoji)) .kg-callout-text { grid-column: 1 / -1; }

/* ---- Toggle card: FAQ accordion ---------------------------------------- */
.gh-content .kg-toggle-card { padding: var(--space-sm); background: var(--c-surface-low); box-shadow: var(--sh-sm); border: 0; border-radius: 0; }
.gh-content .kg-toggle-card + .kg-toggle-card { margin-top: 0.5rem; }
.gh-content .kg-toggle-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; cursor: pointer; }
.gh-content .kg-toggle-heading-text { font-family: var(--font-serif); font-size: 17px; line-height: 1.3; font-weight: 600; margin: 0; text-transform: none; letter-spacing: 0; }
.gh-content .kg-toggle-card-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; transition: transform var(--dur) var(--ease); }
.gh-content .kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon { transform: rotate(180deg); }
.gh-content .kg-toggle-content { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid rgb(27 28 26 / 0.05); font-family: var(--font-mono); font-size: var(--t-body-sm-size); line-height: var(--t-body-sm-lh); color: var(--c-on-surface-variant); } .gh-content .kg-toggle-content p { font: inherit; color: inherit; }
.gh-content .kg-toggle-content-x { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid rgb(27 28 26 / 0.05); font-family: var(--font-mono); font-size: var(--t-body-sm-size); line-height: var(--t-body-sm-lh); color: var(--c-on-surface-variant); }
.gh-content .kg-toggle-card[data-kg-toggle-state="close"] .kg-toggle-content { display: none; }

/* ---- Header card: band with watermark --------------------------------- */
.gh-content .kg-header-card { position: relative; overflow: hidden; display: block; min-height: 0; padding: var(--space-lg) var(--space-md); border-radius: var(--r-xl); text-align: left; background: var(--c-inverse-surface); color: var(--c-inverse-on-surface); }
.gh-content .kg-header-card.kg-style-text { background: var(--c-inverse-surface); color: var(--c-inverse-on-surface); }
.gh-content .kg-header-card.kg-v2 .kg-header-card-content { padding: 0; }
.gh-content .kg-header-card * { max-width: none; text-align: left; }
.gh-content .kg-header-card.kg-style-dark { background: var(--c-inverse-surface); color: var(--c-inverse-on-surface); }
.gh-content .kg-header-card.kg-style-light { background: var(--c-surface-low); }
.gh-content .kg-header-card.kg-style-accent { background: var(--c-primary); color: var(--c-on-primary); }
.gh-content .kg-header-card.kg-style-image { background-size: cover; background-position: center; color: #fff; }
.gh-content .kg-header-card-header, .gh-content .kg-header-card h2 { font-family: var(--font-display); font-size: var(--t-headline-lg-size); line-height: var(--t-headline-lg-lh); letter-spacing: var(--ls-tight); font-weight: 800; text-transform: uppercase; }
.gh-content .kg-header-card-subheader, .gh-content .kg-header-card h3 { margin-top: 0.5rem; font-family: var(--font-serif); font-size: var(--t-body-md-size); line-height: var(--t-body-md-lh); }
.gh-content .kg-header-card .kg-header-card-button, .gh-content .kg-header-card .kg-header-card-btn { display: inline-flex; margin-top: 1rem; padding: 0.625rem 1rem; background: var(--c-surface-lowest); color: var(--c-on-surface); font-family: var(--font-mono); font-size: var(--t-label-md-size); letter-spacing: var(--t-label-md-ls); font-weight: 700; text-transform: uppercase; text-decoration: none; }

/* ---- Button card ------------------------------------------------------- */
.kg-button-card { display: flex; }
.kg-align-center { justify-content: center; }
.gh-content .kg-btn, .gh-content .kg-button-card a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--c-primary);
  color: var(--c-on-primary) !important;
  font-family: var(--font-mono);
  font-size: var(--t-label-lg-size);
  letter-spacing: var(--t-label-lg-ls);
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none !important;
  border: 2px solid var(--c-ink);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.gh-content .kg-btn:hover, .gh-content .kg-button-card a:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--c-ink); }

/* ---- Product card: a zine issue / merch bundle ------------------------- */
.kg-product-card { width: 100%; }
.kg-product-card-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: var(--space-md);
  border-radius: var(--r-xl);
  background: var(--c-secondary-container);
  color: var(--c-on-secondary-container);
  box-shadow: var(--sh-md);
}
.kg-product-card-image { width: 100%; border-radius: var(--r-lg); }
.kg-product-card-title-container { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.kg-product-card-title { font-family: var(--font-serif); font-size: var(--t-headline-sm-size); line-height: var(--t-headline-sm-lh); font-weight: 600; margin: 0; text-transform: none; letter-spacing: 0; }
.kg-product-card-description { font-family: var(--font-serif); font-size: var(--t-body-sm-size); line-height: var(--t-body-sm-lh); }
.kg-product-card-rating { display: flex; gap: 0.125rem; }
.kg-product-card-rating-star svg { width: 1rem; height: 1rem; fill: var(--c-primary); }
.kg-product-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-lg);
  background: var(--c-on-secondary-container);
  color: var(--c-on-secondary) !important;
  font-family: var(--font-mono);
  font-size: var(--t-label-md-size);
  letter-spacing: var(--t-label-md-ls);
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none !important;
}

/* ---- Audio / video / file cards: tape deck ----------------------------- */
/* Ghost's own cards.min.css arrives after the theme (ghost_head) and paints the audio card white with a see-through
   play button, so every audio rule here carries two classes to win. */
.kg-card.kg-audio-card { align-items: center; gap: 0.75rem; min-height: 0; padding: 0.75rem; border-radius: var(--r-lg); background: var(--c-inverse-surface); color: var(--c-inverse-on-surface); box-shadow: var(--sh); font-family: var(--font-mono); }
.kg-audio-card .kg-audio-thumbnail { width: 3.5rem; min-width: 3.5rem; height: 3.5rem; margin: 0; border-radius: 50%; }
.kg-audio-card .kg-audio-thumbnail.placeholder { display: grid; place-items: center; background: var(--c-primary); }
.kg-audio-card .kg-audio-thumbnail.placeholder svg { width: 1.25rem; height: 1.25rem; fill: var(--c-on-primary); }
.kg-audio-card .kg-audio-player-container { min-width: 0; }
.kg-audio-card .kg-audio-title { margin: 0; padding: 0 0 0.375rem; font-family: var(--font-mono); font-size: var(--t-label-md-size); letter-spacing: var(--t-label-md-ls); font-weight: 700; line-height: 1.3; text-transform: uppercase; color: inherit; }
.kg-audio-card .kg-audio-player { gap: 0.5rem; padding: 0; }
.kg-audio-card .kg-audio-play-icon, .kg-audio-card .kg-audio-pause-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; padding: 0; bottom: 0; border-radius: 50%; background: var(--c-primary); color: var(--c-on-primary); }
.kg-audio-card .kg-audio-play-icon svg, .kg-audio-card .kg-audio-pause-icon svg { width: 0.875rem; height: 0.875rem; }
.kg-audio-card .kg-audio-play-icon svg { margin-left: 0.125rem; }
.kg-audio-card .kg-audio-current-time, .kg-audio-card .kg-audio-time { min-width: 0; width: auto; padding: 0; font-family: var(--font-mono); font-size: var(--t-label-sm-size); font-weight: 600; color: var(--c-surface-dim); }
.kg-audio-card .kg-audio-current-time { color: var(--c-inverse-on-surface); }
.kg-audio-card .kg-audio-duration { padding: 0 0 0 0.125rem; }
.kg-audio-card .kg-audio-seek-slider { display: block; min-width: 2rem; margin: 0; color: var(--c-primary-container); }
.kg-audio-card .kg-audio-playback-rate { min-width: 0; padding: 0 0.25rem; font-family: var(--font-mono); font-size: var(--t-label-sm-size); color: var(--c-surface-dim); }
.kg-audio-card .kg-audio-mute-icon, .kg-audio-card .kg-audio-unmute-icon { padding: 0.25rem; bottom: 0; margin-left: 0; background: none; color: var(--c-surface-dim); }
.kg-audio-card .kg-audio-volume-slider { width: 4rem; color: var(--c-primary-fixed); }
.kg-card.kg-audio-card input[type="range"]::-webkit-slider-runnable-track { background: rgb(227 226 223 / 0.25); }
.kg-card.kg-audio-card input[type="range"]::-moz-range-track { background: rgb(227 226 223 / 0.25); }
.kg-card.kg-audio-card input[type="range"]::-webkit-slider-thumb { background: var(--c-surface-lowest); }
.kg-card.kg-audio-card input[type="range"]::-moz-range-thumb { background: var(--c-surface-lowest); }
@media (max-width: 480px) { .kg-audio-card .kg-audio-volume-slider { display: none; } }

/* Canteen Radio players (partials/radio-deck.hbs, radio-row.hbs). A listing renders the whole episode with {{content}},
   so everything but its first Audio card is hidden; the card loses its own box and title and becomes a two-row deck:
   a big play button, the seek bar, then the times, speed and mute. */
.radio-player > :not(.kg-audio-card):not(.radio-wait), .radio-player > .kg-audio-card ~ .kg-audio-card { display: none; }
.radio-player .kg-card.kg-audio-card { display: block; margin: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.radio-player .kg-card .kg-audio-thumbnail, .radio-player .kg-card .kg-audio-title { display: none; }
.radio-player .kg-audio-player { display: grid; grid-template-columns: auto auto auto 1fr auto auto; grid-template-areas: "play seek seek seek seek seek" "play now dur . rate mute"; column-gap: 0.375rem; row-gap: 0.25rem; align-items: center; }
.radio-player .kg-audio-play-icon, .radio-player .kg-audio-pause-icon { grid-area: play; width: 3.5rem; height: 3.5rem; margin-right: 0.5rem; box-shadow: var(--sh); }
.radio-player .kg-audio-play-icon svg, .radio-player .kg-audio-pause-icon svg { width: 1.125rem; height: 1.125rem; }
.radio-player .kg-audio-seek-slider { grid-area: seek; width: 100%; }
.radio-player .kg-audio-current-time { grid-area: now; }
.radio-player .kg-audio-time { grid-area: dur; }
.radio-player .kg-audio-playback-rate { grid-area: rate; }
.radio-player .kg-audio-unmute-icon, .radio-player .kg-audio-mute-icon { grid-area: mute; }
.radio-player .kg-audio-volume-slider { display: none; }
.radio-player.is-compact .kg-audio-play-icon, .radio-player.is-compact .kg-audio-pause-icon { width: 2.5rem; height: 2.5rem; margin-right: 0.25rem; box-shadow: none; }
.radio-player.is-compact .kg-audio-play-icon svg, .radio-player.is-compact .kg-audio-pause-icon svg { width: 0.875rem; height: 0.875rem; }
.radio-player.is-compact .kg-audio-playback-rate, .radio-player.is-compact .kg-audio-unmute-icon, .radio-player.is-compact .kg-audio-mute-icon { display: none; }

.kg-video-card { position: relative; }
.kg-video-container { position: relative; overflow: hidden; }
.kg-video-container video { width: 100%; display: block; }
.kg-video-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.5), transparent 50%); }
.kg-video-large-play-icon { position: absolute; inset: 0; margin: auto; width: 4rem; height: 4rem; display: grid; place-items: center; border-radius: 50%; background: var(--c-primary); color: var(--c-on-primary); cursor: pointer; }
.kg-video-large-play-icon svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.kg-video-player-container { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; color: #fff; font-family: var(--font-mono); font-size: var(--t-label-sm-size); }
.kg-video-player { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.kg-video-play-icon, .kg-video-pause-icon { width: 1.5rem; height: 1.5rem; cursor: pointer; }
.kg-video-play-icon svg, .kg-video-pause-icon svg { width: 100%; height: 100%; fill: currentColor; }
.kg-video-seek-slider { flex: 1; accent-color: var(--c-primary-container); }
.kg-video-hide { display: none !important; }
.kg-video-volume-slider { width: 4rem; }
.kg-video-mute-icon, .kg-video-unmute-icon { width: 1rem; height: 1rem; }
.kg-video-mute-icon svg, .kg-video-unmute-icon svg { fill: currentColor; width: 100%; height: 100%; }

.kg-file-card-container { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem; background: var(--c-surface-lowest); border-radius: var(--r-lg); box-shadow: var(--sh-sm); color: inherit !important; text-decoration: none !important; }
.kg-file-card-title { font-family: var(--font-mono); font-size: var(--t-label-md-size); letter-spacing: var(--t-label-md-ls); font-weight: 700; text-transform: uppercase; }
.kg-file-card-caption { font-family: var(--font-serif); font-size: var(--t-body-sm-size); color: var(--c-on-surface-variant); }
.kg-file-card-metadata { display: flex; gap: 0.5rem; font-family: var(--font-mono); font-size: var(--t-label-sm-size); letter-spacing: var(--t-label-sm-ls); text-transform: uppercase; color: var(--c-secondary); }
.kg-file-card-icon { width: 2.5rem; height: 2.5rem; flex-shrink: 0; display: grid; place-items: center; background: var(--c-primary-fixed); color: var(--c-on-primary-fixed); }
.kg-file-card-icon svg { width: 1.25rem; height: 1.25rem; }

/* ---- Embeds ------------------------------------------------------------ */
.kg-embed-card { display: flex; flex-direction: column; align-items: center; width: 100%; }
.kg-embed-card iframe { width: 100%; }
.kg-embed-card > div:not(.kg-card-caption) { width: 100%; }
.kg-embed-card figcaption { align-self: stretch; }

/* ---- Signup card ------------------------------------------------------- */
.kg-signup-card { display: flex; flex-direction: column; gap: 0.75rem; padding: var(--space-md); border-radius: var(--r-2xl); background: var(--c-primary); color: var(--c-on-primary); }
.kg-signup-card-heading { font-family: var(--font-display); font-size: var(--t-headline-lg-size); line-height: 1.25; letter-spacing: var(--ls-tight); font-weight: 800; text-transform: uppercase; margin: 0; }
.kg-signup-card-subheading { font-family: var(--font-serif); font-size: var(--t-body-sm-size); color: var(--c-primary-fixed); }
.kg-signup-card-form { display: flex; flex-direction: column; gap: 0.5rem; }
.kg-signup-card-fields { display: flex; flex-direction: column; gap: 0.5rem; }
.kg-signup-card-input { padding: 0.875rem 1rem; border-radius: var(--r-lg); background: var(--c-surface-lowest); color: var(--c-on-surface); font-family: var(--font-mono); font-size: var(--t-body-sm-size); border: 0; }
.kg-signup-card-button { padding: 0.875rem 1rem; border-radius: var(--r-lg); background: var(--c-tertiary) !important; color: var(--c-on-tertiary) !important; font-family: var(--font-mono); font-size: var(--t-label-lg-size); letter-spacing: var(--t-label-lg-ls); font-weight: 700; text-transform: uppercase; border: 0; cursor: pointer; }
.kg-signup-card-disclaimer { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--ls-wider); text-transform: uppercase; color: var(--c-primary-fixed); }
.kg-signup-card-success, .kg-signup-card-error { display: none; font-family: var(--font-mono); font-size: var(--t-label-sm-size); text-transform: uppercase; }
.kg-signup-card-form.success .kg-signup-card-success { display: block; }
.kg-signup-card-form.success .kg-signup-card-fields { display: none; }
.kg-signup-card-form.error .kg-signup-card-error { display: block; }
.kg-signup-card-form.invalid .kg-signup-card-error { display: block; }

/* ---- Paywall / CTA ----------------------------------------------------- */
.gh-content .kg-cta-card { padding: var(--space-md); background: var(--c-surface-low); border: 2px solid var(--c-ink); }

/* ---- Tables ------------------------------------------------------------ */
.gh-content table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: var(--t-body-sm-size); }
.gh-content th { text-align: left; padding: 0.5rem; font-family: var(--font-mono); font-size: var(--t-label-sm-size); letter-spacing: var(--t-label-sm-ls); text-transform: uppercase; border-bottom: 2px solid var(--c-ink); }
.gh-content td { padding: 0.5rem; border-bottom: 1px solid var(--c-surface-highest); }

/* ---- Content in the post reader: wide measure on desktop -------------- */
.gh-content .kg-card:not(.kg-width-wide):not(.kg-width-full) { max-width: 100%; }

/* beat cards.min.css on header cards */
.gh-content .kg-header-card h2.kg-header-card-header,
.gh-content .kg-header-card.kg-size-small h2.kg-header-card-header,
.gh-content .kg-header-card.kg-size-medium h2.kg-header-card-header,
.gh-content .kg-header-card.kg-size-large h2.kg-header-card-header {
  font-family: var(--font-display);
  font-size: var(--t-headline-lg-size);
  line-height: var(--t-headline-lg-lh);
  letter-spacing: var(--ls-tight);
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
}
.gh-content .kg-header-card h3.kg-header-card-subheader,
.gh-content .kg-header-card.kg-size-small h3.kg-header-card-subheader,
.gh-content .kg-header-card.kg-size-medium h3.kg-header-card-subheader,
.gh-content .kg-header-card.kg-size-large h3.kg-header-card-subheader {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-size: var(--t-body-md-size);
  line-height: var(--t-body-md-lh);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.gh-content .kg-header-card.kg-width-full { width: 100%; margin-left: 0; }
.gh-content .kg-header-card.kg-size-small,
.gh-content .kg-header-card.kg-size-medium,
.gh-content .kg-header-card.kg-size-large { padding: var(--space-lg) var(--space-md); min-height: 0; }
