/* ==========================================================================
   TreeListView documentation - the treelistview.com/docs chrome
   ==========================================================================
   Loaded after docs.css, by the pages in deploy/docs-tlv/ only. docs.css
   styles the content and the layout for both builds; this file adds what the
   binarymission.co.uk build takes from the site's site-shell.css instead: the
   ten theme palettes, and the docs' own header, theme select and footer.
   Nothing here may be needed by deploy/docs/, which does not load it.

   Same ten palettes, same `html[data-theme]` selectors and the same
   `bm-theme` key as treelistview.com. --text-faint and --accent-ink are the
   main site's values, which clear 4.5:1 on these backgrounds.
   ========================================================================== */

/* ---------- Theme palettes ---------- */

:root,
html[data-theme="dark"] {
  --bg: #0a0d14; --bg-alt: #0d1119; --surface: #12161f; --surface-2: #171c27;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.14);
  --text: #eef1f7; --text-dim: #aab2c5; --text-faint: #7f8697;
  --accent: #7c6cf6; --accent-2: #4f9dff; --accent-3: #22d3c9; --accent-ink: #4f9dff;
  --btn-ink: #060810; --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
html[data-theme="light"] {
  --bg: #f6f7fb; --bg-alt: #eef0f6; --surface: #fff; --surface-2: #f4f5fa;
  --border: rgba(15,23,42,.09); --border-strong: rgba(15,23,42,.16);
  --text: #12141c; --text-dim: #4b5468; --text-faint: #626a7c;
  --accent: #6d5ef0; --accent-2: #2f7fe0; --accent-3: #0fb8ac; --accent-ink: #2864af;
  --btn-ink: #fff; --shadow: 0 20px 50px -22px rgba(30,41,59,.25);
}
html[data-theme="ocean"] {
  --bg: #061820; --bg-alt: #08212b; --surface: #0d2733; --surface-2: #123240;
  --border: rgba(255,255,255,.07); --border-strong: rgba(255,255,255,.13);
  --text: #e6f6f7; --text-dim: #9fc4c9; --text-faint: #789ea3;
  --accent: #17b8c4; --accent-2: #2f9bff; --accent-3: #5fe0c0; --accent-ink: #45a6fe;
  --btn-ink: #04141a; --shadow: 0 20px 60px -20px rgba(0,0,0,.65);
}
html[data-theme="sunset"] {
  --bg: #1a0f14; --bg-alt: #20131a; --surface: #26161f; --surface-2: #2e1a26;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.14);
  --text: #fbeef0; --text-dim: #d3aab0; --text-faint: #a38188;
  --accent: #f6607c; --accent-2: #ff9a4f; --accent-3: #c86cf6; --accent-ink: #ff9a4f;
  --btn-ink: #1a0508; --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
html[data-theme="aurora"] {
  --bg: #08131c; --bg-alt: #0a1826; --surface: #0f1f30; --surface-2: #142839;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.14);
  --text: #eaf6f2; --text-dim: #a9c9c0; --text-faint: #729790;
  --accent: #33e0a1; --accent-2: #4f9dff; --accent-3: #9b6cf6; --accent-ink: #4f9dff;
  --btn-ink: #04140f; --shadow: 0 20px 60px -20px rgba(0,0,0,.62);
}
html[data-theme="royal"] {
  --bg: #0f0a1c; --bg-alt: #140f24; --surface: #1a1330; --surface-2: #20193a;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.15);
  --text: #f1edfb; --text-dim: #c1b3e0; --text-faint: #9283b1;
  --accent: #a06cf6; --accent-2: #6c7bf6; --accent-3: #e0b256; --accent-ink: #7b88f7;
  --btn-ink: #0c0616; --shadow: 0 20px 60px -20px rgba(0,0,0,.65);
}
html[data-theme="mint"] {
  --bg: #f2faf6; --bg-alt: #e9f6ef; --surface: #fff; --surface-2: #eefaf3;
  --border: rgba(6,78,59,.10); --border-strong: rgba(6,78,59,.18);
  --text: #0b1f18; --text-dim: #3f6357; --text-faint: #57736a;
  --accent: #12b886; --accent-2: #0b7f96; --accent-3: #7cc957; --accent-ink: #0d6f7f;
  --btn-ink: #fff; --shadow: 0 20px 50px -22px rgba(6,78,59,.20);
}
html[data-theme="forest"] {
  --bg: #0a140e; --bg-alt: #0d1a12; --surface: #122016; --surface-2: #17281c;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.14);
  --text: #eaf6ee; --text-dim: #a9c9b2; --text-faint: #72977d;
  --accent: #4fce6b; --accent-2: #2fb39c; --accent-3: #a9e05a; --accent-ink: #2fb39c;
  --btn-ink: #06120a; --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
html[data-theme="slate"] {
  --bg: #121317; --bg-alt: #16171c; --surface: #1c1e24; --surface-2: #23252c;
  --border: rgba(255,255,255,.07); --border-strong: rgba(255,255,255,.13);
  --text: #eceef2; --text-dim: #a7acb8; --text-faint: #8b8f96;
  --accent: #7c8cf6; --accent-2: #5fb0d9; --accent-3: #c8ccd6; --accent-ink: #5fb0d9;
  --btn-ink: #0a0b0e; --shadow: 0 20px 60px -20px rgba(0,0,0,.55);
}
html[data-theme="amber"] {
  --bg: #160f06; --bg-alt: #1c1308; --surface: #241a0c; --surface-2: #2c2010;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.14);
  --text: #fbf1e3; --text-dim: #d9bd94; --text-faint: #9f8b6a;
  --accent: #f6a93c; --accent-2: #f66c4f; --accent-3: #e0c250; --accent-ink: #f66d50;
  --btn-ink: #160a02; --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}

/* The header is --header-h tall and there is no docs bar below it; docs.css
   places the sidebar, table of contents and drawer from these two. */
:root { --header-h: 60px; --docs-bar-h: 0px; }

/* ---------- Header ---------- */

.tlv-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
}
/* No backdrop-filter: it creates a containing block for fixed descendants,
   which is what puts an open mobile menu behind the page instead of over it. */

.tlv-header a { text-decoration: none; }
.tlv-header .brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-family: var(--font-display); }
.tlv-header .brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--btn-ink); font-size: 15px;
}
.tlv-header .brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-faint); letter-spacing: .02em; }

