/* Reading pages share the site's palette and locally hosted typefaces. */
.guide-page {
  --guide-purple: #5943ae;
  background: var(--bg);
}

.guide-page::before {
  display: none;
}

.guide-page a {
  color: var(--guide-purple);
  text-underline-offset: 0.2em;
}

.guide-page a:focus-visible,
.guide-page summary:focus-visible,
.guide-page [tabindex]:focus-visible {
  outline: 3px solid var(--guide-purple);
  outline-offset: 5px;
}

.guide-skip {
  position: fixed;
  top: 12px;
  left: 20px;
  z-index: 50;
  padding: 12px 18px;
  background: white;
  transform: translateY(-180%);
}

.guide-skip:focus {
  transform: none;
}

.guide-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface-solid);
}

.guide-header-inner,
.guide-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 22px;
}

.guide-home-link {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.guide-hero {
  max-width: 920px;
  padding-block: 48px 38px;
}

.guide-breadcrumbs,
.guide-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.guide-eyebrow {
  margin: 32px 0 14px;
  color: var(--guide-purple);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-hero h1 {
  max-width: 880px;
  margin: 0;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(1.75rem, 3.8vw, 3.1rem);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.guide-lead {
  max-width: 760px;
  margin-block: 24px;
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.75;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: start;
  gap: 40px;
  padding-bottom: 64px;
}

.guide-article {
  min-width: 0;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  font-size: 1rem;
  line-height: 1.85;
}

.guide-article section + section {
  margin-top: 40px;
}

.guide-article h2 {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.35;
  scroll-margin-top: 24px;
}

.guide-article h3 {
  margin-block: 28px 10px;
  font-size: 1.1rem;
  line-height: 1.5;
}

.guide-article p {
  margin-block: 0 18px;
}

.guide-article ul,
.guide-article ol {
  padding-left: 24px;
}

.guide-article li + li {
  margin-top: 10px;
}

.guide-note,
.guide-example {
  margin-block: 24px;
  padding: 22px 24px;
  border-radius: 16px;
  background: #f1edff;
}

.guide-note {
  border-left: 4px solid var(--guide-purple);
}

.guide-example {
  background: #eef8f1;
}

.guide-note p:last-child,
.guide-example p:last-child {
  margin-bottom: 0;
}

.guide-formula {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.guide-table-wrap {
  margin-block: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.guide-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.65;
}

.guide-table-wrap caption {
  padding: 14px 18px;
  background: #f6f4ff;
  font-weight: 800;
  text-align: left;
}

.guide-table-wrap th,
.guide-table-wrap td {
  padding: 14px 18px;
  vertical-align: top;
  border-top: 1px solid var(--line);
  text-align: left;
}

.guide-table-wrap thead th {
  background: #faf9ff;
}

.guide-table-wrap tbody th {
  font-weight: 700;
}

.guide-figure {
  margin: 28px 0;
}

.guide-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #faf9ff;
}

.guide-figure text {
  fill: var(--ink);
  font: 14px "Manrope", sans-serif;
}

.guide-figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.guide-sidebar {
  position: sticky;
  top: 24px;
}

.guide-toc-title {
  margin: 0 0 16px;
  font-weight: 800;
}

.guide-toc {
  display: grid;
  gap: 14px;
  padding-left: 18px;
  border-left: 2px solid var(--line);
}

.guide-toc a {
  font-size: 0.88rem;
  line-height: 1.6;
  text-decoration: none;
}

.guide-toc a:hover {
  text-decoration: underline;
}

.guide-sidebar-cta {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.guide-sidebar-cta p {
  font-size: 0.88rem;
  line-height: 1.7;
}

.guide-page .guide-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid var(--guide-purple);
  border-radius: 999px;
  background: var(--guide-purple);
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.guide-page .guide-button:hover {
  background: #46348e;
}

.guide-cta {
  margin-top: 40px;
  padding: 28px;
  border-radius: 18px;
  background: #f1edff;
}

.guide-cta h2 {
  font-size: 1.4rem;
}

.guide-article details {
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.guide-article summary {
  font-weight: 800;
  cursor: pointer;
}

.guide-article details p {
  margin-block: 14px 0;
}

.guide-related {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.guide-related a {
  display: block;
  padding-block: 10px;
  line-height: 1.6;
}

.guide-sources {
  color: var(--muted);
  font-size: 0.88rem;
}

.guide-footer {
  border-top: 1px solid var(--line);
}

.guide-footer-inner {
  flex-wrap: wrap;
  padding-block: 26px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .guide-sidebar {
    position: static;
    grid-row: 1;
  }

  .guide-sidebar-cta {
    display: none;
  }

  .guide-hero {
    padding-block: 32px 28px;
  }
}

@media (max-width: 480px) {
  .guide-page .container {
    width: calc(100% - 28px);
  }

  .guide-header-inner {
    gap: 10px;
    padding-block: 16px;
  }

  .guide-page .brand-wordmark {
    height: 13px;
  }

  .guide-home-link {
    font-size: 0.8rem;
  }

  .guide-article {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .guide-note,
  .guide-example,
  .guide-cta {
    padding: 18px;
  }

  .guide-table-wrap th,
  .guide-table-wrap td {
    padding: 12px;
  }
}
