/* Stylesheet for Sphinx's documentation */

/* Set master colours */
:root {
    --fonts-sans-serif: system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --colour-sphinx-blue: #0A507A;
    --colour-text: #333;
    --colour-links-light: #057;
}

body {
    font-family: var(--fonts-sans-serif);
    margin: 0 auto;
    color: var(--colour-text);
}

.pageheader {
    display: flex;
    column-gap: 1em;
    align-items: center;
    width: 100%;
    background-color:#f1f5f9;
    /*background-color: var(--colour-sphinx-blue);*/
    padding: 10px 20px;
}

.pageheader a {
    width: 5%;
}

.pageheader img {
    height: 10vh;
    width: auto;
    filter: drop-shadow(1px 1px 2px grey);
}

.pageheader h1{
    color: var(--colour-sphinx-blue);
    margin: 0;
    font-weight: 600;
    font-size: 3.5rem;
    line-height: 1;
    font-variant: small-caps;
}

div.document {
    display: flex;
    margin: 0 0.5em;
}

div.body {
    border-left: 1px solid var(--colour-sphinx-blue);
    margin: 0;
    padding: 0.5em 1.75em;
    min-width: 0;
    max-width: 60vw;
}

div.related {
    display: flex;
    color: white;
    background-color: var(--colour-sphinx-blue);
    border-top: 1px solid #002e50;
}

div.related ul li {
    margin: 0 5px 0 0;
    float: left;
}

div.related ul li a {
    padding: 0 5px 0 5px;
    line-height: 1.75em;
    color: white;
}

div.related ul li a:hover {
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

div.sphinxsidebarwrapper {
    padding: 0;
}

div.sphinxsidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    width: 250px;
    overflow-y: auto;
    overflow-wrap: break-word;
    margin: 0;
    padding-right: 15px;
    padding-top: 0.5em;
    font-size: 1em;
}

div.sphinxsidebar h3 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 0.5em;
    padding-top: 0.5em;
}

div.sphinxsidebar h4 {
    font-size: 1.2em;
    margin-bottom: 0;
}

div.sphinxsidebar hr {
    margin:0;
}

div.sphinxsidebar h3, div.sphinxsidebar h4 {
    margin-right: -15px;
    margin-left: -15px;
    padding-right: 14px;
    padding-left: 14px;
    color: #333;
    font-weight: 300;
}

div.sphinxsidebar h3 a {
    color: #333;
}

div.sphinxsidebar ul {
    color: #444;
    margin-top: 7px;
    padding: 0;
    line-height: 130%;
}

div.sphinxsidebar ul ul {
    margin-left: 1rem;
    list-style-type: none;
    font-size: .9em;
}

/* De-dent the first list because we hide the top-level item */
.sphinxsidebar .sphinxsidebar-navigation__contents > ul > li > ul {
    margin-left: 0;
}

div.sphinxsidebar p.caption {
    font-weight: 300;
    font-size: 1.2rem;
}

div.sphinxsidebar li.current > a {
    font-weight: 600;
}

.sphinxsidebar-navigation__contents > ul > li > a {
    display: none;
}

div.sphinxsidebar #searchbox {
    margin: 12px 0 20px 0;
}

div.footer {
    background-color: var(--colour-sphinx-blue);
    color: #ccc;
    text-shadow: 0 0 .2px rgba(255, 255, 255, 0.8);
    padding: 3px 8px 3px 8px;
    clear: both;
    font-size: 0.8em;
}

/* no need to make a visible link to Sphinx on the Sphinx page */
div.footer a {
    color: #ccc;
}

/* -- body styles ----------------------------------------------------------- */

p {
    margin: 0.8em 0 0.5em 0;
}

a {
    color: var(--colour-links-light);
    text-decoration: none;
}

div.body a {
    text-decoration: underline;
}

h1 {
    margin: 10px 0 0 0;
    font-size: 2.4em;
    color: var(--colour-sphinx-blue);
    font-weight: 300;
}

h1 span.pre {
    /* for code in titles */
    word-break: break-all;
    white-space: normal;
}

h2 {
    margin: 1em 0 0.2em 0;
    font-size: 1.5em;
    font-weight: 300;
    padding: 0;
    color: #174967;
}

