/* ═══════════════════════════════════════════════════════════════
   Jtek Knowledge Base: visual refresh layer (C1 Ivory)
   Loaded after each page's inline <style>, so source-order wins.
   Overrides common classes (.hero, .article-card, .sm-*, .tip-box,
   .warning-box, .step-mockup, .kb-sidebar-*) to bring every KB page
   in line with the support hub's premium ivory design system.
═══════════════════════════════════════════════════════════════ */

/* ─── TYPOGRAPHY + BASE RHYTHM ─── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.005em;
}

/* ─── GRID OVERLAY (retired in the ivory system) ─── */
#grid-overlay { display: none; }

/* ─── NAV: unified app header (back left, no logo, sticky frosted) ───
   Overrides the per-page inline nav styles so every KB page matches the
   tutorials. !important beats the inline <style> rules that load after this. */
.nav-outer { position: sticky !important; top: 0 !important; z-index: 1000; padding: 0 !important; }
.nav-outer nav {
  max-width: none !important; margin: 0 !important;
  background: rgba(243,244,246,0.82) !important;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: none !important; border-bottom: 1px solid var(--hairline) !important; border-radius: 0 !important;
  padding: var(--sp-3) var(--sp-5) !important;
  display: flex; align-items: center; gap: var(--sp-4);
  justify-content: flex-start !important;
  box-shadow: none !important;
}
.nav-outer .nav-logo { display: none !important; }
.nav-outer .nav-right { display: flex; align-items: center; gap: var(--sp-2); }
.nav-outer .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-small); font-weight: 600; color: var(--text) !important;
  background: var(--surface-2) !important; padding: 8px 14px !important; border-radius: var(--radius-pill) !important;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.nav-outer .btn-ghost:hover { background: #E7EAE3 !important; transform: translateX(-2px); }
.nav-outer .btn-ghost:active { transform: translateX(-2px) scale(0.98); }
.btn-nav-primary { background: var(--green-bright); color: #06130C; font-weight: 700; box-shadow: 0 2px 8px rgba(34,197,94,0.3); }
.btn-nav-primary:hover { background: var(--green-bright); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(34,197,94,0.3); }

/* ─── HERO ─── */
.hero { padding-top: 92px; padding-bottom: 56px; }
.hero-pill {
  padding: 6px 14px 6px 12px;
  border: none;
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 10px 24px rgba(20,30,20,0.06);
  font-weight: 600; font-size: 12.5px; letter-spacing: 0.05em; text-transform: uppercase;
}
.hero-pill-dot { animation: kb-pulse 2.4s ease-in-out infinite; }
@keyframes kb-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(1.3); } }
.hero h1 {
  font-weight: 700; letter-spacing: -0.045em; line-height: 1.04;
  font-size: clamp(32px, 5vw, 52px);
  color: var(--text);
}
.hero-sub { font-size: 17.5px; line-height: 1.6; color: var(--text-2); }

/* ─── KB LAYOUT ─── */
.kb-layout { gap: 40px; max-width: 1120px; }
.kb-sidebar {
  align-self: flex-start; /* hug content height instead of stretching the full column */
  border: none;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07);
  padding: 18px 0 16px;
}
.kb-sidebar-header {
  font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0 18px 14px;
  border-bottom: 1px solid #F0F1ED;
  margin-bottom: 10px;
}
.kb-sidebar-nav { padding: 0 10px; }
.kb-sidebar-link {
  padding: 9px 12px;
  font-size: 13.5px; font-weight: 500; color: #33382F;
  border-radius: 9px;
  border-left: 2.5px solid transparent;
  transition: color .18s, background .18s, border-color .18s, transform .15s;
}
.kb-sidebar-link:hover { background: var(--bg); color: var(--text); transform: translateX(1px); }
.kb-sidebar-link.active {
  background: rgba(16,122,54,0.08);
  color: var(--green-dark); font-weight: 700;
  border-left-color: var(--green-dark);
  box-shadow: none;
}
/* Scoped duplicates: outrank the article pages' own `.kb-sidebar-nav a.active`
   (higher specificity) so the ivory-system accent wins the cascade. */
