/*
 * Progressive Block Loader responsive skeleton styles.
 * Full replacement file.
 */

/*
 * The skeleton surface uses the Figma blue. Internal shapes intentionally use
 * lighter/darker complementary tones so the layout remains visible.
 */
:root {
    --pld-background: #c0d0f2;
    --pld-shape: #91a9dc;
    --pld-card: #e8eefb;
    --pld-card-strong: #d7e1f7;
    --pld-shimmer-highlight: rgba(255, 255, 255, 0.52);
    --pld-shimmer-duration: 1.55s;
}

.pld-skeleton,
.pld-skeleton__visual {
    background-color: var(--pld-background) !important;
}

/* Restore visible structure for every CSS-generated placeholder. */
.pld-skeleton__shape,
.pld-skeleton__copy i,
.pld-cover-column-card i,
.pld-cover-column-title,
.pld-cover-column-line,
.pld-fast-facts-feature i,
.pld-fast-facts-row-copy i {
    background-color: var(--pld-shape) !important;
}

.pld-cover-column-card,
.pld-fast-facts-feature,
.pld-fast-facts-row {
    background-color: var(--pld-card) !important;
}

.pld-cover-column-media,
.pld-fast-facts-number {
    background-color: var(--pld-card-strong) !important;
}

.pld-fast-facts-feature {
    border-color: var(--pld-card) !important;
}

/*
 * Universal shimmer. The selector replaces the original CSS-fallback-only
 * shimmer and works above desktop SVGs, mobile SVGs, and CSS layouts.
 */
.pld-skeleton::after,
.pld-skeleton--css-fallback::after {
    content: "";
    position: absolute;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: -70%;
    width: 55%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        var(--pld-shimmer-highlight) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-18deg);
    animation: pld-unified-shimmer var(--pld-shimmer-duration) ease-in-out infinite;
}

@keyframes pld-unified-shimmer {
    0% { left: -70%; }
    100% { left: 125%; }
}

/*
 * Tablet fallback: never blank the desktop SVG. If no mobile SVG exists, the
 * desktop SVG remains visible instead of becoming a solid rectangle.
 */
@media (max-width: 1024px) {
    .pld-skeleton {
        min-height: 220px;
    }

    .pld-skeleton--has-image .pld-skeleton__visual {
        background-image: var(--pld-image, none);
    }
}

@media (max-width: 767px) {
    /* A real mobile SVG overrides the desktop SVG only when the file exists. */
    .pld-skeleton--has-mobile-image .pld-skeleton__visual {
        background-image: var(--pld-image-mobile);
    }

    /* Generic and Media/Text CSS fallbacks keep their visible structure. */
    .pld-skeleton--css-fallback .pld-skeleton__visual {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 28px 20px;
        box-sizing: border-box;
        background-image: none;
    }

    .pld-skeleton--css-fallback .pld-skeleton__shape,
    .pld-skeleton--css-fallback .pld-skeleton__copy {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        width: auto;
    }

    .pld-skeleton--css-fallback .pld-skeleton__shape {
        display: block;
        order: 1;
        width: 100%;
        height: 220px;
        flex: 0 0 220px;
        border-radius: 12px;
    }

    .pld-skeleton--css-fallback .pld-skeleton__copy {
        display: block;
        order: 2;
        width: 100%;
    }

    .pld-skeleton--text-media.pld-skeleton--css-fallback .pld-skeleton__copy {
        order: 1;
    }

    .pld-skeleton--text-media.pld-skeleton--css-fallback .pld-skeleton__shape {
        order: 2;
    }

    /* Two, three, and four-column CSS cards stack without losing card detail. */
    .pld-cover-columns-grid {
        position: absolute;
        inset: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 20px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .pld-cover-column-card {
        min-height: 180px;
        padding: 18px;
    }

    .pld-cover-column-media {
        min-height: 78px;
        margin-bottom: 18px;
    }

    /* Fast Facts keeps one left feature card followed by three fact rows. */
    .pld-fast-facts-grid {
        position: absolute;
        inset: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 20px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .pld-fast-facts-feature {
        min-height: 240px;
    }

    .pld-fast-facts-stack {
        gap: 14px;
    }

    .pld-fast-facts-row {
        min-height: 110px;
        grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pld-skeleton::after,
    .pld-skeleton--css-fallback::after {
        animation: none;
        display: none;
    }
}
