/* =============================================================================
   HelpSite TK — Main Stylesheet
   Clean, minimal, Stripe-docs inspired.

   Custom-block design rules (callout / badge / step-list / tabs / FAQ) live in
   blocks-shared.css and are enqueued separately via the `enqueue_block_assets`
   hook so the same file loads in both the frontend and the Gutenberg iframe.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   0. CSS Custom Properties
   --------------------------------------------------------------------------- */
:root {
  /* Colour palette */
  --color-bg: #ffffff;
  --color-surface: #f6f8fa;
  --color-border: #e1e4e8;
  --color-border-light: #eaecef;
  --color-text: #0d0d0d;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-accent: #0057ff;
  --color-accent-hover: #0044cc;
  --color-accent-light: #eff4ff;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --color-code-bg: #f3f4f6;
  --color-code-border: #e5e7eb;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-size-base: 15px;
  --line-height: 1.7;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Layout */
  --sidebar-width: 260px;
  --content-max: 760px;
  --container-max: 1200px;
  --header-height: 60px;

  /* Borders / radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ---------------------------------------------------------------------------
   1. Reset & Base
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: var(--line-height);
  font-feature-settings: 'kern' 1, 'liga' 1;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   2. Layout utilities
   --------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   3. Site Header
   --------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  height: 100%;
}

.site-header__logo {
  flex-shrink: 0;
}

.site-header__title-link {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header__title-link:hover {
  text-decoration: none;
  color: var(--color-accent);
}

/* Primary nav */
.site-header__nav {
  margin-left: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
  color: var(--color-text);
}

/* Mobile toggle */
.site-header__menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}

.menu-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------------------------------------------------------------------------
   4. Site Footer
   --------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
  background: var(--color-bg);
  margin-top: var(--space-2xl);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.site-footer__brand a {
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.footer-menu {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-menu a:hover {
  color: var(--color-accent);
}

.site-footer__copy {
  margin: 0;
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.site-footer__copy a {
  color: inherit;
}

/* ---------------------------------------------------------------------------
   5. Docs Layout (sidebar + content)
   --------------------------------------------------------------------------- */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--header-height));
  align-items: start;
}

.docs-layout__sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  /* Thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.docs-layout__main {
  padding: var(--space-2xl) var(--space-2xl);
  max-width: calc(var(--content-max) + var(--space-2xl) * 2);
  min-width: 0;
  /* prevent overflow */
  margin-inline: auto;
}

/* Reference: wider, with TOC column */
.docs-layout--reference .docs-layout__main--reference {
  max-width: 100%;
  padding-right: var(--space-xl);
}

.docs-reference-body {
  display: grid;
  grid-template-columns: minmax(0, 650px) 200px;
  gap: var(--space-2xl);
  align-items: start;
}

/* ---------------------------------------------------------------------------
   6. Docs page header (title + PDF buttons + breadcrumb)
   --------------------------------------------------------------------------- */
.docs-page-header {
  margin-bottom: var(--space-xl);
}

.docs-breadcrumb {
  margin-bottom: var(--space-md);
}

.docs-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.docs-breadcrumb__item+.docs-breadcrumb__item::before {
  content: '/';
  margin-right: var(--space-xs);
  color: var(--color-text-faint);
}

.docs-breadcrumb__item a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.docs-breadcrumb__item a:hover {
  color: var(--color-accent);
}

.docs-breadcrumb__item--current {
  color: var(--color-text-faint);
}

.docs-page-header__inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.docs-page-header__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--color-text);
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.docs-page-header__actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
  padding-top: 0.25rem;
}

.docs-page-header__meta {
  margin: var(--space-sm) 0 0;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.docs-page-header__strip {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8125rem;
  color: var(--color-text-faint);
}

.docs-page-header__strip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.docs-page-header__strip-icon {
  display: inline-flex;
  color: var(--color-text-faint);
}

.docs-page-header__strip time {
  color: inherit;
}

/* ---------------------------------------------------------------------------
   7. Docs content typography
   --------------------------------------------------------------------------- */
.docs-content {
  font-size: 0.9375rem;
  line-height: 1.75;
}

.docs-content h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
  padding-top: 1em;
  border-top: 1px solid var(--color-border-light);
  letter-spacing: -0.02em;
}

