/* Polices */

@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/robotomono/v13/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_SuW4Ep0.woff2) format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
    }
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/robotomono/v13/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vq_ROW4.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/robotomono/v13/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_Of2_SuW4Ep0.woff2) format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
    }
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/robotomono/v13/L0xuDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_Of2_ROW4.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }


/* Structure */

html {
    scroll-behavior: smooth;
}

body {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;

    font-family: 'Roboto Mono', monospace;
    font-size: 12pt;
    background-color: #222;
    color: white;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

    header img {
        height: 40pt;
        margin-right: 30pt;
    }

    header div {
        font-size: 32pt;
        font-weight: bold;
    }

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

    nav a {
        display: inline-block;
        padding: 5px 10px;
        margin: 5px 10px;
        background-color: #333;
        border: 1px solid #333;
    }
    nav a:hover {
        background-color: #444;
        border: 1px solid white;
        font-style: inherit;
    }

footer {
    margin-top: 40px;
    border-top: 2px solid #333;
    padding: 20px;
    text-align: center;
    color: #444;
}

form#deconnexion {
    margin-top: 30px;
}


/* Éléments de texte */

a {
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid white;
}
a:hover {
    font-style: italic;
}

p, ul, ol {
    margin-top: 5px;
    margin-bottom: 10px;
    line-height: 160%;
}
@media screen and (min-width: 500px) {
p, ul, ol {
    text-align: justify;
}}

li {
    margin-top: 0px;
    margin-bottom: 5px;
}

h1 {
    line-height: 120%;
    text-transform: uppercase;
}

    img.h1logo {
        width: 30%;
        max-width: 200px;
        max-height: 120px;
        object-fit: contain;
        object-position: top right;
        float: right;
        margin: 0 0 20px 40px;
    }

    p.wikipedia {
        font-size: 85%;
    }

h2 {
    margin: 40px 0 20px 0;
    font-size: 130%;
}

    h2 span {
        display: inline-block;
        padding-bottom: 5px;
        border-bottom: 6px solid white;
    }

h3 {
    margin-top: 30px;
}

span.emph {
    background-color: white;
    color: #222;
    padding: 1px;
}


/* Page d'accueil */

div#accueil {
    display: flex;
    margin: 30px -10px;
}
@media screen and (max-width: 750px) {
div#accueil {
    flex-wrap: wrap;
}}

    div#accueil a {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        margin: 10px;
        padding: 20px 10px;
        flex-basis: 100%;
        background-color: #333;
        border: 1px solid #333;
    }
    div#accueil a:hover {
        background-color: #444;
        border: 1px solid white;
        font-style: inherit;
    }
    @media screen and (max-width: 750px) {
    div#accueil a {
        flex-direction: row;
        padding: 30px;
    }}

        div#accueil a span {
            display: block;
            margin-bottom: 30px;
            text-align: center;
            text-transform: uppercase;
            font-size: 140%;
            font-weight: bold;
        }
        @media screen and (max-width: 750px) {
        div#accueil a span {
            margin: 0;
            text-align: left;
        }}

        div#accueil a img {
            max-width: 128px;
        }
        @media screen and (max-width: 750px) {
        div#accueil a img {
            width: 84px;
            margin-left: 30px;
        }}


/* Mosaïques */

div.mosaique {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

    div.mosaique a {
        box-sizing: border-box;
        flex-basis: 250px;
        flex-shrink: 0;
        align-items: center;
        padding: 10px;
        border: 1px solid #222;
        margin: 5px 0;
        display: flex;
    }
    div.mosaique a:hover {
        background-color: #333;
        border: 1px solid white;
        font-style: initial;
    }

    div.mosaique a.inactif {
        opacity: 40%;
        filter: grayscale(100%);
    }

        div.mosaique a img {
            width: 64px;
            height: 64px;
            flex-shrink: 0;
            object-fit: contain;
            object-position: center;
            margin-right: 16px;
        }


/* Formulaires */

fieldset {
    margin: 20px 0;
    border: 2px solid #333;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

    legend {
        padding: 0 10px;
        margin: 0 auto;
        color: #444;
        font-weight: bold;
    }

    fieldset div.l100, fieldset div.l33, fieldset div.l25, fieldset div.l20 {
        box-sizing: border-box;
        padding: 5px 10px;
        min-width: 180px;
        flex-grow: 1;
    }
    fieldset div.l100 { flex-basis: 100%; }
    fieldset div.l33  { flex-basis:  33%; }
    fieldset div.l25  { flex-basis:  25%; }
    fieldset div.l20  { flex-basis:  20%; }

div.checkbox {
    display: inline-flex;
    align-items: center;
}

input[type=text], input[type=date], input[type=password], input[type=number], select, textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 4px;
    border: 1px solid #444;
    background-color: #333;
    margin: 5px 0;
    color: white;
    font-family: inherit;
}
input[type=checkbox] {
    margin: 0 10px 0 0;
}
input[type=button], input[type=submit] {
    display: block;
    padding: 5px 10px;
    margin: 5px 10px;
    background-color: #333;
    border: 1px solid #333;
    color: white;
    font-family: inherit;
}
input[type=button]:hover, input[type=submit]:hover {
    background-color: #444;
    border: 1px solid white;
}

    input.centre {
        margin: 10px auto 0;
    }
    
    input.danger:hover {
        background-color: #A44;
    }

    input#sources-nom {
        margin-right: 10px;
    }

    input.numliste {
        width: 100px;
    }

