.quiqqer-control-gallery-gridAdvanced-list {
    display: grid;
}

.quiqqer-control-gallery-gridAdvanced__gap {
    --_qui-gridAdvanced-gap: var(--qui-gridAdvanced-gap, var(--spacing, 1rem));
    gap: var(--_qui-gridAdvanced-gap);
}

.quiqqer-control-gallery-gridAdvanced-entry-wrapper {
    overflow: hidden;
    position: relative;
}

.quiqqer-control-gallery-gridAdvanced-entry,
.quiqqer-control-gallery-gridAdvanced-image,
.quiqqer-control-gallery-gridAdvanced-list picture,
.quiqqer-control-gallery-gridAdvanced-image-img {
    display: block;
    height: 100%;
    width: 100%;
}

.quiqqer-control-gallery-gridAdvanced-image {
    position: relative;
    transition: 0.3s all;
}

.quiqqer-control-gallery-gridAdvanced-image-img {
    /*aspect-ratio: 16/9;*/
    object-fit: cover;
    object-position: center;
    transition: 0.3s ease;
}

.quiqqer-gallery-grid-list-complete {
    display: none;
}

/* scale image on hover */
.quiqqer-control-gallery-gridAdvanced__scaleImageOnHover .quiqqer-control-gallery-gridAdvanced-entry-wrapper:hover .quiqqer-control-gallery-gridAdvanced-image-img {
    transform: scale(1.1);
}

/* END scale image on hover */

/* darken image on hover */
.quiqqer-control-gallery-gridAdvanced__darkenImageOnHover .quiqqer-control-gallery-gridAdvanced-entry-wrapper:hover .quiqqer-control-gallery-gridAdvanced-image-img {
    filter: brightness(0.5);
}

/* END darken image on hover */

/* icon on hover */
.quiqqer-control-gallery-gridAdvanced__iconOnHover .quiqqer-control-gallery-gridAdvanced-image:before {
    align-items: center;
    color: #fff;
    content: "\f002";
    display: flex;
    font-family: 'FontAwesome';
    font-size: 2rem;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    transform: translateY(30px);
    transition: 0.3s all;
    width: 100%;
    z-index: 1;
}

.quiqqer-control-gallery-gridAdvanced__iconOnHover .quiqqer-control-gallery-gridAdvanced-entry-wrapper:hover .quiqqer-control-gallery-gridAdvanced-image:before {
    opacity: 0.9;
    transform: translateY(10px);
}

/* END icon on hover */

/* debug */
.debug.quiqqer-control-gallery-gridAdvanced-list {
    counter-reset: div;
}

.debug .quiqqer-control-gallery-gridAdvanced-entry-wrapper:before {
    background-color: #212325;
    bottom: 0;
    color: #fff;
    content: counter(div);
    counter-increment: div;
    font-size: 1rem;
    font-weight: bold;
    line-height: 2rem;
    margin: auto;
    position: absolute;
    right: 0;
    text-align: center;
    width: 2rem;
    z-index: 1;
}

/* aspect ratio */
.quiqqer-control-gallery-gridAdvanced-entry-wrapper {
    aspect-ratio: var(--_qui-gridAdvanced-aspectRatio, auto);
}

/* Template 2 to 6 per row */
.galleryGridTemplate-2perRow,
.galleryGridTemplate-3perRow,
.galleryGridTemplate-4perRow,
.galleryGridTemplate-5perRow,
.galleryGridTemplate-6perRow {
    grid-template-columns: repeat(var(--_qui-gridAdvanced-colNumber), 1fr);
}

/* auto column count */
.galleryGridTemplate--autoColumn {
    grid-template-columns: repeat(auto-fit, minmax(min(clamp(var(--_qui-gridAdvanced-minWidth), calc(calc(100% / var(--_qui-gridAdvanced-colNumber)) - var(--_qui-gridAdvanced-gap)), var(--_qui-gridAdvanced-maxWidth)), 100%), 1fr));
}

/* Template 1 */
.galleryGridTemplate-1.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 6vw;
    grid-template-columns: repeat(8, 1fr);
}

.galleryGridTemplate-1 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 1) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-1 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 2) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-1 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 3) {
    grid-column: auto / span 4;
    grid-row: auto / span 5;
}

.galleryGridTemplate-1 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 4) {
    grid-column: auto / span 4;
    grid-row: auto / span 3;
}

.galleryGridTemplate-1 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 5) {
    grid-column: auto / span 4;
    grid-row: auto / span 3;
}

.galleryGridTemplate-1 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 6) {
    grid-column: auto / span 4;
    grid-row: auto / span 3;
}

/* Template 2 */
.galleryGridTemplate-2.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 12vw;
    grid-template-columns: repeat(4, 1fr);
}

