/*
 * ============================================================================
 * Wave Developer Portal — Zendesk Guide theme styles
 * ----------------------------------------------------------------------------
 * Generic, reusable building blocks. Built to mirror Wave Lighthouse component
 * patterns (https://wave-lighthouse.s3.amazonaws.com/index.html) and Buoyant
 * design tokens (https://github.com/waveaccounting/buoyant-utils) so that the
 * Zendesk theme stays visually consistent with the rest of the Wave product.
 *
 * Token names roughly follow Buoyant's exported names but are scoped here as
 * CSS custom properties (--wave-*) so that the theme can ship without any JS
 * dependency on @wave/buoyant-utils.
 *
 * ----------------------------------------------------------------------------
 * Isolation strategy
 * ----------------------------------------------------------------------------
 * Every selector in this file is scoped under the `.dev-portal-theme` wrapper
 * class via native CSS nesting (Chrome 112+, Firefox 117+, Safari 16.5+).
 * Pages that opt-in by wrapping their content in `<div class="dev-portal-theme">`
 * pick up these styles; pages that don't are entirely unaffected. This means
 * we can ship this file alongside the existing Zendesk `style.css` without
 * touching it.
 *
 * Custom properties (`--wave-*`) are also scoped to the wrapper so they cannot
 * collide with any tokens defined globally elsewhere in the theme.
 * ============================================================================
 */

/*
 * Web fonts.
 *
 * Zendesk's head template only loads Open Sans + Rubik. Neither matches
 * Wave's --wave-font-body stack, so we pull Inter + STIX Two Text from
 * Google Fonts directly here. The same @import pattern is already used by
 * Zendesk's own style.css (for Rubik), so we know the platform allows it.
 *
 * Dinero Sans (the brand typeface, first in --wave-font-body) is declared
 * via @font-face in document_head.hbs — its .ttf files live in theme
 * Assets and must be referenced with Curlybars `{{asset …}}`, which only
 * runs in templates, not in this stylesheet. Inter stays in the stack as
 * the fallback while Dinero Sans loads (and for any weight not shipped).
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=STIX+Two+Text:ital,wght@0,400;0,700;1,400&display=swap');

/* ---------------------------------------------------------------------------
 * 1. Design tokens (mirrors @wave/buoyant-utils) — scoped to wrapper
 * ------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
 * DONUT SCOPE — critical for widget interop
 * --------------------------------------------------------------------------
 * Articles like Webhooks / Playground / Manage applications embed the
 * `webhook-management` React widget (https://github.com/waveaccounting/
 * webhook-management). It mounts into `#WebhookManagementContent` and
 * at runtime appends its own stylesheets (buoyant-app.css + App.css)
 * that already style every `.wv-*` element it renders. Any dev-portal
 * rule leaking into that subtree causes visual bugs (e.g. our generic
 * `.dev-portal-article__body li + li { margin-top }` breaking the
 * widget's `.wv-action-list__item` spacing).
 *
 * We use CSS Cascade Level 6 `@scope` with a donut range:
 *
 *   @scope (body) to (#WebhookManagementContent) { ... }
 *
 * Rules inside the block match descendants of the scope root (`body`)
 * but STOP at the scope limit (`#WebhookManagementContent`) — they do
 * not match the widget mount itself or any of its descendants. Because
 * the rules are still unlayered author styles they retain full cascade
 * priority against Zendesk Guide's own default stylesheet (which lives
 * in the host theme and would otherwise beat any layered rule we
 * ship). Nothing about specificity or ordering changes elsewhere.
 *
 * `@scope` support: Chrome 118+, Edge 118+, Safari 17.4+, Firefox 128+.
 *
 * Historical note: this file was briefly wrapped in `@layer dev-portal-
 * theme { ... }` to solve the same widget-isolation problem. That did
 * fix the widget but broke every other page on the Guide because
 * unlayered rules ALWAYS beat layered rules — meaning Zendesk's own
 * defaults won every conflict. `@scope` is the right primitive: it
 * scopes without deprioritizing.
 * -------------------------------------------------------------------------- */
