/* CLS-fix: reserver plads til lazy-loaded billeder
   LSCWP sætter data-lazyloaded=1 + placeholder src; uden eksplicit
   aspect-ratio i CSS giver browseren placeholder 0px højde indtil swap. */

/* Sikrer at <img> med width+height HTML-attributter får korrekt
   intrinsic aspect-ratio også når src er en lazy placeholder. */
img[width][height] {
    height: auto;
    aspect-ratio: attr(width) / attr(height);
}

/* Eksplicit for LSCWP lazy-loaded billeder før de er swappet ind.
   Bredden styres af container/Elementor; højde kommer fra aspect-ratio. */
img[data-lazyloaded][width][height],
img[data-ll-status][width][height] {
    height: auto;
    aspect-ratio: attr(width) / attr(height);
    max-width: 100%;
}

/* Fallback: hvis aspect-ratio attr() ikke understøttes,
   sæt min-height så placeholder ikke kollapser. */
@supports not (aspect-ratio: attr(width) / attr(height)) {
    img[data-lazyloaded] {
        min-height: 1px;
    }
}
