/* Shared code-block component, also used by the guides. @import must come
   before any rule or the browser drops it. */
@import url('../resources/styles/code-block.css');

/* ==========================================
   DOCUMENTATION STYLES
   ========================================== */

/* Underline current page in header */
header .header-inner .menu-container .menu .documentation:after {
  transform: translateX(-50%) scaleX(1);
}

/* ==========================================
   BASE STYLES
   ========================================== */
body {
  line-height: 1.6;
  background: var(--whiteBackground);
}

body.docs-landing {
  background: var(--white);
}

/* ==========================================
   HERO SECTION - Landing Page Only
   ========================================== */
/* Lit slate, as on the homepage and pricing. The category sheet below rises
   into the bottom of this band. */
.hero {
  position: relative;
  background:
    radial-gradient(50% 80% at 50% 0%, rgba(120, 150, 220, 0.16), transparent 70%),
    linear-gradient(160deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
  padding: 148px 24px 168px;
}

.hero-content {
  position: relative;
  z-index: 20;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: var(--text-6xl);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--white);
  margin: 0 0 40px;
  line-height: 1.5;
}

/* Hero Search */
.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  z-index: 100;
}

.hero-search .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.hero-search .search-icon {
  position: absolute;
  left: 20px;
  color: var(--black);
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  padding: 18px 100px 18px 56px;
  font-size: var(--text-sm);
  border: 2px solid var(--white-alpha-10);
  border-radius: var(--radius-lg);
  background: var(--white-alpha-95);
  color: var(--gray-900);
  transition: all 0.2s ease;
  box-shadow: var(--elevation-md);
}

.hero-search input::placeholder {
  color: var(--black);
}

.hero-search input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: var(--elevation-md);
}

.hero-search .search-shortcut {
  position: absolute;
  right: 16px;
  background: var(--gray-100);
  color: var(--black);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  font-family: inherit;
  border: 1px solid var(--gray-200);
}

/* ==========================================
   QUICK LINKS BAR
   ========================================== */
.quick-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--white-alpha-05);
  color: var(--white);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--white-alpha-15);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.quick-link:hover {
  background: var(--white-alpha-10);
  border-color: var(--white-alpha-30);
}

.quick-link svg {
  color: var(--white);
  opacity: 0.8;
}

/* ==========================================
   MAIN CONTENT - Landing Page
   ========================================== */
.docs-main {
  position: relative;
  max-width: 1200px;
  box-sizing: border-box;
  margin: -104px auto 0;
  padding: 48px 48px 24px;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -12px 32px var(--shadow-default);
}

/* ==========================================
   CATEGORY SECTIONS - Landing Page
   ========================================== */
.docs-category {
  margin-bottom: 56px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--blue-50);
  color: var(--primary-blue);
}

.category-info h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 4px;
}

.category-info p {
  font-size: var(--text-xs);
  color: var(--black);
  margin: 0;
}

/* ==========================================
   DOCUMENTATION CARDS - Landing Page
   ========================================== */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.doc-card:hover {
  border-color: var(--primary-blue);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary-blue);
}

.doc-card h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 8px;
}

.doc-card p {
  font-size: var(--text-xs);
  color: var(--black);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================
   HELP BANNER - Landing Page
   ========================================== */
.help-banner {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 48px 24px;
}

.help-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.help-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  flex-shrink: 0;
}

.help-text {
  flex: 1;
}

.help-text h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 4px;
}

.help-text p {
  font-size: var(--text-xs);
  color: var(--black);
  margin: 0;
}

.help-button {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--primary-blue);
  color: var(--white);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
  white-space: nowrap;
}

.help-button:hover {
  background: var(--blue-700);
}

/* ==========================================
   FOOTER OVERRIDE FOR LANDING PAGE
   ========================================== */
.docs-landing footer {
  width: 100% !important;
  position: relative !important;
  left: 0 !important;
}

/* ==========================================
   LANDING PAGE RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .hero {
    padding: 120px 20px 128px;
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-sm);
  }

  .hero-search input {
    padding: 16px 20px 16px 48px;
  }

  .hero-search .search-shortcut {
    display: none;
  }

  .quick-links {
    gap: 8px;
  }

  .quick-link {
    padding: 8px 12px;
  }

  .docs-main {
    margin: -80px 12px 0;
    padding: 28px 16px 16px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .category-header {
    gap: 12px;
  }

  .category-icon {
    width: 48px;
    height: 48px;
  }

  .category-info h2 {
    font-size: var(--text-lg);
  }

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

  .help-content {
    flex-direction: column;
    text-align: center;
  }

  .help-icon {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: var(--text-3xl);
  }
}

/* ==========================================
   SUB-PAGE STYLES
   ========================================== */
body.docs-page {
  background: var(--white);
}

