/**
 * Ce fichier contient les styles CSS qui s'appliquent au site public.
 */

/* CSS RESET */
body, form, p, div, hr, fieldset, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
}
h1  { font-size: 2em; }
h2  { font-size: 1.5em; }
h3  { font-size: 1.2em; }
h4  { font-size: 1em; }
h5  { font-size: 0.9em; }
h6  { font-size: 0.8em; }
ul, ol { list-style-type: none; }
article, aside, figure, footer, header, hgroup, menu, nav, section { display: block; }

/* CORPS */
body {
    font-size: 100.01%;
    color: #000;
    font-family: "Trebuchet MS", Helvetica, Sans-serif;
    background: #eee;
    background: rgba(var(--first-color), 0.2);
}

/* DISPOSITION GÉNÉRALE DE LA PAGE */
main {
    max-width: 950px;
    margin: 0 auto;
    display: grid;
    grid-gap: 1em;
    grid-template-columns: 1.4fr 0.6fr;
    grid-template-areas:
        "header header"
        "content nav"
}

header.main {
    grid-area: header;
    display: grid;
    grid-gap: 1em;
    grid-template-columns: 1.4fr 0.6fr;
}
nav.main { grid-area: nav; }
section.page { grid-area: content; }

header.main h1, header.main .contacts, nav.main {
    background: #fff;
    padding: 1em;
    border-radius: .5em
}

header.main .contacts {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

section.page article {
    margin-bottom: 1em;
    padding: 1em;
    background: #fff;
    clear: both;
    border-radius: .5em;
}

/* ENTÊTE AVEC LOGO ET CONTACTS */
header.main h1 {
    padding: 0;
    background: none;
    border-radius: 0;
}

header.main h1 a {
    display: flex;
    padding: 1rem;
    background: #fff;
    border-bottom-left-radius: .5rem;
    border-bottom-right-radius: .5rem;
    text-decoration: none;
    height: calc(100% - 2rem);
    align-items: center;
    justify-content: center;
}

header.main h1 a span {
    font-size: 1.5em;
    font-weight: normal;
    color: rgb(var(--first-color));
    display: block;
}

header.main h1 a:hover span {
    color: rgb(var(--second-color));
}

header.main h1 a:hover img {
    opacity: 0.8;
}

header.main h1 a img {
    max-height: 200px;
}

header.main.home h1 a img {
    max-height: 300px;
}

header.main.home h1 a span {
    font-size: 2em;
}

header.main .contacts {
    font-size: 1.3em;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
}

/* NAVIGATION EN HAUT DE LA PAGE (ACCUEIL/CONNEXION) */
header.nav {
    background: #ddd;
    background: rgba(var(--second-color), 0.2);
    border-bottom: 1px solid #999;
    border-top: .3em solid #666;
    text-align: center;
    padding-top: .3em;
    border-color: rgba(var(--first-color), 1);
}

header.nav li {
    display: inline-block;
    padding: .2em .5em;
    margin-bottom: -3px;
}

header.nav li a {
    padding: .1em .5em;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
}

header.nav li.current a {
    background: #fff;
    border: .1em solid #999;
    border-bottom: none;
    border-top-left-radius: .3em;
    border-top-right-radius: .3em;
}

header.nav li a:hover {
    color: #000;
}

/* LISTE DES CATÉGORIES RACINES */
.subcategories {
    text-align: center;
    margin: 2em 0;
}

nav.main ul li, .subcategories li {
    font-size: 1.4em;
    margin: .8em 0;
    padding: 0;
}

nav.main ul li a, .subcategories li a {
    margin: 0;
    padding: .2em .5em;
    color: #006;
    text-decoration: underline;
    background: #ddd;
    background: rgba(var(--second-color), 0.2);
    border-radius: .5rem;
}

.subcategories li a {
    background: #fff;
}

nav.main ul li a:hover, .subcategories li a:hover {
    color: darkred;
    background: #eee;
}


/* Formulaire de recherche */
::target-text {
    background: #ff0;
    padding: .2em;
}

.search-widget p {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 1em;
}

.search-widget input {
    font-size: 1.2em;
    padding: .2em .5em;
    border: 1px solid #999;
    border-radius: .3rem;
    line-height: 1rem;
    max-width: 10em;
}

.search-widget input[type=submit] {
    margin-left: .5em;
    background: #999;
    color: #fff;
    cursor: pointer;
}

/* PIED DE PAGE */
footer.main {
    color: #666;
    margin: 1em;
    text-align: center;
}

footer.main a {
    text-decoration: none;
    font-weight: bold;
    color: #333;
}

footer.main a:hover {
    color: #006;
    text-decoration: underline;
}

footer.main a#paheko {
    padding-left: 36px;
    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAWBAMAAABTd4N3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAADBQTFRFBUqmR3BMAwl4KZDEBD2dATCVBy+TJU6mC2y1BCWU/v//m7jbUXC3c53NvtPp3ur1QHGW/AAAAAh0Uk5T/gD6+WqzLO5BK691AAABR0lEQVQY02MQhAKRcIbyECDNAOMrMXR0dLTABcSCJnAABTjLYAIOmkB+swUDO1QglXNG8yogWHcgECwgwjCT23jXqvX/V61hY3BJFHPVnFnAd6N/1QOGU+tZGCJncirNPHmu7wfvqscW3avaGTKBApUPTp1e27HqRUfvqgMMohNqzux4W7VnNcevFx28qxoYRCZVnr59ftbn/x2vXnT0r2dgEFSaW8MzV+dAb8erv7d/rWFnEHTS3HOaW/vl645XQIfcYGUQFFVg+LOvau9q41+/d99gYGEQFNNk2LTmVv1i41UvOGfOnAZ0adLMOTdfn3psu+oFw8yZIKeLTZqj9GDX5b5VDzo4ZzqC/JKkpDTztYUV0GEdrRDfBikpXQBa8qJhgiFEQCxy5kyGu3cvW7DCQkwkknMCR7OxsSMiTFNCmY1NEoEMABmgiBzVXBbdAAAAAElFTkSuQmCC") no-repeat left center;
    min-height: 22px;
    display: inline-block;
}

