body {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
}

nav {
    height: 100%;
    min-height: 100vh;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    padding: 0px;
    margin: 0px;
    background-color: white;
    border-right: 1px solid #cccccc;
}

footer {
    grid-column: 2;
    padding-top: 1em;
    padding-bottom: 6px;
    text-align: center;
    font-size: small;
}

footer a {
    color: gray;
    text-decoration: unset;
}

footer a:hover {
    text-decoration: underline;
}

nav a {
    display: block;
    color: unset;
    text-decoration: none;
    height: 32px;
    line-height: 32px;
    padding: 6px 28px 6px 16px;
}

nav a.current {
    background-color: var(--main-bg-color);
    color: white;
}

nav a:hover {
    background-color: #f0f0f0;
}

nav a.current:hover {
    background-color: var(--main-bg-color);
}

nav a.disabled {
    color : grey;
    cursor: default;
}

nav a.disabled:hover {
    background-color: white;
}

nav a[href="logout.php"] {
    color: #880000;
}

nav a i {
    margin-right: 4px;
}

nav div.separator {
    padding: 12px 6px;
    border-top: 1px solid #cccccc;
    text-align: center;
    font-size: small;
    color: #888888;
}


a.button {
    display: inline-block;
    margin: .25em 4px;
    padding: 4px 8px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: unset;
    text-align: center;
}

a.button:hover {
    background-color: white;
}


main {
    grid-column: 2;
}


main h2 {
    margin-top: 2em;
    font-size: larger;
    text-indent: 2ex;
}


section {
    max-width: 800px;
    margin: 1em auto;
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #cccccc;
}

section a {
    color: var(--main-bg-color);
    text-decoration: none;
}

/* Tags */

.taglist {
    display: flex;
    flex-wrap: wrap;
    row-gap: 2px;
    column-gap: 4px;
}

.taglist.vertical {
    flex-direction: column;
    row-gap: 1px;
}

.tag {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 1px 3px;
    border-radius: 2px;
    border: 1px solid;
    background-color: white;
    white-space: nowrap;
}

.tag.selected {
    border: 3px solid;
    font-weight: bold;
    z-index: 1;
}

.tag.selected::after {
    box-sizing: border-box;
    margin: 0px;
    padding: 0px;
    width: 10px;
    text-align: center;
    position: absolute;
    top: -5px;
    right: -5px;

    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
    line-height: 10px;
    content: "\f14a";
    background-color: white;
}

.tag.tag-concept {
    background-color: rgb(158, 203, 255);
}

.tag.tag-stage {
    background-color: rgb(255, 221, 158);
}

.tag.tag-yes {
    background-color: rgb(186, 255, 195);
}

.tag.tag-maybe {
    background-color: rgb(255, 250, 186);
}

.tag.tag-no {
    background-color: rgb(255, 186, 186);
}

.comment {
    color: #888888;
    font-style: italic;
    margin: 0;
}

blockquote {
    border: none;
    font-family: Georgia, "Times New Roman", Times, serif;
    color: #888888;
    font-style: italic;
}

blockquote:before {
    content: open-quote;
    font-weight: bold;
    font-size: 50px;
    color: #888888;
}

blockquote:after {
    content: close-quote;
    font-weight: bold;
    font-size: 50px;
    color: #888888;
}

div.profil-title {
    display: flex;
    justify-content: start;
    align-items: center;
    margin-bottom: 1em;
}

div.profil-title h3 {
    margin: 0;
}

div.profil-title a {
    color: var(--main-bg-color);
    text-decoration: none;
    margin-left : 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #cccccc;
    margin-bottom: 0.5em;
}

table th, table td {
    padding: 3px 6px;
}

table th {
    text-align: unset;
}

table td {
    background-color: #f8f8f8;
}

table.alternate > tbody > tr:nth-of-type(odd) td {
    background-color: #e8e8e8;
}

table.interactive tr:hover td {
    cursor: pointer;
    opacity: 0.8;

}

dt {
    font-weight: bold;
}

dl {
    max-width: 600px;
    margin: 1em auto;
    display: grid;
    grid-template-columns: auto auto;
    border: 1px solid #cccccc;
}

dt, dd {
    background-color: #f8f8f8;
    margin: 0px;
    padding: 6px 12px;
}

dt:nth-of-type(odd), dd:nth-of-type(odd) {
    background-color: #e8e8e8;
}

.tabs {
    display: flex;
    align-items: flex-end;
    padding-left: 8px;
}

.tab {
    display: block;
    transform: translateY(1px);
    margin: 8px 1px 0px 1px;
    padding: 4px 12px;
    border: 1px solid #cccccc;
    border-radius: 4px 4px 0px 0px;
    background-color: #d8d8d8;
    color: #666666;
}

.tab.selected {
    border-bottom: 1px solid white;
    color: black;
    background-color: white;
}


div.user-profil {
    display: grid;
    /* The firs column has less space than the second one */
    grid-template-columns: 1fr 3fr;
    /* On mobile, we want the columns to be stacked */
    grid-template-rows: auto auto;
}

div.number {
    width: 150px;
    height: 140px;
    background-color: #335D72;
    color: white;
    /* Center the text */
    display: flex;
    justify-content: center;
    font-size: 115px;
    font-weight: bold;
    /* The text has to be centered horizontally */
    text-align: center;
    /* The text has to be centered vertically */
    align-items: center;
    /* The square has border on top with a red color */
    border-top: 10px solid #C8243D;
}

