/**
 * Social Feeds Frontend Styles
 *
 * @package BoneAppetitSocialFeeds
 */

/* Block Container */
.basf-social-feeds-grid {
    position: relative;
}

/* Image container z-index */
.basf-feed-card .basf-image-container {
    z-index: 1;
}

/* Ensure content is above image */
.basf-feed-card > .relative.z-10 {
    z-index: 10;
}

/* Feed Card Base */
.basf-feed-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.basf-feed-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Network-specific backgrounds when no image */
.basf-feed-card[data-network="youtube"]:not(:has(img)) {
    background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%);
}

.basf-feed-card[data-network="instagram"]:not(:has(img)) {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.basf-feed-card[data-network="facebook"]:not(:has(img)) {
    background: linear-gradient(135deg, #1877F2 0%, #0d65d9 100%);
}

.basf-feed-card[data-network="tiktok"]:not(:has(img)) {
    background: linear-gradient(135deg, #000000 0%, #25F4EE 50%, #FE2C55 100%);
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Network Badge */
.basf-feed-card .network-badge {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Smooth image loading */
.basf-feed-card img {
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.basf-feed-card img[loading="lazy"] {
    opacity: 0;
}

.basf-feed-card img[loading="lazy"].loaded,
.basf-feed-card img:not([loading="lazy"]) {
    opacity: 1;
}

/* Focus states for accessibility */
.basf-feed-card:focus {
    outline: 2px solid #E36D3A;
    outline-offset: 2px;
}

.basf-feed-card:focus:not(:focus-visible) {
    outline: none;
}

.basf-feed-card:focus-visible {
    outline: 2px solid #E36D3A;
    outline-offset: 2px;
}

/* Animation for cards appearing */
@keyframes basf-card-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.basf-social-feeds-grid[data-animate="true"] .basf-feed-card {
    animation: basf-card-appear 0.5s ease forwards;
}

.basf-social-feeds-grid[data-animate="true"] .basf-feed-card:nth-child(1) { animation-delay: 0ms; }
.basf-social-feeds-grid[data-animate="true"] .basf-feed-card:nth-child(2) { animation-delay: 100ms; }
.basf-social-feeds-grid[data-animate="true"] .basf-feed-card:nth-child(3) { animation-delay: 200ms; }
.basf-social-feeds-grid[data-animate="true"] .basf-feed-card:nth-child(4) { animation-delay: 300ms; }

/* Icon pulse on hover */
.basf-feed-card:hover svg {
    animation: basf-icon-pulse 0.3s ease;
}

@keyframes basf-icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Skeleton loading state */
.basf-feed-card.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: basf-skeleton 1.5s ease-in-out infinite;
}

@keyframes basf-skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .basf-social-feeds-grid .grid {
        gap: 16px;
    }

    .basf-feed-card {
        aspect-ratio: 1 / 1;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .basf-feed-card {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .basf-feed-card,
    .basf-feed-card img,
    .basf-feed-card svg {
        transition: none;
        animation: none;
    }
}

/* Print styles */
@media print {
    .basf-social-feeds-grid {
        display: none;
    }
}