@scope (body) to (#WebhookManagementContent) {
.dev-portal-theme {
  /* Foreground */
  --wave-fg-default: #182127;
  --wave-fg-hint: #515f66;
  --wave-fg-link: #0040ff;

  /* Background */
  --wave-bg-default: #ffffff;
  --wave-bg-hero: #e0f2ff; /* baseColorBlue5 — light blue sidebar / hero tint */
  --wave-bg-article-header: #1e64d0; /* deeper blue used on article header band */
  --wave-bg-footer: #001b66; /* footer navy */

  /* Stroke */
  --wave-stroke-default: #d4dde3;
  --wave-stroke-active: #0040ff;

  /* Foreground (light, used on dark blue band) */
  --wave-fg-light: #ffffff;

  /* Accent (orange step marker used in numbered Get-started lists) */
  --wave-bg-accent-step: #f49342;
  --wave-fg-accent-step: #ffffff;

  /* Brand / button */
  --wave-button-bg-primary: #0040ff;
  --wave-button-bg-primary-hover: #0033cc;
  --wave-button-fg-primary: #ffffff;
  --wave-button-stroke-secondary: #0040ff;
  --wave-button-fg-secondary: #0040ff;
  --wave-button-bg-secondary-hover: #f0f6ff;

  /* Spacing scale */
  --wave-space-xsmall: 4px;
  --wave-space-small: 8px;
  --wave-space-default: 16px;
  --wave-space-medium: 24px;
  --wave-space-large: 32px;
  --wave-space-xlarge: 40px;

  /* Radius */
  --wave-radius-default: 8px;
  --wave-radius-rounded: 500px;

  /* Typography */
  --wave-font-body: 'Dinero Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --wave-font-display: 'STIX Two Text', 'Times New Roman', Georgia, serif;
  --wave-line-height: 1.4;

  /* Layout */
  --wave-content-max-width: 1044px;

  /* -------------------------------------------------------------------------
   * Isolation reset — neutralises common style leaks from the host theme's
   * style.css *inside* the wrapper only. Kept intentionally small.
   * --------------------------------------------------------------------- */
  & a { color: inherit; text-decoration: none; }
  & button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
  & ul, & ol { list-style: none; margin: 0; padding: 0; }
  & h1, & h2, & h3, & h4, & h5, & h6, & p { margin: 0; }
  & img { display: block; max-width: 100%; }
  & *, & *::before, & *::after { box-sizing: border-box; }

  /* -------------------------------------------------------------------------
   * 2. Base typography helpers
   * --------------------------------------------------------------------- */
  & .wave-text {
  font-family: var(--wave-font-body);
  font-size: 16px;
  line-height: var(--wave-line-height);
  color: var(--wave-fg-default);
  margin: 0;
}

.wave-text--lead {
  font-size: 19px;
  font-weight: 400;
}

.wave-text--small {
  font-size: 14px;
  color: var(--wave-fg-hint);
}

.wave-heading {
  font-family: var(--wave-font-body);
  font-size: 19px;
  font-weight: 600;
  line-height: var(--wave-line-height);
  color: var(--wave-fg-default);
  margin: 0;
}

.wave-heading--display {
  font-family: var(--wave-font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
}

/* ---------------------------------------------------------------------------
 * 3. Button (mirrors WaveButton from Lighthouse)
 * ------------------------------------------------------------------------- */
.wave-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wave-space-small);
  padding: 9px 20px;
  font-family: var(--wave-font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: var(--wave-line-height);
  white-space: nowrap;
  text-decoration: none;
  border-radius: var(--wave-radius-rounded);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wave-btn--primary {
  background: var(--wave-button-bg-primary);
  color: var(--wave-button-fg-primary);
  border-color: var(--wave-button-bg-primary);
}

.wave-btn--primary:hover,
.wave-btn--primary:focus-visible {
  background: var(--wave-button-bg-primary-hover);
  border-color: var(--wave-button-bg-primary-hover);
  color: var(--wave-button-fg-primary);
}

.wave-btn--secondary {
  background: transparent;
  color: var(--wave-button-fg-secondary);
  border-color: var(--wave-button-stroke-secondary);
}

.wave-btn--secondary:hover,
.wave-btn--secondary:focus-visible {
  background: var(--wave-button-bg-secondary-hover);
}

.wave-btn--small {
  padding: 4px 16px;
  font-size: 14px;
}

/*
 * Trailing icon inside a pill button — used by the "Manage applications"
 * CTA in the article body (Figma: square-with-arrow external-link icon).
 *
 * Two ways to opt in:
 *   1. Add class `wave-btn--external` to the `.wave-btn` — the icon is
 *      rendered as a CSS background on a `::after` pseudo-element. This is
 *      the recommended path because the icon ships inline in the stylesheet
 *      (data-URI) and bypasses Zendesk's asset CDN, which often serves
 *      uploaded SVGs with `Content-Disposition: attachment` (causing
 *      `<img src="*.svg">` to render blank).
 *   2. Place `<svg class="wave-btn__icon">…</svg>` (or `<img>`) as the
 *      last child of `.wave-btn` — still supported but subject to the
 *      Zendesk editor's HTML sanitizer.
 */
.wave-btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

.wave-btn--external::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Inline external-link icon for text links inside the article body
   (e.g. the "Queries and Mutations examples here" link on the
   Playground page). Uses the same data-URI as `.wave-btn--external`
   but with the link-blue stroke so it matches the link colour, and is
   sized to align with the cap height of body text. */
.dev-portal-article__body a.wave-link--external::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230040ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* ---------------------------------------------------------------------------
 * 4. Layout container (1044px content rail)
 * ------------------------------------------------------------------------- */
.wave-container {
  width: 100%;
  max-width: var(--wave-content-max-width);
  margin: 0 auto;
  padding: 0 var(--wave-space-medium);
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
 * 4b. Top header / primary navigation
 *
 * Wraps the Zendesk template's existing nav structure with a Wave-branded
 * layout: logo + "Developer portal" subtitle on the left, primary nav
 * links + auth button on the right, thin blue bottom border.
 * ------------------------------------------------------------------------- */
.dev-portal-header {
  background: #ffffff;
  border-bottom: 2px solid var(--wave-fg-link);
  /* Asymmetric padding: the brand column (logo + subtitle) is taller than
     the nav row, so we need extra bottom padding to keep the subtitle off
     the blue border. */
  padding: var(--wave-space-default) 0 var(--wave-space-xlarge);
  width: 100%;
  box-sizing: border-box;
}

/* Header gets a wider rail than article content so the logo sits closer to
   the viewport edge and the nav has more breathing room from the brand. */
.dev-portal-header .wave-container {
  max-width: 1280px;
}

.dev-portal-header__inner {
  display: flex;
  /* `flex-start` (not `center`) so the row aligns to the top of the brand —
     this puts links + buttons on the same horizontal line as the logo,
     leaving the "Developer portal" subtitle to hang below without
     dragging everything down to the brand's vertical center. */
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--wave-space-large);
}

.dev-portal-header__brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  margin-bottom: 15px;
}

.dev-portal-header__brand:hover,
.dev-portal-header__brand:focus-visible {
  text-decoration: none;
  outline: none;
}

.dev-portal-header__logo {
  height: 28px;
  width: auto;
  display: block;
}

.dev-portal-header__subtitle {
  font-family: var(--wave-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--wave-fg-hint);
  letter-spacing: 0.01em;
}

.dev-portal-header__nav {
  display: flex;
  align-items: center;
  gap: var(--wave-space-large);
  /* Match the logo's visual height so items centered inside this row
     line up with the logo center (28px tall = button height). */
  min-height: 28px;
}

.dev-portal-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--wave-space-large);
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: 15px;
}

