/* ================================================================
   SpeedShield — Frontend CSS
   Minimal, performance-focused: lazy-load placeholders, YouTube
   facade, skeleton loader, CLS prevention.
   ================================================================ */

/* ── Lazy Load Image Placeholder ─────────────────────────────── */
img.ssp-lazy {
    opacity: 0;
    transition: opacity 0.4s ease;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ssp-shimmer 1.5s infinite;
}

img.ssp-lazy.ssp-loaded {
    opacity: 1;
    animation: none;
    background: none;
}

/* ── Shimmer Skeleton Animation ───────────────────────────────── */
@keyframes ssp-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Lazy Iframe ──────────────────────────────────────────────── */
iframe.ssp-lazy-iframe {
    min-height: 200px;
    background: #1a1a2e;
}

/* ── YouTube Facade ───────────────────────────────────────────── */
.ssp-yt-facade {
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ssp-yt-play {
    transition: transform 0.2s ease, background 0.2s ease;
}

.ssp-yt-play:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    background: rgba(200, 0, 0, 0.95) !important;
}

/* ── Aspect Ratio Preservation (CLS) ─────────────────────────── */
img[width][height] {
    height: auto;
}

/* ── Image Responsive ─────────────────────────────────────────── */
img.ssp-lazy,
img.ssp-loaded {
    max-width: 100%;
    height: auto;
}

/* ── Responsive Video Wrapper ─────────────────────────────────── */
.ssp-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.ssp-video-wrap iframe,
.ssp-video-wrap video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