/* CHEMIN VERS L'ARTICLE (BREADCRUMBS), affiche les catégories parentes */
.breadcrumbs {
    margin-bottom: 1em;
    text-align: center;
}

.breadcrumbs ul {
    margin: 0;
}

.breadcrumbs ul li {
    display: inline-block;
}

.breadcrumbs ul li::before {
    content: "»";
    color: #999;
    margin: .5em;
}

.breadcrumbs ul li:nth-child(1)::before {
    display: none;
}

.breadcrumbs a {
    color: #666;
}


/* MESSAGES ALERTE ET ERREUR (par exemple : page non trouvée) */
.error {
    border-bottom: .2em solid #c00;
    border-radius: .5em;
    background: #fcc;
    padding: .5em;
    margin-bottom: 1em;
    font-size: 1.2em;
    color: #900;
}

.alert {
    border-bottom: .2em solid #cc0;
    border-radius: .5em;
    background: #ffc;
    padding: .5em;
    margin-bottom: 1em;
    font-size: 1.2em;
    color: #990;
}

/* AFFICHAGE D'UN ARTICLE */
section.articles article h3, section.articles article h1 {
    margin-bottom: .3em;
}

section.articles article::after, article.single::after {
    content: "";
    display: block;
    height: 0px;
    clear: both;
}

section.articles article h1 a {
    color: #000;
    text-decoration: none;
    font-weight: normal;
}

section.articles article h3 a {
    color: #009;
    font-weight: normal;
}

section.articles article h3 a:visited {
    color: #669;
}

section.articles article h5 {
    color: #666;
    font-weight: normal;
    font-size: .8em;
    margin-bottom: .3em;
}

section.page > h1 {
    text-align: center;
    margin-bottom: 1em;
}

/* CONTENU DE L'ARTICLE */
article > h4 {
    margin-bottom: 1em;
    color: #666;
    font-weight: normal;
}

article ul, article ol, article blockquote {
    margin-left: 2em;
}

article ul {
    list-style-type: disc;
}

article ol {
    list-style-type: decimal;
}

article dl dd {
    margin: .5em 0 .5em 2em;
}

article img {
    max-width: 100%;
}

article figure {
    text-align: center;
}

article figcaption {
    font-style: italic;
    color: #666;
    margin-top: 2pt;
    font-size: .8em;
}

article > h1 {
    margin-bottom: 1rem;
}

/* GALERIE D'IMAGES EN DESSOUS DE L'ARTICLE */
section.gallery, section.documents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