.dev-portal-header__nav-list a {
  font-family: var(--wave-font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--wave-fg-link);
  text-decoration: none;
  white-space: nowrap;
}

.dev-portal-header__nav-list a:hover,
.dev-portal-header__nav-list a:focus-visible {
  color: var(--wave-fg-link);
  text-decoration: none;
  opacity: 0.8;
  outline: none;
}

.dev-portal-header .wave-btn {
  white-space: nowrap;
}

/* Hamburger toggle (pure CSS, no JS) — visually hidden checkbox sibling
   that drives the open/closed state via :checked + sibling selectors.
   The hamburger label is hidden on desktop and shown ≤960px. */
.dev-portal-header__toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  pointer-events: none;
}

.dev-portal-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  padding: 0;
  background: transparent;
  border: 0;
  margin-left: auto;
}

.dev-portal-header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--wave-fg-link);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Keyboard focus ring on the label (since the checkbox itself is hidden) */
.dev-portal-header__toggle:focus-visible + .dev-portal-header__brand + .dev-portal-header__hamburger,
.dev-portal-header__hamburger:focus-visible {
  outline: 2px solid var(--wave-fg-link);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Auth-state toggling lives OUTSIDE this `.dev-portal-theme { … }` nesting
   scope and OUTSIDE `@scope` — see the block near the very end of this file.
   The `.is-authenticated` / `.is-unauthenticated` marker classes are set on
   an ANCESTOR of `.dev-portal-theme` (the `js-topbar` wrapper created by
   `document.write` in `header.hbs`), so if we nested the rule here CSS
   nesting would auto-prepend `&` and desugar it to
   `.dev-portal-theme .is-authenticated .dev-portal-theme .logged-out` —
   a two-`.dev-portal-theme` chain that never matches. */

/* Spacing inside the logged-in block on tool pages (Playground, etc.).
   The general `.dev-portal-article__body > * + *` rule only targets
   *direct* children of the body, so paragraphs inside `.logged-in`
   don't inherit it. Spec from Figma:
     · 16px between consecutive paragraphs (intro → examples link)
     · 32px between the examples link and the embedded iframe */
.dev-portal-article__body .logged-in > * + * {
  margin-top: var(--wave-space-large);
}

.dev-portal-article__body .logged-in > zd-html-block {
  display: block;
  margin-top: var(--wave-space-large);
}

/* ---------------------------------------------------------------------------
 * 5. Developer portal — Hero
 * ------------------------------------------------------------------------- */
.dev-portal-hero {
  background: var(--wave-bg-hero);
  padding: var(--wave-space-xlarge) var(--wave-space-medium);
  width: 100%;
  box-sizing: border-box;
}

.dev-portal-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wave-space-xlarge);
  max-width: var(--wave-content-max-width);
  margin: 0 auto;
}

