/* Instagram Feed Widget Styles */

.instagram-feed-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    gap: var(--grid-gap, 1px);
    max-width: 100%;
    margin: 0 auto;
}

.instagram-feed-horizontal {
    display: flex;
    overflow-x: auto;
    gap: var(--grid-gap, 1px);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 10px; /* Space for potential scrollbar */
    /* Prevent layout shifts */
    transform: translateZ(0);
    will-change: scroll-position;
    /* Hide scrollbar */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.instagram-feed-horizontal::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.instagram-feed-horizontal .instagram-post {
    flex: 0 0 auto;
    width: var(--post-width, 200px);
    min-width: var(--post-width, 200px);
    /* Prevent layout shifts */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.instagram-post {
    position: relative;
    aspect-ratio: 124/166; /* Portrait aspect ratio as per specs */
    overflow: hidden;
    border-radius: 4px;
    /* Prevent any hover effects */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.instagram-post:hover {
    /* Explicitly prevent any hover effects */
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.instagram-post a:hover {
    /* Prevent link hover effects */
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.instagram-post a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.post-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}



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

.post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-post:hover .post-overlay {
    opacity: 1;
}

.post-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.icon-with-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    text-align: center;
}

.icon-heart,
.icon-comment {
    width: 24px;
    height: 24px;
}

.count {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.media-type-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.media-type-indicator svg {
    width: 24px;
    height: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .instagram-feed-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
    }
    
    .instagram-feed-horizontal .instagram-post {
        width: calc(var(--post-width, 200px) * 0.9); /* Slightly smaller on tablet */
        min-width: calc(var(--post-width, 200px) * 0.9);
    }
}

@media (max-width: 480px) {
    .instagram-feed-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
    
    .instagram-feed-horizontal .instagram-post {
        width: calc(var(--post-width, 200px) * 0.8); /* Smaller on mobile */
        min-width: calc(var(--post-width, 200px) * 0.8);
    }
}

/* Elementor Editor Styles */
.elementor-editor-active .instagram-feed-grid {
    min-height: 200px;
}

.elementor-editor-active .instagram-post {
    background: #f0f0f0;
    border: 1px dashed #ccc;
}

.elementor-editor-active .instagram-post::before {
    content: "Instagram Post";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 12px;
}



/* Override Elementor's default hover effects */
.instagram-post,
.instagram-post *,
.instagram-post:hover,
.instagram-post *:hover,
.instagram-post a,
.instagram-post a:hover,
.instagram-post img,
.instagram-post img:hover {
    transform: none !important;
    transition: none !important;
    animation: none !important;
    filter: none !important;
    box-shadow: none !important;
    scale: 1 !important;
}

/* Prevent any inherited Elementor styles */
.elementor-widget-instagram_feed_widget .instagram-post,
.elementor-widget-instagram_feed_widget .instagram-post * {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}
