.sidebar-logo {
    max-height: 40px !important;
    margin: 0;
}

* {
    font-size: 15px;
    line-height: 1.5rem;
}

.sidebar-drawer {
    /* border:none; */
    padding-right: 20px;
    background-color: var(--color-toc-background);
}

.page {
    max-width: 1640px;
    margin: auto;
}

@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) .sidebar-drawer {
        background-color: var(--color-toc-background);
    }
}

.sidebar-container {
    width: 338px;
}

.sidebar-drawer {
    width: 338px;
}

.toc-drawer {
    width: 314px;
}

@media (max-width: 82em) {
    .toc-drawer {
        width: 15rem;
    }
}

@media (max-width: 63em) {
    .sidebar-drawer {
        width: 15em;
    }
}

.sidebar-search-container {
    border-radius: 8px;
}

.sidebar-search {
    border: 1px solid var(--color-sidebar-search-border);
    border-radius: 8px;
}

.page .main .content {
    width: 100%;
    max-width: 960px;
}

/* Tableaux "Matrice des flux" (installs/*) : layout figé pour que :widths:
   soit respecté quelle que soit la largeur de fenêtre. En dessous de sa
   largeur minimale, le .table-wrapper de Furo (overflow-x: auto) prend le
   relais avec un scroll horizontal plutot que de faire wrapper le texte. */
table.reemo-flowmatrix {
    table-layout: fixed;
    min-width: 950px;
}

.sidebar-tree label {
    border-radius: 8px;
    /* display: none; */
}

.left-details {
    font-size: 0 !important;
}

.left-details a {
    display: none !important;
}

.left-details .copyright {
    display: block !important;
    font-size: 0.9rem !important;
}

.sidebar-tree .reference {
    border-radius: 8px;
    background: none !important;
    color: var(--color-sidebar-link-text) !important;
}

.sidebar-tree .reference:hover {
    color: var(--color-sidebar-item-background--hover) !important;
}

.sidebar-tree .current-page>.reference {
    color: var(--color-sidebar-link-text--top-level) !important;
}

body {
    --primary-color: #896ffb;
    --primary-color-light: #e7e2fe;
    --secondary-color: #1dafa9;
    --secondary-color-light: #cbf6f4;
    --color-link: #896ffb;
    --sd-color-card-border-hover: #896ffb;
    --sidebar-caption-space-above: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

h1,
h2 {
    margin-top: 3rem;
}

h1 {
    color: var(--primary-color);
}

.sphinx-tabs-tab {
    color: var(--primary-color);
}

.sphinx-tabs-panel {
    border-color: var(--color-background-border);
}

.sphinx-tabs-tab[aria-selected="true"] {
    border-color: var(--color-background-border);
    border-bottom: 2px solid #FFF;
}

body[data-theme="dark"] .sphinx-tabs-panel {
    background-color: #131416;
    border-color: var(--color-background-border);
}

body[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] {
    background-color: #131416;
    border-color: var(--color-background-border);
    border-bottom: 2px solid #131416;
}

body[data-theme="dark"] .sphinx-tabs-tab {
    color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] .sphinx-tabs-panel {
        background-color: #131416;
        border-color: var(--color-background-border);
    }

    body[data-theme="auto"] .sphinx-tabs-tab[aria-selected="true"] {
        background-color: #131416;
        border-color: var(--color-background-border);
        border-bottom: 2px solid #131416;
    }

    body[data-theme="auto"] .sphinx-tabs-tab {
        color: var(--primary-color);
    }
}

[role="tablist"] {
    border-color: var(--color-background-border);
}

.sphinx-tabs-panel {
    padding: 2rem;
}

.admonition,
.topic {
    border-radius: 8px;
    padding: 1rem;
    padding-top: 0;
}

.admonition p.admonition-title,
p.topic-title {
    margin-left: -1rem;
    margin-right: -1rem;
}

blockquote {
    border-radius: 8px;
}

/* .toctree-checkbox~ul {
    display:flex;
} */

.toctree-l1 {
    font-weight: 700;
    /* margin-bottom: 25px !important; */
    margin-bottom: 10px !important;
}

.toctree-l2 {
    font-weight: 400;
}

.sd-card .sd-card-img-top {
    height: 40px;
    object-fit: cover;
}

.reemo-text-primary {
    color: #896ffb;
}

.sd-card .sd-hide-link-text>span {
    display: none;
}

/* Conteneur */
.lang-switcher {
    position: relative;
    margin: 1rem 0;
    font-size: 0.9rem;
}

/* Bouton */
.lang-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .6rem;
    border: 1px solid var(--color-sidebar-border);
    border-radius: 8px;
    background: var(--color-background-secondary);
    color: var(--color-foreground-primary);
    cursor: pointer;
}

.lang-trigger:focus-visible {
    outline: 2px solid var(--color-brand-primary);
    outline-offset: 2px;
}

.lang-trigger .label {
    font-weight: 500;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.lang-trigger .chev {
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Menu */
.lang-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + .25rem);
    left: 0;
    width: 100%;
    border: 1px solid var(--color-sidebar-border);
    border-radius: 8px;
    background: var(--color-background-secondary);
    max-height: 220px;
    overflow: auto;
    display: none;
}

.lang-menu.open {
    display: block;
}