.dev-portal-hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--wave-space-small);
  max-width: 560px;
}

.dev-portal-hero__title {
  font-family: var(--wave-font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  color: var(--wave-fg-default);
  margin: 0;
}

.dev-portal-hero__description {
  font-family: var(--wave-font-body);
  font-size: 19px;
  line-height: var(--wave-line-height);
  color: var(--wave-fg-default);
  margin: 0;
}

.dev-portal-hero__actions {
  display: flex;
  gap: var(--wave-space-small);
  padding-top: var(--wave-space-medium);
}

.dev-portal-hero__illustration {
  flex-shrink: 0;
  width: 380px;
  height: 320px;
  object-fit: contain;
}

/* ---------------------------------------------------------------------------
 * 6. Developer portal — Navigation cards
 * ------------------------------------------------------------------------- */
.dev-portal-cards {
  padding: var(--wave-space-xlarge) var(--wave-space-medium);
  width: 100%;
  box-sizing: border-box;
}

.dev-portal-cards__inner {
  max-width: var(--wave-content-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--wave-space-medium);
}

.dev-portal-cards__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wave-space-medium);
}

.dev-portal-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--wave-bg-default);
  border: 1px solid var(--wave-stroke-default);
  border-radius: var(--wave-radius-default);
  padding: var(--wave-space-default);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.dev-portal-card:hover,
.dev-portal-card:focus-visible {
  border-color: var(--wave-button-stroke-secondary);
  box-shadow: 0 4px 12px rgba(0, 64, 255, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.dev-portal-card--with-icon {
  min-height: 224px;
}

.dev-portal-card--compact {
  min-height: 104px;
}

.dev-portal-card__icon {
  width: 28px;
  height: 28px;
  color: var(--wave-fg-default);
  margin-bottom: var(--wave-space-default);
}

.dev-portal-card__icon svg,
.dev-portal-card__icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.dev-portal-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--wave-space-small);
}

.dev-portal-card__title {
  font-family: var(--wave-font-body);
  font-size: 19px;
  font-weight: 600;
  line-height: var(--wave-line-height);
  color: var(--wave-fg-default);
  margin: 0;
}

.dev-portal-card__description {
  font-family: var(--wave-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: var(--wave-line-height);
  color: var(--wave-fg-default);
  margin: 0;
}

/* ---------------------------------------------------------------------------
 * 7. Page header (breadcrumb + title)
 *
 * Shared across the article, section and category landing templates. Mirrors
 * the "header" frame from Figma (1044px content rail, 24px gap between the
 * breadcrumb and the 38px page title).
 * ------------------------------------------------------------------------- */
.dev-portal-page-header {
  background: var(--wave-bg-default);
  padding: var(--wave-space-xlarge) var(--wave-space-medium) var(--wave-space-large);
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid var(--wave-stroke-default);
}

.dev-portal-page-header__inner {
  max-width: var(--wave-content-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--wave-space-small);
}

.dev-portal-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wave-space-xsmall);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--wave-font-body);
  font-size: 14px;
  color: var(--wave-fg-hint);
}

.dev-portal-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: var(--wave-space-xsmall);
}

.dev-portal-breadcrumb__link {
  color: var(--wave-fg-link);
  text-decoration: none;
}

.dev-portal-breadcrumb__link:hover,
.dev-portal-breadcrumb__link:focus-visible {
  text-decoration: underline;
}

.dev-portal-breadcrumb__separator {
  color: var(--wave-fg-hint);
  user-select: none;
}

.dev-portal-breadcrumb__current {
  color: var(--wave-fg-default);
}

.dev-portal-page-header__title {
  font-family: var(--wave-font-display);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--wave-fg-default);
  margin: 0;
}

.dev-portal-page-header__description {
  font-family: var(--wave-font-body);
  font-size: 19px;
  line-height: var(--wave-line-height);
  color: var(--wave-fg-default);
  margin: 0;
}

/* ---------------------------------------------------------------------------
 * 8. Article page — 2-column layout + body
 *
 * Layout:
 *   .dev-portal-article-layout  — CSS grid wrapper (sidebar + main column)
 *   .dev-portal-sidebar         — sticky left nav of sibling articles
 *   .dev-portal-article         — main column wrapping the rich-text body
 *
 * Body styles target raw HTML elements *inside* `.dev-portal-article__body`
 * because Zendesk emits plain tags (h2, p, ul, pre, code, blockquote, …).
 * ------------------------------------------------------------------------- */
