/* Ghost editor cards.
 *
 * card_assets is on, so Ghost injects its own structural CSS. This adds the
 * theme's look on top, and without it anything an editor inserts — an image, a
 * gallery, a button, a callout — renders unstyled. That is the difference
 * between a CMS and a text box.
 *
 * Values are taken from the site's own palette so editor-built pages sit
 * beside the designed ones rather than looking bolted on.
 */

.post-content,
.policy-content {
  --c-text: rgba(255, 255, 255, 0.82);
  --c-heading: #ffffff;
  --c-muted: rgba(255, 255, 255, 0.55);
  --c-accent: #ffd700;
  --c-surface: rgba(255, 255, 255, 0.03);
  --c-border: rgba(255, 255, 255, 0.08);
  color: var(--c-text);
  font-size: 1.0625rem;
  line-height: 1.75;
}

/* --- prose ------------------------------------------------------------- */
.post-content h2,
.policy-content h2 {
  color: var(--c-heading);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 2.5rem 0 1rem;
}
.post-content h3,
.policy-content h3 {
  color: var(--c-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.post-content p,
.policy-content p { margin: 0 0 1.25rem; }

.post-content a,
.policy-content a {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content a:hover,
.policy-content a:hover { text-decoration: none; }

.post-content ul, .post-content ol,
.policy-content ul, .policy-content ol { margin: 0 0 1.25rem 1.25rem; }
.post-content li, .policy-content li { margin-bottom: 0.5rem; }

.post-content blockquote,
.policy-content blockquote {
  border-left: 3px solid var(--c-accent);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--c-muted);
  font-style: italic;
}

.post-content hr, .policy-content hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: 2.5rem 0;
}

.post-content code, .policy-content code {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: 0.15em 0.4em;
  font-size: 0.9em;
}
.post-content pre, .policy-content pre {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 1.15rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
}
.post-content pre code, .policy-content pre code {
  background: none; border: 0; padding: 0;
}

/* --- image, gallery ----------------------------------------------------- */
.kg-card { margin: 2rem 0; }

.kg-image-card img,
.kg-image {
  border-radius: 16px;
  width: 100%;
  height: auto;
  display: block;
}
.kg-image-card figcaption,
.kg-gallery-card figcaption,
.kg-embed-card figcaption {
  color: var(--c-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.65rem;
}

.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.kg-gallery-row { display: flex; gap: 0.75rem; }
.kg-gallery-image img { border-radius: 12px; width: 100%; height: auto; display: block; }

/* Wide and full-bleed images break the measure deliberately. */
.kg-width-wide { max-width: min(90vw, 1100px); margin-inline: auto; }
.kg-width-full { max-width: 100vw; margin-inline: calc(50% - 50vw); }
.kg-width-full img { border-radius: 0; }

/* --- button ------------------------------------------------------------- */
.kg-button-card { display: flex; margin: 2rem 0; }
.kg-button-card.kg-align-center { justify-content: center; }
.kg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(90deg, var(--c-accent), #f5c518);
  color: #111;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: 14px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kg-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 215, 0, 0.32);
  text-decoration: none;
}
.kg-btn-accent { background: linear-gradient(90deg, var(--c-accent), #f5c518); }

/* --- callout ------------------------------------------------------------ */
.kg-callout-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  margin: 2rem 0;
}
.kg-callout-emoji { font-size: 1.15rem; line-height: 1.5; }
.kg-callout-text { margin: 0; }

/* --- toggle ------------------------------------------------------------- */
.kg-toggle-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.kg-toggle-heading { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.kg-toggle-heading-text { color: var(--c-heading); font-weight: 600; margin: 0; }
.kg-toggle-card-icon { width: 1rem; height: 1rem; color: var(--c-accent); transition: transform 0.2s ease; }
.kg-toggle-state-open .kg-toggle-card-icon { transform: rotate(180deg); }
.kg-toggle-content { margin-top: 0.85rem; }
.kg-toggle-card:not(.kg-toggle-state-open) .kg-toggle-content { display: none; }

/* --- header, bookmark, embed -------------------------------------------- */
.kg-header-card {
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 2.5rem 1.75rem;
  text-align: center;
  margin: 2rem 0;
  background: var(--c-surface);
}
.kg-header-card h2 { margin-top: 0; }

.kg-bookmark-card a,
.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  background: var(--c-surface);
}
.kg-bookmark-content { padding: 1.1rem 1.25rem; }
.kg-bookmark-title { color: var(--c-heading); font-weight: 600; }
.kg-bookmark-description { color: var(--c-muted); font-size: 0.9rem; margin-top: 0.35rem; }
.kg-bookmark-thumbnail img { object-fit: cover; height: 100%; }

.kg-embed-card { margin: 2rem 0; }
.kg-embed-card iframe { max-width: 100%; border-radius: 14px; border: 0; }

@media (max-width: 640px) {
  .kg-gallery-row { flex-direction: column; }
  .kg-width-wide, .kg-width-full { max-width: 100%; margin-inline: 0; }
  .kg-width-full img { border-radius: 12px; }
}

/* --- callout colours ----------------------------------------------------
   Ghost's callout card shows a colour picker in the editor. Only the generic
   .kg-callout-card rule existed, so every choice in that picker produced an
   identical card and the control looked broken. Tints come from the site
   palette — Ghost's own defaults are built for a light background and are
   unreadable here. */
.kg-callout-card-grey   { --c-callout: rgba(255, 255, 255, 0.35); }
.kg-callout-card-white  { --c-callout: rgba(255, 255, 255, 0.72); }
.kg-callout-card-blue   { --c-callout: #5b9dff; }
.kg-callout-card-green  { --c-callout: #3ecf8e; }
.kg-callout-card-yellow { --c-callout: #ffd700; }
.kg-callout-card-red    { --c-callout: #ff6b6b; }
.kg-callout-card-pink   { --c-callout: #ff7ac6; }
.kg-callout-card-purple { --c-callout: #b18cff; }
.kg-callout-card-accent { --c-callout: var(--c-accent); }

[class*="kg-callout-card-"] {
  border-left-color: var(--c-callout, var(--c-accent));
  background: color-mix(in srgb, var(--c-callout, var(--c-accent)) 9%, transparent);
}

/* --- tables -------------------------------------------------------------
   Ghost ships no table card, so tables arrive from an HTML card or from
   pasted Markdown. Nothing styled them and a fare table — the block this
   site needs most — rendered as unspaced browser default text.

   display:block is deliberate: it makes a wide fare table scroll inside
   itself on a phone instead of forcing the whole page sideways. The cells
   still lay out through anonymous table boxes. */
.post-content table,
.policy-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.post-content th,
.policy-content th {
  text-align: left;
  font-weight: 700;
  color: var(--c-heading);
  white-space: nowrap;
  background: var(--c-surface);
}

.post-content th,
.post-content td,
.policy-content th,
.policy-content td {
  padding: 0.7rem 1rem;
  border: 1px solid var(--c-border);
}

.post-content tbody tr:hover td,
.policy-content tbody tr:hover td {
  background: var(--c-surface);
}
