/*
images.css
Image and media helpers. Pair them with an existing layout class; they only
handle sizing, cropping and framing.
 */

.ajus-img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Fill the parent box and crop the overflow (cards, thumbs, headers). */
.ajus-img-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ajus-img-rounded {
    border-radius: var(--radius-md);
}

.ajus-img-round {
    border-radius: 50%;
    object-fit: cover;
}

/* Fixed aspect ratio frame — prevents layout shift and crops consistently.
   Assign the frame class to a wrapper and put the image inside it. */
.ajus-ratio {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-bg-surface-soft);
}

.ajus-ratio::before {
    content: '';
    display: block;
    padding-top: var(--ratio, 56.25%);
}

.ajus-ratio > img,
.ajus-ratio > .ajus-img-cover,
.ajus-ratio > video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ajus-ratio--16x9 {
    --ratio: 56.25%;
}

.ajus-ratio--4x3 {
    --ratio: 75%;
}

.ajus-ratio--1x1 {
    --ratio: 100%;
}

.ajus-ratio--3x4 {
    --ratio: 133.33%;
}
