/* 
 * MoSaude Image System Foundation
 * Goal: Visual consistency and robust image rendering
 */

/* 1. Base Container */
.img-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

.img-bg {
    background-color: #f8f9fa;
}

/* 2. Common Aspect Ratios */
.ratio-1-1 { aspect-ratio: 1 / 1; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-3-2 { aspect-ratio: 3 / 2; }

/* 3. Image Behavior */
.img-content {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the container without stretching */
    object-position: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: block;
}

/* 4. Fit variants */
.img-contain { object-fit: contain; }
.img-cover { object-fit: cover; }

/* 5. Special Variants */
.img-avatar {
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.img-rounded {
    border-radius: 8px;
}

/* 6. States */
.img-loading {
    filter: blur(10px);
}

.img-loaded {
    filter: blur(0);
}

/* 7. Hover Effects */
.img-wrapper.hover-zoom:hover .img-content {
    transform: scale(1.05);
}

/* 8. Fallback styling */
.img-wrapper.image-broken::after {
    content: "\F3FB"; /* Bootstrap Icons calendar/image icon code placeholder */
    font-family: "bootstrap-icons";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ced4da;
}
