/**
 * Copyright (c) 2019-2020, Juan Linietsky, Ariel Manzur and the Godot community
 * Copyright (c) 2021, Teslabs Engineering S.L.
 * Copyright (c) 2023-2025, The Linux Foundation.
 * SPDX-License-Identifier: CC-BY-3.0
 *
 * Various tweaks to the Read the Docs theme to better conform with Zephyr's
 * visual identity. Many colors are also overridden to use CSS variables.
 */

 :root {
     /* Use system font stacks for better performance (no Web fonts required) */
     --system-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
     --header-font-family: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif;
     --monospace-font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;

     /* Card "lift on hover" shadow, shared by the landing page and index cards. */
     --shadow-color: rgb(from var(--body-color) r g b / calc(alpha * 0.2));
     --shadow-style: 0 12px 6px -6px var(--shadow-color);
 }

body,
h1,
h2,
h3,
h4,
h5,
h6,
input[type="text"],
input[type="button"],
input[type="reset"],
input[type="submit"],
textarea,
legend,
.btn,
.rst-content .toctree-wrapper p.caption,
.rst-versions {
    font-family: var(--system-font-family);
}

h1,
h2,
h3,
h4,
h5,
h6,
legend,
.rst-content .toctree-wrapper p.caption {
    /* Use a lighter font for headers (Semi-Bold instead of Bold) */
    font-weight: 600;
    font-family: var(--header-font-family);
}

.rst-content div.figure p.caption {
    /* Tweak caption styling to be closer to typical captions */
    text-align: center;
    margin-top: 8px;
    opacity: 0.75;
}

.rst-content div.figure.figure-w480 {
    max-width: 480px;
}

/* sphinxcontrib-mermaid stretches every diagram to the width of the page. Keep the size Mermaid
   computed for a diagram that turns off "useMaxWidth". */
pre.mermaid > svg,
.mermaid-container > pre > svg {
    width: auto !important;
}

p,
article ul,
article ol,
.wy-plain-list-disc,
.wy-plain-list-decimal,
.rst-content ol.arabic,
.rst-content .section ul,
.rst-content .toctree-wrapper ul,
.rst-content .section ol {
    /* Increase the line height slightly to account for the different font */
    line-height: 25px;
}

body,
.rst-content table.docutils thead {
    color: var(--body-color);
}

a {
    color: var(--link-color);
}

a:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

a:active {
    /* Add visual feedback when clicking on a link */
    color: var(--link-color-active);
}

a:visited {
    color: var(--link-color-visited);
}

a.btn:hover {
    text-decoration: none;
}

.sphinx-tabs .sphinx-menu a.item {
    /* Original definition has `!important` */
    color: var(--link-color) !important;
}

.rst-content .toc-backref {
    color: var(--link-color);
}

/* Ensure links in body text are visually distinct from other text as per WCAG 1.4.1 */
.rst-content p a,
.rst-content blockquote p a,
.rst-content dl dd p a,
.rst-content li a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.2em;
}
.rst-content p a:hover,
.rst-content blockquote p a:hover,
.rst-content dl dd p a:hover,
.rst-content li a:hover {
  text-decoration: underline;
}
/* Preserve no-underline for buttons & navigation */
a.btn,
.wy-menu-vertical a,
.wy-breadcrumbs a,
.rst-versions a {
  text-decoration: none !important;
}

/* Style external links differently to make them easier to distinguish from internal links. */
.reference.external {
    background-position: center right;
    background-repeat: no-repeat;
    background-image: var(--external-reference-icon);
    padding-right: 13px;
}

hr,
#search-results .search li:first-child,
#search-results .search li {
    border-color: var(--hr-color);
}

footer,
#search-results .context {
    color: var(--footer-color);
}

/* Icon tweaks */
a.icon-home,
a.icon-home:visited {
    color: var(--navbar-level-1-color);
}

/* Main sections */

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

.wy-nav-content {
    background-color: var(--content-background-color);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
}

.wy-body-for-nav {
    background-color: var(--content-wrap-background-color);
}

@media only screen and (min-width: 769px) {
    .wy-nav-content {
        max-width: 915px;
    }
}

/* Table display tweaks */

.rst-content table.docutils,
.wy-table-bordered-all td,
.rst-content table.docutils td,
.wy-table thead th,
.rst-content table.docutils thead th,
.rst-content table.field-list thead th {
    border-color: var(--code-border-color);
}

.rst-content table.docutils caption, .rst-content table.field-list caption, .wy-table caption {
    color: var(--body-color);
}
.wy-table-odd td,
.wy-table-striped tr:nth-child(2n-1) td,
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td {
    background-color: var(--table-row-odd-background-color);
}