/* Force header to be fixed with light gray background on doc pages */
body.docs-page header {
  position: fixed !important;
  background: var(--neutral-f7f7f8) !important;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: none !important;
}

/* Reuse sticky header text/logo styles for docs pages */
body.docs-page header .header-inner .logo {
  content: url(../resources/images/argo-logo/argo-logo-black.png) !important;
}

body.docs-page header .header-inner .menu-container ul li a {
  color: var(--gray-900) !important;
}

body.docs-page header .header-inner .menu-container ul li a:after {
  background: var(--gray-900) !important;
}

body.docs-page header .menu-icon .nav-icon,
body.docs-page header .menu-icon .nav-icon:before,
body.docs-page header .menu-icon .nav-icon:after {
  background: var(--gray-900) !important;
}

body.docs-page .account-avatar {
  border-color: var(--shadow-lg);
}

/* ==========================================
   THREE-COLUMN LAYOUT
   ========================================== */
.docs-layout {
  display: flex;
  max-width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 50px);
  padding-top: 50px;
}

/* ==========================================
   LEFT SIDEBAR
   ========================================== */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
  overflow-y: auto;
  border-right: 1px solid var(--gray-200);
  padding: 16px 0;
  background: var(--neutral-f7f7f8);
  z-index: 50;
}

/* Prevent flash: hide sidebar until JS restores state */
.sidebar.no-transition,
.sidebar.no-transition .nav-links,
.sidebar.no-transition .nav-section,
.sidebar.no-transition .nav-section-toggle,
.sidebar.no-transition .nav-chevron {
  transition: none !important;
}

.sidebar-nav {
  padding: 0 14px;
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-xs);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ==========================================
   SIDEBAR NAVIGATION SECTIONS
   ========================================== */
.nav-section {
  margin-bottom: 0;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-800);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  text-align: left;
}

.nav-section-toggle:hover {
  background: var(--shadow-xs);
  color: var(--gray-900);
}

.nav-chevron {
  flex-shrink: 0;
  color: var(--black);
  transition: transform 0.2s ease;
  width: 16px;
  height: 16px;
}

.nav-section.expanded .nav-chevron {
  transform: rotate(90deg);
}

/* Nav Links */
.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-section.expanded .nav-links {
  max-height: 2000px;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  display: block;
  padding: 6px 14px 6px 32px;
  color: var(--black);
  text-decoration: none;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  border-left: none;
  margin-left: 0;
}

.nav-links a:hover {
  color: var(--gray-900);
  background: var(--shadow-xs);
}

.nav-links a.active {
  color: var(--primary-blue);
  font-weight: 500;
  background: var(--blue-alpha-08);
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-links a.active::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary-blue);
  border-radius: var(--radius-xs);
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.docs-main-content {
  flex: 1;
  min-width: 0;
  padding: 40px 56px 60px;
}

/* Page Title */
.docs-page-title {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* Hide old page header elements */

/* Content Area - No card, clean typography */
.docs-content {
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none;
}

.docs-content > p:first-child,
.docs-content > .docs-video + p {
  font-size: var(--text-sm);
  color: var(--black);
  line-height: 1.7;
  margin-bottom: 28px;
}

.docs-content h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin: 40px 0 16px;
  scroll-margin-top: 70px;
}

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

.docs-content h3 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--black);
  margin: 28px 0 12px;
  scroll-margin-top: 70px;
}

.docs-content p {
  color: var(--black);
  line-height: 1.7;
  margin-bottom: 16px;
  font-size: var(--text-sm);
}

.docs-content ul {
  margin: 16px 0 16px 16px;
  color: var(--black);
}

.docs-content ol {
  margin: 16px 0 16px 24px;
  color: var(--black);
  list-style: decimal;
  padding-left: 0;
}

.docs-content ol li {
  padding-left: 8px;
  margin-bottom: 12px;
  line-height: 1.7;
  font-size: var(--text-sm);
}

.docs-content ul li {
  margin-bottom: 6px;
  line-height: 1.6;
  font-size: var(--text-sm);
}

.docs-content li {
  line-height: 1.6;
  font-size: var(--text-sm);
}

.docs-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 24px 0;
  border: 1px solid var(--gray-200);
}

.docs-content a.link {
  color: var(--primary-blue);
  text-decoration: none;
}

.docs-content a.link:hover {
  text-decoration: underline;
}

/* ==========================================
   ON THIS PAGE - RIGHT SIDEBAR (TOC)
   ========================================== */
.toc-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
  overflow-y: auto;
  padding: 40px 28px 32px 0;
  margin-left: auto;
}

.toc-container {
  padding-left: 0;
  border-left: none;
}

.toc-heading {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--black);
  margin: 0 0 16px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--gray-200);
}