.dev-portal-article-layout {
  width: 100%;
  max-width: var(--wave-content-max-width);
  margin: 0 auto;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  align-items: stretch;
  /*
   * Ensure the grid (and therefore the shaded sidebar, which is
   * `align-self: stretch`) extends down to the host theme footer even when
   * the article body is short. The reserved 320 px roughly accounts for
   * the host header (~70 px) + the deep-blue article-header band (~150 px)
   * + the host footer band (~100 px). Tweak if the host theme changes.
   */
  min-height: calc(100vh - 320px);
}

/*
 * Tool / landing page variant — no sidebar, content spans the full
 * centered rail. Used by article_page.hbs when the article's section is
 * named "Tools" (e.g. Manage applications, where the body is a single
 * embedded widget rather than long-form prose).
 */
.dev-portal-article-layout--no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

/* Symmetric horizontal padding (the default leans left to offset the
   sidebar, which doesn't apply here). */
.dev-portal-article-layout--no-sidebar .dev-portal-article {
  padding-left: var(--wave-space-default);
  padding-right: var(--wave-space-default);
}

.dev-portal-sidebar {
  background: var(--wave-bg-hero);
  font-family: var(--wave-font-body);
  align-self: stretch;
  position: relative;
}

/*
 * Full-bleed sidebar background: paint a pseudo-element that extends the
 * sidebar's background all the way to the left edge of the viewport while
 * the sidebar text itself stays aligned to the centered 1044 px grid.
 */
.dev-portal-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 100vw;
  background: inherit;
  pointer-events: none;
}

.dev-portal-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: var(--wave-space-medium);
  padding: var(--wave-space-xlarge) var(--wave-space-default) var(--wave-space-xlarge) 0;
}

.dev-portal-sidebar__heading {
  font-family: var(--wave-font-body);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: var(--wave-fg-default);
  margin: 0;
}

.dev-portal-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wave-space-default);
  border-left: none;
}

.dev-portal-sidebar__item {
  margin: 0;
}

.dev-portal-sidebar__link {
  display: block;
  padding: 0;
  margin-left: 0;
  border-left: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--wave-fg-link);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.dev-portal-sidebar__link:hover,
.dev-portal-sidebar__link:focus-visible {
  color: var(--wave-fg-link);
  text-decoration: none;
  outline: none;
}

.dev-portal-sidebar__link.is-active {
  color: var(--wave-fg-default);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}

.dev-portal-article {
  min-width: 0; /* prevents `<pre>` from breaking the grid layout */
  padding: var(--wave-space-xlarge) var(--wave-space-default) var(--wave-space-xlarge) var(--wave-space-medium);
  display: flex;
  flex-direction: column;
}

.dev-portal-article__body {
  min-width: 0;
  font-family: var(--wave-font-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--wave-fg-default);
}

.dev-portal-article__meta {
  margin-top: var(--wave-space-medium);
  padding-top: var(--wave-space-small);
  font-family: var(--wave-font-body);
  font-size: 14px;
  line-height: 1.4;
  color: var(--wave-fg-hint);
}

.dev-portal-article__body > * + * {
  margin-top: var(--wave-space-default);
}

.dev-portal-article__body h2 {
  font-family: var(--wave-font-body);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: var(--wave-space-medium);
  margin-bottom: var(--wave-space-small);
}

.dev-portal-article__body h3 {
  font-size: 19px;
  font-weight: 600;
  margin-top: var(--wave-space-large);
  margin-bottom: var(--wave-space-xsmall);
}

/*
 * `:not(.wave-btn)` excludes pill buttons authored inside the rich-text
 * body so they keep their own primary/secondary colours and aren't
 * over-tinted to link-blue (which made them blend into their own blue
 * background and look invisible until hover).
 */
.dev-portal-article__body a:not(.wave-btn) {
  color: var(--wave-fg-link);
  font-weight: 700;
  text-decoration: none;
}

.dev-portal-article__body ul,
.dev-portal-article__body ol {
  padding-left: var(--wave-space-medium);
}

/* Restore disc bullets for plain `<ul>` (the wrapper reset strips list-style). */
.dev-portal-article__body ul {
  list-style: disc outside;
}

/*
 * Numbered Get-started step lists — orange filled circle with white numeral.
 * Authors get this automatically on any `<ol>` inside an article body.
 * If a plain decimal list is ever needed, add an explicit `.no-step-markers`
 * class on the `<ol>` in the Zendesk editor to opt out.
 */
.dev-portal-article__body ol {
  list-style: none;
  padding-left: 0;
  margin-top: var(--wave-space-large);
  counter-reset: dev-portal-step;
}