/* Override table no-wrap */
/* The first column cells are not verbose, no need to wrap them */
.wy-table-responsive table td:not(:nth-child(1)),
.wy-table-responsive table th:not(:nth-child(1)) {
    white-space: normal;
}

/* Allow to control wrapping behavior per table */
.wy-table-responsive table.wrap-normal td,
.wy-table-responsive table.wrap-normal th {
    white-space: normal;
}

/* Make sure not to wrap keyboard shortcuts */
.wy-table-responsive table td kbd {
    white-space: nowrap;
}

/* Force table content font-size in responsive tables to be 100%
 * fixing larger font size for paragraphs in the kconfig tables */
 .wy-table-responsive td p {
    font-size: 100%;
}

/* Code display tweaks */

code,
.rst-content tt,
.rst-content code {
    font-size: 14px;
    background-color: var(--code-background-color);
    border: 1px solid var(--code-border-color);
}

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

.rst-content div[class^="highlight"] {
    border-color: none;
    border: none;
}

.rst-content pre.literal-block,
.rst-content div[class^="highlight"] pre,
.rst-content .linenodiv pre {
    /* Increase the font size and line height in code blocks */
    font-size: 14px;
    line-height: 1.5;
}

.rst-content pre.literal-block {
    border: none;
    border-radius: 0.25rem;
    background-color: var(--code-background-color);
}

/* Code tab display tweaks */

.ui.tabular.menu .active.item,
.ui.segment,
.sphinx-tabs-panel {
    background-color: var(--code-background-color) !important;
}

.sphinx-tabs-tab {
    color: var(--link-color) !important;
}

.sphinx-tabs-tab[aria-selected="true"] {
    background-color: var(--code-background-color) !important;
    border-bottom: 1px solid var(--code-background-color) !important;
}

/* Code literals that are links in body content take the link color. Scoped to .rst-content so the
   navigation sidebar (where code identifiers are section titles, not cross-references) is unaffected
   and keeps the regular nav text color. */
.rst-content a.internal code.literal {
    color: var(--link-color);
}

.rst-content a.internal:visited code.literal {
    color: var(--link-color-visited);
}

/* Syntax highlighting */

.tab div[class^='highlight']:last-child {
    margin-bottom: 1em;
}

.rst-content tt.literal, .rst-content code.literal, .highlight {
    border-radius: 0.25rem;
}

.highlight {
    background-color: var(--highlight-background-color);
}

/* Emphasized lines */
.highlight .hll {
    background-color: var(--highlight-background-emph-color);
}

.highlight .gh /* Generic.Heading */,
.highlight .gu /* Generic.Subheading */,
.highlight .go /* Generic.Output */,
.highlight .gt /* Generic.Traceback */ {
    color: var(--highlight-default-color);
}

.highlight .c  /* Comment */,
.highlight .c1 /* Comment.Single */,
.highlight .cm /* Comment.Multiline */,
.highlight .cs /* Comment.Special */ {
    color: var(--highlight-comment-color);
}

.highlight .bp /* Name.Builtin.Pseudo */,
.highlight .k  /* Keyword */,
.highlight .kc /* Keyword.Constant */,
.highlight .kd /* Keyword.Declaration */,
.highlight .kn /* Keyword.Namespace */,
.highlight .kp /* Keyword.Pseudo */,
.highlight .kr /* Keyword.Reserved */,
.highlight .kt /* Keyword.Type */,
.highlight .ow /* Operator.Word */ {
    color: var(--highlight-keyword-color);
}

.highlight .ch /* Comment.Hashbang */,
.highlight .cp /* Comment.Preproc */,
.highlight .gp /* Generic.Prompt */ {
    color: var(--highlight-keyword2-color);
}

.highlight .m  /* Literal.Number */,
.highlight .mf /* Literal.Number.Float */,
.highlight .mi /* Literal.Number.Integer */,
.highlight .il /* Literal.Number.Integer.Long */,
.highlight .mb /* Literal.Number.Bin */,
.highlight .mh /* Literal.Number.Hex */,
.highlight .mo /* Literal.Number.Oct */ {
    color: var(--highlight-number-color);
}

.highlight .na /* Name.Attribute */,
.highlight .nd /* Name.Decorator */,
.highlight .ni /* Name.Entity */,
.highlight .nl /* Name.Label */ {
    color: var(--highlight-decorator-color);
}

.highlight .nb /* Name.Builtin */,
.highlight .ne /* Name.Exception */ {
    color: var(--highlight-type-color);
}