.kb-sidebar-nav .kb-sidebar-link { color: #33382F; }
.kb-sidebar-nav .kb-sidebar-link:hover { background: var(--bg); color: var(--text); }
.kb-sidebar-nav .kb-sidebar-link.active {
  background: rgba(16,122,54,0.08);
  color: var(--green-dark);
  border-left-color: var(--green-dark);
}
.kb-hamburger {
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 10px 24px rgba(20,30,20,0.06);
  transition: transform .15s;
}
.kb-hamburger:hover { transform: translateY(-1px); }

/* ─── ARTICLE CARDS ─── */
.article-card {
  border: none;
  border-radius: 26px;
  padding: 36px 40px 40px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07);
  margin-bottom: 20px;
}
.article-card:hover { box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07); }

.article-number {
  width: 32px; height: 32px;
  background: var(--blue);
  color: white; font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,87,255,0.28);
  margin-bottom: 18px;
}
/* Category-accent override, inferred from existing color on hero-pill */
.article-card h2 {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.18;
  color: var(--text); margin-bottom: 14px;
}
.article-intro { font-size: 16px; color: var(--text-2); line-height: 1.65; margin-bottom: 18px; }
.article-card p { font-size: 15.5px; color: #33382F; line-height: 1.7; }
.article-card p strong { font-weight: 700; color: var(--text); }

/* Step list, numbered list of instructions */
.step-list {
  margin: 18px 0;
  padding-left: 0;
  display: flex; flex-direction: column; gap: 12px;
  counter-reset: sl;
  list-style: none;
}
.step-list li {
  position: relative;
  padding-left: 40px;
  font-size: 15.5px; color: #33382F; line-height: 1.6;
  counter-increment: sl;
}
.step-list li::before {
  content: counter(sl);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,87,255,0.08); color: var(--blue);
  font-size: 12px; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,87,255,0.15);
}
.step-list li strong { color: var(--text); font-weight: 700; }

/* Inline code/kbd feel on strong words in steps (optional) */
.article-card code {
  background: rgba(16,122,54,0.08); color: var(--green-dark);
  padding: 1px 6px; border-radius: 5px;
  font-size: 13px; font-weight: 600; font-family: inherit;
}

/* ─── CALLOUTS ─── */
.tip-box, .warning-box {
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px; color: var(--text);
  line-height: 1.6;
  margin-top: 22px;
  gap: 12px;
}
.tip-box {
  background: rgba(16,122,54,0.05);
  border: 1px solid rgba(16,122,54,0.16);
}
.warning-box {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.22);
}
.tip-box-icon, .warning-box-icon {
  width: 28px; height: 28px; border-radius: 9px;
  display: flex !important; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
  margin-top: 0;
}
.tip-box-icon { background: var(--green-dark); color: white; }
.warning-box-icon { background: #F59E0B; color: white; }
.tip-box strong, .warning-box strong { font-weight: 700; }

/* ─── STEP MOCKUPS (the Jtek app screenshots) ─── */
.step-mockup {
  border-radius: 18px;
  border: none;
  margin-top: 28px;
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07);
  background: var(--surface);
  overflow: hidden;
}
.sm-bar {
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid #F0F1ED;
  gap: 7px;
}
.sm-dot { width: 10px; height: 10px; box-shadow: 0 1px 1px rgba(0,0,0,0.1) inset; }
.sm-bar span { font-family: 'Menlo', monospace; font-size: 10px; color: var(--muted); letter-spacing: 0.01em; }

