/*
 * Unwired corporate identity overlay for sphinx_rtd_theme.
 *
 * Loaded after the theme stylesheet via html_css_files in conf.py, so every rule
 * here beats the stock RTD chrome at equal specificity.
 *
 * Colour tokens mirror the CI scales in wasabi-splashpage/admin/src/brand.ts.
 * The primary green is bright: anything sitting on it takes the dark grey
 * --unw-on-accent, never white. Text-sized green (links, captions on light
 * backgrounds) uses the darkest step of the scale so it stays readable.
 */

:root {
  --unw-green-900: #108b3e;
  --unw-green-800: #16ac4e;
  --unw-green-700: #1bd761; /* Primary Green */
  --unw-green-200: #d1f7df;
  --unw-green-100: #e8fbef;

  --unw-grey-800: #121212; /* Page Black / text on light */
  --unw-grey-700: #1f1f1f; /* Raised */
  --unw-grey-600: #3d3d3d;
  --unw-grey-400: #787878;
  --unw-grey-100: #e0e0e0;
  --unw-white: #ffffff;

  --unw-blue-600: #00b7ff;
  --unw-blue-50: #e5f8ff;

  --unw-yellow-600: #ffe100;
  --unw-yellow-400: #ffed66;
  --unw-yellow-50: #fffce5;

  --unw-red-800: #d8001a;
  --unw-red-50: #ffeaee;

  --unw-page: #fafafa;
  --unw-on-accent: var(--unw-grey-800);

  /* No web fonts: Inter is picked up only when installed locally. */
  --unw-font: Inter, -apple-system, BlinkMacSystemFont, Roboto, Ubuntu,
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* -- Typography and page surface ------------------------------------------ */

body {
  font-family: var(--unw-font);
  color: var(--unw-grey-800);
  background: var(--unw-page);
}

.rst-content .toctree-wrapper > p.caption,
h1,
h2,
h3,
h4,
h5,
h6,
legend {
  font-family: var(--unw-font);
  color: var(--unw-grey-800);
}

.wy-nav-content-wrap {
  background: var(--unw-page);
}

.wy-nav-content {
  background: var(--unw-white);
}

figure figcaption {
  color: var(--unw-grey-400);
  margin-top: 8px;
  font-style: italic;
}

/* -- Links ---------------------------------------------------------------- */

a,
a:visited {
  color: var(--unw-green-900);
}

a:hover,
a:active {
  color: var(--unw-green-800);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--unw-green-700);
  outline-offset: 2px;
}

.rst-content code.literal,
.rst-content tt.literal {
  color: var(--unw-red-800);
}

.rst-content .highlighted {
  background: var(--unw-yellow-400);
  box-shadow: 0 0 0 2px var(--unw-yellow-400);
}

.rst-content .guilabel {
  background: var(--unw-green-100);
  border: 1px solid var(--unw-green-200);
  color: var(--unw-grey-800);
}

/* -- Sidebar -------------------------------------------------------------- */

.wy-nav-side {
  color: var(--unw-white);
  background: var(--unw-grey-700);
  border-color: var(--unw-green-700);
  box-shadow: rgba(0, 0, 0, 0.3) 2px 0 9px;
}

/* Darker than the nav itself so the green wordmark stays legible on it. */
.wy-side-nav-search {
  background: var(--unw-grey-800);
  border-bottom: 2px solid var(--unw-green-700);
}

/* RTD emits the project name before the logo; stack them the other way round
   and drop the home glyph, which the wordmark already stands in for. */
.wy-side-nav-search > a.icon-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2em;
  width: 100%;
}

.wy-side-nav-search > a.icon-home::before {
  display: none;
}

.wy-side-nav-search > a img.logo,
.wy-side-nav-search .wy-dropdown > a img.logo {
  order: -1;
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
  margin: 0 auto;
}

.wy-side-nav-search > a,
.wy-side-nav-search > a:visited,
.wy-side-nav-search .wy-dropdown > a {
  color: var(--unw-white);
}

.wy-side-nav-search > div.version {
  color: rgba(255, 255, 255, 0.6);
}

.wy-nav-side a,
.wy-nav-side a:visited {
  color: var(--unw-white);
}

.wy-menu-vertical a:hover {
  background: var(--unw-grey-600);
  color: var(--unw-white);
}

.wy-menu-vertical li button.toctree-expand {
  color: var(--unw-white);
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
  color: var(--unw-green-700);
}

/* The expanded branch keeps RTD's light background, so its text stays dark. */
.wy-menu-vertical li.current a,
.wy-menu-vertical li.current a:visited {
  color: var(--unw-grey-800);
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a {
  border-left: 3px solid var(--unw-green-700);
}

/* -- Search field --------------------------------------------------------- */

.wy-side-nav-search input[type="text"] {
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 16px;
  border: 1px solid var(--unw-green-700);
  background: var(--unw-white);
  color: var(--unw-grey-800);
  box-shadow: none;
}

.wy-side-nav-search input[type="text"]:focus {
  border-color: var(--unw-green-700);
  outline: 2px solid var(--unw-green-700);
  outline-offset: 1px;
}

/* -- Mobile top bar ------------------------------------------------------- */

.wy-nav-top {
  background: var(--unw-green-700);
  color: var(--unw-on-accent);
}

.wy-nav-top a,
.wy-nav-top a:visited,
.wy-nav-top i {
  color: var(--unw-on-accent);
}

/* -- Admonitions ---------------------------------------------------------- */

.rst-content .admonition,
.rst-content .note,
.rst-content .seealso,
.rst-content .admonition-todo {
  background: var(--unw-blue-50);
  border-radius: 8px;
  box-shadow: 2px 2px 8px rgba(18, 18, 18, 0.15);
}

.rst-content .admonition .admonition-title,
.rst-content .note .admonition-title,
.rst-content .seealso .admonition-title,
.rst-content .admonition-todo .admonition-title {
  background: var(--unw-blue-600);
  color: var(--unw-on-accent);
}

.rst-content .tip,
.rst-content .hint,
.rst-content .important {
  background: var(--unw-green-100);
}

.rst-content .tip .admonition-title,
.rst-content .hint .admonition-title,
.rst-content .important .admonition-title {
  background: var(--unw-green-700);
  color: var(--unw-on-accent);
}

.rst-content .warning,
.rst-content .attention,
.rst-content .caution {
  background: var(--unw-yellow-50);
}

.rst-content .warning .admonition-title,
.rst-content .attention .admonition-title,
.rst-content .caution .admonition-title {
  background: var(--unw-yellow-600);
  color: var(--unw-on-accent);
}

.rst-content .danger,
.rst-content .error {
  background: var(--unw-red-50);
}

.rst-content .danger .admonition-title,
.rst-content .error .admonition-title {
  background: var(--unw-red-800);
  color: var(--unw-white);
}

.rst-content .admonition-title {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 8px 16px;
}

.rst-content .admonition-title::before {
  margin-right: 10px;
}

/* -- Tables and footer navigation ----------------------------------------- */

.wy-table-responsive table td,
.wy-table-responsive table th {
  white-space: normal;
}

.rst-footer-buttons a.btn-neutral {
  padding: 10px 12px 8px;
  border-radius: 4px;
  border: 0;
  background: none !important;
  box-shadow: none;
  font-weight: bold;
  color: var(--unw-green-900);
}
