/*
 * AI Purple colour scheme for the MkDocs "readthedocs" theme.
 *
 * The palette follows the book cover (templates/book-cover.svg): a deep purple
 * base, with blue and red accents because red and blue tints make purple.
 * Only colours are changed; layout, fonts and navigation stay with the theme.
 */
:root {
  --ap-deep: #1d1133;        /* sidebar, darkest purple */
  --ap-primary: #5b2a7e;     /* header, accents */
  --ap-primary-hover: #7a3da3;
  --ap-lilac: #e9d5ff;       /* light text on dark */
  --ap-soft: #efe7f8;        /* light surfaces */
  --ap-softer: #faf6fd;
  --ap-line: #d9c8f0;
  --ap-blue: #60a5fa;
  --ap-rose: #f43f5e;
  --ap-link: #6b2fa0;        /* 8.4:1 on white */
  --ap-link-hover: #be123c;  /* 6.3:1 on white */
}

::selection {
  background: #d8b4fe;
  color: var(--ap-deep);
}

/* Header and search box */
.wy-side-nav-search,
.wy-nav-top {
  background: var(--ap-primary);
}

.wy-side-nav-search > a,
.wy-side-nav-search .wy-dropdown > a,
.wy-nav-top a {
  color: #fff;
}

.wy-side-nav-search input[type="text"] {
  border-color: #3b1f63;
}

.wy-side-nav-search > div.version {
  color: var(--ap-lilac);
}

/* Sidebar with the cover's blue-to-red accent line on its left edge */
.wy-nav-side {
  background: var(--ap-deep);
  border-left: 6px solid;
  border-image: linear-gradient(180deg, var(--ap-blue), var(--ap-rose)) 1;
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
  color: #c4a3ee;
}

.wy-menu-vertical a {
  color: #d9c8f0;
}

.wy-menu-vertical a:hover {
  background: #2f1c52;
  color: #fff;
}

.wy-menu-vertical li.current {
  background: var(--ap-soft);
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a {
  background: #e3d7f2;
  color: var(--ap-deep);
  border-color: var(--ap-line);
}

.wy-menu-vertical li.current a {
  color: #3b2d52;
  border-right-color: var(--ap-line);
}

.wy-menu-vertical li.current a:hover {
  background: var(--ap-line);
}

.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a {
  background: #f3ecfa;
}

.wy-menu-vertical li.toctree-l1.current > a {
  border-bottom-color: var(--ap-line);
  border-top-color: var(--ap-line);
}

.wy-menu-vertical li.current > a button.toctree-expand,
.wy-menu-vertical li.on a button.toctree-expand {
  color: var(--ap-primary);
}

.wy-nav-side::-webkit-scrollbar-thumb {
  background: #4a3a6b;
}

/* Page links and headings */
a {
  color: var(--ap-link);
}

a:hover,
a:focus {
  color: var(--ap-link-hover);
}

.rst-content a:visited {
  color: #52308a;
}

.rst-content h1 {
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--ap-blue), var(--ap-rose)) 1;
  padding-bottom: 0.25em;
}

.rst-content h2,
.rst-content h3 {
  color: var(--ap-deep);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ap-blue);
  outline-offset: 2px;
}

/* Inline code and code blocks: light purple surface, readable syntax colours */
.rst-content code,
.rst-content tt,
code {
  background: var(--ap-softer);
  border-color: var(--ap-line);
  color: var(--ap-primary);
}

.rst-content div[class^="highlight"],
.rst-content pre.literal-block {
  background: var(--ap-softer);
  border: 1px solid var(--ap-line);
}

.rst-content div[class^="highlight"] pre {
  background: transparent;
}

/* Block quotes and tables */
.rst-content blockquote {
  border-left: 4px solid #a371d6;
  background: var(--ap-softer);
  margin-left: 0;
  padding: 0.5em 1em;
}

.rst-content table.docutils,
.rst-content table.field-list,
.wy-table-bordered-all {
  border-color: var(--ap-line);
}

.rst-content table.docutils th,
.wy-table thead th {
  background: var(--ap-soft);
  color: var(--ap-deep);
  border-color: var(--ap-line);
}

.rst-content table.docutils td,
.wy-table-bordered-all td {
  border-color: var(--ap-line);
}

.rst-content table.docutils tr:nth-child(2n-1) td,
.wy-table-backed,
.wy-table-odd td,
.wy-table-striped tr:nth-child(2n-1) td {
  background: var(--ap-softer);
}

/* Footer navigation buttons */
.btn-neutral {
  background-color: var(--ap-soft) !important;
  color: var(--ap-deep) !important;
}

.btn-neutral:hover {
  background-color: var(--ap-line) !important;
}

/* Cover image on the start page */
.rst-content img[alt="Cover of AI Purple"] {
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(29, 17, 51, 0.35);
}