.highlight .nc /* Name.Class */,
.highlight .nn /* Name.Namespace */,
.highlight .no /* Name.Constant */,
.highlight .nv /* Name.Variable */,
.highlight .vc /* Name.Variable.Class */,
.highlight .vg /* Name.Variable.Global */,
.highlight .vi /* Name.Variable.Instance */,
.highlight .vm /* Name.Variable.Magic */ {
    color: var(--highlight-type2-color);
}

.highlight .nf /* Name.Function */,
.highlight .fm /* Name.Function.Magic */,
.highlight .nt /* Name.Tag */ {
    color: var(--highlight-function-color);
}

.highlight .o  /* Operator */,
.highlight .si /* Literal.String.Interpol */,
.highlight .sx /* Literal.String.Other */,
.highlight .sr /* Literal.String.Regex */,
.highlight .ss /* Literal.String.Symbol */ {
    color: var(--highlight-operator-color);
}

.highlight .cpf/* Comment.PreprocFile */,
.highlight .s  /* Literal.String */,
.highlight .s1 /* Literal.String.Single */,
.highlight .s2 /* Literal.String.Double */,
.highlight .sc /* Literal.String.Char */,
.highlight .se /* Literal.String.Escape */,
.highlight .sa /* Literal.String.Affix */,
.highlight .sb /* Literal.String.Backtick */,
.highlight .dl /* Literal.String.Delimiter */,
.highlight .sd /* Literal.String.Doc */,
.highlight .sh /* Literal.String.Heredoc */ {
    color: var(--highlight-string-color);
}

/* Admonition tweaks */

.rst-content .admonition,
.rst-content .admonition.note,
.rst-content .admonition.seealso {
    background-color: var(--admonition-note-background-color);
    color: var(--admonition-note-color);
    overflow: auto;
}

.rst-content .admonition .admonition-title,
.rst-content .admonition.note .admonition-title,
.rst-content .admonition.seealso .admonition-title {
    background-color: var(--admonition-note-title-background-color);
    color: var(--admonition-note-title-color);
}

.rst-content .admonition.attention,
.rst-content .admonition.caution,
.rst-content .admonition.warning {
    background-color: var(--admonition-attention-background-color);
    color: var(--admonition-attention-color);
    overflow: auto;
}

.rst-content .admonition.attention .admonition-title,
.rst-content .admonition.caution .admonition-title,
.rst-content .admonition.warning .admonition-title {
    background-color: var(--admonition-attention-title-background-color);
    color: var(--admonition-attention-title-color);
}

.rst-content .admonition.danger {
    background-color: var(--admonition-danger-background-color);
    color: var(--admonition-danger-color);
    overflow: auto;
}

.rst-content .admonition.danger .admonition-title {
    background-color: var(--admonition-danger-title-background-color);
    color: var(--admonition-danger-title-color);
}

.rst-content .admonition.tip,
.rst-content .admonition.important {
    background-color: var(--admonition-tip-background-color);
    color: var(--admonition-tip-color);
    overflow: auto;
}

.rst-content .admonition.tip .admonition-title,
.rst-content .admonition.important .admonition-title {
    background-color: var(--admonition-tip-title-background-color);
    color: var(--admonition-tip-title-color);
}

/* Admonition tweaks - sphinx_togglebutton */

.rst-content .admonition.toggle {
    overflow: visible;
}

.rst-content .admonition.toggle button {
    display: inline-flex;
    color: var(--admonition-note-title-color);
}

.rst-content .admonition.toggle .tb-icon {
    height: 1em;
    width: 1em;
}

/* Keyboard shortcuts tweaks */
kbd, .kbd,
.rst-content :not(dl.option-list) > :not(dt):not(kbd):not(.kbd) > kbd,
.rst-content :not(dl.option-list) > :not(dt):not(kbd):not(.kbd) > .kbd {
    background-color: var(--kbd-background-color);
    border: 1px solid var(--kbd-outline-color);
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 var(--kbd-shadow-color);
    color: var(--kbd-text-color);
    display: inline-block;
    font-size: 12px;
    line-height: 11px;
    padding: 4px 5px;
    vertical-align: middle;
}

/* guilabel and menuselection tweaks */
.rst-content .guilabel,
.rst-content .menuselection {
    color: var(--body-color);
    background-color: var(--guiitems-background-color);
    border-color: var(--guiitems-border-color);
}

/* footnote labels and brackets tweaks */
.rst-content .fn-bracket,
.rst-content .footnote .label,
.rst-content .citation .label {
  color: var(--body-color)
}
.rst-content .backrefs {
  color: var(--link-color);
}

