/*
 * Bundle website: photo placeholder (script: views/skeleton.xml), as on the Kondo and BULKS websites (S-24).
 * Namespace: bw-* only (bd-* / bq-* belong to the bundle and bulk quotation pages).
 */

/* While a photo loads, its box shows the Bundle "b" (first shape of Logo.svg) on light grey. Drawn here, no extra
   download. The script adds .bw-img-ok once the photo has loaded, so nothing stays behind a transparent image. Not on
   hover photos (they would cover the first photo), logos, small portraits nor cut-out pictures. */
.bw-img-on img[src]:not(.bw-img-ok, .featured-product-img-hover, .bwc-hover-img, .brand-logo-img, .footer-logo-img, .profile-avatar, .testimonial-avatar, .comment-avatar, .mission-phone, .scene-img) {
    background: var(--bg-light-grey, #f8f9fa) center / min(3.5rem, 30%) auto no-repeat;
}

/* The "b": after the first frame only (see the script), drawing it earlier delays the page */
.bw-img-painted img[src]:not(.bw-img-ok, .featured-product-img-hover, .bwc-hover-img, .brand-logo-img, .footer-logo-img, .profile-avatar, .testimonial-avatar, .comment-avatar, .mission-phone, .scene-img) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30.71 36.97'%3E%3Cpath fill='%23c9ced6' d='M5.445 14.8168V25.0487C5.445 28.6504 8.41 31.5752 12.05 31.5752H25.255V27.519C25.255 20.5133 19.485 14.8168 12.4 14.8168H5.445ZM25.995 36.9605H12.05C5.405 36.9605 0 31.6197 0 25.0537V0H5.445V9.43651H12.4C22.49 9.43651 30.705 17.5489 30.705 27.524V32.3114C30.705 34.8756 28.595 36.9605 26 36.9605'/%3E%3C/svg%3E");
}

/* Photos under white text: plain navy while they load, so the text stays readable, without the "b" */
.bw-img-on :is(.hero-fs-img, .page-hero-img, .inspiration-img, .industry-page-hero img):not(.bw-img-ok) {
    background: var(--bundle-blue, #0a2240);
}

/* The photo arrives soft and muted, then sharpens. A filter, not a fade: fading the <img> would hide its placeholder
   too and flash white. */
img.bw-img-in:not(.featured-product-img-hover, .bwc-hover-img, .brand-logo-img, .footer-logo-img, .profile-avatar, .testimonial-avatar, .comment-avatar, .mission-phone, .scene-img) {
    animation: bw-img-in 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes bw-img-in {
    from {
        filter: blur(12px) saturate(0.6) brightness(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    img.bw-img-in {
        animation: none !important;
    }
}
