/*!
 * WebCMS lazy loading 1.0.0 — shared, theme-agnostic skeleton styles.
 *
 * The versioned path /static/vendor/webcms-lazy/1.0.0/ is served with
 * Cache-Control: immutable, so breaking changes must ship as a new version
 * directory rather than an edit in place.
 *
 * Colours come from --lazy-* custom properties so a theme can restyle the
 * skeleton from its own stylesheet without duplicating any layout rule.
 */

:root {
    --lazy-skeleton-base: #e9ecf3;
    --lazy-skeleton-highlight: rgba(255, 255, 255, 0.65);
    --lazy-fallback-bg: #f4f5f7;
    --lazy-fallback-text: #8a94a6;
    --lazy-card-radius: 12px;
    --lazy-min-height: 180px;
    --lazy-transition: 240ms ease;
}

/* --- Media placeholder -----------------------------------------------
   The shimmer is painted on the element's own background: no wrapper element
   is inserted, so existing theme selectors and fixed-height containers keep
   working untouched. */
.lazy-media {
    background-color: var(--lazy-skeleton-base);
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        var(--lazy-skeleton-highlight) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: lazy-shimmer 1.4s ease-in-out infinite;
}

.lazy-media.is-loaded {
    background-image: none;
    background-color: transparent;
    animation: none;
}

.lazy-media.is-failed {
    background-color: var(--lazy-fallback-bg);
    background-image: none;
    animation: none;
}

@keyframes lazy-shimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

/* --- Terminal placeholder for media that never loaded ---------------- */
.lazy-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: var(--lazy-min-height);
    padding: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: center;
    color: var(--lazy-fallback-text);
    background-color: var(--lazy-fallback-bg);
    border-radius: var(--lazy-card-radius);
}

/* --- List skeleton --------------------------------------------------- */
.lazy-skeleton-card {
    box-sizing: border-box;
    width: 100%;
    min-height: var(--lazy-min-height);
    background-color: var(--lazy-skeleton-base);
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        var(--lazy-skeleton-highlight) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    border-radius: var(--lazy-card-radius);
    animation: lazy-shimmer 1.4s ease-in-out infinite;
}

.lazy-list-status {
    margin-top: 1.25rem;
    text-align: center;
}

/* Invisible scroll tripwire; must keep a non-zero height to be observable. */
.lazy-sentinel {
    width: 100%;
    height: 1px;
}

.lazy-list-end {
    margin: 0;
    font-size: 0.875rem;
    color: var(--lazy-fallback-text);
}

/* Added by lazy.js only once a list actually activates, so the classic
   pagination stays visible when JS is unavailable or the list is not
   lazy-loadable. */
[data-lazy-pagination] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .lazy-media,
    .lazy-skeleton-card {
        animation: none;
    }
}
