@import "../mixins/mixins-master";

/* Elementor Empty Widget Container Fix */
.elementor-widget-pp-instafeed .pp-instagram-feed {
    min-height: 2px;
}
// Masonry layout — items are absolutely positioned by the instafeed script; the
// container is sized via an explicit height, so the flow-based negative gutter
// margin must be neutralised. A CSS-grid fallback keeps the correct column count
// visible in the brief window before the script runs (e.g. switching to masonry
// in the editor), instead of collapsing to a single full-width column.
.pp-instafeed-grid.pp-instafeed-masonry {
    position: relative;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: grid;
    grid-template-columns: repeat(var(--pp-gallery-columns, 5), 1fr);
    // Gap doubles as the pre-script gutter (no item padding → no load-in shift)
    // and the source the script reads back via getComputedStyle().column/row-gap.
    gap: var(--grid-row-gap, 0) var(--grid-column-gap, 0);
}

.pp-media-overlay {
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	bottom: 0;

	@include transition();
}

.pp-icon {
	display: inline-block;
	line-height: 1;
	text-align: center;
    transition: all .3s;
}

.pp-icon i,
.pp-icon svg {
    width: 1em;
    height: 1em;
    position: relative;
    display: block;
}

.pp-instagram-feed {
    position: relative;

    .pp-feed-item {
        float: inline-start;
        position: relative;

        img {
            filter: none;
			vertical-align: middle;
        }

        &:hover {

            img {
                filter: none;
            }
        }
    }

    &-gallery {

        .pp-feed-item {
            width: 20%;
        }
    }

    &-title-wrap {
        background: #fff;
        position: absolute;
        z-index: 2;

        @include center(both);
    }

    &-title-wrap {

        .pp-insta-title-top & {
            top: 0;

            @include center(horizontal);
        }

        .pp-insta-title-bottom & {
            bottom: 0;
            top: auto;

            @include center(horizontal);
        }
    }

    &-title {
        display: block;
        padding: 6px 30px;
        text-align: center;
    }

    .pp-feed-item {
        position: relative;
    }

    .pp-feed-item-inner {
        display: block;
        position: relative;
    }

    &-gray .pp-feed-item img {
        filter: grayscale(100%);

        @include transition(filter);
    }

    &-hover-gray .pp-feed-item:hover img {
        filter: grayscale(100%);

        @include transition(filter);
    }

    .pp-overlay-container {
        color: #fff;
        display: flex;
		flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1;

        span {
			display: flex;
			align-items: center;
            margin: 0 5px;
        }
    }

    &-hover {

        .pp-overlay-container {
            opacity: 0;
        }

        .pp-feed-item:hover {

            .pp-overlay-container {
                opacity: 1;
            }
        }
    }

    .swiper-container {

        .swiper-slide {

            img {
                width: 100%;
            }
        }
    }
}

.pp-insta-icons {
	display: flex;
}

.pp-instafeed {
	position: relative;
}

.pp-if-icon {
	margin-inline-end: 5px;
}

.pp-if-square-images {

	.pp-feed-item-inner {
		position: relative;
		padding-bottom: 100%;
		width: 100%;
	}

	.pp-if-img {
    	overflow: hidden;
		position: absolute;
		width: 100%;
		height: 100%;
		inset-inline-start: 0;
		top: 0;
	}

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

.pp-load-more-button {
    cursor: pointer;

    &[disabled='disabled'] {
        display: none;
    }
}

.pp-button-loading {

    .pp-button-loader {
        display: inline-block;
        width: 22px;
        height: 22px;
        vertical-align: middle;
        margin-inline-end: 8px;

        &::after {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 3px solid #fff;
            border-color: #fff transparent #fff transparent;
            animation: pp-dual-ring 1.2s linear infinite;
        }
    }

    @keyframes pp-dual-ring {

      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }
}

/* Warning for Empty Instagram Feed */
.pp-instagram-warning {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 3px;
    box-shadow: 0 0 12px -5px #c0c0c0;
    
    &::before {
        content: '\f071';
        font-family: 'Font Awesome 5 Free', sans-serif;
        font-weight: 900;
        margin-inline-end: 10px;
        font-size: 20px;
        color: #e14e4e;
    }
}