/* ===============================================================
   Relay Me — docs page styles
   Two-column docs layout, code blocks, callouts, param tables.
   Loaded after site.css, which holds the shared tokens, nav,
   buttons and footer.
   =============================================================== */

/* Smooth-scroll anchor jumps so tapping a TOC entry eases into place.
   Anchors also get a small offset so the heading isn't flush against
   the viewport top. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
* { scroll-margin-top: 24px; }

/* ── DOCS LAYOUT ── */
.docs {
  padding: 32px 0 100px;
}
.docs-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: stretch;
}
@media (max-width: 960px) {
  .docs-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 18px;
  }
}

/* ── MOBILE SIDEBAR TOGGLE ── */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 0 0 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8d0dd;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  justify-content: flex-start;
}
.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
@media (max-width: 960px) {
  .sidebar-toggle { display: inline-flex; }
}

/* ── SIDEBAR ── */
/* The .sidebar cell stretches the full height of its row so that the inner
   element has enough room to stay pinned with position: sticky as the user
   scrolls the article. The inner element itself scrolls if its contents
   exceed the viewport, so a very long TOC still works. */
.sidebar {
  align-self: stretch;
}
.sidebar-inner {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 8px;
}
.sidebar-inner::-webkit-scrollbar { width: 6px; }
.sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
@media (max-width: 960px) {
  .sidebar-inner {
    position: static;
    max-height: none;
    padding-right: 0;
  }
  .sidebar {
    margin-bottom: 18px;
    display: none;
  }
  .sidebar.is-open {
    display: block;
    padding: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
  }
}

.sidebar-head { margin-bottom: 14px; }
.sidebar-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7585;
}

.nav-group { margin-bottom: 22px; }
.nav-group:last-child { margin-bottom: 0; }
.nav-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7585;
  padding: 0 0 0 14px;
  margin-bottom: 8px;
}
.nav-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group a {
  display: block;
  padding: 7px 12px 7px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #aab3c2;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-group a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav-group a.active {
  background: rgba(47, 103, 255, 0.12);
  color: #fff;
  border-left-color: var(--blue-1);
  padding-left: 16px;
}

/* ── CONTENT ── */
.content {
  max-width: 760px;
  min-width: 0;
}

/* ── CRUMBS ── */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #6b7585;
  margin-bottom: 22px;
}
.crumbs a {
  color: #8eb1ff;
  transition: color 0.15s ease;
}
.crumbs a:hover { color: #b8cdff; }
.crumbs svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── PAGE HEAD ── */
.page-head {
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 36px;
}
.page-head h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.page-head p {
  color: #aab3c2;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 640px;
}

/* ── HEADINGS ── */
.content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 14px;
  scroll-margin-top: 24px;
}
.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 10px;
  scroll-margin-top: 24px;
}

/* ── PROSE ── */
.content p {
  color: #c8d0dd;
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 16px;
}
.content p a,
.content li a,
.content td a {
  color: #8eb1ff;
  border-bottom: 1px solid rgba(142, 177, 255, 0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.content p a:hover,
.content li a:hover,
.content td a:hover {
  color: #b8cdff;
  border-bottom-color: #b8cdff;
}
.content ul, .content ol {
  margin: 0 0 18px 22px;
  color: #c8d0dd;
  font-size: 0.98rem;
  line-height: 1.75;
}
.content ul li, .content ol li { margin-bottom: 4px; }

/* ── INLINE CODE ── */
.content code:not(pre code) {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6eaf2;
}

/* ── CODE BLOCK ── */
.code-block {
  position: relative;
  margin: 20px 0 24px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.78rem;
  color: #6b7585;
  font-weight: 500;
}
.code-head .lang {
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-head .lang::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-1);
  box-shadow: 0 0 8px var(--blue-1);
}
.code-head .copy {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #aab3c2;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.code-head .copy:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: #c8d0dd;
}
pre::-webkit-scrollbar { height: 6px; }
pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

/* ── CALLOUTS ── */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  margin: 22px 0;
  border-radius: 12px;
  background: rgba(47, 103, 255, 0.08);
  border: 1px solid rgba(47, 103, 255, 0.2);
  font-size: 0.93rem;
  line-height: 1.55;
  color: #d6dde8;
}
.callout-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(47, 103, 255, 0.18);
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.callout-icon svg {
  width: 14px;
  height: 14px;
  stroke: #8eb1ff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.callout strong { color: #fff; font-weight: 600; }
.callout-body { flex: 1; min-width: 0; }

.callout-good {
  background: rgba(110, 231, 160, 0.07);
  border-color: rgba(110, 231, 160, 0.22);
}
.callout-good .callout-icon {
  background: rgba(110, 231, 160, 0.18);
}
.callout-good .callout-icon svg { stroke: #6ee7a0; }

/* ── PARAM TABLES ── */
.params {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 28px;
  font-size: 0.93rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}
.params th, .params td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}
.params thead th {
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aab3c2;
}
.params tbody tr:last-child td { border-bottom: none; }
.params td code {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: #c4d6ff;
  background: transparent;
  border: 0;
  padding: 0;
}
.params td:not(:first-child) {
  color: #c8d0dd;
}

/* ── PAGE NAV ── */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pn-empty { display: block; }
.page-nav a {
  display: block;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.page-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(47, 103, 255, 0.3);
  transform: translateY(-1px);
}
.page-nav .pn-label {
  display: block;
  font-size: 0.78rem;
  color: #6b7585;
  font-weight: 500;
  margin-bottom: 4px;
}
.page-nav .pn-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
}
.page-nav .pn-title svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.pn-next { text-align: right; }
@media (max-width: 600px) {
  .page-nav {
    grid-template-columns: 1fr;
  }
  .pn-empty { display: none; }
  .pn-next { text-align: left; }
}

/* ── TOAST (page-specific overrides; the element lives in docs.html scripts block) ── */
.toast { pointer-events: none; }
</content>
</invoke>
