/* ============================================================
   docs.css - Oravio Developer Documentation Page
   ============================================================ */

:root {
  --docs-brand:        #5f43d0;
  --docs-brand-light:  #ede9ff;
  --docs-text-dark:    #1a0e4a;
  --docs-text-mid:     #4b4568;
  --docs-text-soft:    #7b74a0;
  --docs-bg-white:     #ffffff;
  --docs-bg-light:     #faf9ff;
  --docs-bg-code:      #0f0e17;
  --docs-border:       #e8e4f8;
  --docs-sidebar-w:    260px;
  --docs-header-h:     64px;
}

/* ════════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════ */
.docs-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--docs-brand);
  background: var(--docs-brand-light);
  border: 1.5px solid #d4c9ff;
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 18px;
}

.docs-hero {
  background: linear-gradient(155deg, #fbfaff 0%, #fff 50%, #f0edff 100%);
  padding: 80px 24px 60px;
  text-align: center;
  border-bottom: 1.5px solid var(--docs-border);
}

.docs-hero__inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.docs-hero__h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--docs-text-dark);
  margin: 0 0 16px;
  line-height: 1.2;
}

.docs-hero__sub {
  font-size: 1.0625rem;
  color: var(--docs-text-mid);
  max-width: 580px;
  line-height: 1.7;
  margin: 0 0 32px;
}

/* Search bar */
.docs-hero__search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--docs-bg-white);
  border: 1.5px solid var(--docs-border);
  border-radius: 12px;
  padding: 12px 18px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 48px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-hero__search:hover {
  border-color: #c4b5f8;
  box-shadow: 0 0 0 3px rgba(95,67,208,0.08);
}

.docs-hero__search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'PlusJakartaSans', sans-serif;
  font-size: 0.9375rem;
  color: var(--docs-text-soft);
  background: transparent;
  cursor: text;
}

.docs-hero__search-kbd {
  font-size: 0.72rem;
  color: var(--docs-text-soft);
  background: var(--docs-bg-light);
  border: 1px solid var(--docs-border);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: monospace;
}

/* Quick-access cards */
.docs-hero__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  text-align: left;
}

.docs-hero__card {
  background: var(--docs-bg-white);
  border: 1.5px solid var(--docs-border);
  border-radius: 14px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.docs-hero__card:hover {
  border-color: #c4b5f8;
  box-shadow: 0 6px 20px rgba(95,67,208,0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.docs-hero__card-icon { font-size: 1.5rem; margin-bottom: 6px; }

.docs-hero__card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--docs-text-dark);
}

.docs-hero__card span {
  font-size: 0.8rem;
  color: var(--docs-text-soft);
  line-height: 1.4;
}

/* ════════════════════════════════════════════════════════
   LAYOUT - sidebar + content
════════════════════════════════════════════════════════ */

/* vendor .page sets overflow:hidden which breaks position:sticky */
.docs-page {
  overflow: visible !important;
}

.docs-page #oravio-cta-section {
  margin-top: 80px;
}

.docs-layout {
  margin-bottom: 80px;
}

.docs-layout {
  display: flex;
  align-items: flex-start;   /* allows sticky to work in flex */
  background: var(--docs-bg-white);
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  border-left: 1.5px solid var(--docs-border);
  border-right: 1.5px solid var(--docs-border);
}

/* ── Sidebar ───────────────────────────────────────────── */
.docs-sidebar {
  width: var(--docs-sidebar-w);
  flex-shrink: 0;
  border-right: 1.5px solid var(--docs-border);
  background: var(--docs-bg-light);
  padding: 32px 0 48px;
  position: sticky;
  top: var(--docs-header-h);
  max-height: calc(100vh - var(--docs-header-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d4c9ff transparent;
}

.docs-sidebar__close { display: none; }

.docs-nav { padding: 0 16px; }

.docs-nav__group {
  margin-bottom: 28px;
}

.docs-nav__group-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--docs-text-soft);
  padding: 0 8px;
  margin-bottom: 6px;
}

.docs-nav__link {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--docs-text-mid);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
}