/* heading tweaks to make document hierarchy easier to grasp */

.rst-content section > h1 {
    font-weight: 700;
    margin-bottom: 2.5rem;
    position: relative;
    line-height: 1;
    z-index: 1;
}

.rst-content section > h1::before {
    content: '';
    position: absolute;
    z-index:-1;
    left: 0;
    right: 0;
    height: 4px;
    bottom: -1px;
    background: linear-gradient(to right, var(--admonition-note-title-background-color), var(--admonition-note-title-background-color) 50%, var(--admonition-note-background-color) 80%, transparent); /* Example gradient */
    opacity:50%;
}

.rst-content section > h2 {
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 3.5rem 0 1rem;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--heading-accent-color);
}

.rst-content section > h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 2.5rem 0 0.75rem;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--heading-rule-color);
}

.rst-content section > h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1.875rem 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 9px;
}

.rst-content section > h4::before {
    content: '';
    flex: none;
    width: 14px;
    height: 2px;
    background: var(--footer-color);
}

.rst-content section > h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--body-color);
    margin: 2rem 0 0.5rem;
}

/* Consecutive leaf sections are a list of entries — separate them. */
.rst-content section:has(> h5) + section:has(> h5) > h5 {
    border-top: 1px solid var(--hr-color);
    padding-top: 1.75rem;
    margin-top: 1.75rem;
}

/* Section titles that are code identifiers would otherwise render as a small inline-code chip, both
   in the body and the sidebar. Let the code inherit the surrounding size, weight and color so the
   heading hierarchy and nav entries stay legible.
   The code.literal qualifier is what makes `color` stick. */
.rst-content section > :is(h1, h2, h3, h4, h5, h6) code.literal,
.wy-menu-vertical a code.literal {
    font-size: inherit;
    font-weight: inherit;
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
}

/* An h5 that is nothing but an identifier is named like one, in the same colour
   a signature would give it. */
.rst-content section > h5 > code.literal {
    color: var(--highlight-function-color);
    font-weight: 700;
}

/* Definition lists: three layouts (stacked, fields, entry) and two term
   flavours (word, code). Stock RTD styles every classed dl as an API
   signature at (0,8,2), which is why the entry rules below repeat its
   :not() chain — that chain is an inert filter on the selectors we use. */

/* Exclusions go in :where() so they cost no specificity; otherwise this base
   rule outranks the component rules below it. */

.rst-content dl:where(:not(.option-list, .footnote, .citation)) {
    border-left: 0;
}

.rst-content dl:where(:not(.option-list, .footnote, .citation)) > dt {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--term-color);
    background: none;
    border-radius: 0;
    padding: 0;
    margin: 1.875rem 0 0.1875rem;
}

.rst-content dl > dt:first-child {
    margin-top: 0;
}

.rst-content dl:where(:not(.option-list, .footnote, .citation)) > dt::before {
    content: none;
}

.rst-content dl:where(:not(.option-list, .footnote, .citation)) > dd {
    margin: 0;
}

.rst-content dl:where(:not(.option-list, .footnote, .citation)) > dd > :last-child {
    margin-bottom: 0;
}

/* Fields: a field list and a colon-terminated definition list say the same
   thing, so they render alike. fit-content() stops a long label eating the row. */
html.writer-html5 .rst-content dl.field-list,
.rst-content dl.simple:not(.glossary) {
    display: grid;
    grid-template-columns: fit-content(11rem) minmax(0, 1fr);
    gap: 6px 20px;
    align-items: baseline;
}

html.writer-html5 .rst-content dl.field-list > dt,
.rst-content dl.simple:not(.glossary) > dt {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--footer-color);
    /* RTD indents a field-list term by 1em, which misaligns it against its
       own value. */
    margin: 0;
    padding: 0;
}

/* Entry: dt.sig is Sphinx's marker on every object description, so this covers
   py, cmake, kconfig, c and cpp without a selector per domain. */
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt.sig {
    /* Not flex: the py domain emits many sibling spans per signature. */
    display: block;
    font-size: 1rem;
    /* RTD bolds the whole dt; the name should carry the weight, not the
       parameters. */
    font-weight: 400;
    line-height: 1.6;
    border-radius: 5px;
    padding: 9px 12px;
    position: static;
    /* RTD hard-codes #f0f0f0/#555 for nested object descriptions at (0,14,3);
       repeating that chain would be unreadable, hence !important. */
    color: var(--highlight-default-color) !important;
    background: var(--sig-background-color) !important;
    border: 1px solid var(--sig-border-color) !important;
    margin: 0 0 13px !important;
}