h3 {
    margin: 1em 0 -0.3em 0;
    font-size: 1.3em;
    font-weight: 300;
}

div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a {
    text-decoration: none;
}

div.body h1 a tt, div.body h2 a tt, div.body h3 a tt, div.body h4 a tt, div.body h5 a tt, div.body h6 a tt {
    color: var(--colour-sphinx-blue) !important;
    font-size: inherit !important;
}

a.headerlink {
    color: var(--colour-sphinx-blue) !important;
    font-size: .8em;
    margin-left: 6px;
    padding: 0 4px 0 4px;
    text-decoration: none !important;
}

a.headerlink:hover {
    background-color: #ccc;
    color: white!important;
}

/* avoid font-size when :mod: role in headings */
h1 code, h2 code, h3 code, h4 code {
    font-size: inherit;
}

cite, code, tt {
    font-family: 'Consolas', 'DejaVu Sans Mono',
                 'Bitstream Vera Sans Mono', monospace;
    font-size: 1em;
    letter-spacing: -0.02em;
}

table.deprecated code.literal {
    word-break: break-all;
}

tt {
    background-color: #f2f2f2;
    border: 1px solid #ddd;
    border-radius: 2px;
    color: #333;
    padding: 1px 0.2em;
}

tt.descname, tt.descclassname, tt.xref {
    border: 0;
}

hr {
    border: 1px solid #abc;
    margin: 2em;
}

a tt {
    border: 0;
    color: var(--colour-links-light);
}

pre {
    font-family: 'Consolas', 'Courier New', 'DejaVu Sans Mono',
                 'Bitstream Vera Sans Mono', monospace;
    font-size: 1em;
    letter-spacing: 0.015em;
    line-height: 120%;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 2px;
    background-color: #f8f8f8;
}

pre a {
    color: inherit;
    text-decoration: underline;
}

td.linenos pre {
    padding: 0.5em 0;
}

div.quotebar {
    background-color: #f8f8f8;
    max-width: 250px;
    float: right;
    padding: 0px 7px;
    border: 1px solid #ccc;
    margin-left: 1em;
}

blockquote.epigraph {
    font-size: 1.5em;
    padding-left: 1rem;
    margin-left: 0;
}

nav.contents,
div.topic,
aside.topic {
    background-color: #f8f8f8;
}

table {
    border-collapse: collapse;
    margin: 0 -0.5em 0 -0.5em;
}

table td, table th {
    padding: 0.2em 0.5em 0.2em 0.5em;
}

div.admonition, div.warning {
    font-size: 0.9em;
    margin: 1em 0 1em 0;
    border: 1px solid #86989B;
    border-radius: 2px;
    background-color: #f7f7f7;
    padding: 1rem;
}

div.admonition > p, div.warning > p {
    margin: 0;
    padding: 0;
}

div.admonition > pre, div.warning > pre {
    margin: 0.4em 1em 0.4em 1em;
}

div.admonition > p.admonition-title,
div.warning > p.admonition-title {
    font-weight: bold;
}

div.warning {
    border: 1px solid #940000;
}

div.admonition > ul,
div.admonition > ol,
div.warning > ul,
div.warning > ol {
    margin: 0.1em 0.5em 0.5em 3em;
    padding: 0;
}

div.admonition div.highlight {
    background: none;
}

.viewcode-back {
    font-family: var(--fonts-sans-serif);
}

div.viewcode-block:target {
    background-color: #f4debf;
    border-top: 1px solid #ac9;
    border-bottom: 1px solid #ac9;
}

.math {
    font-size: 0.9em;
}

.last-update .date {
    font-weight: 600;
    color: #0A507A;          /* un azul suave que contraste */
    background-color: #E6F0FA; /* fondo muy suave */
    padding: 0 0.3em;
    border-radius: 3px;
}