.lang-option {
    padding: .5rem .6rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Neutralise le style <a> par défaut de Furo (couleur primary + underline)
     — on veut un rendu texte simple, comme dans la doc actuelle. */
    color: var(--color-foreground-primary);
    text-decoration: none;
}

a.lang-option:hover,
a.lang-option:focus,
a.lang-option:visited {
    color: var(--color-foreground-primary);
    text-decoration: none;
}

.lang-option[aria-selected="true"]::after,
.lang-option.active::after {
    content: "✓";
    opacity: .8;
}

.lang-option:hover,
.lang-option[data-active="true"],
.lang-option.active {
    background: var(--color-background-hover);
}

blockquote {
    padding: 1.5rem;
    border-right: 4px solid var(--color-background-border);
}

blockquote img {
    border: 4px solid var(--color-background-border);
    border-radius: 16px;
}

figure img {
    border: 4px solid var(--color-background-border);
    border-radius: 16px;
}

div.highlight {
    background: none !important;
}


/* Fond général des blocs */
div.highlight pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1rem;
    border-radius: 16px;
    font-family: "Fira Code", "JetBrains Mono", monospace;
    font-size: 13px !important;
    line-height: 1.5;
    overflow-x: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Numéros de ligne */
.highlighttable td.linenos {
    background: #181825;
    color: #6c7086;
    padding: 0.5rem;
    border-right: 1px solid #2a2a3a;
}

/* === Pygments token classes === */

div.highlight pre .p {
    color: #cdd6f4;
    font-size: 13px !important;
}

/* Commentaires */
.highlight .c,
.highlight .cm,
.highlight .c1,
.highlight .cs {
    color: #6c7086;
    font-style: italic;
    font-size: 13px !important;
}

/* Chaînes */
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sr,
.highlight .ss {
    color: #f5c2e7;
    font-size: 13px !important;
}

/* Nombres */
.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo {
    color: #f38ba8;
    font-weight: bold;
    font-size: 13px !important;
}

/* Mots-clés */
.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt,
.highlight .na {
    color: #89b4fa;
    font-weight: bold;
    font-size: 13px !important;
}

/* Opérateurs */
.highlight .o,
.highlight .ow {
    color: #89dceb;
    font-size: 13px !important;
}

/* Identificateurs (noms) */
.highlight .n,
.highlight .nx {
    color: #cdd6f4;
    font-size: 13px !important;
}

/* Fonctions */
.highlight .nf {
    color: #94e2d5;
    font-size: 13px !important;
}

/* Classes */
.highlight .nc {
    color: #fab387;
    font-weight: bold;
    font-size: 13px !important;
}

/* Variables */
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi {
    color: #f9e2af;
    font-size: 13px !important;
}

/* Constantes */
.highlight .no {
    color: #fab387;
    font-size: 13px !important;
}

/* Exceptions, erreurs */
.highlight .err {
    background-color: #f38ba8;
    color: #1e1e2e;
    border-radius: 4px;
    padding: 0 2px;
    font-size: 13px !important;
}

/* Sélection de texte */
div.highlight pre ::selection {
    background: #89b4fa;
    color: #1e1e2e;
    font-size: 13px !important;
}

/* Scrollbar */
div.highlight pre::-webkit-scrollbar {
    height: 8px;
}

div.highlight pre::-webkit-scrollbar-thumb {
    background: #585b70;
    border-radius: 4px;
}

div.highlight pre::-webkit-scrollbar-thumb:hover {
    background: #a6adc8;
}

.green {
    color: #2ecc71;
    font-weight: bold;
}

.red {
    color: #e74c3c;
    font-weight: bold;
}

.padded-figure {
    padding: 40px;
}

.highlight .hll {
    background-color: #303049 !important;
    margin-left: -1.6rem;
}

.sidebar-tree .caption,
.sidebar-tree :not(.caption)>.caption-text {
    opacity: 0.4;
    font-size: 12px !important;
    text-transform: capitalize;
}

.sidebar-tree .caption {
  cursor: pointer;
  user-select: none;
}

.sidebar-tree .caption .caption-chevron::before {
  content: ' ▾';
  font-size: 18px;
  display: inline-block;
  margin-left: 4px;
}

.sidebar-tree .caption.caption-collapsed .caption-chevron::before {
  content: ' ▸';
}

.highlight .nb {
    color: #d3b18a;
}

img.os-icon {
    vertical-align: middle;
    margin-right: 4px;
    height: 1em;
    width: auto;
    pointer-events: none !important;
}

a:has(> img.os-icon) {
    pointer-events: none !important;
    cursor: default !important;
}

body[data-theme="dark"] img.macos-icon {
    filter: invert(1);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="auto"] img.macos-icon {
        filter: invert(1);
    }
}

button.sphinx-tabs-tab {
    cursor: pointer;
}

.bpFab {
    height: 64px !important;
    width: 64px !important;
}

/* Tableaux de metadonnees d'images (pages <image>-versions.rst, generes par
     le pipeline CI des images reemosb*). La 1re colonne est un stub (fond gris
     + gras fournis par furo) ; furo la centre par defaut -> on la realigne a
     gauche. Scope par la classe reemo-imgmeta : n'affecte aucun autre tableau. */
table.reemo-imgmeta th.stub {
    text-align: left;
}