.rst-content dt.sig + dd {
    margin-left: 1.5rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--hr-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--hr-color);
}

html.writer-html5 .rst-content dd dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt.sig {
    background: none !important;
    border: 0 !important;
    border-bottom: 1px solid var(--sig-border-color) !important;
    border-radius: 0;
    padding: 0 0 5px;
    margin: 0 0 10px;
}

.rst-content dd dt.sig + dd {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.rst-content dl > dt.sig:last-of-type + dd:last-child {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt.sig .headerlink {
    float: right;
    margin-left: 12px;
    color: var(--link-color);
    opacity: 0.45;
    visibility: visible;
}

.rst-content dt.sig:hover .headerlink,
.rst-content dt.sig .headerlink:focus {
    opacity: 1;
}

.rst-content dt.sig + dd dl:not(.field-list) > dt:not(.sig) {
    justify-self: start;
    font-family: var(--monospace-font-family);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--code-border-color) !important;
    border-radius: 3px;
    padding: 2px 8px;
    color: var(--highlight-default-color) !important;
    background: var(--highlight-background-color) !important;
}

/* Only CMake signatures go through Pygments and land in a .highlight wrapper;
   other domains emit the same token classes without it, so they came out
   monochrome. The same variables keep one palette across both. */

.rst-content dt.sig .sig-name,
.rst-content dt.sig .descname {
    color: var(--highlight-function-color) !important;
    font-weight: 700;
}

.rst-content dt.sig .sig-prename,
.rst-content dt.sig .descclassname {
    color: var(--footer-color) !important;
    font-weight: 400;
}

.rst-content dt.sig .property,
.rst-content dt.sig .k {
    color: var(--highlight-keyword-color);
}

/* Body colour on purpose: --highlight-type2-color is a near neighbour of
   --highlight-type-color, so colouring this muddies the annotation. */
.rst-content dt.sig .sig-param > .n:first-child {
    color: var(--highlight-default-color);
}

.rst-content dt.sig .sig-param .n,
.rst-content dt.sig .sig-return-typehint,
.rst-content dt.sig .sig-return-typehint .n {
    color: var(--highlight-type-color);
}

.rst-content dt.sig .default_value,
.rst-content dt.sig .m {
    color: var(--highlight-number-color);
}

.rst-content dt.sig .o,
.rst-content dt.sig .sig-return-icon {
    color: var(--highlight-operator-color);
}

/* Buttons */

.btn-neutral {
    background-color: var(--btn-neutral-background-color) !important;
    color: var(--body-color) !important;
}

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

.btn-neutral:visited {
    color: var(--body-color) !important;
}

/* Navigation bar logo and search */

.logo {
    opacity: var(--logo-opacity);
}

.wy-side-nav-search > a img.logo {
    /* Fixed size to prevent reflows and support hiDPI displays */
    /* A 5 pixel margin is added on each side. The logo itself displays at 200×100 at 100% scaling. */
    width: 210px;
    height: 105px;
}

.wy-side-nav-search {
    background-color: var(--navbar-background-color);
}

.wy-side-nav-search.fixed {
    position: fixed;
}

@media only screen and (min-width: 769px) {
    /* Simulate a drop shadow that only affects the bottom edge */
    /* This is used to indicate the search bar is fixed */
    .wy-side-nav-search.fixed-and-scrolled::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: -8px;
        width: 300px;
        height: 8px;
        pointer-events: none;
        background: linear-gradient(hsla(0, 0%, 0%, 0.2), transparent);
    }
}

.wy-side-nav-search > a:hover,
.wy-side-nav-search .wy-dropdown > a:hover {
    background-color: var(--navbar-background-color-hover);
}

.wy-side-nav-search > a:active,
.wy-side-nav-search .wy-dropdown > a:active {
    background-color: var(--navbar-background-color-active);
}

.wy-side-nav-search input[type=search] {
    width: 100%;
    border-radius: 50px;
    padding: 6px 12px;
    background-color: var(--input-background-color);
    color: var(--body-color);
    /* Avoid reflowing when toggling the focus state */
    border: 2px solid transparent;
    box-shadow: none;
    /* Make visual feedback instant */
    transition: none;
    font-size: 14px;
}

.wy-side-nav-search input[type="search"]:focus {
    border: 2px solid var(--input-focus-border-color);
}

.wy-side-nav-search input[type="search"]::placeholder {
    color: var(--body-color);
    opacity: 0.55;
}

/* Navigation bar */

.wy-nav-side {
    background-color: var(--navbar-background-color);
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
    color: var(--navbar-heading-color);

    /* Improves the appearance of uppercase text */
    letter-spacing: 0.75px;
}

