/* GALERIE — VERSION 3.2 */

* { box-sizing: border-box; }

/* Neutralise l'ancienne règle div { display:inline-block; } de first.css */
body.gallery_body div { display: block; }

.gallery_body {
    margin: 0;
    padding: 84px 24px 40px 24px;
}

.gallery_topbar {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    padding-left: 1rem;
    text-align: left;
    line-height: 4rem;
    font-size: 1.5rem;
}

.theme_nav {
    max-width: 1166px;
    margin: 0 auto 24px auto;
    text-align: left;
    font-size: 1.3rem;
}

/* PAGE IMAGE : 900 px + navigation 230 px */
body.gallery_body .photo_page {
    display: grid;
    grid-template-columns: minmax(0, 900px) 230px;
    grid-template-rows: auto auto;
    column-gap: 36px;
    row-gap: 20px;
    justify-content: center;
    align-items: start;
    width: 100%;
    max-width: 1166px;
    margin: 0 auto;
}

body.gallery_body .photo_page {
    margin-top: 0.75rem;
}

body.gallery_body .theme_nav > a {
    font-weight: 600;
}

body.gallery_body .photo_image_container {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

body.gallery_body .photo_image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

body.gallery_body .photo_navigation {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 230px;
    margin: 0.5rem 0 0 0;
    padding: 18px;
    text-align: left;
    background-color: #404040;
}

body.gallery_body .photo_navigation a,
body.gallery_body .photo_navigation a:visited {
    color: #fff;
    text-decoration: none;
}

body.gallery_body .photo_navigation a:hover,
body.gallery_body .photo_navigation a:active {
    color: #ddd;
}

body.gallery_body .photo_navigation .nav_link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
}

body.gallery_body .photo_navigation .nav_symbol {
    display: block;
    width: 1.2em;
    height: 1.2em;
    flex: 0 0 1.2em;
    object-fit: contain;
}

.download_link { margin-top: 18px; }

body.gallery_body .photo_info {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    margin: 0;
    text-align: center;
}

body.gallery_body .photo_info p {
    max-width: 750px;
    margin: 0.15rem auto;
    text-align: center;
    line-height: 1.2;
}

.photo_titre {
    font-style: italic;
    font-weight: 600;
}

body.gallery_body .photo_titre.sans_titre {
    font-style: normal;
}

.photo_date { font-weight: 400; }

.photo_desc_1,
.photo_desc_2,
.photo_dim,
.photo_docu_1,
.photo_docu_2 { line-height: 1.2; }

/* INDEX DE THÈME */
.theme_page {
    max-width: 1300px;
    margin: 0 auto;
}

.theme_title {
    margin: 0 0 30px 0;
    text-align: left;
}

body.gallery_body .theme_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 300px);
    gap: 24px;
    justify-content: center;
}

.mini_link {
    display: flex;
    width: 300px;
    height: 300px;
    align-items: center;
    justify-content: center;
}

.mini_image {
    display: block;
    width: auto;
    height: auto;
    max-width: 300px;
    max-height: 300px;
}

.mini_image.vertical { max-height: 250px; }

@media (max-width: 560px) {
    .gallery_body { padding: 76px 16px 30px 16px; }
    .gallery_topbar { line-height: 3.5rem; font-size: 1.1rem; }
    .theme_nav { font-size: 1.1rem; }

    body.gallery_body .photo_page {
        display: flex;
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
    }

    body.gallery_body .photo_image_container,
    body.gallery_body .photo_info { width: 100%; }

    body.gallery_body .photo_navigation {
        width: 100%;
        align-self: stretch;
    }

    body.gallery_body .theme_grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 14px;
    }

    .mini_link { width: 100%; height: auto; }

    .mini_image {
        width: 100%;
        height: auto;
        max-width: 300px;
        max-height: none;
        margin: 0 auto;
    }

    .mini_image.vertical { max-height: none; }
}
body.gallery_body .gallery_index_page {
    box-sizing: border-box;
    width: 100%;
    padding: 2rem;
}

body.gallery_body .gallery_index {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

body.gallery_body .gallery_theme_link {
    display: block;
    color: #000;
    text-decoration: none;
}

body.gallery_body .gallery_theme {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 130px;
    padding: 15px;
    background-color: #e8e8e8;
}

body.gallery_body .gallery_theme_image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 100px;
    flex: 0 0 160px;
}

body.gallery_body .gallery_theme_image img {
    display: block;
    height: 100px;
    width: auto;
    max-width: 160px;
}

body.gallery_body .gallery_theme_text {
    min-width: 0;
    text-align: left;
}

body.gallery_body .gallery_theme_title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.2;
}

body.gallery_body .gallery_theme_count {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    font-weight: 400;
}

body.gallery_body .gallery_theme_link:hover .gallery_theme,
body.gallery_body .gallery_theme_link:active .gallery_theme {
    background-color: #dedede;
}

body.gallery_body .gallery_theme_link:hover,
body.gallery_body .gallery_theme_link:active {
    color: #333;
}

/* ============================================================
   SMARTPHONE
   ============================================================ */

@media (max-width: 700px) {

    /* Index général de la Galerie :
       un thème par ligne */

    body.gallery_body .gallery_index {
        grid-template-columns: 1fr;
    }


    /* Pages d'images :
       image -> légende -> navigation */

    body.gallery_body .photo_page {
        display: flex;
        flex-direction: column;
    }

    body.gallery_body .photo_image_container {
        order: 1;
    }

    body.gallery_body .photo_info {
        order: 2;
    }

    body.gallery_body .photo_navigation {
        order: 3;
    }

}