.toc-item {
  margin-bottom: 0;
}

.toc-item.toc-h3 {
  padding-left: 12px;
}

.toc-link {
  display: block;
  padding: 4px 0 4px 16px;
  font-size: var(--text-2xs);
  color: var(--black);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.15s ease;
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.toc-link:hover {
  color: var(--gray-900);
}

.toc-link.active {
  color: var(--gray-900);
  font-weight: 500;
  border-left-color: var(--gray-900);
}

/* TOC scrollbar */
.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: var(--radius-xs);
}

/* ==========================================
   INFO & WARNING BOXES
   ========================================== */
.info-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: var(--radius-md);
  line-height: 1.7;
  font-size: var(--text-sm);
  color: var(--black);
}

/* Make the label (Tip:/Note:/Info:) appear on its own line with outlined icon */
.info-box > strong:first-child,
.info-box > p:first-child > strong:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--gray-900);
}

.info-box > strong:first-child::before,
.info-box > p:first-child > strong:first-child::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.info-box p {
  margin: 4px 0;
  color: var(--black);
  font-size: var(--text-sm);
}

.warning-box {
  background: var(--amber-50);
  border: 1px solid var(--amber-300);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: var(--radius-md);
  line-height: 1.7;
  font-size: var(--text-sm);
  color: var(--black);
}

.warning-box > strong:first-child,
.warning-box > p:first-child > strong:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--gray-900);
}

.warning-box > strong:first-child::before,
.warning-box > p:first-child > strong:first-child::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ==========================================
   CONTENT UTILITY STYLES
   ========================================== */

/* Two-column list */
.two-column-list {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: start;
  gap: 0 3rem;
  margin: 1rem 0 1.5rem;
}

.two-column-list ul {
  margin: 0;
  padding-left: 1.25rem;
}

.two-column-list li {
  padding: 2px 0;
}

/* Steps list - simple numbered list */
.steps-list {
  list-style: decimal;
  counter-reset: none;
  padding-left: 24px;
  margin: 16px 0;
}

.steps-list li {
  position: relative;
  padding-left: 8px;
  margin-bottom: 12px;
  line-height: 1.7;
  font-size: var(--text-sm);
  color: var(--black);
}

.steps-list li::before {
  content: none;
}

/* ==========================================
   TABLES
   ========================================== */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  font-size: var(--text-sm);
}

.comparison-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--black);
}

/* Body cells only: a header here would lose the 600 the other headers carry. */
.comparison-table td:first-child {
  font-weight: 500;
}

/* An arrow key is drawn rather than typed: the text arrows are hairline beside bold
   words, and the vertical pair fell back to a symbol font that coloured them. One icon,
   turned, keeps all four identical. */
.key-arrow {
  vertical-align: -0.2em;
}

.key-arrow.left { transform: rotate(180deg); }
.key-arrow.up { transform: rotate(-90deg); }
.key-arrow.down { transform: rotate(90deg); }

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background: var(--gray-50);
}

.comparison-table tr:nth-child(even) {
  background: var(--gray-50);
}

.comparison-table tr:nth-child(odd) {
  background: var(--white);
}

/* ==========================================
   VERSION COMPARISON
   ========================================== */
.version-comparison {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.version-comparison .description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px;
}

.version-comparison .description h2 {
  font-size: var(--text-2xl);
  margin-bottom: 16px;
}

.version-comparison .description p {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ==========================================
   SYSTEM REQUIREMENTS GRID
   ========================================== */
.requirements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.requirement-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 24px;
}

.requirement-card h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px 0;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--gray-800);
}

.req-icon {
  width: 24px;
  height: 24px;
  color: var(--black);
}

/* Shown when a platform has no build yet (system-requirements.json "available") */
.req-coming-soon {
  padding: 2px 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-pill);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.requirement-card ul {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.requirement-card li {
  color: var(--black);
  font-size: var(--text-sm);
  margin-bottom: 8px;
  line-height: 1.5;
}

.requirement-card li:last-child {
  margin-bottom: 0;
}

/* ==========================================
   PAGE NAVIGATION LINKS
   ========================================== */
.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
  gap: 1rem;
}

.nav-button {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  gap: 4px;
}

.nav-button .nav-label {
  font-size: var(--text-2xs);
  color: var(--black);
  font-weight: 400;
}

.nav-button .nav-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--primary-blue);
  transition: color 0.15s ease;
}

.nav-button:hover .nav-title {
  text-decoration: underline;
}

.nav-button.prev {
  margin-right: auto;
  align-items: flex-start;
}

.nav-button.next {
  margin-left: auto;
  align-items: flex-end;
}

.nav-button svg {
  flex-shrink: 0;
}