.dev-portal-article__body ol > li {
  position: relative;
  padding-left: calc(var(--wave-space-large) + var(--wave-space-default));
  counter-increment: dev-portal-step;
}

.dev-portal-article__body ol > li::before {
  content: counter(dev-portal-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wave-bg-accent-step);
  color: var(--wave-fg-accent-step);
  font-family: var(--wave-font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.dev-portal-article__body ol.no-step-markers {
  list-style: decimal outside;
  padding-left: var(--wave-space-medium);
  counter-reset: none;
}

.dev-portal-article__body ol.no-step-markers > li {
  padding-left: 0;
  counter-increment: none;
}

.dev-portal-article__body ol.no-step-markers > li::before {
  content: none;
}

.dev-portal-article__body li + li {
  margin-top: var(--wave-space-large);
}

/*
 * Pill buttons sitting in the rich-text body (e.g. "Manage applications"
 * after a numbered list in article 2). The wrapper reset zeroes `<p>`
 * margins, so without this rule the button collapses right under the
 * previous block. Match the Figma's generous breathing room.
 */
.dev-portal-article__body .wave-btn {
  margin-top: 56px;
}

.dev-portal-article__body code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f4f6f8;
  border-radius: 4px;
  padding: 2px 6px;
}

.dev-portal-article__body pre {
  background: #0b1320;
  color: #e6edf3;
  border-radius: var(--wave-radius-default);
  padding: var(--wave-space-default);
  overflow-x: auto;
}

.dev-portal-article__body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.dev-portal-article__body blockquote {
  border-left: 2px solid var(--wave-stroke-active);
  background: transparent;
  margin: var(--wave-space-default) 0;
  padding: var(--wave-space-small) var(--wave-space-medium);
  border-radius: 0;
  font-size: 19px;
  line-height: 1.4;
  color: var(--wave-fg-default);
}

.dev-portal-article__body blockquote a {
  color: var(--wave-fg-link);
  font-weight: 700;
  text-decoration: none;
}

.dev-portal-article__body blockquote a:hover,
.dev-portal-article__body blockquote a:focus-visible {
  text-decoration: underline;
}

/* Cream "notice" callout — used on tool landing pages (e.g. Manage
   Applications) to introduce the page before the actual tool UI loads.
   Background uses a soft Wave peach/cream; copy is centered horizontally
   in the article column so it visually anchors a sparse page. */
.dev-portal-article__body .wave-callout--notice {
  background: #FFF1D6;
  border-radius: var(--wave-radius-default);
  padding: var(--wave-space-default) var(--wave-space-medium);
  margin: 0 auto var(--wave-space-medium);
  max-width: 520px;
  color: var(--wave-fg-default);
  font-size: 15px;
  line-height: 1.5;
}

.dev-portal-article__body .wave-callout--notice p {
  margin: 0;
}

/* CTA row that follows the notice. The row itself is centered to match
   the callout's max-width, and the button is left-aligned within that row
   so it sits flush with the callout's left edge (not centered on the page).
   Top margin is 0 — the callout's own bottom margin (24px) provides the gap. */
.dev-portal-article__body .wave-cta-row {
  display: flex;
  justify-content: flex-start;
  max-width: 520px;
  margin: 0 auto var(--wave-space-large);
}

/* Auth gate — full-bleed centered "you need to sign in" panel shown on
   tool pages (Playground, etc.) when the visitor is logged out. Layout
   is: illustration → headline → primary CTA, all centered vertically and
   horizontally. Combined with `.logged-out` so the existing auth-toggle
   CSS hides it for signed-in visitors.

   The illustration is rendered via a `::before` pseudo-element backed by
   a CSS custom property that document_head.hbs injects using Curlybars
   `{{asset …}}`. This lets us reference theme assets without dropping
   their hashed CDN URL into the Zendesk article body (where Curlybars
   doesn't run). Add a new gate variant by injecting another `--wave-
   illustration-*` variable in document_head.hbs. */
.dev-portal-article__body .wave-auth-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--wave-space-medium);
  padding: var(--wave-space-xlarge) var(--wave-space-medium);
  min-height: 360px;
}

.dev-portal-article__body .wave-auth-gate::before {
  content: '';
  width: 220px;
  height: 220px;
  background: var(--wave-auth-gate-illustration, none) center / contain no-repeat;
}

/* Variant: Playground / generic "sign in" gate — uses welcome-spot.png. */
.dev-portal-article__body .wave-auth-gate--welcome-spot {
  --wave-auth-gate-illustration: var(--wave-illustration-welcome-spot);
}

/* Inline <img> fallback (in case an article author embeds an image
   directly): opt out of the generic article-image border / radius below
   and constrain the artwork width. */
.dev-portal-article__body .wave-auth-gate img,
.dev-portal-article__body .wave-auth-gate svg {
  max-width: 220px;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  margin: 0;
}

