/* ============================================
   Ghost Content Styles
   Targets HTML output from Ghost's {{content}} helper.
   All rules scoped to .article-body wrapper.
   ============================================ */

/* ============================================
   PARAGRAPHS
   ============================================ */
.article-body p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

/* ============================================
   HEADINGS
   ============================================ */
.article-body h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  position: relative;
  scroll-margin-top: 100px;
}

.article-body h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-body h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ============================================
   INLINE CODE
   ============================================ */
.article-body code {
  font-family: 'Fira Code', monospace;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--text-data);
  background: rgba(35,127,212,0.06);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

/* Reset inline code styles inside code blocks */
.article-body pre code {
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ============================================
   CODE BLOCKS
   ============================================ */
.article-body pre {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  color: var(--text-secondary);
}

/* ============================================
   BLOCKQUOTES
   ============================================ */
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--accent-glow);
  border-radius: 0 2px 2px 0;
}
.article-body blockquote p {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* ============================================
   LINKS
   ============================================ */
.article-body a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
.article-body a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.article-body a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   IMAGES & FIGURES
   ============================================ */
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.article-body figure {
  margin: 2rem 0;
}

.article-body figcaption {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ============================================
   LISTS
   ============================================ */
.article-body ul,
.article-body ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  font-size: 1rem;
}

.article-body li::marker {
  color: var(--text-dim);
}

/* ============================================
   TABLES
   ============================================ */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.article-body th {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-hover);
}

.article-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.article-body tr:hover td {
  background: rgba(15,23,42,0.02);
}

/* ============================================
   HORIZONTAL RULES
   ============================================ */
.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15,23,42,0.1), transparent);
  margin: 3rem 0;
}

/* ============================================
   GHOST KOENIG EDITOR CARDS
   ============================================ */

/* Image card */
.article-body .kg-image-card {
  margin: 2rem 0;
}
.article-body .kg-image-card img {
  width: 100%;
  border-radius: 2px;
}
.article-body .kg-image-card figcaption {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.5;
}

/* Wide and full-width image cards */
.article-body .kg-width-wide {
  grid-column: full;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
.article-body .kg-width-full {
  grid-column: full;
  width: 100%;
}

/* Gallery card */
.article-body .kg-gallery-card {
  margin: 2rem 0;
}
.article-body .kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.article-body .kg-gallery-row {
  display: flex;
  gap: 0.75rem;
}
.article-body .kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

/* Bookmark card */
.article-body .kg-bookmark-card {
  margin: 1.5rem 0;
}
.article-body .kg-bookmark-container {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.article-body .kg-bookmark-container:hover {
  border-color: var(--border-hover);
}
.article-body .kg-bookmark-content {
  flex: 1;
  padding: 1.25rem;
}
.article-body .kg-bookmark-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.article-body .kg-bookmark-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-body .kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.article-body .kg-bookmark-icon {
  width: 16px;
  height: 16px;
}
.article-body .kg-bookmark-thumbnail {
  flex-shrink: 0;
  width: 200px;
}
.article-body .kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Callout card */
.article-body .kg-callout-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
  background: var(--accent-glow);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
}
.article-body .kg-callout-emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.article-body .kg-callout-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Toggle card */
.article-body .kg-toggle-card {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.article-body .kg-toggle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: var(--bg-raised);
}
.article-body .kg-toggle-heading h4 {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.article-body .kg-toggle-content {
  padding: 1rem 1.25rem;
}

/* Button card */
.article-body .kg-button-card {
  margin: 2rem 0;
  text-align: center;
}
.article-body .kg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 14px 28px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  background: var(--accent-hover);
  color: var(--bg-start);
}
.article-body .kg-btn:hover {
  background: var(--text-data);
  box-shadow: 0 4px 12px rgba(35,127,212,0.25);
}

/* Header card */
.article-body .kg-header-card {
  padding: clamp(3rem, 6vh, 5rem) clamp(1.5rem, 3vw, 3rem);
  text-align: center;
  background: var(--bg-raised);
  border-radius: 2px;
  margin: 2rem 0;
}
.article-body .kg-header-card h2 {
  margin-top: 0;
}