/* Heading copy-link button (injected by docs-headings.js). */
.docs-content h2,
.docs-content h3 {
  position: relative;
}

.hs-anchor {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.25rem;
  margin-left: 0.5rem;
  color: var(--color-text-faint);
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease;
}

.docs-content h2:hover .hs-anchor,
.docs-content h3:hover .hs-anchor,
.hs-anchor:focus-visible {
  opacity: 1;
}

.hs-anchor:hover {
  color: var(--color-accent, #0057ff);
  background-color: rgba(0, 87, 255, 0.08);
}

.hs-anchor:focus-visible {
  outline: 2px solid var(--color-accent, #0057ff);
  outline-offset: 2px;
}

.hs-anchor.is-copied {
  opacity: 1;
  color: var(--color-accent, #0057ff);
}

.hs-anchor.is-copied::after {
  content: 'Copied';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-accent, #0057ff);
  white-space: nowrap;
}

.docs-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.75em 0 0.5em;
  letter-spacing: -0.015em;
}

.docs-content h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 1.5em 0 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.docs-content p {
  margin: 0 0 1em;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}

.docs-content li+li {
  margin-top: 0.25em;
}

.docs-content blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: normal;
  color: var(--color-text-muted);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.875rem;
}

.docs-content th,
.docs-content td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.docs-content th {
  background: var(--color-surface);
  font-weight: 600;
}

.docs-content tr:nth-child(even) td {
  background: #fafafa;
}

.docs-content img {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  max-width: 100%;
}

.docs-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

/* Inline code */
.docs-content code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
  color: #c7254e;
}

/* Code blocks */
.docs-content pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius-md);
  padding: 1.25em 1.5em;
  overflow-x: auto;
  margin: 1.5em 0;
  tab-size: 2;
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ---------------------------------------------------------------------------
   8. Docs prev/next pagination
   --------------------------------------------------------------------------- */
.docs-pagination {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.docs-pagination__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.docs-pagination__link:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  text-decoration: none;
}

.docs-pagination__link--next {
  text-align: right;
}

.docs-pagination__dir {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.docs-pagination__link--prev .docs-pagination__dir::before {
  content: '← ';
}

.docs-pagination__link--next .docs-pagination__dir::after {
  content: ' →';
}

.docs-pagination__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ---------------------------------------------------------------------------
   9. Docs archive — card grid
   --------------------------------------------------------------------------- */
.docs-archive-header {
  margin-bottom: var(--space-2xl);
}

.docs-archive-header__title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 var(--space-sm);
}

.docs-archive-header__intro {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  margin: 0;
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.docs-cards--children {
  margin-top: var(--space-xl);
}

.docs-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.docs-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.docs-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}

.docs-card__excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md);
  line-height: 1.5;
}

.docs-card__links {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-sm);
}

.docs-card__links li {
  font-size: 0.8rem;
  color: var(--color-accent);
  padding: 2px 0;
}

.docs-card--sm {
  flex-direction: row;
  align-items: center;
}

.docs-card--sm .docs-card__body {
  flex: 1;
}

.docs-card--sm .docs-card__title {
  font-size: 0.9375rem;
  margin-bottom: var(--space-xs);
}

.docs-card__arrow {
  color: var(--color-text-faint);
  font-size: 1.1rem;
  transition: transform 0.15s, color 0.15s;
  flex-shrink: 0;
}

.docs-card:hover .docs-card__arrow {
  color: var(--color-accent);
  transform: translateX(3px);
}

