/* WASViking docs — 3-column layout, brand-aligned */

:root {
  --wv-red: #ad0f00;
  --wv-red-deep: #8a0c00;
  --wv-graphite: #0F1419;
  --wv-ink: #1a1f24;
  --wv-line: #e6e8eb;
  --wv-muted: #5a6470;
  --wv-soft: #f7f8fa;
}

body.wv-docs {
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--wv-ink);
  background: #fff;
  line-height: 1.6;
  /* Guard against any element forcing the page wider than the viewport.
     `clip` (not `hidden`) does not create a scroll container, so the sticky
     topbar and sidebar keep working. */
  overflow-x: clip;
}

.wv-docs .main { background: #fff; }

/* ===== Top bar (dark, consistent with wasviking.com header) ===== */
.wv-docs-topbar {
  border-bottom: 1px solid #1a1f24;
  background: var(--wv-graphite);
  position: sticky;
  top: 0;
  z-index: 100;
}
.wv-docs-topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  max-width: 1440px; margin: 0 auto;
}
.wv-docs-brand { display: flex; align-items: center; gap: 14px; }
.wv-docs-brand img { height: 28px; display: block; }
.wv-docs-brand-tag {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: #c5cad1; font-weight: 700; padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  background: rgba(255,255,255,.04);
}
/* ===== Search ===== */
.wv-docs-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0; /* allow the search to shrink instead of overlapping the nav */
  max-width: 420px;
  margin: 0 28px;
}
.wv-docs-search-input {
  width: 100%;
  /* keep padding + border inside the 100% width, otherwise the input renders
     ~54px wider than its wrap and bleeds off the right edge (worst on phones
     where the search spans the full row) */
  box-sizing: border-box;
  padding: 9px 14px 9px 38px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  color: #e6e8eb;
  background: rgba(255,255,255,.06) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c5cad1' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") 12px 50% / 16px 16px no-repeat;
  transition: border-color .15s ease, background-color .15s ease;
}
.wv-docs-search-input::placeholder { color: #8a93a0; }
.wv-docs-search-input:focus {
  outline: none;
  border-color: var(--wv-red);
  background-color: rgba(255,255,255,.10);
}
.wv-docs-search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: .72rem; color: #c5cad1;
  border: 1px solid rgba(255,255,255,.18);
  padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.06);
  pointer-events: none;
}
.wv-docs-search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--wv-line);
  border-radius: 10px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.18);
  max-height: 480px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.wv-docs-search-panel.open { display: block; }
.wv-docs-search-hit {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--wv-ink);
  border-bottom: 1px solid var(--wv-line);
}
.wv-docs-search-hit:last-child { border-bottom: 0; }
.wv-docs-search-hit:hover { background: var(--wv-soft); }
.wv-docs-search-meta {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--wv-muted); font-weight: 700;
}
.wv-docs-search-title { font-weight: 600; color: var(--wv-graphite); margin-top: 3px; }
.wv-docs-search-snip { font-size: .85rem; color: var(--wv-muted); margin-top: 4px; line-height: 1.45; }
.wv-docs-search-empty { padding: 14px 16px; color: var(--wv-muted); font-size: .9rem; }
.wv-docs-search-hit mark { background: rgba(173,15,0,.15); color: var(--wv-graphite); padding: 0 2px; border-radius: 2px; }

.wv-docs-topnav { display: flex; gap: 22px; align-items: center; }
.wv-docs-topnav a {
  color: #e6e8eb; text-decoration: none; font-size: .95rem; font-weight: 500;
}
.wv-docs-topnav a:hover { color: #ff8a7a; }
.wv-docs-topnav .wv-docs-cta {
  background: var(--wv-red); color: #fff; padding: 8px 16px; border-radius: 999px;
  font-weight: 600;
}
.wv-docs-topnav .wv-docs-cta:hover { background: var(--wv-red-deep); color: #fff; }

/* ===== Mobile menu button + drawer backdrop (hidden on desktop) ===== */
.wv-docs-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  background: transparent; border: 0; color: #e6e8eb;
  padding: 6px; margin-right: 6px; cursor: pointer; border-radius: 6px;
}
.wv-docs-menu-btn:hover { background: rgba(255,255,255,.08); }
.wv-docs-backdrop {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(15,20,25,.45);
}
/* Institutional nav surfaced only inside the mobile drawer */
.wv-docs-side-extranav { display: none; }

/* ===== Layout ===== */
.wv-docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 240px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
}
/* Responsive overrides live at the END of this file (after the base
   component rules) so equal-specificity media rules win on source order. */