/* ==========================================
   MOBILE SIDEBAR TOGGLE BUTTON
   ========================================== */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--primary-blue);
  border: none;
  border-radius: var(--radius-round);
  cursor: pointer;
  z-index: 1001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: var(--elevation-brand-strong);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--elevation-brand-strong);
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--white);
  border-radius: var(--radius-xs);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.sidebar-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ==========================================
   RESPONSIVE - SUB-PAGES
   ========================================== */

/* Hide TOC on medium screens */
@media (max-width: 1200px) {
  .toc-sidebar {
    display: none;
  }

  .docs-main-content {
    max-width: 100%;
  }
}

/* Mobile layout */
@media (max-width: 1024px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    max-height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--elevation-md);
    border-right: none;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-nav {
    padding: 24px 14px;
    padding-top: 32px;
  }

  .docs-main-content {
    padding: 24px 24px 40px;
  }
}

/* Sidebar overlay for mobile */
@media (max-width: 1024px) {
  .sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 300px;
    width: calc(100vw - 300px);
    height: 100vh;
    background: var(--overlay-dark);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .sidebar.active::before {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 768px) {
  .docs-page-title {
    font-size: var(--text-2xl);
  }

  .docs-main-content {
    padding: 20px 16px 40px;
  }

  .comparison-table {
    display: block;
    overflow-x: auto;
  }

  .comparison-table th,
  .comparison-table td {
    min-width: 120px;
    white-space: nowrap;
  }

  .two-column-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page-navigation {
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-button.prev,
  .nav-button.next {
    margin: 0;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .docs-page-title {
    font-size: var(--text-xl);
  }

  .requirements-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   SEARCH OVERLAY
   ========================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.active {
  display: flex;
}

.search-overlay-container {
  width: 100%;
  max-width: 560px;
  position: relative;
}

.search-overlay .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-overlay .search-icon {
  position: absolute;
  left: 16px;
  color: var(--black);
  pointer-events: none;
}

.search-overlay input {
  width: 100%;
  padding: 16px 70px 16px 48px;
  font-size: var(--text-sm);
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--white);
  color: var(--gray-900);
  box-shadow: var(--elevation-xl);
}

.search-overlay input:focus {
  outline: none;
}

.search-overlay .search-shortcut {
  position: absolute;
  right: 12px;
  background: var(--gray-100);
  color: var(--black);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  font-family: inherit;
  border: 1px solid var(--gray-200);
}

.search-overlay .search-results {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-top: 1px solid var(--gray-200);
  box-shadow: var(--elevation-xl);
}

/* Footer override for sub-pages */
.docs-page footer {
  width: 100% !important;
  position: relative !important;
  left: 0 !important;
}
/* ==========================================
   CODE BLOCKS
   The component and its colours are shared with the guides, so they live in
   resources/styles/code-block.css. Only the docs-specific inline-code rule
   stays here.
   ========================================== */

.docs-content p > code,
.docs-content li > code,
.docs-content td > code {
  font-family: 'IBM Plex Mono', Consolas, monospace;
  font-size: var(--text-xs);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  color: var(--gray-700);
  overflow-wrap: anywhere;
}


/* ==========================================
   DOCS TABLES
   Plain <table> in documentation prose had no styling at all, so reference
   tables rendered as unruled columns. This matches .comparison-table's visual
   language, but on the bare element so a new page needs no extra class.
   ========================================== */
.docs-content table {
  width: 100%;
  margin: 22px 0;
  font-size: var(--text-sm);
  /* separate, not collapse: a collapsed table ignores border-radius, so the
     rounded corners would be clipped off the border but not the header fill. */
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.docs-content table thead th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gray-600);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.docs-content table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  /* Top, not middle: rows in these tables mix one-word cells with a sentence,
     and centring makes the short ones float away from the row they belong to. */
  vertical-align: top;
  line-height: 1.55;
  color: var(--gray-700);
}

.docs-content table tbody tr:last-child td {
  border-bottom: none;
}

.docs-content table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.docs-content table tbody tr:hover {
  background: var(--blue-50);
}

/* The first column is a field or endpoint name. Letting it wrap mid-identifier
   makes a column of names much harder to scan down. */
.docs-content table td:first-child code {
  white-space: nowrap;
}

/* Parenthetical detail beside a type, e.g. "string (max 255)". */
.docs-content .muted {
  color: var(--gray-500);
}

@media (max-width: 720px) {
  /* Wide reference tables scroll rather than squeezing four columns of prose
     into a phone. Block display is what makes a table scrollable at all. */
  .docs-content table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }

  .docs-content table thead th,
  .docs-content table tbody td {
    padding: 9px 11px;
  }
}

/* Video walkthrough at the top of a page, above the written steps. */
.docs-video {
  width: 100%;
  max-width: 640px;
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0 0 28px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
}

.docs-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