/* Row variant — used on landing page for recently-updated docs */
.docs-cards--row {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ---------------------------------------------------------------------------
   10. In-page TOC (Reference template)
   --------------------------------------------------------------------------- */
.docs-toc {
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
  padding: var(--space-md);
  border-left: 2px solid var(--color-border);
  font-size: 0.8125rem;
}

.docs-toc__heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 700;
  margin: 0 0 var(--space-sm);
}

.docs-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-toc__item {
  margin-bottom: 0.2em;
}

.docs-toc__item--h3 {
  padding-left: var(--space-md);
}

.docs-toc__link {
  color: var(--color-text-muted);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  line-height: 1.4;
  transition: color 0.12s;
}

.docs-toc__link:hover,
.docs-toc__link.is-active {
  color: var(--color-accent);
}

/* ---------------------------------------------------------------------------
   11. Buttons
   --------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.45em 1em;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
}

.button:disabled,
.button[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.button--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.button--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
}

.button--secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

.button--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Icon-only download buttons in the doc page header — kept quiet so they
   don't compete with the H1. Accessible label and visible tooltip come from
   the button's aria-label + title attributes. */
.button--pdf {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.button--pdf:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.button--pdf .button__icon {
  display: inline-flex;
}

.button__icon svg {
  display: block;
}

/* ---------------------------------------------------------------------------
   12. Contact form
   --------------------------------------------------------------------------- */
.contact-container {
  max-width: 680px;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.feedback-form-wrapper {
  margin-top: var(--space-2xl);
}

.form-row {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.5em 0.75em;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75em center;
  padding-right: 2.5em;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  display: block;
  font-size: 0.8rem;
  color: var(--color-danger);
  margin-top: var(--space-xs);
}

.form-row--submit {
  padding-top: var(--space-sm);
}

.feedback-response {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}

.feedback-response--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.feedback-response--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

/* ---------------------------------------------------------------------------
   13. Generic page layout
   --------------------------------------------------------------------------- */
.page-container {
  max-width: 820px;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}

.page-content {
  font-size: 0.9375rem;
  line-height: 1.75;
}

/* ---------------------------------------------------------------------------
   14. 404
   --------------------------------------------------------------------------- */
.error-404 .page-title {
  color: var(--color-text-muted);
  font-size: 1.5rem;
  font-weight: 600;
}

.error-404 .page-content {
  margin-top: var(--space-lg);
}

.error-404 .button {
  margin-right: var(--space-sm);
  margin-top: var(--space-sm);
}

/* ---------------------------------------------------------------------------
   15. Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 220px;
  }

  .docs-layout__main {
    padding: var(--space-xl) var(--space-lg);
  }

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

  .docs-toc {
    display: none;
    /* collapse TOC on small screens */
  }
}

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

  .docs-layout__sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .docs-layout__main {
    padding: var(--space-lg) var(--space-md);
  }

  .docs-page-header__inner {
    flex-direction: column;
  }

  .docs-page-header__actions {
    width: 100%;
    padding-top: 0;
  }

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

  .container {
    padding-inline: var(--space-md);
  }

  .nav-menu {
    display: none;
    /* toggle via JS */
  }

  .site-header__menu-toggle {
    display: flex;
  }

  .nav-menu.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-xl);
    gap: var(--space-md);
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
}

/* =============================================================================
   16. Webinars
   ============================================================================= */

/* ── Archive ── */
.webinar-archive-container {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.webinar-archive-header {
  margin-bottom: var(--space-2xl);
}

.webinar-archive-header__title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 var(--space-sm);
}

.webinar-archive-header__intro {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  margin: 0;
}

.webinar-archive-empty {
  color: var(--color-text-muted);
}

/* ── Card grid ── */
.webinar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.webinar-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  transition: box-shadow 0.15s, transform 0.1s;
}

.webinar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Thumbnail */
.webinar-card__thumb-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.webinar-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.webinar-card:hover .webinar-card__thumb {
  transform: scale(1.03);
}

.webinar-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-text-faint);
  width: 100%;
  height: 100%;
}

.webinar-card__duration {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Card body */
.webinar-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-lg);
}

