/*
:filename: statics/clamming.css
:author: Brigitte Bigi
:contact: contact@sppas.org
:summary: Style to be used for Auto-CS documentations.

..
    This file is part of Auto-CS: <https://autocs.sourceforge.io>
    -------------------------------------------------------------------------

    Copyright (C) 2021-2026  Brigitte Bigi, CNRS
    Laboratoire Parole et Langage, Aix-en-Provence, France

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

    This banner notice must not be removed.

    -------------------------------------------------------------------------

*/

/* =======================================================================
                           VARIABLE RE-DEFINITIONS
  ======================================================================== */

:root {
    /* HEADER/FOOTER */
    --header-slidein: animDisabled;
    --footer-slidein: animDisabled;
    --header-height: max(calc(12rem / var(--size-divisor)), 7rem);
    --footer-height: max(calc(6rem / var(--size-divisor)), 4rem);

    --toc-width: 18rem;
    --border-width: 6px;

    /* CARDS */
    --card-border-radius: 0.8rem;
    --card-border-width: 0;

}

:root:not(.contrast) {
    --border-width: 2px;
    --border-radius: 4px;
}

.contrast {
    --border-width: 3px;
    --border-radius: 6px;
}


/* --------------------------------------- */
/* Variables for light mode                */
/* --------------------------------------- */
:root:not([data-theme=dark]), [data-theme=light], .light {

    --bg-color: rgb(245, 250, 245);
    --bg-color-alt: rgb(237, 250, 235); /*#CFF5C6;*/
    --fg-color: #023306;
    --fg-color-alt: #183302;

    --h1-color: rgb(110, 90, 50);
    --h2-color: rgb(130, 65, 25);
    --h3-color: rgb(175, 85, 0);
    --h4-color: rgb(130, 65, 25);
    --h5-color: rgb(90, 110, 80);
    --h6-color: rgb(90, 110, 80);
    --blockquote-border-color: rgb(88, 126, 105);
    --blockquote-footer-color: rgb(88, 126, 105);

    --buttons-fg-color: #023306;
    --buttons-bg-color: rgb(211, 237, 209);
    --border-color: rgb(128, 160, 128);
    --table-row-stripped-bg-color: rgb(235, 250, 239);
    --table-head-bg-color: rgb(215, 225, 215);
    --table-head-fg-color: rgb(30, 30, 40);
    --table-caption-bg-color: rgb(230, 235, 245);
    --table-caption-fg-color: rgb(30, 30, 40);
    --li-color: rgb(175, 85, 0);
    --a-color: rgb(45, 105, 165);

    --header-fg-color: rgb(10, 50, 20);
    --nav-fg-color: rgb(10, 50, 20);
    --header-bg-color: linear-gradient(170deg, rgb(240, 255, 245) 0%, rgb(228, 245, 211) 42%, rgb(220, 250, 228) 68%, rgb(87, 199, 133) 100%);
    --nav-bg-color: transparent;

    --footer-fg-color: rgb(10, 50, 20);
    --footer-bg-color: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-color-alt) 30%, rgb(250, 250, 200) 70%, rgb(187, 207, 217) 100%);
}

/* --------------------------------------- */
/* Variables for dark mode                 */
/* --------------------------------------- */

@media not print {
    .dark {
        --bg-color: rgb(20, 25, 20);
        --bg-color-alt: rgb(40, 60, 40);

        --fg-color: rgb(245, 248, 246);
        --fg-color-alt: rgb(240, 245, 215);

        --h1-color: rgb(245, 175, 100);
        --h2-color: rgb(240, 185, 80);
        --h3-color: rgb(235, 215, 90);
        --h4-color: rgb(194, 213, 208);
        --h5-color: rgb(184, 203, 208);
        --h6-color: rgb(184, 203, 208);

        --li-color: rgb(224, 243, 228);

        --blockquote-border-color: rgb(95, 150, 135);
        --blockquote-footer-color: rgb(95, 150, 135);
        --buttons-fg-color: #e6f3ea;
        --buttons-bg-color: rgb(50, 80, 60);

        --border-color: rgb(200, 220, 200);

        --table-row-stripped-bg-color: #13231a;
        --table-head-bg-color: #1a2e22;
        --table-head-fg-color: #e6f3ea;
        --table-caption-bg-color: #15271d;
        --table-caption-fg-color: #e6f3ea;

        --a-color: #7fbbe0;

        --header-fg-color: #e6f3ea;
        --nav-fg-color: #e6f3ea;
        --header-bg-color: linear-gradient(
            170deg,
            #0f1b14 0%,
            #14241a 42%,
            #173022 68%,
            #1f5a3a 100%
        );
        --nav-bg-color: transparent;

        --footer-fg-color: #e6f3ea;
        --footer-bg-color: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-color-alt) 30%, rgb(20, 25, 20) 70%, rgb(30, 38, 31) 100%);
    }
}