section.gallery figure, section.documents aside {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

section.documents aside a {
    display: block;
    text-decoration: none;
    border-radius: .5em;
    background: rgba(var(--first-color), 0.2) no-repeat center center;
    background-image: url('data:image/svg+xml;utf8,<svg width="33.87mm" height="33.87mm" version="1.1" viewBox="0 0 33.87 33.87" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-45.16 -132.5)"><path d="m46.87 166.3c-1.895-0.8504-2.04-3.422-1.368-5.124 0.4287-0.9042 1.363-1.675 2.405-1.471h29.27c1.387 0.5818 2.074 2.134 1.853 3.586 0.137 1.429-0.8551 3.219-2.472 3.059-8.696 0.1509-17.4 0.0429-26.09 0.0478-1.196-0.027-2.4 0.0278-3.591-0.0985zm14.74-10.2c-2.695-3.234-5.319-6.532-7.861-9.888-0.6409-1.955 1.712-1.953 2.991-1.809h1.863c5.01e-4 -3.406 1e-3 -6.812 0.0015-10.22 0.3553-1.875 2.409-1.689 3.866-1.626 1.341-0.2301 3.068 0.2243 3.15 1.818 4.92e-4 3.342 9.83e-4 6.684 0.0015 10.03 1.442 0.0378 2.903-0.0975 4.331 0.1108 1.533 1.159-0.2458 2.66-0.9956 3.69-2.104 2.658-4.17 5.352-6.377 7.926-0.2941 0.1659-0.6875 0.1582-0.9702-0.0291z" fill="%23fff" stroke-width=".07256"/></g></svg>');
    padding: .5em;
    color: #666;
    transition: background-color .2s, color .2s, box-shadow .2s;
    background-size: 90% 90%;
}

section.documents aside a:hover {
    background-color: #eee;
    color: #333;
    box-shadow: 0px 0px 5px rgba(var(--first-color), 1);
}

section.documents aside a:hover b {
    color: darkred;
}

section.documents aside b {
    display: block;
    font-size: 1.1em;
    text-decoration: underline;
    color: darkblue;
}

section.documents aside span {
    font-size: .8em;
}

/* FORMULAIRES */
fieldset {
    border: 2px solid #ccc;
    border-radius: .5em;
    padding: 1em;
    margin: 1em;
}

fieldset legend {
    padding: 0 1em;
}

fieldset input, fieldset textarea, fieldset select {
    padding: .5rem;
    border: 1px solid #999;
    border-radius: .3rem;
    font-size: 1.2em;
}

fieldset input[type=submit] {
    background: #999;
    color: #fff;
    cursor: pointer;
}

input:focus, textarea:focus, select:focus, button:focus {
    outline: none;
    box-shadow: 0px 0px 5px 2px orange;
}

fieldset dl dd {
    margin: .5em 1em;
}

/* Modifications du style pour les petits écrans */
@media handheld, screen and (max-width: 980px) {
    body {
        padding: 0;
    }

    main, header.main {
        display: block;
    }

    header.nav {
        font-size: .9em;
        margin: 0;
    }

    header.main h1 a, header.main .contacts {
        border-radius: 0;
        margin: .2em 0;
        padding: 0;
    }

    header.main {
        background: #fff;
        padding: 1em;
    }


    header.main .contacts * {
        text-align: center;
        font-size: .8em;
    }

    header.main h1 a img {
        max-height: 100px;
        max-width: 100%;
    }

    header.main.home h1 a img {
        max-height: 300px;
    }

    .search-widget p {
        display: block;
        text-align: center;
    }

    .search-widget input {
        font-size: 1em;
    }

    nav.main ul, .subcategories {
        text-align: center;
    }

    nav.main ul li, .subcategories li {
        font-size: 1.2em;
        display: inline-block;
        margin: .3em;
    }
    nav.main ul li a, .subcategories li a {
        background: #fff;
    }

    .breadcrumbs {
        display: none;
    }

    nav.main {
        font-size: 1em;
        background: none;
    }

    section.page article {
        border-radius: 0;
    }

    section.page h1 { font-size: 1.5em; }
    section.page h2 { font-size: 1.3em; }
    section.page h3 { font-size: 1.2em; }
    section.page h4 { font-size: 1em; }
    section.page h5 { font-size: .9em; }
    section.page h6 { font-size: .8em; }

    footer.main {
        font-size: .8em;
    }
}