/* ==========================================================================
   Aura — theme-owned editor cards
   (Cards excluded from Ghost's bundled card assets; see package.json)
   1. Blockquotes  2. Callout  3. Toggle  4. Bookmark  5. Button
   6. Product  7. File  8. Overrides for Ghost-bundled cards
   9. Gallery
   ========================================================================== */

/* --- 1. Blockquotes --- */

/* Default quotes go centered-italic per the Aura post mockup; the
   alternate style stays distinct by running larger and sage. */
blockquote {
  margin: 3em 0;
  padding: 0 1rem;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink-strong);
}

blockquote.kg-blockquote-alt {
  font-size: 1.75rem;
  color: var(--ink-muted);
}

/* --- 2. Callout --- */

.kg-callout-card {
  display: flex;
  gap: 0.75rem;
  padding: 1.1rem 1.35rem;
  margin: 2rem 0;
  font-size: 1.0625rem;
  background: color-mix(in srgb, var(--callout-hue, #707070) 9%, var(--paper));
  border-left: 2px solid var(--callout-hue, var(--rule-strong));
}

.kg-callout-card-grey,
.kg-callout-card-background-grey   { --callout-hue: #707070; }
.kg-callout-card-blue,
.kg-callout-card-background-blue   { --callout-hue: #4a7fb5; }
.kg-callout-card-green,
.kg-callout-card-background-green  { --callout-hue: #3f8f5f; }
.kg-callout-card-yellow,
.kg-callout-card-background-yellow { --callout-hue: #b58a2a; }
.kg-callout-card-red,
.kg-callout-card-background-red    { --callout-hue: #b5524a; }
.kg-callout-card-pink,
.kg-callout-card-background-pink   { --callout-hue: #b54a8f; }
.kg-callout-card-purple,
.kg-callout-card-background-purple { --callout-hue: #7a4ab5; }
.kg-callout-card-accent,
.kg-callout-card-background-accent { --callout-hue: var(--accent); }

.kg-callout-card-white,
.kg-callout-card-background-white {
  background: transparent;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--rule-strong);
}

.kg-callout-emoji,
.kg-callout-card-emoji { font-size: 1.15em; line-height: 1.4; }
.kg-callout-text,
.kg-callout-card-text { min-width: 0; }
.kg-callout-text p:last-child,
.kg-callout-card-text p:last-child { margin-bottom: 0; }

/* --- 3. Toggle --- */

.kg-toggle-card {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.25rem 0;
  margin: 2rem 0;
}

.kg-toggle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.kg-toggle-heading-text {
  font-size: 1.125rem;
  font-weight: 550;
  margin: 0.65rem 0;
}

.kg-toggle-card-icon {
  background: none;
  border: none;
  padding: 0.25rem;
  margin: 0;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  flex-shrink: 0;
}

.kg-toggle-card-icon svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}

.kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon svg { transform: rotate(0deg); }
.kg-toggle-card[data-kg-toggle-state="close"] .kg-toggle-content { display: none; }
.kg-toggle-content { padding: 0.25rem 0 1rem; }
.kg-toggle-content > :last-child { margin-bottom: 0; }

/* --- 4. Bookmark --- */

.kg-bookmark-card { margin: 2rem 0; }

.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  background: none;
}

.kg-bookmark-container:hover { border-color: var(--ink-muted); color: inherit; }

.kg-bookmark-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  min-width: 0;
  text-align: left;
}

.kg-bookmark-title { font-size: 1rem; font-weight: 550; line-height: 1.35; }

.kg-bookmark-description {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
}

.kg-bookmark-icon { width: 1rem; height: 1rem; margin-right: 0.5rem; }
.kg-bookmark-author { display: inline; }
.kg-bookmark-author:after { content: "·"; margin: 0 0.4em; }
.kg-bookmark-publisher { display: inline; }

.kg-bookmark-thumbnail {
  position: relative;
  flex-basis: 33%;
  flex-shrink: 0;
  min-height: 100%;
}

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

@media (max-width: 600px) {
  .kg-bookmark-container { flex-direction: column; }
  .kg-bookmark-thumbnail { order: -1; min-height: 160px; }
}

/* --- 5. Button --- */

.kg-button-card { display: flex; margin: 2rem 0; }
.kg-button-card.kg-align-center { justify-content: center; }
.kg-button-card.kg-align-left { justify-content: flex-start; }

.kg-btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.55rem 1.25rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kg-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.kg-btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.kg-btn-accent:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* --- 6. Product --- */

.kg-product-card { margin: 2rem 0; }

.kg-product-card-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.kg-product-card-image { align-self: center; max-height: 340px; width: auto; max-width: 100%; }
.kg-product-card-title-container { margin: 0; }
.kg-product-card-title { font-size: 1.125rem; font-weight: 550; margin: 0; }

.kg-product-card-rating { display: flex; gap: 0.15rem; }
.kg-product-card-rating-star svg { width: 1rem; height: 1rem; fill: var(--rule); }
.kg-product-card-rating-active.kg-product-card-rating-star svg { fill: var(--accent); }

.kg-product-card-description { font-size: 0.9375rem; color: var(--ink-muted); }
.kg-product-card-description p:last-child { margin-bottom: 0; }

.kg-product-card-button {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.5rem 1.1rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kg-product-card-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.kg-product-card-btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.kg-product-card-button span { display: inline; }

/* --- 7. File --- */

.kg-file-card { margin: 2rem 0; }

.kg-file-card-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.kg-file-card-container:hover { border-color: var(--ink-muted); color: inherit; }

.kg-file-card-contents { min-width: 0; }
.kg-file-card-title { font-size: 1rem; font-weight: 550; }
.kg-file-card-caption { font-size: 0.875rem; color: var(--ink-muted); }

.kg-file-card-metadata {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

.kg-file-card-filename { display: inline; font-weight: 550; }
.kg-file-card-filesize { display: inline; margin-left: 0.5rem; }

.kg-file-card-icon { flex-shrink: 0; display: flex; }
.kg-file-card-icon svg { width: 1.6rem; height: 1.6rem; color: var(--ink-muted); }

.kg-file-card-medium .kg-file-card-caption { display: none; }

.kg-file-card-small .kg-file-card-container { padding: 0.6rem 0.9rem; }
.kg-file-card-small .kg-file-card-caption,
.kg-file-card-small .kg-file-card-metadata { display: none; }

/* --- 8. Light overrides for Ghost-bundled cards (header, signup, embed) --- */

.kg-header-card.kg-v2 .kg-header-card-heading,
.kg-header-card .kg-header-card-heading {
  font-family: var(--gh-font-heading, var(--font-serif));
}

.kg-header-card.kg-v2 .kg-header-card-subheading,
.kg-header-card .kg-header-card-subheading {
  font-family: var(--gh-font-body, var(--font-serif));
}

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

/* --- 9. Gallery --- */

.kg-gallery-card { margin: 2rem 0; }

.kg-gallery-container { display: flex; flex-direction: column; gap: 0.5rem; }

.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; gap: 0.5rem; }

.kg-gallery-image { min-width: 0; }

.kg-gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
