/*Gallery*/
.gallery {
    display: flex;
    align-items: flex-start;
    position: relative;
}
.gallery.column  { max-height: 50vh; }

.gallery .images {
    display: flex;
    flex-flow: row wrap;
    width: 20%;
}

.g-item { 
    width: calc(50% - 2px);
    max-height: 50px;
    object-fit: cover;
    color: var(--attn);
    border: var(--gray) 2px solid;
    margin: 1px;
    cursor: pointer;
}

.g-item:hover, .minimal.gallery .g-item:hover {
    background: var(--attn);
    color: var(--secondary-light);
    border-color: var(--attn);
}

.g-item.current {
    background: var(--primary-light);
}

.gallery .active {
    width: 80%;
    max-height: calc(50vh - 24px);
}
.gallery .active a {
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--gray) 2px solid;
    text-shadow: var(--text-outline);
}

.gallery .active img {
    object-fit: contain;
    height: 100%;
    border: var(--outline);
}

.gallery .tooltip { position: absolute; }
.gallery p { margin-bottom: 0; }

.gallery .notes {
    top: 2px;
    right: 2px;
    text-align: right;
    font: var(--body-sm);
    font-weight: 600;
    padding: 2px 8px;
    background: var(--gray);
    border: var(--outline);
    border-width: 0 0 1px 1px;
    position: absolute;
}

.gallery .active a:hover .notes {
    color: var(--attn);
    background: var(--primary-light);
}
.gallery .active:hover a {
    border-color: var(--primary-light);
}

.tooltip, .collec-label {
    text-align: center;
    font: var(--body-sm);
    letter-spacing: 1pt;
    line-height: 1rem;
    padding: 8px;
    margin: 0 auto;
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    -webkit-transition: all var(--speed);
	transition: all var(--speed);
}

.tooltip {
    text-shadow: var(--text-outline);
    background: var(--secondary-light);
}


.gallery .active a:hover .tooltip, .collec:hover .collec-label {
    opacity: 1;
    margin-top: -10px;
}

.collec-label {
    background: var(--secondary-dark);
    border: var(--secondary-light-light) 1px solid;
}

/*Minimal Gallery*/
.minimal.gallery {
    flex-wrap: wrap;
    flex-direction: column-reverse;
    align-items: center;
}
.minimal.gallery .active {
    display: flex;
    width: unset;
    max-height: unset;
    height: 50vh;
    margin: 0 auto;
}

.minimal.gallery .active img {
    height: 100%;
}

.minimal .active a {
    border-color: transparent;
    margin: 0 auto;
}

.minimal.gallery .images {
    width: 100%;
    font: var(--body-sc);
    list-style-position: inside;
    list-style-type: decimal-leading-zero;
    margin: -2px;
}

.minimal.gallery .g-item {
    width: calc(10% - 4px);
    margin: 2px;
    text-align: center;
    color: var(--bodytext);
    border: var(--bodytext) 1px solid;
}

.minimal.gallery .g-item::marker {
    content: counter(list-item, decimal-leading-zero);
    font: var(--body-sm);
}

.minimal.gallery .buttons {
    max-width: 100%;
    z-index: 1;
}

/*Paginate*/
.page-l, .page-r {
    display: block;
    padding: 6px;
    -webkit-transition: transform 0.2s;
	transition: transform 0.2s;
    font-size: 1.5rem;
}

.paginate {
    font: var(--body-sm);
    line-height: 1;
    font-weight: 600;
    width: 100%;
    letter-spacing: 1pt;
    padding: 0 4px;
    margin: var(--side-padding-sm) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paginate button {
    background: none;
    border: none;
}

.pagetitle {
    position: static;
    text-align: center;
}

.page-r:hover { transform: translateX(4px); }
.page-l:hover { transform: translateX(-4px); }

/*Minibook*/

.pageflip {
    display: flex;
    position: relative;
    justify-content: space-between;
}

.pageflip a { max-width: 60%; }
.pageflip .controls { 
    width: calc(40% - 2px);
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    align-content: flex-start;
}
.fwd, .bck {
    width: calc(50% - 2px);
    text-align: center;
    margin-top: 1rem;
    text-transform: uppercase;
}

.fwd span, .bck span { display: inline-block; }

.controls .details { width: 100%; }
.controls .caption { position: absolute; align-self: flex-end; }




@media screen and (max-width: 800px) {   
    .gallery { display: block; height: unset; }
    .gallery .images, .gallery .active { width: 100%;}
    .gallery .images { justify-content: center; }
    .gallery .active { margin: 0; }
    .gallery.column .images { flex-flow: row wrap; }
    
    .minimal .active a, .minimal.gallery .buttons {
        position: static;
    }
    
    .minimal.gallery .buttons {
        max-width: unset;
        width: 100%;
    }
    
    .g-item {
        max-width: 10%;
        max-height: 40px;
    }
    
    .minimal.gallery .g-item {
        width: 12%;
    }
    
    .pageflip { flex-wrap: wrap; }
    .pageflip .controls, .pageflip a {
        width: 100%; max-width: 100%; margin-bottom: 1rem;
    }
}