/* Axios AI Media Wiki & Documentation Hub - Markdown Typography & Component Styles */

.markdown-body {
  font-family: var(--font-sans);
  font-size: 1.025rem;
  line-height: 1.75;
  color: var(--text-primary);
  word-wrap: break-word;
}

/* Headings */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.markdown-body h1 {
  font-size: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.markdown-body h2 {
  font-size: 1.55rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.markdown-body h3 {
  font-size: 1.28rem;
}

.markdown-body h4 {
  font-size: 1.1rem;
}

.markdown-body p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

/* Links */
.markdown-body a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all var(--transition-fast);
}

.markdown-body a:hover {
  color: var(--accent-primary-hover);
  border-bottom-color: var(--accent-primary);
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body li > p {
  margin-bottom: 0.5rem;
}

/* Task Checklists */
.markdown-body ul.task-list {
  list-style: none;
  padding-left: 0;
}

.markdown-body li.task-list-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.markdown-body input[type="checkbox"] {
  accent-color: var(--accent-primary);
  transform: translateY(2px);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* Blockquotes */
.markdown-body blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--accent-primary);
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: normal;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

/* GitHub Style Alerts / Callouts */
.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.callout-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.callout-content p:last-child {
  margin-bottom: 0;
}

.callout-note {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.06);
}
.callout-note .callout-title { color: #3b82f6; }

.callout-tip {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}
.callout-tip .callout-title { color: #10b981; }

.callout-important {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
}
.callout-important .callout-title { color: #8b5cf6; }

.callout-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}
.callout-warning .callout-title { color: #f59e0b; }

.callout-caution {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}
.callout-caution .callout-title { color: #ef4444; }

/* Inline Code */
.markdown-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.18em 0.45em;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: #38bdf8;
  border: 1px solid var(--border-color);
}

[data-theme="light"] .markdown-body :not(pre) > code {
  color: #0284c7;
  background: #f1f5f9;
}

/* Code Blocks */
.code-block-wrapper {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  background: #090d16;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: #111726;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.code-lang-tag {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.copy-code-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Tables */
.markdown-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.markdown-body th,
.markdown-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.markdown-body th {
  background: var(--bg-tertiary);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.markdown-body tr:last-child td {
  border-bottom: none;
}

.markdown-body tr:hover td {
  background: var(--bg-hover);
}

/* Horizontal Rule */
.markdown-body hr {
  height: 1px;
  background: var(--border-color);
  border: none;
  margin: 2.25rem 0;
}

/* Collapsible Details */
.markdown-body details {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.markdown-body summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  outline: none;
  user-select: none;
}

.markdown-body details[open] summary {
  margin-bottom: 0.75rem;
}

/* Images */
.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 1.25rem 0;
}

/* Badges & Tags */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.2;
}

.badge-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
