/* =========================================================================
   docs.css — styles for /docs/* (documentation hub)
   Loaded ONLY by DocsLayout. Uses the same design tokens as the rest of the
   marketing site (--rh-purple, Poppins, etc).
   ========================================================================= */

:root {
  --docs-sidebar-w: 260px;
  --docs-toc-w: 220px;
  --docs-content-max: 760px;
  --docs-gap: 2.5rem;

  --docs-prose-color: rgba(233, 230, 240, 0.92);
  --docs-prose-muted: rgba(233, 230, 240, 0.62);
  --docs-prose-strong: #f4f1fb;
  --docs-border: rgba(255, 255, 255, 0.08);
  --docs-border-strong: rgba(255, 255, 255, 0.16);
  --docs-bg-card: rgba(255, 255, 255, 0.025);
  --docs-bg-card-hover: rgba(138, 43, 214, 0.08);
}

html[data-theme='light'] {
  --docs-prose-color: #1a1530;
  --docs-prose-muted: rgba(13, 10, 31, 0.62);
  --docs-prose-strong: #0d0a1f;
  --docs-border: rgba(13, 10, 31, 0.08);
  --docs-border-strong: rgba(13, 10, 31, 0.16);
  --docs-bg-card: #ffffff;
  --docs-bg-card-hover: rgba(106, 26, 176, 0.04);
}

/* ----- Shell layout (sidebar + content + TOC) ------------------------------ */

.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr) var(--docs-toc-w);
  gap: var(--docs-gap);
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .docs-shell {
    grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr);
  }
  .docs-toc { display: none; }
}

@media (max-width: 820px) {
  .docs-shell {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 3rem;
    gap: 2rem;
  }
}

/* ----- Sidebar ------------------------------------------------------------- */

.docs-sidebar {
  position: sticky;
  top: 96px; /* below the rh4-hd top strip + main row */
  align-self: start;
  max-height: calc(100vh - 96px - 2rem);
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
}

@media (max-width: 820px) {
  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--docs-border);
  }
}

.docs-sidebar-group + .docs-sidebar-group {
  margin-top: 1.75rem;
}

.docs-sidebar-group-h {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--docs-prose-muted);
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
}

.docs-sidebar-badge {
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.docs-sidebar-badge--tip {
  background: linear-gradient(135deg, var(--rh-purple-deep, #6a1ab0), var(--rh-purple, #8a2bd6));
  color: #fff;
}

.docs-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar-link {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--docs-prose-muted);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
  border-left: 2px solid transparent;
}
.docs-sidebar-link:hover {
  color: var(--docs-prose-strong);
  background: var(--docs-bg-card-hover);
}
.docs-sidebar-link.is-active {
  color: var(--rh-purple-light, #b855ff);
  background: rgba(138, 43, 214, 0.12);
  border-left-color: var(--rh-purple, #8a2bd6);
  font-weight: 600;
}
html[data-theme='light'] .docs-sidebar-link.is-active {
  color: var(--rh-purple-deep, #6a1ab0);
  background: rgba(106, 26, 176, 0.08);
}

/* ----- Article header ------------------------------------------------------ */

.docs-article {
  min-width: 0;
  max-width: var(--docs-content-max);
}

.docs-article-head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--docs-border);
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--docs-prose-muted);
  margin-bottom: 0.75rem;
}
.docs-breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease;
}
.docs-breadcrumb a:hover { color: var(--rh-purple-light, #b855ff); }
.docs-breadcrumb-current { color: var(--docs-prose-strong); font-weight: 500; }

.docs-article-title {
  font-size: clamp(2rem, 4vw, 2.625rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--docs-prose-strong);
  margin: 0 0 0.75rem;
}

.docs-article-lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--docs-prose-muted);
  margin: 0;
  max-width: 60ch;
}

/* ----- Prose (markdown body) ---------------------------------------------- */

.docs-prose {
  color: var(--docs-prose-color);
  font-size: 15.5px;
  line-height: 1.7;
}

.docs-prose > * + * { margin-top: 1.25rem; }

.docs-prose h2 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--docs-prose-strong);
  margin: 3rem 0 1rem;
  padding-top: 0.5rem;
  scroll-margin-top: 100px;
}
.docs-prose h2:first-child { margin-top: 0; }

.docs-prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--docs-prose-strong);
  margin: 2.25rem 0 0.75rem;
  scroll-margin-top: 100px;
}

.docs-prose h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--docs-prose-strong);
  margin: 1.75rem 0 0.5rem;
}

.docs-prose p { margin: 0; }

.docs-prose strong { color: var(--docs-prose-strong); font-weight: 600; }