/* ===== Sidebar ===== */
.wv-docs-side {
  border-right: 1px solid var(--wv-line);
  padding: 32px 18px 64px 28px;
  position: sticky;
  top: 55px;
  align-self: start;
  max-height: calc(100vh - 55px);
  overflow-y: auto;
}
.wv-docs-side h6 {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--wv-muted); font-weight: 700;
  margin: 22px 0 8px;
}
.wv-docs-side h6:first-child { margin-top: 0; }
.wv-docs-side ul { list-style: none; padding: 0; margin: 0; }
.wv-docs-side li a {
  display: block;
  padding: 6px 10px;
  margin: 1px 0;
  border-radius: 6px;
  text-decoration: none;
  color: var(--wv-ink);
  font-size: .92rem;
  line-height: 1.35;
}
.wv-docs-side li a:hover { background: var(--wv-soft); color: var(--wv-graphite); }
.wv-docs-side li.active a {
  background: rgba(173,15,0,.08);
  color: var(--wv-red);
  font-weight: 600;
}

/* ===== Content ===== */
.wv-docs-main {
  padding: 48px 56px 96px;
  min-width: 0;
}
.wv-docs-eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--wv-red); font-weight: 700; margin-bottom: 10px;
}
.wv-docs-content h1 {
  font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--wv-graphite); margin: 0 0 12px;
}
.wv-docs-content h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em;
  color: var(--wv-graphite); margin: 40px 0 12px;
  padding-top: 8px;
}
.wv-docs-content h3 {
  font-size: 1.15rem; font-weight: 700; color: var(--wv-graphite);
  margin: 28px 0 8px;
}
.wv-docs-content p { color: var(--wv-ink); margin: 0 0 14px; }
.wv-docs-content ul, .wv-docs-content ol { padding-left: 22px; margin: 6px 0 16px; }
.wv-docs-content li { margin: 4px 0; }
.wv-docs-content a { color: var(--wv-red); text-decoration: none; }
.wv-docs-content a:hover { text-decoration: underline; }
.wv-docs-content code {
  background: #f1f3f5;
  color: var(--wv-graphite);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: .86em;
}
.wv-docs-content pre {
  background: #0b0f13;
  color: #e6e8eb;
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.6;
  margin: 14px 0 20px;
  border: 1px solid #1a1f24;
}
.wv-docs-content pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
.wv-docs-content blockquote {
  border-left: 3px solid var(--wv-red);
  padding: 6px 16px;
  background: rgba(173,15,0,.04);
  color: var(--wv-ink);
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
}
/* Wide tables scroll horizontally on small screens; desktop stays full width */
.wv-docs-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 18px 0; }
.wv-docs-tablewrap table { margin: 0; }
.wv-docs-content table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
  font-size: .94rem;
  border: 1px solid var(--wv-line); border-radius: 8px; overflow: hidden;
}
@media (max-width: 768px) {
  .wv-docs-content table { min-width: 520px; }
}
.wv-docs-content th, .wv-docs-content td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--wv-line);
  vertical-align: top;
}
.wv-docs-content thead th {
  background: var(--wv-soft); font-size: .82rem;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--wv-muted); font-weight: 700;
}
.wv-docs-content tr:last-child td { border-bottom: 0; }
.wv-docs-content hr { border: 0; border-top: 1px solid var(--wv-line); margin: 32px 0; }