/* Columned toctree */
.keyword-columns ul {
    columns: 4;
    column-gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.keyword-columns li {
    break-inside: avoid;
    padding: 2px 0;
}

/* Custom roles */

.varenv-role {
    font-family: monospace;
    background: #faf3dd;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #d4a373;
    color: #3b2f2f;
}

.filext-role {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: tomato;
}

.filename-role {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: #059669;
}

.filepath-role {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: #dc2626;
}

.guielem-role {
    font-family: monospace;
    font-size: 1.1em;
    color: #059669;
}

.menu-role {
    font-family: monospace;
    color: tomato;
}

.program-role {
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: #2563eb;
}

/* Variables */
.variable-card {
    border: 1px solid #e2e8f0;
    border-left: 5px solid #f97316;
    border-radius: 8px;
    background: #fefaf6;
    padding: 0px 16px;
    padding-bottom: 0.5em;
    margin: 12px 0;
}

.variable-card .var-name {
    font-family: "JetBrains Mono", monospace;
    font-size: 1.05em;
    font-weight: bold;
    color: #c2410c;
    margin-top:0.5em;
}

.variable-card .var-type {
    font-size: 0.85em;
    color: #92400e;
    font-style: italic;
}

.variable-card .var-desc {
    color: #4b5563;
}

.highlight-bash_extension {
    font-family: "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 1.0em;
}

/* Tokens pygments */

:root {
    --fp-blue: #2563eb;       /* azul intenso para comandos */
    --fp-green: #059669;      /* verde suave para variables */
    --fp-purple: #7c3aed;     /* morado para extensiones */
    --fp-yellow: #ca8a04;     /* dorado para strings */
    --fp-orange: #ea580c;     /* naranja para opciones */
    --fp-cyan: #0ea5e9;       /* cian para rutas */
    --fp-red: #dc2626;        /* rojo para operadores */
    --fp-gray: #475569;       /* gris para argumentos */
}

/* ============================
   ASIGNACIÓN DE TOKENS PYGMENTS
   ============================ */

/* Variables: $HOME, ${PATH} */
.highlight .nv {
    color: var(--fp-blue);
}

/* Rutas: /usr/bin, ./foo/bar */
.highlight .nn {
    color: var(--fp-cyan);
    font-weight: 600;
}

/* Extensiones: .py .cif */
.highlight .nc {
    color: var(--fp-purple);
    font-weight: 600;
}

/* Comentarios */
.highlight .c {
    color: var(--fp-gray);
    font-style: normal;
}

/* Opciones: -a --help */
.highlight .k {
    color: var(--fp-orange);
    font-weight: normal;
}

/* Strings */
.highlight .s {
    color: var(--fp-yellow);
}

/* Números */
.highlight .m {
    color: var(--fp-yellow);
    opacity: 0.85;
}

/* Comandos: mkdir, cd, rsync */
.highlight .nf {
    color: var(--fp-green);
    font-weight: normal;
}

/* Operadores: | & > < */
.highlight .o {
    color: var(--fp-red);
    font-weight: 700;
}

/* Texto normal / argumentos */
.highlight .w,
.highlight .n,
.highlight .p,
.highlight .x,
.highlight .err,
.highlight .pre,
.highlight .txt,
.highlight .text,
.highlight .t {
    color: var(--fp-orange);
}

/* Texto sin clase asignada */
.highlight pre {
  color: var(--fp-orange);
  font-weight: normal; 
}

.arg {
    color: var(--fp-orange);
    font-weight: 600;
}

.keyword {
    color: var(--fp-green);
    font-weight: 600;
}

/* media queries */

/* Reduce padding & margins for smaller screens */
@media (max-width: 750px) {

    .sphinxsidebar {
        /*display: none;*/
        transform: translateX(-110%);
    }

    .sphinxsidebar.show {
        /*display: block;*/
        min-width:200px;
        background-color: #f8f8f8;
        transform: translateX(0);
        transition: transform 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        width:100%;
    }

    div.body {
        border-left: none;
        max-width: 100vw;
    }

    .pageheader {
        position: sticky;
        top:0;
        z-index: 1000;
    }

    .pageheader h1 {
        font-size: 1.8em;
    }

    .pageheader img {
        height: 4vh;
        width: auto;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 40px;
        height: 24px;
        cursor: pointer;
        margin-right: 1em;
    }

    .menu-toggle span {
        display: block;
        height: 4px;
        background-color: var(--colour-sphinx-blue);
        border-radius: 2px;
        margin-right: 10px;
    }
}