.galleryGridTemplate-2 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 1) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-2 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 4) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

/* Template 3 */
.galleryGridTemplate-3.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: min(10vw, 9rem);
    grid-template-columns: repeat(6, 1fr);
}

.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 1) {
    grid-column: auto / span 4;
    grid-row: auto / span 2;
}

.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 2) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 3),
.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 4),
.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 5),
.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 8),
.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 9),
.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 10) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 6),
.galleryGridTemplate-3 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(10n + 7) {
    grid-column: auto / span 3;
    grid-row: auto / span 3;
}


/* Template 4 */
.galleryGridTemplate-4.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 20vw;
    grid-template-columns: repeat(3, 1fr);
}

.galleryGridTemplate-4 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(12n + 2) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-4 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(12n + 7) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}


/* Template 5 */
.galleryGridTemplate-5.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 20vw;
    grid-template-columns: repeat(3, 1fr);
}

.galleryGridTemplate-5 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(5n + 1) {
    grid-column: auto / span 1;
    grid-row: auto / span 2;
}

.galleryGridTemplate-5 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(5n + 2) {
    grid-column: auto / span 2;
    grid-row: auto / span 1;
}

.galleryGridTemplate-5 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(5n + 4) {
    grid-column: auto / span 1;
    grid-row: auto / span 2;
}

.galleryGridTemplate-5 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(5n + 5) {
    grid-column: auto / span 2;
    grid-row: auto / span 1;
}

/* Template 6 */
.galleryGridTemplate-6.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 15vw;
    grid-template-columns: repeat(4, 1fr);
}

.galleryGridTemplate-6 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(13n + 1) {
    grid-column: auto / span 1;
    grid-row: auto / span 2;
}

.galleryGridTemplate-6 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(13n + 3) {
    grid-column: auto / span 2;
    grid-row: auto / span 1;
}

.galleryGridTemplate-6 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(13n + 5) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

.galleryGridTemplate-6 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(13n + 12),
.galleryGridTemplate-6 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(13n + 13) {
    grid-column: auto / span 2;
    grid-row: auto / span 1;
}

/* Template 7 */
.galleryGridTemplate-7.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 15vw;
    grid-template-columns: repeat(4, 1fr);
}

.galleryGridTemplate-7 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(8n + 2),
.galleryGridTemplate-7 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(8n + 5) {
    grid-column: auto / span 3;
    grid-row: auto / span 3;
}

/* Template 8 */
.galleryGridTemplate-8.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 20vw;
    grid-template-columns: repeat(3, 1fr);
}

.galleryGridTemplate-8 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 2),
.galleryGridTemplate-8 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 4) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

/* Template 9 */
.galleryGridTemplate-9.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 15vw;
    grid-template-columns: repeat(4, 1fr);
}

.galleryGridTemplate-9 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(14n + 5),
.galleryGridTemplate-9 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(14n + 12) {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

/* Template 10 */
.galleryGridTemplate-10.quiqqer-control-gallery-gridAdvanced-list {
    grid-auto-rows: 20vw;
    grid-template-columns: repeat(6, 1fr);
}

.galleryGridTemplate-10 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 1) {
    grid-column: auto / span 6;
    grid-row: auto / span 1;
}

.galleryGridTemplate-10 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 2),
.galleryGridTemplate-10 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 3) {
    grid-column: auto / span 3;
    grid-row: auto / span 1;
}

.galleryGridTemplate-10 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 4),
.galleryGridTemplate-10 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 5),
.galleryGridTemplate-10 .quiqqer-control-gallery-gridAdvanced-entry-wrapper:nth-child(6n + 6) {
    grid-column: auto / span 2;
    grid-row: auto / span 1;
}

/**************************************************************/
/* order random - use placeholder and skeleton loading effect */
/**************************************************************/
.quiqqer-control-gallery-gridAdvanced-entry.skeletonLoadingEffect {
    position: relative;
}

.quiqqer-control-gallery-gridAdvanced-entry.skeletonLoadingEffect:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #ececec;
    background-image: linear-gradient(110deg, #ececec 180px, #f3f3f3 250px, #ececec 320px);
    background-size: 2000px 100%;
    animation: gridAdvanced-skeleton-shining 3s infinite linear;
    background-position: -350px 0;
    background-repeat: no-repeat;
    transition: 500ms opacity ease;
}

.quiqqer-control-gallery-gridAdvanced-entry.skeletonLoadingEffect.hide:after {
    opacity: 0;
}

@keyframes gridAdvanced-skeleton-shining {
    0% {
        background-position: -300px 0;
    }
    100% {
        background-position: 1700px 0;
    }
}
