/* mosaique */

.mosaique-grid {
    display: grid;
    grid-gap: 0.5rem;
    grid-template-columns: 1fr;
}

.item {
    border-radius:4px;
    cursor: pointer;
}
.item.actuel {
    background-color: #eee; 
    border-radius: 5px;
    box-shadow: 0 0 2px 2px #efefef;
}
.item.selected {
    background-color: var(--color-ok); 
}

.item:hover .item-illu, #viewer-inner .item-illu:hover {
    object-fit: contain !important;
    background-color: #efefef;
    border: 1px solid #ddd;
    box-shadow: inset 0 0 1rem #ddd;
}

/*
filtrage par live search, mots clés, collection
*/

[data-filtersearch] [data-search='hide'] {
    display:none;
}
[data-filtercollection] [data-collection='hide']{
    display: none;
}
[data-filtertags] .item[data-filter="hide"] {
    display:none;
}


[data-listingtype="liste"] .mosaique-grid .item {
    display: grid;
    grid-template-columns: minmax(3rem, 15%) 1fr;
    grid-gap: 1rem;
    border-bottom: 1px dotted var(--color-light);
    padding:0 !important;
} 

[data-listingtype="liste"] .mosaique-grid .item-infos {
    display: flex;
    gap: 1rem;
    align-items: center;
}
[data-listingtype="liste"] .mosaique-grid h2 {
    font-size: 1.2rem !important;
}
[data-listingtype="liste"] .mosaique-grid .item-header{
    text-align: right;
}
[data-listingtype="liste"] .mosaique-grid .item-illu {
    height: 3rem !important;
    width: auto !important;
    aspect-ratio: auto;
    display: inline;
}
[data-listingtype="liste"] .mosaique-grid .item-illu:hover {
    transform: scale(2);
    border:0;
    box-shadow: 0 0 2px 2px #fff;
}
[data-listingtype="mes"] .mosaique-grid {
    grid-template-columns: 1fr 1fr 1fr;  
}

[data-listingtype="mb"] .mosaique-grid {
    grid-template-columns: 1fr 1fr;  
}
[data-listingtype="hdisplay"] .mosaique-grid {
    display: flex;
    gap: 0.5rem;
    height: 100%;
}
[data-listingtype="hdisplay"] .mosaique-grid .item {
    height: 100%;
    flex-grow: 2;
    flex-direction: column;
}
[data-listingtype="hdisplay"] .mosaique-grid .item-header {
    height: calc(100% - 9rem);
    margin-bottom: 1rem;

}
[data-listingtype="hdisplay"] .mosaique-grid .item-infos {
    height: 8rem;

}
[data-listingtype="hdisplay"] .mosaique-grid .item-illu {
    aspect-ratio: auto !important;
    height: 100%;
}

/* listing en gros blocs verticaux */
[data-listingtype="vdisplay"] .mosaique-grid {

}

[data-listingtype="vdisplay"] .mosaique-grid .item {
    height: 100%;
    display: grid;
    grid-template-columns: 2fr 3fr;
    grid-gap: 1.5rem;
}

[data-listingtype="vdisplay"] .mosaique-grid .item-illu {
    aspect-ratio: 4 / 3 !important;
}

/* filtrage (collections) */
#v-collectionclose {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

#collections-container[data-filtered='true'] .collection:not(.filtered) {
    display:none;
}
#collections-container .collection-texte {
    display:none;
}
#collections-container[data-filtered='true'] .grid {
    display: block !important;
}
#collections-container .filtered .collection-texte {
    display:block;
}
#collections-container[data-filtered='true'] .filtered [data-source] {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-gap: 1rem;
}

/* full window */

#fw {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 1rem;
    grid-template-areas:
        "fwvisual" "fwinfos";
    height: 100vh;
    overflow: hidden;
    position: relative;
}

[data-toolbar="hide"] #viewer-menu {
    display: none;
}
#viewer-inner[data-show-info="hide"] #fw {
    grid-template-columns: 1fr;
    grid-template-areas:
        "fwvisual";
}
#viewer-inner[data-show-info="hide"] #fw-infos{
    display: none;   
}

#fw-visual {
    grid-area: fwvisual;
    height:100%;
    overflow: hidden;
}
#fw-infos {
    grid-area: fwinfos;
    overflow: auto;
}

#fw-image {
    position:relative;
    height: 100%;
}
#fw-image img {
    object-fit: contain;
    height: 100%;
    display: block;
    width: 100%;
    cursor:zoom-in;
}

#fw-image img.active {
    object-fit:none; 
    cursor: move;
}

#fw-image img.active ~ div  {
    display: none;
}

.fw-description {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    text-align: center;
    text-shadow: 1px 1px 1px #000;
    color: #fff;
    opacity: 0;
    transition: opacity 1s linear;
}

.fw-description span {
    padding:4px;
    background-color: var(--color-primary);
}

#fw-image:hover .fw-description {
    opacity: 1;
}

.fw-nav {
    position: absolute;
    top: 0;
    left:0;
    height:100%;
    width:20%;
    cursor: url("../images/chevron-left-big.svg"), auto;
}
.fw-nav:hover {
    background: linear-gradient(to left, rgba(0,0,0,0),rgba(0,0,0,0.25));
}
.fw-next {
    right:0;
    left: auto;
    cursor: url("../images/chevron-right-big.svg"), auto;
}
.fw-next:hover {
    background: linear-gradient(to right, rgba(0,0,0,0),rgba(0,0,0,0.25));
}

#fw-infos img[data-slideshow] {
    cursor:pointer;
}
#fw-infos img[data-slideshow='actuel'] {
    opacity: 0.2;
    background-color: #ccc;
}
#fw-infos img[data-slideshow='actuel']:hover {
    opacity: 0.5;
}
[data-show-info="hide"] .docinfobutton {
    background-color:#d5d5d5;
}

@media (min-width: 576px) {
    [data-listingtype="mes"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;  
    }
    [data-listingtype="mb"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (min-width: 768px) {

    [data-listingtype="mes"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;  
    }
    [data-listingtype="mb"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    }
    [data-listingtype="mm"] .mosaique-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    [data-listingtype="mes"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;  
    }
    [data-listingtype="mb"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    }
    [data-listingtype="mm"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    [data-listingtype="ms"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    [data-listingtype="hdisplay"] .mosaique-grid .item {
        width: calc(50vw - 2rem);
    }
}

@media (min-width: 1200px) {

    [data-listingtype="mes"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;  
    }
    [data-listingtype="mb"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
    }
    [data-listingtype="mm"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    }
    [data-listingtype="ms"] .mosaique-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    [data-listingtype="hdisplay"] .mosaique-grid .item {
        width: calc(33.3vw - 2rem);
    }
}