/* components.css — Reusable UI components: cards, code, badges, command parts.
   Requires: tokens.css */

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-primary);
}

code,
.font-mono {
  font-family: var(--font-mono);
}

/* ── Command name ────────────────────────────────────────────────────────── */
.command-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-accent);
  font-size: 1rem;
}

/* ── Command part pill ───────────────────────────────────────────────────── */
.command-part {
  background: var(--bg-surface);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: inline-block;
  margin: 2px;
}

/* ── Code example box ────────────────────────────────────────────────────── */
.example-box {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Shell syntax highlighting inside example boxes */
.example-box .sh-comment { color: #6a9955; }
.example-box .sh-prompt  { color: #569cd6; font-weight: 600; }

/* ── "Why" callout box ───────────────────────────────────────────────────── */
.why-box {
  background: var(--accent-bg);
  color: var(--accent-text);
  border-left: 4px solid var(--text-accent);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* ── Detail label ────────────────────────────────────────────────────────── */
.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
}

.card.border-primary {
  border-left-width: 4px !important;
}

/* ── Bootstrap accordion overrides ──────────────────────────────────────── */
.accordion-button {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-accent);
}

.accordion-button:not(.collapsed) {
  color: var(--text-accent);
  background: #f0f5ff;
  box-shadow: none;
}

.accordion-button::after {
  filter: none;
}

/* ── Prose block ─────────────────────────────────────────────────────────── */
.module-prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Clickable header (only when block has a title) */
.module-prose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.module-prose-header:hover {
  background: var(--bg-surface);
}

.module-prose-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.module-prose-chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.module-prose.collapsed .module-prose-chevron {
  transform: rotate(90deg);
}

/* Animated body */
.module-prose-body {
  overflow: hidden;
  max-height: 3000px;
  transition: max-height 0.25s ease;
}

.module-prose.collapsed .module-prose-body {
  max-height: 0;
}

.module-prose-body-inner {
  padding: 0 1.25rem 1.25rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.module-prose-body-inner p:last-child,
.module-prose-body-inner ul:last-child,
.module-prose-body-inner ol:last-child {
  margin-bottom: 0;
}

/* Plain prose (no title, no toggle) */
.module-prose-plain {
  padding: 1.25rem 1.5rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.module-prose-plain p:last-child,
.module-prose-plain ul:last-child,
.module-prose-plain ol:last-child {
  margin-bottom: 0;
}

/* ── Note / callout block ────────────────────────────────────────────────── */
.module-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: 0.9rem;
  line-height: 1.6;
}

.module-note-icon {
  flex-shrink: 0;
  line-height: 1.6;
}

.module-note-content {
  flex: 1;
  min-width: 0;
}

.module-note code {
  color: inherit;
  background: rgba(0, 0, 0, 0.07);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

.module-note--info {
  background: var(--accent-bg);
  color: var(--accent-text);
  border-color: var(--text-accent);
}

.module-note--tip {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}

.module-note--warning {
  background: #fffbeb;
  color: #78350f;
  border-color: #f59e0b;
}

/* ── Section badge (numbered circle) ────────────────────────────────────── */
.section-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}