.header-spacer { flex: 1; }

.header-nav { display: flex; gap: .25rem; align-items: center; }
.header-nav a {
  padding: .4rem .7rem; border-radius: 8px; color: var(--text-dim); font-size: 14px; font-weight: 500;
}
.header-nav a:hover { background: var(--surface); color: var(--text); }

/* The way to buy, on every page and at every width: the related-sites links fold away on a phone, this does not. */
.header-cta {
  flex: none; padding: .4rem .85rem; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--btn-ink); font-size: 13.5px; font-weight: 600;
}
.header-cta:hover { filter: brightness(1.08); }

.theme-pick { display: flex; align-items: center; gap: .45rem; }
.theme-swatch {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 1px solid var(--border-strong);
  background: linear-gradient(120deg, var(--accent-2), var(--accent), var(--accent-3));
}
.theme-picker {
  appearance: none; -webkit-appearance: none;
  padding: .35rem 1.6rem .35rem .6rem; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 12px center, right 7px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* The contents toggle is docs.css's .docs-nav-toggle (shown at 900px and
   below); in this header it is the square glyph button. */
.tlv-header .docs-nav-toggle {
  justify-content: center; width: 38px; height: 38px; padding: 0;
  font-size: 17px; font-weight: 400;
}

.api-filter { top: calc(var(--docs-top) + .5rem); }

/* ---------- Footer ---------- */

.tlv-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2rem 1.5rem;
  color: var(--text-dim); font-size: 13.5px;
}
.tlv-footer a { color: var(--accent-ink); text-decoration: none; }
.tlv-footer a:hover { text-decoration: underline; }
.footer-inner { max-width: 1500px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-left: auto; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .header-nav { display: none; }

  /* The subtitle wraps to a second line at this width, which pushes the brand
     past the header's fixed height. The version is in the footer. */
  .tlv-header .brand small { display: none; }
  .tlv-header .brand { font-size: 15px; }
}

/* The header is a flex row whose items will not shrink below their content;
   on a phone it needs the smaller padding and no swatch to fit beside Pricing. */
@media (max-width: 480px) {
  .tlv-header { padding: 0 .75rem; gap: .5rem; }
  .theme-swatch { display: none; }
  .header-cta { padding: .3rem .6rem; font-size: 12.5px; }
}

/* The narrowest phones: the name goes (the page heading carries it) so Pricing still fits beside the theme. */
@media (max-width: 380px) {
  .tlv-header .brand > span:last-child { display: none; }
}

@media print {
  .tlv-header, .tlv-footer { display: none !important; }
}