/* Mobile navigation */

.wy-nav-top,
.wy-nav-top a {
    background-color: var(--navbar-background-color);
    color: var(--navbar-level-1-color);
}

/* Version branch label below the logo */
.wy-side-nav-search > div.version {
    color: var(--navbar-level-3-color);
    opacity: 0.9;
}

/* First level of navigation items */

.wy-menu-vertical a {
    color: var(--navbar-level-1-color);
}

.wy-menu-vertical a:hover {
    background-color: var(--navbar-background-color-hover);
    color: var(--navbar-level-1-color);
}

.wy-menu-vertical a:active {
    background-color: var(--navbar-background-color-active);
}

.wy-menu-vertical li.toctree-l1.current > a {
    border: none;
}

.wy-menu-vertical a button.toctree-expand,
.wy-menu-vertical li.toctree-l2 a button.toctree-expand {
    color: var(--navbar-level-3-color);
    opacity: 0.9;
    margin-right: 6px;
}

.wy-menu-vertical a:hover button.toctree-expand,
.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand {
    color: var(--navbar-level-2-color);
    opacity: 1;
}

.wy-menu-vertical a:active button.toctree-expand,
.wy-menu-vertical li.toctree-l2 a:active button.toctree-expand {
    color: var(--navbar-level-1-color);
    opacity: 1;
}

/* Second (and higher) levels of navigation items */

.wy-menu-vertical li.current a {
    /* Make long words always display on a single line, keep wrapping for multiple words */
    /* This fixes the class reference titles' display with very long class names */
    display: flex;
}

.wy-menu-vertical li.current a,
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l4 > a {
    background-color: var(--navbar-current-background-color);
    color: var(--navbar-level-2-color);
    border-color: var(--navbar-current-background-color);
}

.wy-menu-vertical li.current a:hover,
.wy-menu-vertical li.toctree-l2.current > a:hover,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a:hover,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a:hover {
    background-color: var(--navbar-current-background-color-hover);
}

.wy-menu-vertical li.current a:active,
.wy-menu-vertical li.toctree-l2.current > a:active,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a:active,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a:active {
    background-color: var(--navbar-current-background-color-active);
}

.wy-menu-vertical a {
    /* This overrides 8px margin added in other multi-selector rules */
    margin-right: 0;
}

/* Banner panel in sidebar */
.wy-nav-side .ethical-rtd.fixed {
    position: fixed;
}

/* Version selector (only visible on Read the Docs) */

.rst-versions {
    background-color: var(--navbar-current-background-color);
}

.rst-versions a,
.rst-versions .rst-current-version,
.rst-versions .rst-current-version .fa,
.rst-versions .rst-other-versions dd a {
    color: var(--navbar-level-1-color);
}

.rst-versions .rst-other-versions small {
    color: var(--navbar-level-3-color);
}

.rst-versions .rst-other-versions dd a:hover {
    text-decoration: underline;
}

.rst-versions .rst-other-versions {
    color: var(--navbar-heading-color);
}

.rst-versions .rst-current-version {
    background-color: var(--navbar-current-background-color);
}

.rst-versions .rst-current-version:hover {
    background-color: var(--navbar-current-background-color-hover);
}

.rst-versions .rst-current-version:active {
    background-color: var(--navbar-current-background-color-active);
}

.rst-versions.shift-up {
    overflow-y: auto;
}

/* Hide the obnoxious automatic highlight in search results */
.rst-content .highlighted {
    background-color: transparent;
    font-weight: inherit;
    padding: 0;
}

/* Allows the scrollbar to be shown in the sidebar */
@media only screen and (min-width: 769px) {
    .wy-side-scroll {
        overflow: hidden;
    }

    .wy-nav-side .wy-side-scroll .ethical-rtd {
        width: calc(300px - 1.25em);
        padding: 0 0 0 1em;
    }
}
.wy-menu.wy-menu-vertical {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100% - 243px);
}
@media screen and (max-width: 768px) {
    .wy-nav-side {
        padding-bottom: 44px;
    }
    .wy-menu.wy-menu-vertical {
        overflow-y: initial;
        max-height: initial;
    }
    .wy-nav-content {
        min-height: calc(100vh - 64px);
        min-height: calc(100dvh - 64px);
    }
}