.dev-portal-article__body .wave-auth-gate p {
  margin: 0;
  max-width: 560px;
  font-family: var(--wave-font-body);
  font-size: 33px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--wave-fg-default);
}

.dev-portal-article__body .wave-auth-gate .wave-btn {
  margin-top: var(--wave-space-small);
}

/* ---------------------------------------------------------------------------
 * External widget mount points
 *
 * Articles like Webhooks / Playground / Manage applications embed the
 * `webhook-management` React widget (see repo: waveaccounting/webhook-
 * management). The widget mounts into `#WebhookManagementContent` and
 * loads its own stylesheets at runtime — it fully styles every element
 * it renders. We intentionally ship ZERO `.wv-*` overrides here.
 *
 * The `@scope (body) to (#WebhookManagementContent)` wrapper around the
 * whole theme means no selector in this file ever matches the widget
 * mount or any of its descendants — so there is nothing to override.
 *
 * If the widget's visuals look off, the fix belongs in
 * https://github.com/waveaccounting/webhook-management (App.css / a
 * design-system component) or in buoyant-utils, not in this theme.
 * ------------------------------------------------------------------------- */

.dev-portal-article__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--wave-radius-default);
  border: 1px solid var(--wave-stroke-default);
}

/* Images authored inline inside a paragraph (Help-Center editor wraps
   pasted screenshots in <p><img></p>) need extra top breathing room so
   they don't sit flush against the preceding line of text. */
.dev-portal-article__body p img {
  margin-top: var(--wave-space-medium);
}

.dev-portal-article__body table {
  width: 100%;
  border-collapse: collapse;
}

.dev-portal-article__body th,
.dev-portal-article__body td {
  text-align: left;
  padding: var(--wave-space-small) var(--wave-space-default);
  border-bottom: 1px solid var(--wave-stroke-default);
}

/* ---------------------------------------------------------------------------
 * 9. Section landing — article list
 *
 * Used by section_page.hbs. A vertical list of articles inside the current
 * section.
 * ------------------------------------------------------------------------- */
.dev-portal-article-list {
  width: 100%;
  padding: var(--wave-space-xlarge) var(--wave-space-medium);
  box-sizing: border-box;
}

.dev-portal-article-list__inner {
  max-width: var(--wave-content-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dev-portal-article-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wave-space-default);
  padding: var(--wave-space-default) 0;
  border-bottom: 1px solid var(--wave-stroke-default);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.15s ease;
}

.dev-portal-article-list__item:hover,
.dev-portal-article-list__item:focus-visible {
  padding-left: var(--wave-space-xsmall);
  outline: none;
}

.dev-portal-article-list__item:hover .dev-portal-article-list__title,
.dev-portal-article-list__item:focus-visible .dev-portal-article-list__title {
  color: var(--wave-fg-link);
}

.dev-portal-article-list__title {
  font-family: var(--wave-font-body);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  color: var(--wave-fg-default);
  transition: color 0.15s ease;
}

.dev-portal-article-list__chevron {
  flex-shrink: 0;
  color: var(--wave-fg-hint);
  font-size: 20px;
  line-height: 1;
}

/* ---------------------------------------------------------------------------
 * 11. Page-header variants
 *
 *  · `.dev-portal-section-intro`           — deep-blue intro band used by
 *                                            section landings (matches the
 *                                            article-page header band).
 *  · `.dev-portal-page-header--article`    — deep-blue band used by
 *                                            article pages (Figma node
 *                                            2073:1363 et al.).
 * ------------------------------------------------------------------------- */
.dev-portal-section-intro {
  background: var(--wave-bg-article-header);
  border-bottom: none;
}

/*
 * `.dev-portal-page-header` paints its own white background. When it is
 * nested inside `.dev-portal-section-intro`, the white panel hides the band
 * — so reset the header to transparent and let the section-intro show.
 */
.dev-portal-section-intro .dev-portal-page-header {
  background: transparent;
  border-bottom: none;
  padding: var(--wave-space-xlarge) var(--wave-space-medium);
}

.dev-portal-section-intro .dev-portal-page-header__title {
  font-family: var(--wave-font-body);
  font-size: 33px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--wave-fg-light);
}

.dev-portal-section-intro .dev-portal-page-header__description {
  color: var(--wave-fg-light);
}

.dev-portal-section-intro .dev-portal-breadcrumb,
.dev-portal-section-intro .dev-portal-breadcrumb__separator,
.dev-portal-section-intro .dev-portal-breadcrumb__current,
.dev-portal-section-intro .dev-portal-breadcrumb__link {
  color: var(--wave-fg-light);
}