.docs-prose a {
  color: var(--rh-purple-light, #b855ff);
  text-decoration: underline;
  text-decoration-color: rgba(184, 85, 255, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms ease;
}
html[data-theme='light'] .docs-prose a {
  color: var(--rh-purple-deep, #6a1ab0);
  text-decoration-color: rgba(106, 26, 176, 0.35);
}
.docs-prose a:hover { text-decoration-color: currentColor; }

.docs-prose ul, .docs-prose ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}
.docs-prose li { margin: 0.4rem 0; }

.docs-prose hr {
  border: none;
  border-top: 1px solid var(--docs-border);
  margin: 2.5rem 0;
}

/* Inline code */
.docs-prose code:not(pre code) {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(138, 43, 214, 0.14);
  border: 1px solid var(--docs-border);
  color: var(--docs-prose-strong);
}
html[data-theme='light'] .docs-prose code:not(pre code) {
  background: rgba(106, 26, 176, 0.08);
}

/* Code blocks (Astro-default Shiki output) */
.docs-prose pre {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: #0d0a1f !important;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 8px 28px rgba(106, 26, 176, 0.08);
}
.docs-prose pre code {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace;
  background: transparent !important;
  padding: 0;
  border: none;
  color: #d6deeb;
  font-size: inherit;
}

/* Tables */
.docs-prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 14.5px;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  overflow: hidden;
}
.docs-prose th,
.docs-prose td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--docs-border);
}
.docs-prose th {
  background: rgba(138, 43, 214, 0.06);
  color: var(--docs-prose-strong);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.docs-prose tr:last-child td { border-bottom: none; }
.docs-prose td code:not(pre code) { white-space: nowrap; }

/* Blockquotes */
.docs-prose blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid var(--rh-purple, #8a2bd6);
  color: var(--docs-prose-muted);
  font-style: italic;
}

/* ----- Aside (callouts) ---------------------------------------------------- */

.docs-aside {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid;
  background: rgba(255, 255, 255, 0.02);
}
.docs-aside-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 0.4rem;
}
.docs-aside-head svg { flex: 0 0 16px; }
.docs-aside-body { font-size: 14.5px; line-height: 1.6; }
.docs-aside-body > :first-child { margin-top: 0; }
.docs-aside-body > :last-child { margin-bottom: 0; }
.docs-aside-body code { font-size: 0.9em; }