/* Scrollbar styling */
.wy-menu.wy-menu-vertical {
    scrollbar-color: var(--navbar-scrollbar-color) var(--navbar-scrollbar-background);
}
.wy-menu.wy-menu-vertical::-webkit-scrollbar {
    width: .75rem;
}
.wy-menu.wy-menu-vertical::-webkit-scrollbar-track {
    background-color: var(--navbar-scrollbar-background);
}
.wy-menu.wy-menu-vertical::-webkit-scrollbar-thumb {
    background-color: var(--navbar-scrollbar-color);
}
/* Firefox does the dimming on hover automatically. We emulate it for Webkit-based browsers. */
.wy-menu.wy-menu-vertical::-webkit-scrollbar-thumb:hover {
    background-color: var(--navbar-scrollbar-hover-color);
}
.wy-menu.wy-menu-vertical::-webkit-scrollbar-thumb:active {
    background-color: var(--navbar-scrollbar-active-color);
}

/* Misc tweaks */

.rst-columns {
    column-width: 18em;
}

.rst-content div.figure, .rst-content figure {
    text-align: center;
}

.wy-alert.wy-alert-danger {
    background-color: var(--admonition-danger-background-color);
}

dark-mode-toggle::part(fieldset) {
  padding-inline: 0.75rem;
  padding-block: 0;
}

dark-mode-toggle::part(darkLabel),
dark-mode-toggle::part(lightLabel),
dark-mode-toggle::part(toggleLabel){
  font-size: unset;
}

div.graphviz > object {
    filter: var(--graphviz-filter);
}

/* Sidebar */
.rst-content .sidebar {
    border-radius: 12px;
    padding: 0px;
    background: var(--admonition-note-background-color);
    color: var(--admonition-note-title-color);
    border-color: var(--admonition-note-title-background-color);
}

@media screen and (max-width: 480px) {
    .rst-content .sidebar {
        float: none;
        margin-left: 0;
    }
}

.rst-content .sidebar {
    color: var(--admonition-note-color);
}

.rst-content .sidebar .sidebar-title {
    font-family: var(--header-font-family);
    background: var(--admonition-note-title-background-color);
    color: var(--admonition-note-title-color);
    border-radius: 12px 12px 0px 0px;
    margin: 0px;
    text-align: center;
}

.rst-content .sidebar figure {
    padding: 1rem;
    margin-bottom: -1rem;
}

.rst-content .sidebar figure img {
    height: auto !important;
}

.rst-content .sidebar figure figcaption p {
    margin-bottom: 0px;
}

/* A sidebar card is narrow, so its labels shrink rather than its values: at the
   body label size, "Architecture:" alone takes half the card. */
html.writer-html5 .rst-content .sidebar dl.field-list {
    grid-template-columns: fit-content(5.5rem) minmax(0, 1fr);
    gap: 9px 12px;
    align-items: baseline;
    margin: 12px 0;
    /* The card has no padding of its own: each child insets itself, and the
       figure caption above sets the convention at 16px. */
    padding: 0 16px;
}

html.writer-html5 .rst-content .sidebar dl.field-list > dt {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
    padding: 0;
}

.rst-content .sidebar dl.field-list > dt .colon {
    display: none;
}

html.writer-html5 .rst-content .sidebar dl.field-list > dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.rst-content .sidebar dl.field-list > dd code {
    font-size: 0.9em;
}

/* Icon for the hover text that appears next to headings */
.headerlink::after {
    content: "\f0c1"; /* font-awesome "link" icon */
}

/* Home page grid display */
.grid {
    list-style-type: none !important;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    margin: 1rem auto;
    max-width: calc((160px + 2rem) * 4);
}

.grid-item {
    list-style-type: none !important;
    -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    width: 150px;
    text-align: center;
    margin: 1rem;
}

.grid-item a {
    display: block;
    width: 150px;
    height: 150px;
    padding: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, #0070c5 0%, #5c13a5 100%);
    color: white;
}

.grid-item h2 {
    font-size: 1rem;
}

.grid-item img {
    margin-bottom: 1rem;
    max-width: 75%;
}

.grid-item a:hover {
    text-decoration: none;
}

.grid-item p {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--body-color);
    font-weight: 200;
    margin-left: -0.9em;
    margin-right: -0.9em;
    line-height: 1.4rem;
}

.grid-icon {
   line-height: 1.5;
   font-size: 3rem;
   color: white;
}

.lastupdated {
    font-weight: 200;
    font-size: 0.9rem;
}

/* Make actual document take all vertical space available so that footer is always at the bottom */

.rst-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.document {
    flex-grow: 1;
}

/* Custom search box, including search engine selection */

.search-container {
    position: relative;
}

#search-se-settings-icon {
    position: absolute;
    color: var(--body-color);
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.8;
    padding: 10px;
}