.webinar-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.webinar-card__date {
  font-weight: 500;
}

.webinar-card__presenter::before {
  content: '·';
  margin-right: var(--space-sm);
}

.webinar-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  line-height: 1.35;
}

.webinar-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

.webinar-card__title a:hover {
  color: var(--color-accent);
}

.webinar-card__excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 0 var(--space-md);
  flex: 1;
}

.webinar-card__cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  margin-top: auto;
}

.webinar-card__cta:hover {
  text-decoration: underline;
}

/* ── Single webinar ── */
.webinar-container {
  max-width: 900px;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.webinar-header {
  margin-bottom: var(--space-xl);
}

.webinar-title {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-md);
  line-height: 1.2;
}

/* Meta row */
.webinar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: center;
}

.webinar-meta__item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.webinar-meta__item svg {
  flex-shrink: 0;
  color: var(--color-text-faint);
}

/* Video embed */
.webinar-video {
  margin-bottom: var(--space-2xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
}

.webinar-video__embed {
  position: relative;
  aspect-ratio: 16 / 9;
}

.webinar-video__embed iframe,
.webinar-video__embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.webinar-video--thumb-only .webinar-video__poster {
  width: 100%;
  border-radius: var(--radius-lg);
}

.webinar-video__fallback {
  padding: var(--space-lg);
  color: var(--color-text-muted);
  background: var(--color-surface);
  margin: 0;
}

/* Webinar content */
.webinar-content {
  font-size: 0.9375rem;
  line-height: 1.75;
}

.webinar-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
  letter-spacing: -0.02em;
}

.webinar-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5em 0 0.5em;
}

.webinar-content p {
  margin: 0 0 1em;
}

.webinar-content ul,
.webinar-content ol {
  padding-left: 1.5em;
  margin: 0 0 1em;
}


/* ── Responsive ── */
@media (max-width: 700px) {
  .webinar-grid {
    grid-template-columns: 1fr;
  }

  .webinar-title {
    font-size: 1.5rem;
  }

  .webinar-container {
    padding-top: var(--space-xl);
  }
}

/* =============================================================================
   17. Homepage
   ============================================================================= */

/* ── Shared section scaffolding ── */
.home-section {
  padding: var(--space-2xl) 0;
}

.home-section--alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.home-section__header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: var(--space-xl);
  align-items: end;
  margin-bottom: var(--space-xl);
}

.home-section__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-xs);
  grid-column: 1;
  grid-row: 1;
}

.home-section__subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  grid-column: 1;
  grid-row: 2;
}

.home-section__link {
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
}

.home-section__link:hover {
  text-decoration: underline;
}

/* ── Large button variant ── */
.button--lg {
  padding: 0.65em 1.5em;
  font-size: 1rem;
}

/* ── Hero ── */
.home-hero {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--color-border-light);
  overflow: hidden;
}

.home-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.home-hero__eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 0.2em 0.75em;
  border-radius: 20px;
  margin-bottom: var(--space-md);
}

.home-hero__heading {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}

.home-hero__heading-accent {
  color: var(--color-accent);
}

.home-hero__subtext {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0 0 var(--space-xl);
  max-width: 480px;
}

.home-hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.home-hero__graphic {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-svg {
  width: 100%;
  max-width: 520px;
  height: auto;
}

/* ── Latest webinars ── */
.home-webinars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.home-webinar-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  transition: box-shadow 0.15s, transform 0.1s;
}

.home-webinar-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.home-webinar-card__thumb-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d0d0d;
}

.home-webinar-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.home-webinar-card:hover .home-webinar-card__thumb {
  transform: scale(1.04);
}

.home-webinar-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  background: var(--color-surface);
  width: 100%;
  height: 100%;
}

