/* Copyright (C) 2024  Niels Martignène <niels.martignene@protonmail.com>

   Permission is hereby granted, free of charge, to any person obtaining a copy of
   this software and associated documentation files (the “Software”), to deal in
   the Software without restriction, including without limitation the rights to use,
   copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
   Software, and to permit persons to whom the Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in all
   copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   OTHER DEALINGS IN THE SOFTWARE. */

@media screen and (max-width: 1300px) {
    #side menu {
        width: auto;
        margin: 16px;
        padding: 16px;
        position: static;
    }

    #side ~ main { padding-right: 16px; }

    button > span { display: none; }
}

@media screen and (max-width: 960px) {
    html { scroll-padding-top: calc(var(--small_height) + 10px); }

    #top menu {
        height: var(--small_height);
        padding-top: 16px;
        padding-left: 60px;
        flex-direction: column;
        gap: 0;
        align-items: start;
        z-index: 8;
    }
    #top li a {
        font-size: 1.1em;
        line-height: 1.6em;
    }
    #top li > a:hover, #top li.active > a { margin-bottom: -2px; }
    #top li > a { border-bottom: none; }
    .js #top li > a, .nojs #top:not(:hover) li > a { display: none; }
    .nojs #top:hover menu, #top.active menu {
        height: auto;
        gap: 4px;
    }
    #top.active li > a, .nojs #top li.active > a { display: block !important; }
    #top li.active > div, .nojs #top li:hover > div { position: static; }

    #side a {
        font-size: 1.1em;
        line-height: 1.6em;
    }

    footer {
        flex-direction: column;
        padding: 0.5em;
        gap: 6px;
        text-align: center;
    }
    footer > img { display: none; }

    #logo {
        height: 100%;
        margin: 0 auto;
        transform: translate(-10px, 0);
    }
    .js #top.active #logo { display: none; }
    .nojs #top:hover #logo { display: none; }

    :is(#deploy, .deploy) {
        display: block !important;
        position: fixed;
        width: 42px;
        height: 40px;
        top: 10px;
        left: 8px;
        padding: 0;
        background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAOUlEQVQ4T2O0sLD4z0ADwDhqMCxUGWkQvGAjRw2GhyztgmI0HcPTMc2CYjSDDOGygmapYtRgWKoAAGrCE+uzrIQ5AAAAAElFTkSuQmCC");
        background-repeat: no-repeat;
        background-position: center;
        z-index: 999;
        cursor: pointer;
    }
    .nojs #deploy { pointer-events: none; }

    pre { margin: 1em 0; }

    .alert {
        margin-left: 0.4em;
        margin-right: 0.4em;
    }
}