#search-se-menu {
    display: none;
    position: absolute;
    font-size: 11px;
    background-color: var(--input-background-color);
    color: var(--body-color);
    right: 0px;
    top: 36px;
    border: solid 1px var(--body-color);
    border-radius: 10px;
    z-index: 1000;
}

#search-se-menu ul {
    list-style: none;
    margin: 0;
    padding: 2px;
}

#search-se-menu ul li {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

#search-se-menu [role="menuitemradio"]:focus {
    background-color: var(--navbar-current-background-color-hover);
    color: var(--navbar-level-1-color);
    border-radius: 10px;
}

#search-se-menu ul li .fa-check {
    display: none;
  }

  #search-se-menu ul li.selected .fa-check {
    display: inline;
  }

.doxygroup::after {
    content: 'Doxygen';
    display: inline-block;
    background-color: var(--admonition-note-title-background-color);
    color: var(--admonition-note-title-color);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-size: 0.875em;
    font-weight: bold;
}

.code-sample-list li {
    margin-bottom: 0.25em;
}
.code-sample-name {
    font-weight: bold;
    padding-right: 0.5em;
}

.code-sample-description {
    font-weight: 300;
}

.code-sample-description::before {
    content: '\F0A9'; /* arrow-circle-right */
    font-family: 'FontAwesome';
    padding-right: 0.5em;
}

li>a.code-sample-link.reference.internal {
    font-weight: 100;
}

li>a.code-sample-link.reference.internal.current {
    text-decoration: underline;
}

/* Categorized index cards (e.g. the OS Services landing page). */

.sd-index-grid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sd-index-grid .sd-row {
    display: block;
    column-count: 3;
    column-gap: 1.5rem;
}

@media (max-width: 996px) {
    .sd-index-grid .sd-row { column-count: 2; }
}

@media (max-width: 700px) {
    .sd-index-grid .sd-row { column-count: 1; }
}

.sd-index-grid .sd-col {
    display: block;
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    break-inside: avoid;
    margin: 0 0 1.5rem;
    padding: 0 !important;
}

.sd-card.sd-index-card {
    --svc-accent: var(--navbar-scrollbar-active-color);
    --svc-accent-soft: color-mix(in oklab, var(--svc-accent) 55%, var(--body-color));
    position: relative;
    overflow: hidden;
    background-color: var(--landing-card-background-color);
    border: 1px solid transparent;
    border-radius: 0.75rem;
    box-shadow: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sd-card.sd-index-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-style) !important;
}

.sd-index-watermark {
    position: absolute;
    right: -0.75rem;
    bottom: -1.25rem;
    margin: 0;
    line-height: 1;
    color: var(--svc-accent);
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.sd-index-card:hover .sd-index-watermark {
    transform: rotate(-10deg) scale(1.1);
    opacity: 0.18;
}

.sd-index-card .sd-card-body {
    position: relative;
    z-index: 1;
}

.sd-index-card .sd-card-title {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--body-color);
    margin-bottom: 1.2rem;
}

.sd-index-card .sd-card-title a {
    color: inherit;
    text-decoration: none;
}

.sd-index-card .sd-card-title a:hover {
    color: var(--svc-accent-soft);
}

.sd-index-card .toctree-wrapper {
    position: relative;
    z-index: 1;
}

.sd-index-card .toctree-wrapper ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.sd-index-card .toctree-wrapper li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.sd-index-card .toctree-wrapper > ul > li.toctree-l1 > a.reference {
    display: none;
}

.sd-index-card .toctree-wrapper > p.caption {
    display: none;
}

.landing-container .persona-link,
.sd-index-card .toctree-wrapper a.reference {
    display: flex;
    align-items: center;
    color: var(--body-color);
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none !important;
    padding: 0;
    margin: 0 0 0.3rem;
    transition: color 0.15s ease;
}

.landing-container .persona-link i,
.sd-index-card .toctree-wrapper a.reference::before {
    font-size: 0.75rem;
    color: var(--svc-accent, var(--link-color));
    margin-right: 0.6rem;
    flex: none;
}

.sd-index-card .toctree-wrapper a.reference::before {
    content: "\f054";
    font-family: FontAwesome;
}

.landing-container .persona-link:hover,
.sd-index-card .toctree-wrapper a.reference:hover {
    color: var(--svc-accent-soft, var(--link-color));
    font-weight: 500;
}

/* Size landing cards against the content column, excluding the navigation sidebar. */
.landing-container {
    container-type: inline-size;
}

@container (max-width: 640px) {
    .landing-container .landing-grid,
    .landing-container .landing-grid.three-col {
        grid-template-columns: 1fr;
    }
}