.home-webinar-card__duration {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.home-webinar-card__body {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.home-webinar-card__meta {
  display: flex;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.home-webinar-card__meta span::before,
.home-webinar-card__meta time+span::before {
  content: '·';
  margin-right: var(--space-sm);
}

.home-webinar-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  line-height: 1.35;
}

.home-webinar-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

.home-webinar-card__title a:hover {
  color: var(--color-accent);
}

.home-webinar-card__excerpt {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Latest updates ── */
.home-updates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.update-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.update-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
}

.update-card__inner {
  flex: 1;
  min-width: 0;
}

.update-card__top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.update-card__section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 7px;
  border-radius: 20px;
}

.update-card__date {
  font-size: 0.775rem;
  color: var(--color-text-faint);
}

.update-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 var(--space-xs);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-card__excerpt {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.update-card__arrow {
  color: var(--color-text-faint);
  font-size: 1rem;
  transition: transform 0.15s, color 0.15s;
  flex-shrink: 0;
  align-self: center;
}

.update-card:hover .update-card__arrow {
  color: var(--color-accent);
  transform: translateX(3px);
}

/* ── Homepage responsive ── */
@media (max-width: 1000px) {
  .home-webinars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 780px) {
  .home-hero__inner {
    grid-template-columns: 1fr;
  }

  .home-hero__graphic {
    display: none;
  }

  .home-hero__subtext {
    max-width: 100%;
  }

  .home-updates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .home-webinars-grid {
    grid-template-columns: 1fr;
  }

  .home-section__header {
    grid-template-columns: 1fr;
  }

  .home-section__link {
    grid-column: 1;
    grid-row: 3;
    margin-top: var(--space-xs);
  }
}

/* =============================================================================
   18. Annotated Image Block — Frontend
   ============================================================================= */

/* ── Outer wrapper provides the gap between the two cards ── */
.annotated-image-block {
  margin: var(--space-xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ── Side-by-side layout — image card + steps card on the same row when
   the image is narrower than ~half the content column (e.g. Mobile preset).
   Falls back to the default stacked layout on actual mobile viewports
   where side-by-side would squash both cards. ── */
@media (min-width: 700px) {
  .annotated-image-block.is-narrow {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .annotated-image-block.is-narrow .annotated-image__container {
    flex-shrink: 0;
    /* Inline max-width still controls actual width; don't auto-center inside flex row. */
    margin-left: 0;
    margin-right: 0;
  }

  .annotated-image-block.is-narrow .annotated-image__steps {
    flex: 1;
    min-width: 0;
    align-self: stretch;
  }
}

/* ── Card 1: Image container (rounded card, light bg, holds the pills) ── */
.annotated-image__container {
  position: relative;
  display: block;
  line-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Center the card when an inline max-width is applied (mobile / desktop /
     custom preset). With no inline max-width (Full preset), the card just
     fills its parent column as before. */
  margin-left: auto;
  margin-right: auto;
}

.annotated-image__img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Annotation pills (dark with subtle white halo) ── */
.annotated-image__pill {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.95);
  z-index: 1;
  user-select: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.annotated-image__pill.is-active {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.95);
  z-index: 5;
}

/* ── Card 2: Steps list (separate rounded card, no row dividers) ── */
.annotated-image__steps {
  list-style: none;
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.annotated-image__step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: 0;
  background: transparent;
  transition: opacity 0.15s ease;
  cursor: default;
}

.annotated-image__step.is-active {
  /* Subtle highlight when the matching pill is hovered — no bg, just a soft pull */
  opacity: 1;
}

.annotated-image__step-pill {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  /* Mirror the pill style on the image: dark bg, thin white halo */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.annotated-image__step-body {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
}

.annotated-image__step-title {
  display: inline;
  font-weight: 700;
  color: var(--color-text);
}

.annotated-image__step-title::after {
  content: ' ';
}

.annotated-image__step-desc {
  display: inline;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .annotated-image__pill {
    width: 30px;
    height: 30px;
    font-size: 0.8125rem;
  }

  .annotated-image__step-pill {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .annotated-image__step {
    padding: var(--space-sm) var(--space-md);
  }
}