.docs-nav__link:hover {
  background: #ede9ff;
  color: var(--docs-brand);
  text-decoration: none;
}

.docs-nav__link--active {
  background: #ede9ff;
  color: var(--docs-brand);
  font-weight: 700;
}

/* ── Content ───────────────────────────────────────────── */
.docs-content {
  flex: 1;
  padding: 48px 60px;
  min-width: 0;
  max-width: 900px;
  margin: 0 auto;
}

.docs-menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: 'PlusJakartaSans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--docs-text-mid);
  background: var(--docs-bg-light);
  border: 1.5px solid var(--docs-border);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: 28px;
}

/* ── Overlay ───────────────────────────────────────────── */
.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
}

.docs-overlay--show { display: block; }

/* ════════════════════════════════════════════════════════
   CONTENT ELEMENTS
════════════════════════════════════════════════════════ */
.docs-section {
  margin-bottom: 0;
  scroll-margin-top: calc(var(--docs-header-h) + 24px);
}

.docs-section__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--docs-brand);
  margin-bottom: 8px;
}

.docs-section__h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--docs-text-dark);
  margin: 0 0 16px;
  line-height: 1.25;
}

.docs-h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--docs-text-dark);
  margin: 28px 0 12px;
}

.docs-text {
  font-size: 0.9375rem;
  color: var(--docs-text-mid);
  line-height: 1.75;
  margin: 0 0 20px;
}

.docs-divider {
  height: 1px;
  background: var(--docs-border);
  margin: 48px 0;
}

/* Steps */
.docs-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0 28px;
  border: 1.5px solid var(--docs-border);
  border-radius: 14px;
  overflow: hidden;
}

.docs-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 20px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-step:last-child { border-bottom: none; }

.docs-step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--docs-brand);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.docs-step strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--docs-text-dark);
  margin-bottom: 4px;
}

.docs-step p {
  font-size: 0.875rem;
  color: var(--docs-text-mid);
  line-height: 1.6;
  margin: 0;
}

/* Inline code */
.docs-inline-code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.82em;
  background: #f0edff;
  color: var(--docs-brand);
  border-radius: 5px;
  padding: 2px 6px;
  border: 1px solid #d4c9ff;
}

/* Code block */
.docs-code-block {
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0 24px;
  border: 1.5px solid #2a2840;
}

.docs-code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1830;
  padding: 10px 16px;
  gap: 12px;
}

.docs-code-tabs {
  display: flex;
  gap: 4px;
}

.docs-code-tab {
  font-family: 'PlusJakartaSans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8880aa;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.docs-code-tab--active,
.docs-code-tab:hover {
  background: #2e2b4a;
  color: #c4b5f8;
}

.docs-code-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7b74a0;
}

.docs-code-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'PlusJakartaSans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7b74a0;
  background: transparent;
  border: 1px solid #2e2b4a;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-left: auto;
}

.docs-code-copy:hover { color: #c4b5f8; border-color: #5f43d0; }

.docs-code {
  background: var(--docs-bg-code);
  margin: 0;
  padding: 20px 20px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.84rem;
  line-height: 1.7;
  color: #e2deff;
  scrollbar-width: thin;
  scrollbar-color: #2e2b4a transparent;
}

/* Response block */
.docs-response-block {
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0 24px;
  border: 1.5px solid var(--docs-border);
}

.docs-response-block__header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--docs-bg-light);
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--docs-text-soft);
  border-bottom: 1px solid var(--docs-border);
}

.docs-response-block .docs-code {
  background: #fdfcff;
  color: var(--docs-text-dark);
}

