/* ─── VARIABLES ───────────────────────────────────────────── */

:root {
  /* HubSpot brand palette — matches main site */
  --primary:       #FF7A59;
  --primary-dark:  #E55C38;
  --primary-light: rgba(255,122,89,0.1);
  --primary-2:     #FF4F89;
  --gradient:      linear-gradient(135deg, #FF7A59 0%, #FF4F89 100%);
  --gradient-sub:  linear-gradient(135deg, rgba(255,122,89,0.09) 0%, rgba(255,79,137,0.07) 100%);

  --dark:          #17152B;
  --text:          #2E2B44;
  --text-muted:    #6B6882;
  --text-light:    #A9A6BB;

  --bg:            #ffffff;
  --bg-warm:       #FDFAF8;
  --bg-soft:       #F8F5F1;
  --bg-alt:        #F2EDE8;
  --sidebar-bg:    #F8F5F1;
  --code-bg:       #1C1F2E;

  --border:        #E8E3DD;
  --border-light:  #F0EBE5;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;

  --shadow:        0 4px 16px rgba(20,10,0,.07), 0 1px 3px rgba(20,10,0,.04);
  --shadow-md:     0 8px 32px rgba(20,10,0,.09), 0 2px 8px rgba(20,10,0,.04);
  --shadow-orange: 0 8px 32px rgba(255,122,89,.24), 0 2px 8px rgba(255,122,89,.12);

  --nav-height:    58px;
  --sidebar-width: 272px;
  --content-max:   740px;
  --toc-width:     216px;

  --font:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* ─── RESET ───────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
svg { display: block; overflow: hidden; flex-shrink: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: var(--font); cursor: pointer; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── LAYOUT ──────────────────────────────────────────────── */

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ─── LOGO ────────────────────────────────────────────────── */

.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.logo-mark::before {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 15px; height: 15px;
  background: rgba(255,255,255,.28);
  border-radius: 4px 0 9px 0;
}
.logo-mark::after {
  content: '';
  position: absolute;
  top: 8px; left: 8px;
  width: 9px; height: 9px;
  border: 2.5px solid rgba(255,255,255,.9);
  border-radius: 2px;
}
.logo-wordmark {
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -0.04em;
}
.logo-wordmark em { font-style: normal; color: var(--primary); }

/* ─── TOP NAVIGATION ──────────────────────────────────────── */

.docs-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 0 var(--border-light);
}

.docs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
  gap: 16px;
}

/* Logo */
.docs-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
}

.docs-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.docs-logo-mark::before {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 13px; height: 13px;
  background: rgba(255,255,255,0.28);
  border-radius: 4px 0 7px 0;
}

.docs-logo-mark::after {
  content: '';
  position: absolute;
  top: 6px; left: 6px;
  width: 7px; height: 7px;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 2px;
}

.docs-logo-wordmark {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -0.04em;
}

.docs-logo-wordmark em { font-style: normal; color: var(--primary); }

.docs-logo-sm .docs-logo-wordmark { font-size: 0.88rem; }
.docs-logo-sm .docs-logo-mark { width: 22px; height: 22px; }

/* Header layout */
.docs-header-left { flex-shrink: 0; }

.docs-header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Back link */
.docs-back-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  white-space: nowrap;
}

.docs-back-link:hover { color: var(--dark); border-color: #d0d5dd; background: var(--bg-soft); }

/* Mobile toggle */
.docs-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--dark);
}

/* ─── SEARCH FORM ─────────────────────────────────────────── */

.docs-search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.docs-search-form .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  pointer-events: none;
}

.docs-search-form input[type="search"] {
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 36px 0 36px;
  height: 36px;
  width: 100%;
  outline: none;
  transition: all 0.15s;
  -webkit-appearance: none;
}

.docs-search-form input[type="search"]::placeholder { color: var(--text-light); }
.docs-search-form input[type="search"]::-webkit-search-cancel-button { display: none; }

.docs-search-form input[type="search"]:focus {
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(255,122,89,0.12);
}

.search-kbd {
  position: absolute;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-light);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  pointer-events: none;
}

/* Sidebar search (no kbd) */
.sidebar-search input[type="search"] { font-size: 0.82rem; height: 32px; }

/* Hero search */
.hero-search { max-width: 580px; margin: 0 auto; }

.hero-search .search-icon {
  left: 18px;
  color: var(--text-muted);
}

.hero-search input[type="search"] {
  font-size: 1rem;
  height: 52px;
  padding: 0 140px 0 50px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
}

