/* Loading Spinner for Images */
.img-loading-wrapper {
    position: relative;
    background-color: #f0f0f0;
    min-height: 200px;
    /* Approximate height of thumbnails */
    display: block;
    overflow: hidden;
}

.img-loading-wrapper::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary-color, #4a7cad);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 1;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.img-loading-wrapper img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: relative;
    z-index: 2;
    /* Sit above the loader */
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* When loading class is removed via JS, show image and hide loader */
.project-image:not(.img-loading-wrapper) img,
.news-image:not(.img-loading-wrapper) img {
    opacity: 1;
}

.project-image:not(.img-loading-wrapper)::before,
.news-image:not(.img-loading-wrapper)::before {
    display: none;
}