
:root {
    --gallery-button-width-desktop: 28px;
    --gallery-button-width-mobile: 20px;

    --gallery-button-size-spacing: 12px;

    --gallery-preview-bar-width: 200px;
}

@media(max-width: 768px) {
    :root {
        --gallery-button-size-spacing: calc(100vw * 0.075);
    }
}

.gallery-container {
    margin-top: 12px;
    margin-bottom: 24px;
}

.gallery-content-container {
    user-select: none;

    width: 100%;
    aspect-ratio: 16 / 9;
}

@media(max-width: 768px) {

    .gallery-content-container {
        width: calc(100% + 40px);
        margin-left: -20px;
    }

}

.gallery-arrows-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;

    width: 100%;
}

.gallery-swipe-overlay {
    display: none;
}

.gallery-swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #00000052;
    z-index: 2;

    transition: opacity 1.5s ease-out;
}

.gallery-swipe-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

@media(max-width: 768px) {
    .gallery-swipe-overlay {
        display: flex;
    }
}

/********************************/
/* Loading of the next gallery */
.gallery-next .gallery-custom-loader {
    display: none;
}

/* Hiding the SVG of the arrow */
.gallery-loading-next-gallery .gallery-next svg {
    display: none;
}

/* Showing the loader */
.gallery-loading-next-gallery .gallery-next .gallery-custom-loader {
    display: block;
}

/* Making the container appropriately large */
.gallery-loading-next-gallery .gallery-next  {
    width: 35px;
}

.gallery-loading-next-gallery .gallery-back {
    opacity: 0;
    pointer-events: none;
}

.gallery-loading-next-gallery .gallery-arrows-container {
    cursor: default;
    pointer-events: none;
}

.gallery-loading-next-gallery .gallery-quickjump-container {
    pointer-events: none;
}

@media(max-width: 768px) {
    .gallery-quickjump-container {
        display: none;
    }

    .gallery-texts, .gallery-texts-spacing {
        padding-top: 12px;
    }
}

.gallery-counter-container {
    position: absolute;
    top: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 2px;
    color: white;

    z-index: 1;

    opacity: 1;
    transition: opacity 0.15s ease-in-out;
}

.gallery-counter-container > .gallery-counter {
    background: rgba(64,64,64,0.6);
    border-radius: 4px;
    padding: 10px 14px;

    font-weight: 600;
}


.gallery-back, .gallery-next {
    position: absolute;
    top: calc(50% - 50px);
    background: white;
    width: var(--gallery-button-width-desktop);
    height: 100px;

    z-index: 2;
    opacity: 0.8;

    text-align: center;
    border-radius: 7px;

    box-shadow: rgba(0, 0, 0, 0.1) 0 2px 4px;

    transition: opacity 0.15s ease-in-out;

    display: flex;
    justify-content: center;
    align-items: center;
}

/* Keep only the small ones */
.gallery-back, .gallery-next {
    width: var(--gallery-button-width-desktop);
    height: 100px;
    top: calc(50% - 50px);
}

.gallery-clickable-area-padding {
    padding: 0 calc(var(--gallery-button-size-spacing) + var(--gallery-button-width-desktop));
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 610px;
}

@media (max-width: 480px) {

    .gallery-back, .gallery-next {
        width: var(--gallery-button-width-mobile);
        height: 80px;
        top: calc(50% - 40px);
    }

    .gallery-counter-container {
        top: 8px;
        right: 16px;
    }

    .gallery-counter-container > div {
        padding: 6px;
    }

    .gallery-clickable-area-padding {
        max-width: inherit !important;
        padding: 0 calc(var(--gallery-button-size-spacing) + var(--gallery-button-width-mobile));
    }
}


.gallery-back > svg,
.gallery-next > svg {
    width: 20px;
    height: 16px;

    padding-left: 8px;
    padding-right: 4px;
}

.gallery-back:hover, .gallery-next:hover {
    opacity: 1;
}

.gallery-back {
    left: var(--gallery-button-size-spacing);
}

.gallery-back.gallery-hidden,
.gallery-next.gallery-hidden,
.gallery-counter-container.gallery-hidden {
    opacity: 0;
    pointer-events: none;
}

@media(max-width: 768px) {
    /* Sempre disabilitato sul mobile, tranne quando viene mostrata l'ad */
    .gallery-arrows-container:not(.gallery-buttons-mandatory) .gallery-back,
    .gallery-arrows-container:not(.gallery-buttons-mandatory) .gallery-next
    {
        opacity: 0;
        pointer-events: none;
    }

    .gallery-back > svg,
    .gallery-next > svg {
        padding-left: 6px;
    }
}

