/* =====================================================================
   HopLinks docs layout (Developer Guide + Marketer Guide)
   Article in the centre, "On this page" rail on the right with an
   animated outlined pill that follows the section you're reading.
   Builds on the tokens in site.css.
   ===================================================================== */

body.hl-docs {
  background: var(--hl-bg);
}

.docs-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}
@media (min-width: 1024px) {
  .docs-shell {
    grid-template-columns: minmax(0, 1fr) 248px;
    padding: 8px 32px 0;
    gap: 64px;
  }
}

/* ---------- Guide tabs (Developer / Marketer) ---------- */
.docs-tabs {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 8px 0 40px;
  border-radius: 999px;
  background: #f4f4f5;
  border: 1px solid var(--hl-border);
}
.docs-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--hl-muted);
  text-decoration: none !important;
  transition: color 0.25s;
  white-space: nowrap;
}
.docs-tab:hover {
  color: var(--hl-ink);
}
.docs-tab.is-active {
  color: #fff;
}
.docs-tabs-indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  border-radius: 999px;
  background: var(--hl-ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
@media (max-width: 479px) {
  .docs-tabs {
    display: flex;
  }
  .docs-tab {
    flex: 1;
    justify-content: center;
    padding: 9px 10px;
    font-size: 13px;
  }
}

/* ---------- Article typography (readability first) ---------- */
.docs-article {
  min-width: 0;
  max-width: 46rem; /* ~72 characters per line */
  padding-bottom: 40px;
  font-size: 17px;
  line-height: 1.75;
  color: #3f3f46;
}
.docs-article > section {
  scroll-margin-top: var(--hl-header-space);
}
.docs-article h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  line-height: 1.05 !important;
  color: var(--hl-ink) !important;
  -webkit-text-fill-color: currentColor !important;
  background: none !important;
  margin: 0 0 1.25rem !important;
}
.docs-article h2 {
  display: block !important;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.15 !important;
  color: var(--hl-ink) !important;
  margin: 0 0 1.25rem !important;
  padding: 0 !important;
  border: 0 !important;
}
.docs-article h2::before {
  display: none !important;
}
.docs-article > section + section {
  margin-top: 6rem !important;
  padding-top: 0;
}
.docs-article h3 {
  font-size: 1.3rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
  color: var(--hl-ink) !important;
  margin: 2.5rem 0 0.75rem !important;
}
/* Headings that sit in a row (e.g. numbered steps) keep their own spacing */
.docs-article .flex > h3,
.docs-article h3.m-0 {
  margin: 0 !important;
  line-height: 1.3 !important;
}
.docs-article p,
.docs-article li {
  font-size: 17px !important;
  line-height: 1.75 !important;
  color: #3f3f46 !important;
}
.docs-article p {
  margin: 0 0 1.25rem !important;
}
.docs-article strong {
  color: var(--hl-ink) !important;
}
.docs-article a:not([class]) {
  color: var(--hl-blue);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.35);
  text-underline-offset: 3px;
}
.docs-article :is(p, li, td) > code {
  font-size: 0.88em !important;
  color: #be185d !important;
  background: #fdf2f8 !important;
  border: 1px solid #fce7f3 !important;
  border-radius: 6px !important;
  padding: 0.1em 0.4em !important;
}
.docs-article pre[class*='language-'] {
  font-size: 14px;
  line-height: 1.65;
  border-radius: var(--hl-r-md) !important;
}
/* Small UI text inside cards stays compact */
.docs-article .step-card p,
.docs-article .text-xs,
.docs-article .text-sm {
  font-size: 14px !important;
  line-height: 1.55 !important;
}
.docs-article .step-card h4 {
  font-size: 15px !important;
}
.docs-article section[class*='bg-slate-900'] p {
  color: #a1a1aa !important;
}
.docs-article section[class*='bg-slate-900'] h2 {
  color: #fff !important;
}

/* Section headings ease in as you reach them */
.hl-js .docs-article h2.docs-h-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--hl-ease), transform 0.7s var(--hl-ease);
}
.hl-js .docs-article h2.docs-h-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 767px) {
  .docs-article,
  .docs-article p,
  .docs-article li {
    font-size: 16px !important;
  }
  .docs-article > section + section {
    margin-top: 4.5rem !important;
  }
}

/* ---------- "On this page" rail ---------- */
.docs-toc {
  display: none;
}
@media (min-width: 1024px) {
  .docs-toc {
    display: block;
  }
}
.docs-toc-inner {
  position: sticky;
  top: var(--hl-header-space);
  max-height: calc(100vh - var(--hl-header-space) - 24px);
  overflow-y: auto;
  padding: 24px 4px 24px 0;
  scrollbar-width: none;
}
.docs-toc-inner::-webkit-scrollbar {
  display: none;
}
.docs-toc-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--hl-muted);
  margin: 0 0 6px 20px;
}
.docs-toc-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--hl-ink);
  margin: 0 0 18px 20px;
}
.docs-toc-nav {
  position: relative;
}
.docs-toc-group {
  margin: 18px 0 6px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hl-subtle);
}
.docs-toc-group:first-child {
  margin-top: 0;
}
.docs-toc-link {
  position: relative;
  z-index: 1;
  display: block;
  padding: 10px 20px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--hl-muted);
  text-decoration: none;
  border-radius: 22px;
  transition: color 0.25s, font-weight 0.25s;
}
.docs-toc-link:hover {
  color: var(--hl-ink);
}
.docs-toc-link.is-active {
  color: var(--hl-ink);
  font-weight: 600;
}
/* The outlined pill that glides (and stretches) between sections */
.docs-toc-indicator {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border-radius: 24px;
  border: 1.5px solid var(--hl-ink);
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
}

/* ---------- Mobile / tablet contents ---------- */
.docs-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--hl-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  border: 0;
  cursor: pointer;
}
@media (min-width: 1024px) {
  .docs-fab {
    display: none;
  }
}
.docs-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.docs-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  max-height: 78vh;
  overflow-y: auto;
  padding: 10px 16px 28px;
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.15);
  transform: translateY(105%);
  transition: transform 0.4s var(--hl-ease);
}
.docs-sheet::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d4d4d8;
  margin: 0 auto 14px;
}
.docs-sheet-open .docs-sheet {
  transform: none;
}
.docs-sheet-open .docs-sheet-backdrop {
  opacity: 1;
  visibility: visible;
}
.docs-sheet .docs-toc-link.is-active {
  background: var(--hl-surface);
  box-shadow: inset 0 0 0 1.5px var(--hl-ink);
}

/* ---------- Reading progress ---------- */
.docs-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 1100;
  background: var(--hl-gradient);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Previous / Up next ---------- */
.docs-pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 6rem;
}
@media (min-width: 640px) {
  .docs-pager {
    grid-template-columns: 1fr 1fr;
  }
}
.docs-pager a {
  display: block;
  padding: 26px 28px;
  border-radius: var(--hl-r-lg);
  background: var(--hl-surface);
  border: 1px solid var(--hl-border);
  text-decoration: none !important;
  transition: transform 0.3s var(--hl-ease), box-shadow 0.3s, border-color 0.3s;
}
.docs-pager a:hover {
  transform: translateY(-3px);
  border-color: #d4d4d8;
  box-shadow: var(--hl-shadow-md);
}
.docs-pager .pager-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--hl-muted);
}
.docs-pager .pager-title {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--hl-ink);
}
.docs-pager .is-next {
  text-align: right;
}
.docs-pager .is-next .pager-kicker {
  justify-content: flex-end;
}