div.number .border {
    background-color: #EDBF2E;
    width: 150px;
    height: 10px;
    position: absolute;
    margin-top : -130px;
}

div.number p {
    font-family: "Arvo", serif;
    font-weight: 700;
    font-style: normal;
    text-shadow: 2px 2px 0px #C8243D, 2px -2px 0px #C8243D, -2px 2px 0px #C8243D, -2px -2px 0px #C8243D;
}

ul.badges {
    padding: 0;
    max-width: 600px;
    margin: 1em auto;
    border: 1px solid #cccccc;
}

/* Emoji and text are in grey */
.badge.locked {
    color: #888888!important;
    filter: grayscale(100%);
    opacity: 0.5;
}

/* Authentification */

form.login {
    max-width: 360px;
    margin: 1em auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid #cccccc;
}

form.login label {
    flex-grow: 1;
    display: flex;
    margin: 4px 0px;
    padding: 0px;
}

form.login label:not(:has(input[type="checkbox"])) {
    background-color: var(--main-bg-color);
    border: 1px solid var(--main-bg-color);
}

form.login i {
    height: 48px;
    width: 48px;
    line-height: 48px;
    text-align: center;
    color: white;
}

form.login input:not([type="checkbox"]) {
    flex-grow: 1;
    height: 48px;
    margin: 0px;
    padding: 0px 6px;
    border: unset;
    border-radius: 0px;
}

form.login input[type="submit"] {
    margin-top: 4px;
    background-color: var(--main-bg-color);
    color: white;
    cursor: pointer;
}

form.login a {
    display: block;
    margin: 1em auto;
    text-align: center;
    font-size: small;
    color: #888888;
}

form.login div#message {
    color: #e64e4e;
    text-align: center;
    margin: 12px auto;
}


/* Candidature */
form#candidater #roles {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    row-gap: 4px;
    column-gap: 8px;
}

form#candidater textarea {
    width: 100%;
    resize: vertical;
    font-family: unset;
    font-size: small;
}

form#candidater #controls {
    margin: auto;
    text-align: center;
}

form#candidater #controls > * {
    margin: 3px 6px;
    padding: 4px 8px;
    border: 1px solid;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 100%
}

form#candidater #controls > *:hover {
    opacity: 0.8;
}

form#candidater #controls input[type="submit"] {
    border-color: var(--main-bg-color);
    background-color: var(--main-bg-color);
    color: white;
}

form#candidater #controls input[type="submit"][disabled] {
    border-color: lightgray;
    background-color: lightgray;
    cursor: default;
    color: white;
}

form#candidater #controls a.danger {
    border-color: var(--main-danger-color);
    background-color: var(--main-danger-color);
    color: white;
    white-space: pre;
}

form#candidater #controls a {
    border-color: #888888;
    background-color: #f0f0f0;
    color: unset;
}

#article-content img {
    width: 100%;    
}

thead.sortable th[onclick] {
    cursor: pointer;
}

thead.sortable th[onclick]::after {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f0dc";
    margin-left: 3px;
}

thead.sortable th[onclick].sorted-asc::after {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f0d8";
    margin-left: 3px;
}

thead.sortable th[onclick].sorted-desc::after {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    content: "\f0d7";
    margin-left: 3px;
}

#controls button {
    font-size: large;
}

@media (min-width: 701px) {
    .mobile-only {
        display: none;
    }
}


@media (max-width: 700px) {

    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    nav, main {
        border-left: unset;
        border-right: unset;
    }

    nav {
        grid-row: 1;
        grid-column: 1;
        padding-top: 0px;
        margin-right : 0px;
        height: auto;
        min-height: unset;
        border-bottom: 1px solid #cccccc;
    }

    nav a {
        padding: 6px 6px 6px 6px;
    }

    nav .separator {
        max-width: 100vw;
    }

    main {
        grid-row: 2;
        grid-column: 1;
    }

    footer {
        grid-row: 3;
        grid-column: 1;
    }

    div.user-profil {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        justify-items: center;
    }

    /* Tables */

    /** S'applique à tous les tableaux excepté ceux qui sont dans la div.calendar */

    :not(#calendar) > thead, .desktop-only {
        display: none;
    }

    :not(#calendar) > table > tr {
        display: block;
        width: 100%;
    }

    :not(#calendar) > table td {
        display: block;
        text-align: right;
    }

    :not(#calendar) > table td:before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }

    :not(#calendar) > thead.sortable {
        display: flex;
        font-size: large;
    }

    :not(#calendar) > thead.sortable th[onclick] {
        display: block;
    }

    :not(#calendar) > thead.sortable > th[onclick]::after {
        float: right;
    }

    /* Menu déroulant */

    .menu-container {
        overflow-y: hidden;
        transition: max-height 0.5s ease;
        max-height: 700px;
    }

    #menu-switch {
        background-color: white;
        max-width: 100vw;
    }

    #menu-switch:hover {
        cursor: pointer;
    }

    #menu-open {
        display: none;
    }

    nav.closed #menu-open {
        display: block;
    }

    nav.closed #menu-close {
        display: none;
    }

    nav.closed .menu-container {
        max-height: 0px;
    }
}