.hero-search input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255,122,89,0.1), var(--shadow-md);
}

.search-submit-btn {
  position: absolute;
  right: 8px;
  height: 36px;
  padding: 0 18px;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s;
}

.search-submit-btn:hover { opacity: 0.9; }

/* ─── HOMEPAGE ────────────────────────────────────────────── */

.docs-home { flex: 1; }

.docs-hero {
  padding: 72px 24px 56px;
  text-align: center;
  background:
    radial-gradient(ellipse 700px 400px at 50% 0%, rgba(255,122,89,0.06) 0%, transparent 70%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border-light);
}

.docs-hero-inner { max-width: 640px; margin: 0 auto; }

.docs-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.docs-hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.65;
}

.docs-home-section {
  padding: 56px 24px;
  border-bottom: 1px solid var(--border-light);
}

.docs-home-section--alt { background: var(--bg-soft); }

.docs-home-wrap { max-width: 960px; margin: 0 auto; }

/* Category cards */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  border-color: var(--cat-color, var(--primary));
  box-shadow: var(--shadow-md), 0 0 0 1px var(--cat-color, var(--primary));
  transform: translateY(-2px);
}

.category-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: var(--cat-bg, var(--bg-alt));
  color: var(--cat-color, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-card-body { flex: 1; min-width: 0; }

.category-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.category-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cat-color, var(--primary));
}

.category-arrow {
  color: var(--border);
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.category-card:hover .category-arrow {
  color: var(--cat-color, var(--primary));
  transform: translateX(3px);
}

/* Popular articles */
.popular-header { margin-bottom: 24px; }

.popular-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.03em;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 4px;
}

.popular-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.popular-item a:hover { background: var(--bg-alt); }

.popular-item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.12s;
}

.popular-item a:hover .popular-item-title { color: var(--primary); }

.popular-item-cat {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}

/* ─── DOCS LAYOUT ─────────────────────────────────────────── */

.docs-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--nav-height));
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */

.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-light);
  background: var(--sidebar-bg);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.docs-sidebar-inner {
  padding: 16px 0 40px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar-search-wrap {
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

/* Sidebar home link */
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.12s;
}

.sidebar-home-link:hover { color: var(--primary); }
.sidebar-home-link svg { flex-shrink: 0; }

/* Category toggles */
.sidebar-category { margin-bottom: 2px; }

.sidebar-category-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 7px 16px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  text-align: left;
  color: var(--dark);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: color 0.12s;
}

.sidebar-category-toggle:hover { color: var(--primary); }

.toggle-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-light);
  flex-shrink: 0;
}

.sidebar-category.is-open .toggle-chevron { transform: rotate(90deg); }

/* Sidebar items */
.sidebar-items {
  display: none;
  flex-direction: column;
  padding: 2px 0 8px;
}

.sidebar-category.is-open .sidebar-items { display: flex; }

.sidebar-item {
  display: block;
  padding: 6px 16px 6px 28px;
  font-size: 0.84rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  margin-left: 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all 0.12s;
  line-height: 1.4;
}

.sidebar-item:hover { color: var(--dark); background: var(--bg-alt); }

.sidebar-item.is-active {
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
  background: rgba(255,122,89,0.05);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 16px 14px 0;
  border-top: 1px solid var(--border-light);
}

.sidebar-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  transition: color 0.12s;
  padding: 6px 0;
}

.sidebar-back-link:hover { color: var(--primary); }

/* ─── MAIN CONTENT ────────────────────────────────────────── */

.docs-main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

.docs-main-inner {
  display: flex;
  gap: 48px;
  padding: 40px 48px 80px;
  max-width: 1060px;
}

.docs-main-inner--wide { max-width: 800px; flex-direction: column; }

.docs-main--archive .docs-main-inner,
.docs-main--bare .docs-main-inner {
  max-width: 760px;
}

/* ─── BREADCRUMB ──────────────────────────────────────────── */

.docs-breadcrumb {
  margin-bottom: 24px;
}

.docs-breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.docs-breadcrumb li {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.docs-breadcrumb li + li::before {
  content: '/';
  margin: 0 8px;
  color: var(--border);
}

.docs-breadcrumb a {
  color: var(--text-muted);
  transition: color 0.12s;
}

.docs-breadcrumb a:hover { color: var(--primary); }

.docs-breadcrumb [aria-current="page"] { color: var(--text-muted); }

/* ─── ARTICLE ─────────────────────────────────────────────── */

.docs-article {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.article-header h1 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.article-meta-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255,122,89,0.08);
  padding: 3px 9px;
  border-radius: 100px;
  transition: background 0.12s;
}