label{
    font-size: 85%;
}

    label:not(.post) {
        display: block;
    }
    label.post {
        margin-right: 10px;
        flex-shrink: 0;
    }

    label abbr {
        float: right;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: #333;
        text-align: center;
        text-decoration: none;
        cursor: help;
    }


/* Boîtes d'information */

div.info {
    background-color: #111;
    border: 1px solid #333;
    padding: 20px;
    margin: 20px 0;
}

    div.info h4 {
        margin: 5px 0 10px 0;
        font-size: 120%;
        font-weight: bold;
    }

    div.info p {
        margin: 0 0 5px 0;
    }

div.debug {
    display: inline-block;
    position: absolute;
    right: 10px;
    font-size: 12pt;
    color: #444;
}

/* Représentation des sièges */

div.boitesieges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

div.hemicycle {
    aspect-ratio: 2 / 1; 
    position: relative; 
}

a.siege {
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #222;
    margin: auto;
}
a.siege:hover {
    border-color: white;
}

/* Résultats par établissement */

div#graphe-elec{
    clear: both;
    overflow-x: scroll;
    margin: 30px 0;
    display: flex;
    flex-direction: row-reverse;
}

    div#graphe-elec div#inner{
        box-sizing: border-box;
        flex-basis: 50%;
        flex-grow: 1;
        display: flex;
        justify-content: center;
        background: url("images/fond-trait.png") repeat-x left bottom;
    }

        div#graphe-elec div.election {
            position: relative;
            flex-basis: 60px;
            margin: 0 20px;
            display: flex;
            flex-direction: column;
            text-align: center;
        }

            div#graphe-elec div.annulee {
                position: absolute;
                z-index: -1;
                width: 100%;
                height: 100%;
                background-image: repeating-linear-gradient(45deg,
                    transparent 0 10px,
                    #555 0 11px
                    );
            }

            div#graphe-elec div.boitesieges {
                padding-top: 10px;
                flex-grow: 1;
                flex-direction: column;
                justify-content: space-around;
            }

                div#graphe-elec div.sep{
                    margin: 5px 0;
                    border: 1px dashed #444;
                }
            
            div#graphe-elec div.graduation {
                height: 20px;
                margin: 15px 0;
            }

            div#graphe-elec a.date {
                height: 25px;
                margin-bottom: 5px;
                border: none;
                font-style: normal;
            }

            div#graphe-elec div.sub-date {
                height: 20px;
                margin-bottom: 10px;
                font-size: 80%;
            }
                div#graphe-elec abbr {
                    text-decoration: none;
                    cursor: default;
                }

    div#graphe-elec div#fleche{
        width: 50px;
        flex-shrink: 0;
        background: url("images/fond-fleche.png") no-repeat left bottom;
    }

div.infos-elec {
    margin: 40px 0;
}

    div.infos-elec h3 {
        font-size: 120%;
        margin: 20px 0 10px;
        border-bottom: 1px solid #333;
        padding: 8px;
        background-color: #333;
        text-align: center;
    }

        div.infos-elec h3 div.h3logo {
            float: left; 
            width: 0px; 
            overflow-x: visible;
        }
        div.infos-elec h3 div.h3logo img {
            max-height: 18pt; 
            max-width: 100px; 
            vertical-align: middle;
        }

    div.infos-elec h4 {
        margin: 20px 0 12px;
        border-top: 1px solid #444;
        border-bottom: 1px solid #444;
        background-color: #262626;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

        div.infos-elec h4 div {
            padding: 10px 0;
        }
        div.infos-elec h4 div.participation {
            font-weight: normal;
            font-size: 85%;
        }

    div.infos-elec div.inner {
        margin-bottom: 10px;
        border-bottom: 1px solid #333;
        padding-bottom: 10px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

        div.infos-elec div.liste {
            flex-basis: 30%;
            flex-grow: 1;
            min-width: 250px;
            padding-right: 30px;
        }

            div.infos-elec span.etiquette {
                font-weight: bold;
            }

            div.infos-elec span.soutiens {
                font-size: 80%;
            }

            div.infos-elec div.nom {
                padding-top: 5px;
            }

        div.infos-elec div.resultats {
            flex-basis: 50%;
            padding: 5px 0;
            flex-grow: 2;
        }

            div.infos-elec div.courants{
                display: flex;
                align-items: flex-end;
            }

                div.infos-elec div.pourcentage {
                    width: 80px;
                    text-align: right;
                    padding-right: 20px;
                }

                div.infos-elec div.histogramme {
                    flex-basis: 50%;
                    flex-grow: 1;
                    padding-right: 30px;
                }

                    div.infos-elec div.histogramme div.courant {
                        height: 20px;
                    }
                    div.infos-elec div.histogramme div.precedent {
                        height: 5px;
                        opacity: 0.5;
                    }

                div.infos-elec div.sieges {
                    flex-basis: 140px;
                    flex-grow: 1;
                    text-align: center;
                }
                div.courants div.sieges {
                    font-size: 150%;
                }
        
        .differences {
            font-size: 9pt;
            opacity: 0.6;
        }

            div.infos-elec div.differences {
                display: flex;
                margin-top: 8px;
            }

    div.infos-elec p.infos {
        margin-top: 15px;
        font-size: 85%;
        color: #777;
    }

        div.infos-elec p.infos a {
            border-bottom-color: #777;
        }