/* Syntax tokens */
.tok-k { color: #c4b5f8; }   /* key */
.tok-s { color: #86efac; }   /* string */
.tok-n { color: #fbbf24; }   /* number */
.tok-b { color: #60a5fa; }   /* boolean */
.tok-c { color: #6b7280; }   /* comment */

/* Tables */
.docs-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1.5px solid var(--docs-border);
  margin: 12px 0 24px;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-table th {
  padding: 11px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--docs-text-soft);
  background: var(--docs-bg-light);
  text-align: left;
  border-bottom: 1.5px solid var(--docs-border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-table td {
  padding: 11px 16px;
  color: var(--docs-text-mid);
  border-bottom: 1px solid #f3f1fa;
  vertical-align: top;
  line-height: 1.55;
}

.docs-table tr:last-child td { border-bottom: none; }

/* Endpoint pill */
.docs-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--docs-bg-light);
  border: 1.5px solid var(--docs-border);
  border-radius: 10px;
  padding: 10px 16px;
  margin: 12px 0 20px;
  font-family: 'Fira Code', 'Consolas', monospace;
}

.docs-method {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 5px;
  padding: 3px 8px;
}

.docs-method--get  { background: #dcfce7; color: #166534; }
.docs-method--post { background: #dbeafe; color: #1e40af; }
.docs-method--put  { background: #fef9c3; color: #854d0e; }
.docs-method--del  { background: #fee2e2; color: #991b1b; }

.docs-endpoint__path {
  font-size: 0.9rem;
  color: var(--docs-text-dark);
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 0;
}

/* Required badge */
.docs-req {
  font-size: 0.72rem;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 4px;
  padding: 2px 6px;
}

/* Callouts */
.docs-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0 20px;
  font-size: 0.875rem;
  line-height: 1.6;
}

.docs-callout--warning {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  color: #78350f;
}

.docs-callout--info {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #1e40af;
}

.docs-callout svg { flex-shrink: 0; margin-top: 1px; }

/* Badges */
.docs-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 7px;
}

.docs-badge--green  { background: #dcfce7; color: #166534; }
.docs-badge--yellow { background: #fef9c3; color: #854d0e; }
.docs-badge--red    { background: #fee2e2; color: #991b1b; }
.docs-badge--blue   { background: #dbeafe; color: #1e40af; }

/* SDK cards */
.docs-sdk-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.docs-sdk-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--docs-bg-light);
  border: 1.5px solid var(--docs-border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-sdk-card:hover {
  border-color: #c4b5f8;
  box-shadow: 0 4px 16px rgba(95,67,208,0.08);
}

.docs-sdk-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.docs-sdk-card__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--docs-text-dark);
  margin: 0 0 4px;
}

.docs-sdk-card__install {
  display: block;
  font-size: 0.8rem;
}

.docs-sdk-card__link {
  margin-left: auto;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--docs-brand);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.docs-sdk-card__link:hover { text-decoration: underline; }

/* Changelog */
.docs-changelog {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid var(--docs-border);
  border-radius: 12px;
  overflow: hidden;
}

.docs-changelog-item {
  display: grid;
  grid-template-columns: 80px auto 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px 20px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-changelog-item:last-child { border-bottom: none; }

.docs-changelog-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--docs-text-soft);
  padding-top: 2px;
}

.docs-changelog-notes p {
  font-size: 0.875rem;
  color: var(--docs-text-mid);
  line-height: 1.6;
  margin: 0 0 6px;
}

.docs-changelog-notes p:last-child { margin-bottom: 0; }

/* ════════════════════════════════════════════════════════
   RESPONSIVE - tablet
════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .docs-content { padding: 40px 36px; }
  .docs-hero__cards { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE - mobile
════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Hero */
  .docs-hero { padding: 72px 20px 48px; }
  .docs-hero__cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .docs-hero__card { padding: 16px 14px; }
  .docs-hero__search { max-width: 100%; }

  /* Sidebar - slide in from left */
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    border-right: 1.5px solid var(--docs-border);
    padding-top: 56px;
  }

  .docs-sidebar--open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .docs-sidebar__close {
    display: flex;
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--docs-text-soft);
    cursor: pointer;
    padding: 4px;
  }

  /* Content takes full width */
  .docs-content {
    padding: 28px 20px;
    max-width: 100%;
    margin: 0;
  }

  .docs-layout {
    border-left: none;
    border-right: none;
  }

  .docs-menu-btn { display: flex; }

  .docs-section__h2 { font-size: 1.375rem; }

  .docs-changelog-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .docs-hero__cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .docs-hero__cards { grid-template-columns: 1fr; }
}