.article-meta-cat:hover { background: rgba(255,122,89,0.14); }

.article-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border);
}

.article-meta-read,
.article-meta-updated {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ─── ARTICLE BODY TYPOGRAPHY ─────────────────────────────── */

.article-body {
  font-size: 0.96rem;
  line-height: 1.82;
  color: var(--text);
}

.article-body > * + * { margin-top: 1.15em; }

.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--dark);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  position: relative;
}

.article-body h2 {
  font-size: 1.3rem;
  margin-top: 2.2em;
  margin-bottom: 0.6em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.article-body h3 {
  font-size: 1.1rem;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
}

.article-body h4 {
  font-size: 0.95rem;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
  color: var(--text);
}

/* Anchor links on headings */
.article-body h2 .anchor,
.article-body h3 .anchor {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--border);
  font-size: 0.85em;
  opacity: 0;
  transition: opacity 0.12s;
  text-decoration: none;
}

.article-body h2:hover .anchor,
.article-body h3:hover .anchor { opacity: 1; color: var(--text-light); }

.article-body p { line-height: 1.82; }

.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(255,122,89,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s;
}

.article-body a:hover { text-decoration-color: var(--primary); }

/* Lists */
.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body ul { list-style: none; }

.article-body ul li {
  position: relative;
  padding-left: 1.2em;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.article-body ol { list-style: decimal; }

.article-body ol li { padding-left: 0.3em; }

.article-body li + li { margin-top: 0.45em; }

.article-body li > ul,
.article-body li > ol { margin-top: 0.5em; }

/* Strong + em */
.article-body strong { font-weight: 700; color: var(--dark); }
.article-body em { font-style: italic; }

/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: #FFF3F0;
  color: #c0392b;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,122,89,0.15);
}

/* Code blocks */
.article-body pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  position: relative;
  margin: 1.6em 0;
}

.article-body pre code {
  font-family: var(--font-mono);
  font-size: 0.865rem;
  background: transparent;
  color: #E2E8F0;
  padding: 0;
  border: none;
  line-height: 1.7;
}

/* Copy button (JS-inserted) */
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.code-copy-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); }
.code-copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,0.3); }

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 1.6em 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-body th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--dark);
  text-align: left;
  padding: 10px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.article-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td { background: rgba(248,245,241,0.5); }

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--primary);
  background: rgba(255,122,89,0.04);
  padding: 14px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.4em 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body blockquote strong { color: var(--primary); }

/* Images */
.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin: 1.4em 0;
}

/* Horizontal rule */
.article-body hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: 2.4em 0;
}

/* ─── CALLOUT BOXES ───────────────────────────────────────── */

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  margin: 1.4em 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

.callout-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-info  { background: #EFF6FF; border-color: #BFDBFE; color: #1e40af; }
.callout-tip   { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.callout-warn  { background: #FFFBEB; border-color: #FDE68A; color: #92400e; }
.callout-danger { background: #FEF2F2; border-color: #FECACA; color: #991b1b; }

/* Gutenberg callout shorthand classes */
.wp-block-info  { composes: callout callout-info; }
.wp-block-tip   { composes: callout callout-tip; }

/* ─── ARTICLE FOOTER ──────────────────────────────────────── */

.article-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

/* Feedback */
.article-feedback {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 32px;
}

.article-feedback > p {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.feedback-btns { display: flex; gap: 8px; }

.feedback-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: all 0.15s;
}

.feedback-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(255,122,89,0.04); }
.feedback-btn.active { background: var(--gradient); color: #fff; border-color: transparent; }

.feedback-thanks {
  font-size: 0.82rem;
  color: #10b981;
  font-weight: 600;
  margin: 0;
}

/* Prev / Next nav */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.article-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.18s;
  text-decoration: none;
}

.article-nav-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.article-nav-next { text-align: right; }

.article-nav-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.article-nav-next .article-nav-label { justify-content: flex-end; }

.article-nav-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.35;
}

/* ─── TABLE OF CONTENTS ───────────────────────────────────── */

.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  max-height: calc(100vh - var(--nav-height) - 64px);
  overflow-y: auto;
  scrollbar-width: none;
}

.docs-toc::-webkit-scrollbar { display: none; }

.toc-inner { padding: 0; }

.toc-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dark);
  margin-bottom: 10px;
}