.gallery-display-none {
    display: none;
}

.gallery-next {
    right: var(--gallery-button-size-spacing);

    display: flex;
    flex-direction: row;

    transition: width 0.25s ease-in;
}

.gallery-slide {
    width: calc(100% + 1px);
    min-width: calc(100% + 1px);
    aspect-ratio: 16 / 9;
    object-fit: contain;
    max-width: 100%;
    background: white;

    pointer-events: none;
}

.gallery-ad-container {
    width: calc(100% + 1px);
    min-width: calc(100% + 1px);

    aspect-ratio: 16 / 9;
    display: flex;
    justify-content: center;
    align-items: center;

    background-color: #e8e8e8;

    border: 2px solid #d6d6d6;
}

.gallery-quickjump-container {
    width: calc(100% - 32px);
    margin: 0 16px;

    overflow-x: hidden;

    box-sizing: border-box;
    user-select: none;
}

.gallery-quickjump-container.gallery-space-both {
    mask-image: linear-gradient(to right, transparent 0, black 20px, black calc(100% - 20px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 20px, black calc(100% - 20px), transparent 100%);
}

.gallery-quickjump-container.gallery-space-left {
    mask-image: linear-gradient(to right, transparent 0, black 20px, black 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 20px, black 100%);
}

.gallery-quickjump-container.gallery-space-right {
    mask-image: linear-gradient(to right, black 0, black calc(100% - 20px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 20px), transparent 100%);
}

.gallery-quickjump-container::-webkit-scrollbar {
    display: none;
}

.gallery-quickjump-container::-webkit-scrollbar-track,
.gallery-quickjump-container::-webkit-scrollbar-thumb{
    background: transparent;
}

.gallery-quickjump-flow {
    display: flex;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: center;
    gap: 4px;
    margin: 12px auto;
    width: fit-content;

    height: 56px;

    user-select: none;
}

.gallery-quickjump-slide {
    width: 96px;
    min-width: 96px;
    height: 56px;
    background: #d2d2d2;
    object-fit: cover;

    cursor: pointer;

    border-radius: 4px;
    opacity: 0.4;

    transition: opacity 0.15s ease-in-out;

    /* Do not allow dragging or selection */
    user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.gallery-quickjump-slide:hover {
    opacity: 0.75;
}

.gallery-quickjump-slide.gallery-quickjump-slide-active {
    opacity: 1;
}

.gallery-images-flow {
    display: flex;
    flex-wrap: nowrap;

    width: 100%;
    aspect-ratio: 16 / 9;
}

@media(max-width: 768px) {
    .gallery-images-flow {
        width: calc(100% - (100vw * 0.1));
        margin-left: calc(100vw * 0.05);

        aspect-ratio: unset;

        gap: 4px;
    }
}

.gallery-images-flow img {
    background: #e8e8e8;
}

.gallery-texts, .gallery-texts-spacing {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 4px 0px;
}

.gallery-slide-text, .gallery-noscript-text {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.25;
}

.gallery-slide-author {
    font-size: 16px;
    color: rgba(0,0,0,0.6);
}

.gallery-noscript-container {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.gallery-noscript-image-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
}

.single-entry-tags {
    margin-top: 8px;
    margin-bottom: 0;
}

.clicks-enabled {
    pointer-events: auto;
}

.gallery-preview-next-container {
    width: calc(100% + 1px);
    min-width: calc(100% + 1px);
    position: relative;

    pointer-events: none;
}

img.gallery-preview-next-image {
    width: 100%;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    object-fit: contain;
}

.gallery-preview-next-text-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 100px 48px 24px;
    color: #fff;
    background: linear-gradient(180deg, transparent, rgb(0 0 0 / 75%));
    max-height: 100%;
    line-height: 1.5rem;
    text-shadow: 0 0 2px black;
}

.gallery-preview-next-gallery-text {
    font-size: 0.75rem;
}

.gallery-preview-next-text {
    max-height: 3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;

    font-size: 1.25rem;
    font-weight: 700;
}

.gallery-custom-loader {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background:
            radial-gradient(farthest-side, #000000 94%,#0000) top/4px 4px no-repeat,
            conic-gradient(#0000 30%, #000000);
    -webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 4px),#000 0);
    animation: gallery-custom-loader-s3 1s infinite linear;
}

@keyframes gallery-custom-loader-s3 {
    100%{transform: rotate(1turn)}
}


.galley-title-padding {
    padding: 8px 16px 0;
}