/* Increase the bg/fg contrast of some colors in the default mode */
.contrast:not(.dark) {
    --a-color: rgb(0, 70, 100);
}


html {
    margin-left: calc(var(--toc-width) + 1rem);
}


/* too small titles ... make them bigger */
h4 {
    font-size: calc(1.3 * var(--font-size));
    letter-spacing: calc(1.4*var(--letter-spacing));
    color: var(--h4-color);
    font-weight: var(--font-weight-semibold);
}

/* functions */
h4 {
    margin-top: calc(2 * var(--typography-spacing-vertical));
    color: #0066BB;  /* Name.function in code.css */
}

h5 {
    font-size: calc(1.1 * var(--font-size));
    letter-spacing: calc(1.2*var(--letter-spacing));
    color: var(--h5-color);
}

summary {
    padding: 0.5em;
    color: var(--fg-color-alt);
    background-color: var(--bg-color-alt);
    border-radius: var(--border-radius);
}

/* ============================================================ */

#nav-book {
    box-shadow: none;
}

nav#nav-book:not(.dark) {
    background: linear-gradient(180deg,
    rgb(97, 197, 127) 0%,
    rgb(211, 237, 209) 20%,
    rgb(155, 219, 147) 40%,
    rgb(211, 237, 209) 70%,
    rgb(97, 197, 127) 100%);
}

.dark nav#nav-book {
    background: linear-gradient(180deg,
    #0f1b14 0%,
    #0f1b14 10%,
    #173022 30%,
    rgb(10, 60, 10) 50%,
    rgb(10, 45, 5) 70%,
    #0f1b14 100%);
}

/* =======================================================================
                              OTHER DEFINITIONS
  ======================================================================== */

.small-logo  {
    max-height: 3.5rem;
    width: auto;
}

.card {
    background: var(--bg-color-alt);
    box-shadow: none;
    border: 1px solid var(--buttons-bg-color);
}

.card header, .card footer {
    background: var(--bg-color-alt);
}

.card header span {
    font-size: 250%;
    position: relative;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left: 2rem;
    padding-right: 2rem;
    margin: auto;
    text-align: center;
}

.card > * > a[role=button], .card > * > button {
    border: 1px solid var(--li-color);
    padding: 1rem;
}
.card > * > a[role=button]:hover, .card > * > button:enabled:hover {
    border: calc(var(--border-width)/2) dashed var(--a-color);
}


/* =======================================================================
                              BOOK NAVIGATION
  ======================================================================== */

/* nav buttons used to browse throw modules/classes */

nav.side-nav > ul, nav.side-nav > hr, nav.side-nav > h1, nav.side-nav > h2 {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

nav.side-nav h1 {
    font-size: 130%;
    font-weight: var(--font-weight-black);
}

nav.side-nav h2 {
    font-size: 120%;
    font-weight: var(--font-weight-bold);
}

nav.side-nav a[role=button], nav.side-nav button {
    width: calc(0.75*var(--toc-width));
    height: calc(3*var(--font-size));
    display: flex;
    justify-content: center;
    flex-direction: column;
    margin-bottom: 0.5rem;
}


/* =======================================================================
                              PRINTING
  ======================================================================== */

@media print {
    html {
        margin-left: unset;
    }

    body > header {
        display: none;
    }
    body > nav {
        display: none;
    }
    body > footer {
        display: none;
    }

    nav.side-nav {
        display: none;
        /* Migrate to a top nav for printing or small screens
        color: inherit;
        width: 100%;
        position: absolute;
        padding-top: 1rem;
        padding-bottom: 0.3rem;
        margin: 0 auto;
        font-size: 90%;
        overflow: unset; */
    }

    #toc-content {
        margin-left: 1rem;
    }
}