.dev-portal-page-header--article {
  background: var(--wave-bg-article-header);
  border-bottom: none;
  padding: var(--wave-space-xlarge) var(--wave-space-medium);
}

.dev-portal-page-header--article .dev-portal-page-header__inner {
  gap: var(--wave-space-small);
}

.dev-portal-page-header--article .dev-portal-breadcrumb,
.dev-portal-page-header--article .dev-portal-breadcrumb__separator,
.dev-portal-page-header--article .dev-portal-breadcrumb__current {
  color: var(--wave-fg-light);
}

.dev-portal-page-header--article .dev-portal-breadcrumb__link {
  color: var(--wave-fg-light);
}

.dev-portal-page-header--article .dev-portal-page-header__title {
  font-family: var(--wave-font-body);
  font-size: 33px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--wave-fg-light);
}

/* ---------------------------------------------------------------------------
 * 12. Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .dev-portal-header__inner {
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wave-space-default);
  }

  .dev-portal-header__brand {
    flex: 1 1 auto;
  }

  .dev-portal-header__hamburger {
    display: inline-flex;
  }

  /* Nav takes the full second row and is hidden until the toggle is checked */
  .dev-portal-header__nav {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--wave-space-default);
  }

  .dev-portal-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--wave-space-default);
    width: 100%;
  }

  .dev-portal-header__toggle:checked ~ .dev-portal-header__nav {
    display: flex;
  }

  /* Animate hamburger into an X when open */
  .dev-portal-header__toggle:checked ~ .dev-portal-header__hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .dev-portal-header__toggle:checked ~ .dev-portal-header__hamburger span:nth-child(2) {
    opacity: 0;
  }

  .dev-portal-header__toggle:checked ~ .dev-portal-header__hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .dev-portal-hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--wave-space-medium);
  }

  .dev-portal-hero__illustration {
    width: 100%;
    max-width: 380px;
    height: auto;
  }

  .dev-portal-cards__row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Article page: stack sidebar above the article body */
  .dev-portal-article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .dev-portal-sidebar__inner {
    padding: var(--wave-space-medium) var(--wave-space-medium);
  }

  .dev-portal-article {
    padding: var(--wave-space-medium) var(--wave-space-medium) var(--wave-space-xlarge);
  }
}

@media (max-width: 600px) {
  .dev-portal-hero__title {
    font-size: 40px;
  }

  .dev-portal-page-header__title {
    font-size: 30px;
  }

  .dev-portal-section-intro .dev-portal-page-header__title {
    font-size: 36px;
  }

  .dev-portal-page-header--article .dev-portal-page-header__title {
    font-size: 26px;
  }

  .dev-portal-cards__row {
    grid-template-columns: 1fr;
  }
}
} /* end .dev-portal-theme */
} /* end @scope (body) to (#WebhookManagementContent) — see comment near top */

/* ---------------------------------------------------------------------------
 * 12. Host-theme overrides (intentionally unscoped)
 *
 * These rules sit *outside* the `.dev-portal-theme` wrapper because they
 * target host-theme elements that are siblings/ancestors of our content
 * (`.wv-frame__footer` is part of the host theme's page chrome). We gate
 * them on the presence of a `.dev-portal-theme` element anywhere in the
 * document via `:has()` so other Help-Center pages are unaffected.
 *
 * Browser support for `:has()`: Chrome 105+, Edge 105+, Safari 15.4+,
 * Firefox 121+ — covers the supported Wave audience.
 * ------------------------------------------------------------------------- */
body:has(.dev-portal-theme) .wv-frame__footer {
  padding: 0;
}

/*
 * Auth-state gating for `.logged-in` / `.logged-out` article content
 * (Playground page, and any other article that authors both states).
 *
 * The host page's `header.hbs` runs a `document.write` that opens a
 * `<div class="wv-frame__topbar--fixed js-topbar is-authenticated …">`
 * (or `is-unauthenticated`) which wraps the ENTIRE page — including
 * `.dev-portal-theme`. So the auth-state marker is an ANCESTOR of our
 * wrapper, never a descendant. That's why this rule is:
 *   1. NOT nested inside `.dev-portal-theme { … }` (CSS nesting would
 *      auto-prepend `&`, breaking the ancestor→descendant relationship).
 *   2. NOT inside `@scope (body) to (#WebhookManagementContent)` — the
 *      widget mount would then be a hard boundary, but auth-gated divs
 *      typically WRAP the mount rather than sit inside it, so scoping
 *      isn't necessary here.
 *
 * The Manage-applications page uses a separate ID-based gate in
 * `document_head.hbs` (`.is-authenticated #applications2-signed-out { display:none }`)
 * and does not depend on this rule.
 */
.is-authenticated .dev-portal-theme .logged-out,
.is-unauthenticated .dev-portal-theme .logged-in {
  display: none !important;
}

