/* ════════════════════════════════════════════════════════════
   User Guide — "book" layout: left navigation + right content.
   Shared across all /user-guide/* pages.
   ════════════════════════════════════════════════════════════ */

/* ── Two-column shell ── */
.guide-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1600px;
  margin: 2rem auto 4rem;
  padding: 0 1.25rem;
}

/* ── Left navigation ── */
.guide-sidebar {
  align-self: start;
  position: sticky;
  top: 1.5rem;
}

.guide-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  background: var(--surface);
  padding: 0.85rem;
}

.guide-nav__heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0.85rem 0.6rem 0.35rem;
}

.guide-nav a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

.guide-nav a:hover {
  background: #f8f9fb;
}

.guide-nav a.nav-link-active {
  background: rgba(15, 109, 95, 0.1);
  color: var(--primary);
  font-weight: 700;
}

/* ── Right content column ── */
.guide-content {
  min-width: 0;
}

/* ── Header ── */
.guide-header {
  margin-bottom: 1.5rem;
}

.guide-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
}

.guide-title {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.2;
  color: var(--text);
}

.guide-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Sections ── */
.guide-section {
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guide-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.section-title {
  margin: 0;
  font-size: 1.3rem;
  font-family: "Fraunces", Georgia, serif;
  scroll-margin-top: 1.5rem;
  color: var(--text);
}

.section-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

/* ── Subsections ── */
.subsection {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.subsection-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sub-subsection-title {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Numbered steps & bullet lists ── */
.guide-steps,
.guide-list {
  margin: 0;
  padding-left: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}

/* ── Screenshots ── */
figure {
  margin: 0;
}

.screenshot {
  display: block;
}

.screenshot figcaption {
  margin-top: 0.4rem;
}

.screenshot-placeholder {
  width: 100%;
  min-height: 220px;
  background: #f8f9fb;
  border: 2px dashed var(--border);
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  display: block;
}

.screenshot-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

/* ── Dashboard card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.card-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-doc__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.card-doc__desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

.card-doc--total             { border-left-color: var(--primary); }
.card-doc--success           { border-left-color: #22c55e; }
.card-doc--failed            { border-left-color: #ef4444; }
.card-doc--pending           { border-left-color: #f59e0b; }
.card-doc--integrations      { border-left-color: #14b8a6; }
.card-doc--subscriptions     { border-left-color: #6366f1; }
.card-doc--duplicates        { border-left-color: #a855f7; }
.card-doc--invalid           { border-left-color: #ef4444; }
.card-doc--success-rate      { border-left-color: #10b981; }
.card-doc--registered-topics { border-left-color: #3b82f6; }

/* ── Status pills ── */
.status-pill {
  display: inline-block;
  border-radius: 100px;
  padding: 1px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pill--delivered { background: #dcfce7; color: #16a34a; }
.status-pill--failed    { background: #fee2e2; color: #dc2626; }
.status-pill--pending   { background: #fef9c3; color: #ca8a04; }

/* ── Event detail parts ── */
.detail-parts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.detail-part {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-part__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

.detail-part__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Tip boxes ── */
.tip {
  display: flex;
  gap: 0.6rem;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.55;
}

.tip-icon {
  flex-shrink: 0;
}

/* ── Code elements ── */
code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82em;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #4f46e5;
}

.code-badge {
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 700;
}

.code-badge--success {
  background: #dcfce7;
  color: #16a34a;
}

.code-block {
  background: #1e1e2e;
  border-radius: 12px;
  overflow: auto;
}

.code-block pre {
  margin: 0;
  padding: 1rem 1.2rem;
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
  color: #cdd6f4;
  font-size: 0.82rem;
  line-height: 1.65;
}

/* ── Prev / next pager ── */
.guide-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.guide-pager a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 48%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
}

.guide-pager a:hover {
  border-color: var(--primary);
}

.guide-pager a.is-next {
  margin-left: auto;
  text-align: right;
}

.guide-pager__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.guide-pager__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── Help footer ── */
.help-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-top: 2rem;
}

.help-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.help-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Responsive: stack nav above content ── */
@media (max-width: 820px) {
  .guide-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .guide-sidebar {
    position: static;
  }

  .guide-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .guide-nav__heading {
    display: none;
  }
}