/* Dark Jtek sidebar in mockups: deep forest to match the C1 dark surface */
.sm-side {
  background: var(--forest);
  border-right: 1px solid rgba(255,255,255,0.06);
  width: 132px;
  padding: 12px 8px;
}
.sm-side-item {
  padding: 7px 10px;
  font-size: 10.5px; font-weight: 500;
  color: rgba(255,255,255,0.42);
  border-radius: 7px;
  border-left: 2px solid transparent;
  letter-spacing: -0.005em;
  margin-bottom: 1px;
}
.sm-side-item:first-child { padding: 4px 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 8px; border-radius: 0; }
.sm-side-item:first-child span { color: rgba(255,255,255,0.92) !important; font-weight: 700 !important; font-size: 12px !important; }
.sm-side-item.active {
  color: white; font-weight: 600;
  background: rgba(255,255,255,0.08);
  border-left-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* Main panel */
.sm-main { background: var(--bg); }
.sm-topbar {
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid #F0F1ED;
  gap: 10px;
}
.sm-topbar h4 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-size: 13.5px !important; }

/* Buttons inside mockups */
.sm-btn {
  font-size: 10px; font-weight: 700; letter-spacing: 0.01em;
  padding: 5px 11px; border-radius: 100px;
  display: inline-flex; align-items: center; gap: 3px;
  transition: transform .15s;
}
.sm-btn.blue   { background: var(--blue); color: white; box-shadow: 0 2px 6px rgba(0,87,255,0.3); }
.sm-btn.purple { background: #6B3FFF; color: white; box-shadow: 0 2px 6px rgba(107,63,255,0.3); }
.sm-btn.outline { background: var(--surface); color: var(--text); border: 1px solid rgba(0,0,0,0.08); font-weight: 600; }

/* Tag pills */
.sm-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.01em;
  padding: 2.5px 9px; border-radius: 100px;
  display: inline-flex; align-items: center;
}
.sm-tag.blue   { background: rgba(0,87,255,0.10); color: var(--blue); }
.sm-tag.green  { background: rgba(34,197,94,0.12); color: var(--green-dark); }
.sm-tag.purple { background: rgba(107,63,255,0.10); color: #6B3FFF; }
.sm-tag.orange { background: rgba(249,115,22,0.12); color: #C2410C; }

/* Row items in mockups */
.sm-row {
  padding: 8px 14px;
  border-bottom: 1px solid #F4F5F1;
  font-size: 11px;
  gap: 10px;
}
.sm-row:last-child { border-bottom: none; }
.sm-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 8px; font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Hide the pulsing attention-grabber outline, it was positioned off-center
   because per-page dimensions didn't match the actual button rects. The
   "Click here" badge alone is enough to draw attention. */
.sm-highlight { display: none !important; }
.sm-badge {
  background: var(--blue);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 10px; border-radius: 100px;
  box-shadow: 0 3px 10px rgba(0,87,255,0.35);
  /* Page-level inline styles position each badge at the same column as the
     target button in the topbar (e.g. right:65px). That inline position stacks
     the "Click here" pill ON TOP of the button. Shift every badge down 32px
     so it always sits under the topbar, pointing at the button above. */
  transform: translateY(32px);
}
.sm-badge::before {
  /* little upward arrow from the badge toward the button it points at */
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--blue);
}

/* Form fields inside mockups */
.sm-form-field { margin-bottom: 10px; }
.sm-form-label { font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.sm-form-input {
  background: var(--bg);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 10.5px; color: var(--text-2);
}
.sm-form-input.filled { color: var(--text); font-weight: 600; border-color: rgba(0,0,0,0.12); background: var(--surface); }

/* ─── BACK LINK / CTA ─── */
.back-link {
  background: var(--surface);
  border: none;
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07);
  padding: 12px 26px;
  font-weight: 600;
  color: var(--green-dark);
}
.back-link:hover {
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07);
  transform: translateY(-2px);
}

/* ─── FOOTER ─── */
.footer {
  padding: 48px 20px 32px;
  border-top: none;
  color: var(--muted); font-size: 13.5px;
}

/* ─── CATEGORY ACCENT INHERITANCE ─── */
/* Let each page's inline color on .hero-pill-dot drive the article-number/badge */
/* (no selector override needed, we use blue by default and let pages that set a custom pill color keep their hero color) */

