/**
 * PSCX Toolkit Public Styles
 * Minimal CSS for frontend performance
 *
 * @package PSCX_Toolkit
 * @version 1.0.0
 */

/* Lazy Loading */
.pscx-lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.pscx-lazy.loaded {
    opacity: 1;
}

/* LQIP Background */
.pscx-lqip {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Placeholder Shimmer */
.pscx-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pscx-shimmer 1.5s infinite;
}

@keyframes pscx-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Progressive Image Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded,
img[loading="lazy"][data-loaded="true"] {
    opacity: 1;
}

/* Prevent layout shift */
.pscx-aspect-ratio {
    position: relative;
    width: 100%;
}

.pscx-aspect-ratio::before {
    content: "";
    display: block;
}

.pscx-aspect-ratio--16-9::before {
    padding-top: 56.25%;
}

.pscx-aspect-ratio--4-3::before {
    padding-top: 75%;
}

.pscx-aspect-ratio--1-1::before {
    padding-top: 100%;
}

.pscx-aspect-ratio > img,
.pscx-aspect-ratio > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