.docs-aside--note {
  border-color: rgba(60, 158, 255, 0.35);
  background: rgba(60, 158, 255, 0.06);
}
.docs-aside--note .docs-aside-head { color: #6cb5ff; }
.docs-aside--tip {
  border-color: rgba(138, 43, 214, 0.35);
  background: linear-gradient(135deg, rgba(138, 43, 214, 0.08), rgba(1, 250, 213, 0.04));
}
.docs-aside--tip .docs-aside-head { color: var(--rh-purple-light, #b855ff); }
.docs-aside--caution {
  border-color: rgba(255, 154, 60, 0.35);
  background: rgba(255, 154, 60, 0.06);
}
.docs-aside--caution .docs-aside-head { color: #ffb265; }
.docs-aside--danger {
  border-color: rgba(255, 80, 80, 0.35);
  background: rgba(255, 80, 80, 0.06);
}
.docs-aside--danger .docs-aside-head { color: #ff7a7a; }

/* ----- Steps --------------------------------------------------------------- */

.docs-steps {
  margin: 1.5rem 0;
  counter-reset: step;
}
.docs-steps ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.docs-steps ol > li {
  position: relative;
  padding: 0 0 1.5rem 2.75rem;
  margin: 0;
  border-left: 2px solid var(--docs-border);
  margin-left: 1rem;
  counter-increment: step;
}
.docs-steps ol > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.docs-steps ol > li::before {
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: -2px;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rh-purple-deep, #6a1ab0), var(--rh-purple, #8a2bd6));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(106, 26, 176, 0.35);
}
.docs-steps ol > li > * { margin-top: 0.6rem; }
.docs-steps ol > li > :first-child { margin-top: 0; }

/* ----- Cards (info Card + grid + LinkCard) -------------------------------- */

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.docs-card {
  display: flex;
  gap: 0.875rem;
  padding: 1.125rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-bg-card);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.docs-card:hover {
  border-color: rgba(138, 43, 214, 0.4);
  box-shadow: 0 12px 28px rgba(106, 26, 176, 0.12);
}
.docs-card-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(138, 43, 214, 0.14);
  color: var(--rh-purple-light, #b855ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html[data-theme='light'] .docs-card-icon {
  background: rgba(106, 26, 176, 0.08);
  color: var(--rh-purple-deep, #6a1ab0);
}
.docs-card-body { flex: 1; min-width: 0; }
.docs-card-title {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--docs-prose-strong);
  letter-spacing: -0.005em;
}
.docs-card-content {
  font-size: 14px;
  line-height: 1.55;
  color: var(--docs-prose-muted);
}
.docs-card-content > :first-child { margin-top: 0; }

.docs-linkcard {
  display: block;
  padding: 1.125rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-bg-card);
  text-decoration: none !important;
  color: var(--docs-prose-color) !important;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.docs-linkcard:hover {
  border-color: rgba(138, 43, 214, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(106, 26, 176, 0.12);
}
.docs-linkcard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--docs-prose-strong);
  letter-spacing: -0.005em;
}
.docs-linkcard-title svg {
  flex: 0 0 14px;
  color: var(--rh-purple-light, #b855ff);
  transition: transform 160ms ease;
}
.docs-linkcard:hover .docs-linkcard-title svg { transform: translateX(2px); }
.docs-linkcard-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--docs-prose-muted);
  margin: 0;
}

/* ----- Tabs ---------------------------------------------------------------- */

.docs-tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--docs-bg-card);
}
.docs-tab-tab {
  order: 1;
  flex: 0 0 auto;
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--docs-prose-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 140ms ease, border-color 140ms ease;
}
.docs-tab-tab:hover { color: var(--docs-prose-strong); }
.docs-tab-tab.is-active {
  color: var(--rh-purple-light, #b855ff);
  border-bottom-color: var(--rh-purple, #8a2bd6);
}
html[data-theme='light'] .docs-tab-tab.is-active {
  color: var(--rh-purple-deep, #6a1ab0);
}
.docs-tab-panel {
  order: 2;
  flex: 0 0 100%;
  padding: 1.25rem;
  border-top: 1px solid var(--docs-border);
}
.docs-tab-panel > :first-child { margin-top: 0; }
.docs-tab-panel[hidden] { display: none; }

/* ----- LeadCallout (conversion CTA) ---------------------------------------- */

.lead-callout {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(138, 43, 214, 0.14), rgba(37, 211, 102, 0.06));
  border: 1px solid rgba(138, 43, 214, 0.35);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
html[data-theme='light'] .lead-callout {
  background: linear-gradient(135deg, rgba(106, 26, 176, 0.08), rgba(37, 211, 102, 0.04));
  border-color: rgba(106, 26, 176, 0.25);
}
.lead-callout-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rh-purple-deep, #6a1ab0), var(--rh-purple-light, #b855ff));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(106, 26, 176, 0.4);
}
.lead-callout-icon svg { width: 22px; height: 22px; }
.lead-callout-body { flex: 1; min-width: 0; }
.lead-callout-body strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--docs-prose-strong);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.lead-callout-body p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--docs-prose-color);
  opacity: 0.92;
}
.lead-callout-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--rh-purple-deep, #6a1ab0);
  color: #fff !important;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 200ms ease;
  box-shadow: 0 4px 14px rgba(106, 26, 176, 0.35);
}
.lead-callout-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(106, 26, 176, 0.5);
  filter: brightness(1.08);
}

@media (max-width: 50rem) {
  .lead-callout { flex-direction: column; padding: 1.25rem; }
}

/* ----- Pager (prev/next) --------------------------------------------------- */

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
}
.docs-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: var(--docs-bg-card);
  text-decoration: none !important;
  transition: border-color 160ms ease, transform 160ms ease;
}
.docs-pager-link:hover {
  border-color: rgba(138, 43, 214, 0.4);
  transform: translateY(-1px);
}
.docs-pager-link--next { text-align: right; align-items: flex-end; }
.docs-pager-label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--docs-prose-muted);
}
.docs-pager-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--docs-prose-strong);
  letter-spacing: -0.005em;
}

@media (max-width: 600px) {
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager-link--next { text-align: left; align-items: flex-start; }
}

.docs-updated {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--docs-border);
  font-size: 13px;
  color: var(--docs-prose-muted);
}

/* ----- Right TOC ----------------------------------------------------------- */

.docs-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 96px - 2rem);
  overflow-y: auto;
  padding: 0 0.5rem;
  font-size: 13px;
  scrollbar-width: thin;
}
.docs-toc-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--docs-prose-muted);
  margin: 0 0 0.75rem;
}
.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--docs-border);
}
.docs-toc-item a {
  display: block;
  padding: 4px 12px;
  color: var(--docs-prose-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 140ms ease, border-color 140ms ease;
}
.docs-toc-item a:hover { color: var(--docs-prose-strong); }
.docs-toc-item--depth-3 a { padding-left: 24px; font-size: 12.5px; }