/* ─── SMALL SCREENS ─── */
@media (max-width: 768px) {
  .article-card { padding: 26px 22px 30px; border-radius: 18px; }
  .article-card h2 { font-size: 21px; }
  .step-list li { padding-left: 36px; font-size: 15px; }
  .step-list li::before { width: 22px; height: 22px; font-size: 11px; }
}

/* ─── VIDEO WALKTHROUGH EMBED ─── */
/* Lazy player (preload="none") + poster, source videos are large, so nothing
   loads until the visitor hits play. Sits at the top of .kb-main, above the
   written walkthrough. */
.kb-video {
  margin-bottom: 24px;
  border-radius: 26px;
  border: none;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07);
  overflow: hidden;
}
.kb-video-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 11px; row-gap: 8px;
  padding: 15px 20px;
  border-bottom: 1px solid #F0F1ED;
}
.kb-video-badge {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--blue);
  background: rgba(0,87,255,0.08);
  border: 1px solid rgba(0,87,255,0.16);
  padding: 5px 11px 5px 9px; border-radius: 100px;
}
.kb-video-badge svg { width: 11px; height: 11px; }
.kb-video-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; line-height: 1.3; min-width: 0; }
.kb-video-read { margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; transition: color .2s; }
.kb-video-read:hover { color: var(--green-dark); }
.kb-video-read:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.kb-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--forest);
}
.kb-video-frame video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block; border: 0;
}
@media (max-width: 768px) {
  .kb-video-head { padding: 13px 16px; gap: 9px; }
  .kb-video-title { font-size: 13px; }
  .kb-video-read { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}


/* ─── RELATED ARTICLES ─── */
.kb-related { margin: 8px 0 16px; }
.related-h { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card { background: var(--surface); border: none; border-radius: 18px; padding: 20px; text-decoration: none; color: inherit; box-shadow: 0 2px 4px rgba(20,30,20,0.04), 0 16px 40px rgba(20,30,20,0.07); transition: transform .4s cubic-bezier(0.16,1,0.3,1); display: flex; flex-direction: column; gap: 10px; }
.related-card:hover { transform: translateY(-6px); }
.related-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.related-steps { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 100px; width: fit-content; color: var(--blue); background: rgba(0,87,255,0.10); }
.related-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.3; }
.related-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.related-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--green-dark); margin-top: auto; opacity: 0.9; transition: opacity .2s, transform .2s; }
.related-card:hover .related-arrow { opacity: 1; transform: translateX(2px); }
.related-arrow svg { width: 12px; height: 12px; }
@media (max-width: 860px) { .related-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .kb-video-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kb-video-read { margin-left: 0; }
}

/* ─── DARK MODE (hardcoded-color overrides only; var() tokens flip via _app.css) ─── */
@media (prefers-color-scheme: dark) {
  /* Frosted nav: swap the near-white glass for a dark glass */
  .nav-outer nav { background: rgba(11,14,9,0.82) !important; border: none !important; border-bottom: 1px solid var(--hairline) !important; }
  .nav-outer .btn-ghost { color: var(--text) !important; background: var(--surface-2) !important; }
  .nav-outer .btn-ghost:hover { background: #2A3227 !important; }

  /* Near-white hairline borders read too hot on dark cards */
  .kb-sidebar-header,
  .sm-bar,
  .sm-topbar,
  .sm-row,
  .kb-video-head { border-bottom-color: var(--hairline); }

  /* Dark body + nav text is invisible on near-black */
  .kb-sidebar-link,
  .kb-sidebar-nav .kb-sidebar-link,
  .article-card p,
  .step-list li { color: var(--text); }

  /* Dark-on-light borders inside the app mockups */
  .sm-btn.outline,
  .sm-form-input,
  .sm-form-input.filled { border-color: var(--hairline); }

  /* Orange tag text is too muddy on near-black, lift it */
  .sm-tag.orange { color: #FB923C; }
}