/* Pygments code highlight */
.wv-codehilite .k, .wv-codehilite .kn, .wv-codehilite .kd { color: #ff8a7a; }
.wv-codehilite .s, .wv-codehilite .s1, .wv-codehilite .s2 { color: #a3d9b1; }
.wv-codehilite .c, .wv-codehilite .c1, .wv-codehilite .cm { color: #6c7480; font-style: italic; }
.wv-codehilite .nf, .wv-codehilite .nc { color: #ffd166; }
.wv-codehilite .n { color: #e6e8eb; }
.wv-codehilite .o { color: #c5cad1; }
.wv-codehilite .mi, .wv-codehilite .mf { color: #6ad99c; }
.wv-codehilite .nb { color: #ff8a7a; }

/* Callouts */
.wv-callout {
  border: 1px solid var(--wv-line);
  background: #fff;
  border-left: 3px solid var(--wv-red);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
}
.wv-callout-title { font-weight: 700; color: var(--wv-graphite); margin-bottom: 4px; }

/* ===== TOC (right column) ===== */
.wv-docs-toc {
  padding: 48px 28px 96px 18px;
  position: sticky;
  top: 55px;
  align-self: start;
  max-height: calc(100vh - 55px);
  overflow-y: auto;
}
.wv-docs-toc h6 {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--wv-muted); font-weight: 700; margin: 0 0 12px;
}
.wv-docs-toc ul { list-style: none; padding: 0; margin: 0; }
.wv-docs-toc li a {
  display: block;
  padding: 5px 0 5px 10px;
  border-left: 2px solid transparent;
  color: var(--wv-muted);
  text-decoration: none;
  font-size: .87rem;
  line-height: 1.4;
}
.wv-docs-toc li a:hover { color: var(--wv-graphite); border-left-color: var(--wv-line); }
.wv-docs-toc li.lvl-3 a { padding-left: 22px; font-size: .83rem; }

/* ===== Page footer (prev/next) ===== */
.wv-docs-pagenav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--wv-line);
}
.wv-docs-pagenav a {
  display: block; padding: 16px 20px;
  border: 1px solid var(--wv-line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--wv-graphite);
  transition: border-color .15s ease, transform .15s ease;
}
.wv-docs-pagenav a:hover { border-color: var(--wv-red); transform: translateY(-1px); }
.wv-docs-pagenav .label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wv-muted); font-weight: 700; }
.wv-docs-pagenav .ttl { font-weight: 600; margin-top: 4px; }
.wv-docs-pagenav .next { text-align: right; }
@media (max-width: 600px) { .wv-docs-pagenav { grid-template-columns: 1fr; } }

/* ===== Footer ===== */
.wv-docs-foot {
  border-top: 1px solid var(--wv-line);
  padding: 24px 28px; max-width: 1440px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .85rem; color: var(--wv-muted);
}
.wv-docs-foot a { color: var(--wv-muted); text-decoration: none; margin-right: 14px; }
.wv-docs-foot a:hover { color: var(--wv-graphite); }

/* ===== Responsive (placed last: equal-specificity rules win on order) ===== */
@media (max-width: 1199px) {
  .wv-docs-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .wv-docs-toc { display: none; }
  /* Below 1200px the topbar has no room for the four institutional links beside
     search + Sign in (Sign in bled off the edge). Drop them from the topbar at
     every tablet/phone width and surface them in the sidebar instead, which is
     visible as a column here (1121-1199) and inside the drawer below 1120. The
     topbar keeps just search + Sign in, so it never overflows. */
  .wv-docs-topnav a:not(.wv-docs-cta) { display: none; }
  .wv-docs-side-extranav {
    display: block; margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--wv-line);
  }
}
@media (max-width: 1120px) {
  /* Compact chrome (drawer + stacked topbar) only where the desktop topbar
     cannot fit one row: it needs ~1085px (brand + DOCS tag + search + four
     institutional links + Sign in). That covers phones and iPad PORTRAIT
     (<=1024). iPad LANDSCAPE (1133-1199) keeps the two-column desktop layout
     from the block above (sidebar visible + content), which uses the wide
     screen properly and is overflow-safe via minmax(0, 1fr). */
  .wv-docs-shell { grid-template-columns: 1fr; }

  /* Topbar: row 1 = menu + brand + Sign in; row 2 = full-width search */
  .wv-docs-menu-btn { display: inline-flex; }
  .wv-docs-topbar-inner { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .wv-docs-brand { margin-right: auto; }
  .wv-docs-brand img { height: 24px; }
  .wv-docs-brand-tag { display: none; }
  .wv-docs-search-wrap { order: 3; flex: 1 0 100%; max-width: none; margin: 6px 0 0; min-width: 0; }
  .wv-docs-search-kbd { display: none; }
  .wv-docs-topnav { gap: 0; }

  /* Sidebar becomes an off-canvas drawer instead of disappearing.
     top tracks the real topbar height (set in JS) since it now wraps. */
  .wv-docs-side {
    position: fixed;
    top: var(--wv-topbar-h, 53px); left: 0; bottom: 0;
    width: 290px; max-width: 84vw;
    background: #fff; z-index: 95;
    padding: 24px 18px 64px 24px;
    max-height: none;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 24px 48px -16px rgba(0,0,0,.25);
  }
  body.wv-nav-open { overflow: hidden; }
  body.wv-nav-open .wv-docs-side { transform: translateX(0); }
  body.wv-nav-open .wv-docs-backdrop { display: block; }

  /* Content breathing room on small screens */
  .wv-docs-main { padding: 28px 20px 72px; }
  .wv-docs-content h1 { font-size: 1.75rem; }
}
