/*
Theme Name: ROBIN MEIER THEME
Theme URI: 
Author: jjj
Author URI: https://joanajost.fr
Description: thème wp personnalisé pour archive/portfolio rmw, designed by ac+ll. connected to github
Version: 26.03.20
Text Domain: theme for robin meier
*/


:root {
    /* couleurs */
    --background: #0a0a0a;
    --primary: #FAF9F6;
    --secondary: #929292;

    /* admin bar height (overridden in body.admin-bar) */
    --admin-bar-height: 0px;

    /* fonte */
    --main-font: "neue-haas-grotesk-display", sans-serif;

    /* tailles police */
    --fontsize-big: 12pt;
    --fontsize-small: 10pt;

    /* big : 12pt -> 14pt */
    --fontsize-big: clamp(12pt,
            calc(12pt + (2 * (100vw - 1500px) / 500)),
            14pt);

    /* small : 10pt -> 11pt */
    --fontsize-small: clamp(10pt,
            calc(10pt + (1 * (100vw - 1500px) / 500)),
            11pt);

    /* tailles */
    --col: calc(100vw / 12);
    --2col: calc(var(--col) * 2);
    --3col: calc(var(--col) * 3);
    --4col: calc(var(--col) * 4);
    --5col: calc(var(--col) * 5);
    --6col: calc(var(--col) * 6);
    --7col: calc(var(--col) * 7);
    --8col: calc(var(--col) * 8);
    --9col: calc(var(--col) * 9);
    --10col: calc(var(--col) * 10);
    --11col: calc(var(--col) * 11);

    --small-marge: 0.2rem;
    --medium-marge: 0.4rem;
    --big-marge: 0.8rem;

    --button-padding: var(--medium-marge) var(--big-marge);

    /* mesures */
    --big-marge-button-height: 2.8rem;
    --header-height: 2rem;
    /* à modifier avec la hauteur réelle */
    /* --vh-100-header: calc(100dvh - var(--header-height)); */
    /* --vh-100-header: calc(100vh - calc(var(--header-height) + var(--admin-bar-height, 0))); */
    --vh-100-header: calc(100dvh - var(--header-height) - var(--admin-bar-height));

    /* styles */
    --white-border: 1px solid var(--primary);
}

/* réglages et réinitialisation */

* {
    box-sizing: border-box;
    /* list-style: none; */
}


html {
    font-size: var(--fontsize-big);
}

@supports (-webkit-appearance: none) and (not (-moz-appearance: none)) {
    ::-webkit-scrollbar {
        display: none;
    }

    html,
    body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}



::selection {
    background: var(--primary);
    color: var(--background);
}

::-moz-selection {
    background: var(--primary);
    color: var(--background);
}

input::selection,
textarea::selection {
    color: var(--primary);
    background: var(--background);
}

input::-moz-selection,
textarea::-moz-selection {
    color: var(--primary);
    background: var(--background);
}


body {
    background-color: var(--background);
    color: var(--primary);
    font-family: var(--main-font);

    /* fonte */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
    font-kerning: normal;
    font-feature-settings: "liga", "kern";
    line-height: 1.2;
}

/* réinitialisations */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    margin: 0;
    padding: 0;
    color: inherit;
}

button {
    font-family: inherit;
    color: inherit;
    background-color: inherit;
    font-size: inherit;
    margin: 0;
    padding: 0;
    border: none;
    text-align: left;

    cursor: pointer;
}

input,
textarea,
select {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

textarea:focus,
input:focus {
    outline: none;
    box-shadow: none;
}


a {
    color: var(--primary);
    text-decoration: none;
}

/* a:hover {
    color: var(--secondary);
} */


/* bouton rechercher */
#search-toggle {
    position: fixed;
    top: var(--admin-bar-height, 0);
    right: 0;
    text-align: right;

    z-index: 20;
    padding: var(--button-padding);
}

/* ----------------------------------
                HEADER 
------------------------------------- */
.main-header {
    display: flex;
    position: fixed;
    top: var(--admin-bar-height, 0);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 26;
    height: fit-content;
    width: fit-content;
}

.site-title {
    width: var(--2col);
    background-color: var(--primary);
    color: var(--background);
    margin-right: var(--col);

    min-width: fit-content;
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    color: inherit;
}

.menu-page-about-header-container {
    width: var(--col);
    background-color: var(--background);
}

.menu-toggle,
.mobile-menu {
    display: none;
}

body.no-scroll {
    overflow: hidden;
}

/* Admin bar - Desktop 32px, Mobile 46px */
body.admin-bar {
    --admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --admin-bar-height: 46px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* GENERAL */

    :root {
        /* tailles police */
        --fontsize-big: 12pt;
        --fontsize-small: 10pt;

        /* mesures */
        --header-height: 2.8rem;
        /* --button-padding: var(--medium-marge) var(--big-marge); */
        --button-padding: var(--big-marge);

        /* --vh-100-header: calc(100dvh - var(--header-height) - var(--admin-bar-height)); */

    }

    .main-header {
        inset: unset;
        bottom: unset;
        left: unset;
        bottom: 0;
        left: 0;
        width: 100vw;
    }

    #menu-about-desktop,
    .menu-about-page,
    .search-toggle {
        display: none;
    }

    .site-title {
        margin-right: 0;
        padding: 0;
        width: 50%;
    }

    .site-title a {
        width: 100%;
        display: block;
        padding: var(--button-padding);
    }

    .menu-toggle {
        display: block;
        background: var(--background);
        cursor: pointer;
        width: 50%;
        text-align: left;
    }

    .menu-toggle span {
        padding: var(--button-padding);
    }

    #search-toggle {
        display: none !important;
    }

    .mobile-menu {
        display: none;
        position: fixed;
        left: 0;
        width: 100%;
        height: var(--vh-100-header);
        background-color: var(--background);
        z-index: 25;
        overflow-y: auto;
        top: var(--admin-bar-height, 0);
    }

    .mobile-menu.is-open {
        display: block;
    }

    .mobile-menu__search {
        position: absolute;
        top: 0;
        left: 0;
        padding: var(--button-padding);
        border-bottom: var(--white-border);
        width: 100%;
        text-align: left;
    }

    .mobile-menu__bottom {
        position: absolute;
        bottom: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .mobile-menu__bottom>* {
        /* border-bottom: var(--white-border); */
        width: 100%;
    }

    .mobile-menu__bottom>*:first-child {
        border-top: var(--white-border);
    }

    .menu-page-about-header-container {
        padding: 0;
        border-top: var(--white-border);
    }

    .mobile-menu__bottom a,
    .mobile-menu__bottom button {
        width: 100%;
        height: fit-content;
        display: block;
        padding: var(--button-padding);
    }

    .mobile-menu__archive-list {
        display: none;
    }

    /* état actif (panneau ouvert) */
    .mobile-menu__archive.is-active {
        position: fixed;
        top: var(--admin-bar-height, 0);
        color: var(--background);
        z-index: 35;
        background-color: var(--primary);
        width: 50%;
        cursor: default;
        border-bottom: none;
    }


    /* SEARCH */

    .mobile-menu__archive-list.is-visible {
        display: block;
    }

    body.no-scroll {
        overflow: hidden;
    }

    body.menu-open .site-header .site-title a {
        color: var(--primary);
        border-top: var(--white-border);
        background-color: var(--background);
    }

    body.menu-open .menu-toggle {
        color: var(--background);
        border-top: var(--white-border);
        background-color: var(--primary);
    }
}