#toc-nav { display: flex; flex-direction: column; }

.toc-item {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 0 4px 10px;
  border-left: 2px solid var(--border-light);
  line-height: 1.4;
  transition: all 0.12s;
  text-decoration: none;
}

.toc-item:hover { color: var(--dark); border-left-color: var(--text-light); }

.toc-item.is-active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

.toc-item--h3 { padding-left: 22px; font-size: 0.77rem; }

/* ─── ARCHIVE PAGES ───────────────────────────────────────── */

.archive-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.archive-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.archive-header h1 em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.archive-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.archive-list { display: flex; flex-direction: column; }

.archive-item { border-bottom: 1px solid var(--border-light); }
.archive-item:first-child { border-top: 1px solid var(--border-light); }

.archive-item-link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  margin: 0 -4px;
}

.archive-item-link:hover { background: var(--bg-soft); }
.archive-item-link:hover .archive-item-link svg { color: var(--primary); }

.archive-item-body { flex: 1; min-width: 0; }

.archive-item-top { margin-bottom: 4px; }

.archive-item-cat {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255,122,89,0.08);
  padding: 2px 8px;
  border-radius: 100px;
}

.archive-item-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.35;
}

.archive-item-body p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-light);
}

.archive-read-time { font-size: 0.78rem; white-space: nowrap; }

/* ─── SEARCH NO RESULTS ───────────────────────────────────── */

.search-no-results {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-light);
}

.search-no-results svg { margin: 0 auto 20px; }
.search-no-results h2 { font-size: 1.4rem; color: var(--dark); margin-bottom: 10px; letter-spacing: -0.03em; }
.search-no-results p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.7; }
.search-no-results a { color: var(--primary); text-decoration: underline; }

/* ─── 404 ─────────────────────────────────────────────────── */

.docs-not-found {
  text-align: center;
  padding: 80px 24px;
  max-width: 480px;
  margin: 0 auto;
}

.not-found-code {
  font-size: 6rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.docs-not-found h1 { font-size: 1.6rem; color: var(--dark); margin-bottom: 12px; letter-spacing: -0.03em; }
.docs-not-found > p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 32px; }

.not-found-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.btn-docs-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s;
}

.btn-docs-primary:hover { opacity: 0.88; }

.not-found-search {
  width: 100%;
  max-width: 360px;
}

.not-found-search input[type="search"] { width: 100%; }

.no-results {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 32px 0;
}

.no-results a { color: var(--primary); text-decoration: underline; }

/* ─── FOOTER ──────────────────────────────────────────────── */

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border-light);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 28px;
}
.footer-brand-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 14px;
  max-width: 240px;
}
.hs-partner-badge {
  display: inline-block;
  margin-top: 20px;
  background: #1A1814;
  border-radius: 10px;
  padding: 10px 16px;
}
.hs-partner-badge img { height: 34px; width: auto; display: block; }
.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dark);
  margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a { font-size: 0.86rem; color: var(--text-muted); transition: color 0.15s; }
.footer-col ul a:hover { color: var(--primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; }
.footer-bottom p, .footer-bottom a { font-size: 0.8rem; color: var(--text-light); transition: color 0.15s; }
.footer-bottom a:hover { color: var(--dark); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 1180px) {
  .docs-toc { display: none; }
  .docs-main-inner { max-width: 740px; }
}

@media (max-width: 900px) {
  .docs-main-inner { padding: 28px 28px 60px; }
}

@media (max-width: 768px) {
  .docs-header-center { display: none; }
  .docs-mobile-toggle { display: flex; }

  .docs-layout { position: relative; }

  .docs-sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    height: calc(100vh - var(--nav-height));
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
  }

  .docs-sidebar.is-open { transform: translateX(0); }

  .docs-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: rgba(0,0,0,0.3);
    z-index: 140;
  }

  .docs-sidebar-overlay.is-visible { display: block; }

  .docs-main-inner { padding: 20px 18px 48px; }

  .article-header h1 { font-size: 1.4rem; }
  .article-nav { grid-template-columns: 1fr; }

  .categories-grid { grid-template-columns: 1fr; }
  .popular-list { grid-template-columns: 1fr; }
  .docs-hero { padding: 48px 18px 36px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid > div:first-child { grid-column: 1/-1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .docs-back-link span:not(:last-child) { display: none; }
  .article-feedback { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
}
