/* ================================================================
   Xera Tech Docs — Master Stylesheet
   File: /docs/assets/docs.css
   ================================================================ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #29166f;
  --brand-dark:   #1c0e56;
  --brand-light:  #f0edfb;
  --accent:       #f59e0b;
  --green:        #10b981;
  --red:          #ef4444;
  --blue:         #1e88e5;

  --text:         #1a1a2e;
  --text-2:       #4b5563;
  --text-3:       #9ca3af;
  --border:       #e5e7eb;
  --bg:           #ffffff;
  --bg-2:         #f9fafb;
  --bg-3:         #f3f4f6;

  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:    0 4px 24px rgba(0,0,0,.10);

  --font:         'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --topbar-h:     60px;
  --container:    1200px;
  --sidebar-w:    280px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ── Topbar ───────────────────────────────────────────────────── */
.docs-topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--brand);
  height: var(--topbar-h);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 32px;
}
.topbar-logo { display: flex; align-items: center; flex-shrink: 0;    height: 100%; }
.topbar-logo img { filter: brightness(0) invert(1);     height: 90%; }
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.topbar-nav a {
  color: rgba(255,255,255,.8); padding: 6px 12px; border-radius: 6px;
  font-size: .9rem; font-weight: 500; transition: .15s;
}
.topbar-nav a:hover, .topbar-nav a.active { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.topbar-cta {
  background: var(--accent); color: var(--brand-dark) !important;
  padding: 8px 18px; border-radius: 8px; font-weight: 600; font-size: .875rem;
  white-space: nowrap; transition: .15s;
}
.topbar-cta:hover { background: #fbbf24; text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; font-weight: 600;
  font-size: .9rem; cursor: pointer; transition: .15s; border: none;
  text-decoration: none !important;
}
.btn-primary  { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline  { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-wa       { background: #25d366; color: #fff; }
.btn-wa:hover { background: #128c4c; }
.btn-lg       { padding: 14px 28px; font-size: 1rem; }

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb-bar { background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 10px 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--text-2); }
.breadcrumb a { color: var(--brand); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--text); font-weight: 500; }

/* ── Doc page layout ──────────────────────────────────────────── */
.docs-main { padding: 32px 0 64px; }
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.docs-sidebar { position: sticky; top: calc(var(--topbar-h) + 24px); display: flex; flex-direction: column; gap: 20px; }

.toc-card, .related-card, .sidebar-cta-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow);
}
.toc-title, .related-title { font-size: .9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-2); margin-bottom: 14px; }
.toc-list { counter-reset: toc; display: flex; flex-direction: column; gap: 4px; }
.toc-list li { counter-increment: toc; }
.toc-list a {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: .875rem; color: var(--text-2); padding: 5px 8px; border-radius: 6px;
  transition: .15s; line-height: 1.4;
}
.toc-list a::before {
  content: counter(toc); flex-shrink: 0;
  width: 20px; height: 20px; background: var(--bg-3); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; color: var(--text-3); margin-top: 1px;
}
.toc-list a:hover { background: var(--brand-light); color: var(--brand); text-decoration: none; }
.toc-list a:hover::before { background: var(--brand); color: #fff; }

.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-list a {
  font-size: .875rem; color: var(--text-2); line-height: 1.4;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  transition: .15s;
}
.related-list a:last-child { border-bottom: none; }
.related-list a:hover { color: var(--brand); text-decoration: none; }
.related-list a::before { content: "→ "; color: var(--brand); }

.sidebar-cta-card { background: var(--brand-light); border-color: rgba(41,22,111,.15); text-align: center; }
.sidebar-cta-icon { font-size: 2rem; margin-bottom: 8px; }
.sidebar-cta-card p { font-size: .9rem; color: var(--text-2); margin-bottom: 14px; }
.sidebar-cta-card .btn { width: 100%; justify-content: center; margin-bottom: 8px; }

/* ── Article ──────────────────────────────────────────────────── */
.article-header { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  border: 1px solid transparent;
}
.hero-tag {
  background: var(--bg-3); color: var(--text-2);
  padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 500;
}
.audience-badge {
  padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.audience-common     { background: #dcfce7; color: #166534; }
.audience-contractor { background: #dbeafe; color: #1e40af; }
.audience-business   { background: #fef3c7; color: #92400e; }

.article-title { font-size: 2rem; font-weight: 700; line-height: 1.25; color: var(--text); margin-bottom: 14px; }
.article-intro { font-size: 1.1rem; color: var(--text-2); line-height: 1.65; margin-bottom: 16px; }
.article-byline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .85rem; color: var(--text-3); }
.byline-author { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.byline-author img { border-radius: 3px; }
.byline-sep { color: var(--border); }

/* ── Answer Box ───────────────────────────────────────────────── */
.answer-box {
  background: linear-gradient(135deg, var(--brand-light) 0%, #e8f4fd 100%);
  border: 1px solid rgba(41,22,111,.2);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 32px;
}
.answer-box-label { font-size: .8rem; font-weight: 700; color: var(--brand); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px; }
.answer-box p { font-size: .95rem; color: var(--text-2); line-height: 1.6; }

/* ── Content sections ─────────────────────────────────────────── */
.content-section { margin-bottom: 36px; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.content-section h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--text);
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-light);
}
.content-section p { font-size: 1rem; color: var(--text); line-height: 1.75; }

/* ── FAQ Accordion ────────────────────────────────────────────── */
.faq-section { margin-top: 40px; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.faq-section > h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--text);
  margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid var(--brand-light);
}
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-question {
  width: 100%; background: var(--bg-2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; text-align: left; font-size: .95rem; font-weight: 600;
  color: var(--text); transition: .15s;
}
.faq-question:hover { background: var(--brand-light); color: var(--brand); }
.faq-question[aria-expanded="true"] { background: var(--brand); color: #fff; }
.faq-icon { width: 18px; height: 18px; flex-shrink: 0; transition: transform .25s; }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(180deg); }
.faq-answer { padding: 16px 20px; background: var(--bg); }
.faq-answer p { font-size: .95rem; color: var(--text-2); line-height: 1.7; }

/* ── Article CTA banner ───────────────────────────────────────── */
.article-cta-banner {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: var(--radius-lg); padding: 28px 32px; margin: 40px 0;
}
.cta-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-banner-text { color: #fff; }
.cta-banner-text strong { display: block; font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.cta-banner-text span { font-size: .875rem; opacity: .8; }
.cta-banner-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Article footer ───────────────────────────────────────────── */
.article-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.doc-nav { display: flex; gap: 10px; }
.share-row { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-2); }
.share-btn {
  padding: 6px 14px; border-radius: 6px; font-size: .8rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none !important; transition: .15s;
}
.share-wa   { background: #dcfce7; color: #166534; }
.share-wa:hover { background: #25d366; color: #fff; }
.share-li   { background: #dbeafe; color: #1e40af; }
.share-li:hover { background: #0077b5; color: #fff; }
.share-copy { background: var(--bg-3); color: var(--text-2); }
.share-copy:hover { background: var(--bg-3); color: var(--brand); }

/* ── More docs section ────────────────────────────────────────── */
.more-docs-section { background: var(--bg-2); padding: 48px 0; border-top: 1px solid var(--border); }
.more-docs-section h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 20px; }
.more-docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.more-doc-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  transition: .15s; text-decoration: none !important;
  border-left: 3px solid var(--cat-color, var(--brand));
}
.more-doc-card:hover { box-shadow: var(--shadow); border-color: var(--cat-color, var(--brand)); background: var(--brand-light); }
.more-doc-tag { font-size: 1.1rem; flex-shrink: 0; }
.more-doc-title { font-size: .875rem; font-weight: 500; color: var(--text); flex: 1; line-height: 1.35; }
.more-doc-arrow { color: var(--text-3); font-size: .9rem; flex-shrink: 0; transition: .15s; }
.more-doc-card:hover .more-doc-arrow { color: var(--brand); transform: translateX(3px); }
.hub-link { margin-top: 24px; text-align: center; }

/* ── Hub page ─────────────────────────────────────────────────── */
.hub-hero {
  background: linear-gradient(135deg, var(--brand) 0%, #1c0e56 60%, #0f172a 100%);
  padding: 64px 0 56px;
}
.hub-hero-inner { display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: center; }
.hub-hero-tag {
  display: inline-block; background: rgba(255,255,255,.15); color: rgba(255,255,255,.9);
  padding: 6px 14px; border-radius: 20px; font-size: .85rem; font-weight: 600;
  margin-bottom: 16px;
}
.hub-hero h1 { font-size: 2.25rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 16px; }
.hub-hero > .hub-hero-inner > .hub-hero-text > p { color: rgba(255,255,255,.8); font-size: 1.05rem; line-height: 1.65; margin-bottom: 28px; }
.hub-stats { display: flex; gap: 28px; }
.hub-stat { display: flex; flex-direction: column; }
.hub-stat strong { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.hub-stat span { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: 2px; }

.hub-search-form { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-lg); padding: 24px; }
.search-field { display: flex; gap: 0; position: relative; }
.search-icon { width: 18px; height: 18px; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-field input {
  flex: 1; padding: 13px 14px 13px 42px; border: 1px solid var(--border);
  border-right: none; border-radius: 8px 0 0 8px; font-size: .95rem; font-family: var(--font);
  outline: none; transition: .15s; background: var(--bg);
}
.search-field input:focus { border-color: var(--brand); }
.search-field button {
  padding: 13px 22px; background: var(--brand); color: #fff; border: none;
  border-radius: 0 8px 8px 0; font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: .15s; font-family: var(--font);
}
.search-field button:hover { background: var(--brand-dark); }

/* ── Category filter bar ─────────────────────────────────────── */
.cat-filter-bar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 14px 0; position: sticky; top: var(--topbar-h); z-index: 90; }
.cat-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 14px; border-radius: 20px; font-size: .85rem; font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text-2); transition: .15s;
  text-decoration: none !important;
}
.cat-pill:hover { border-color: var(--cat-color, var(--brand)); color: var(--cat-color, var(--brand)); background: color-mix(in srgb, var(--cat-color, var(--brand)) 8%, transparent); }
.cat-pill.active { background: var(--cat-color, var(--brand)); color: #fff !important; border-color: var(--cat-color, var(--brand)); }
.pill-count { background: rgba(0,0,0,.1); border-radius: 10px; padding: 1px 7px; font-size: .75rem; font-weight: 600; }
.cat-pill.active .pill-count { background: rgba(255,255,255,.25); }

/* ── Doc grid (cards) ─────────────────────────────────────────── */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.doc-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; text-decoration: none !important; transition: .2s;
  border-top: 3px solid var(--cat-color, var(--brand));
}
.doc-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-top-color: var(--cat-color, var(--brand)); }
.doc-card-cat { font-size: .8rem; font-weight: 600; color: var(--cat-color, var(--brand)); text-transform: uppercase; letter-spacing: .04em; }
.doc-card-title { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.35; flex: 1; }
.doc-card-intro { font-size: .875rem; color: var(--text-2); line-height: 1.55; }
.doc-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.doc-card-arrow { margin-left: auto; color: var(--cat-color, var(--brand)); font-weight: 600; transition: .15s; }
.doc-card:hover .doc-card-arrow { transform: translateX(3px); }

/* ── Hub category sections ────────────────────────────────────── */
.hub-full { padding: 40px 0 64px; }
.hub-category-section { margin-bottom: 56px; }
.hub-cat-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.hub-cat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.hub-cat-title { font-size: 1.35rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.hub-cat-count { font-size: .85rem; color: var(--text-3); }
.hub-cat-more { margin-left: auto; font-size: .875rem; font-weight: 600; color: var(--brand); flex-shrink: 0; }
.hub-cat-more:hover { text-decoration: underline; }

/* ── Results section ──────────────────────────────────────────── */
.docs-results-section { padding: 36px 0 64px; }
.results-heading { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 24px; }
.results-heading strong { color: var(--brand); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty-state a { color: var(--brand); }

/* ── Hub CTA strip ────────────────────────────────────────────── */
.hub-cta-strip { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); padding: 48px 0; }
.hub-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.hub-cta-text h2 { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.hub-cta-text p { font-size: .95rem; color: rgba(255,255,255,.8); }
.hub-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────────────────────────── */
.docs-footer { background: #0f172a; padding: 40px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 40px; align-items: start; }
.footer-brand img { filter: brightness(0) invert(1); margin-bottom: 10px; }
.footer-brand p { font-size: .875rem; color: rgba(255,255,255,.5); line-height: 1.5; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .875rem; transition: .15s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-copy p { color: rgba(255,255,255,.35); font-size: .8rem; }
.footer-copy a { color: rgba(255,255,255,.55); }

/* ── Error page ───────────────────────────────────────────────── */
.error-main { min-height: 60vh; display: flex; align-items: center; }
.error-inner { text-align: center; max-width: 560px; margin: 0 auto; padding: 64px 20px; }
.error-visual { font-size: 5rem; margin-bottom: 20px; }
.error-title { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.error-desc { font-size: 1.05rem; color: var(--text-2); margin-bottom: 28px; }
.error-search { display: flex; gap: 0; max-width: 420px; margin: 0 auto 24px; }
.error-search input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border);
  border-right: none; border-radius: 8px 0 0 8px; font-size: .95rem; outline: none;
  font-family: var(--font);
}
.error-search input:focus { border-color: var(--brand); }
.error-search button {
  padding: 12px 20px; background: var(--brand); color: #fff; border: none;
  border-radius: 0 8px 8px 0; font-weight: 600; cursor: pointer; font-family: var(--font);
}
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.error-suggestions h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.suggestion-list { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.suggestion-list a { color: var(--brand); font-size: .9rem; }
.suggestion-list a:hover { text-decoration: underline; }
.suggestion-list a::before { content: "→ "; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .hub-hero-inner { grid-template-columns: 1fr; }
  .hub-search-form { max-width: 580px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-copy { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --topbar-h: 56px; }
  .topbar-nav { display: none; }
  .article-title { font-size: 1.5rem; }
  .hub-hero { padding: 40px 0 36px; }
  .hub-hero h1 { font-size: 1.65rem; }
  .hub-stats { gap: 20px; }
  .hub-stat strong { font-size: 1.3rem; }
  .doc-grid { grid-template-columns: 1fr; }
  .cta-banner-inner { flex-direction: column; text-align: center; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .hub-cta-inner { flex-direction: column; text-align: center; }
  .hub-cta-actions { justify-content: center; }
  .hub-cat-header { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .hub-stats { flex-wrap: wrap; gap: 16px; }
  .cat-filter-bar { padding: 10px 0; }
  .doc-card { padding: 16px; }
  .answer-box { padding: 14px 16px; }
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {
  .docs-topbar, .breadcrumb-bar, .docs-sidebar, .article-cta-banner,
  .article-footer, .more-docs-section, .docs-footer { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
}
