.staff-image-mosaic-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: var(--mosaic-height, 350px);
    background-color: var(--mosaic-bg, transparent);
    overflow: hidden;
}

.staff-image-mosaic-wrapper.allow-overflow {
    overflow: visible;
}

.staff-image-mosaic-wrapper .staff-image-mosaic-link {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.staff-image-mosaic-track {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    max-width: 100%;
    gap: var(--mosaic-gap, 0px);
}

.staff-image-mosaic-item {
    flex: 0 0 auto;
    height: 100%;
    position: relative;
    overflow: visible;
    transition: scale 0.3s ease, filter 0.3s ease;
}

.staff-image-mosaic-item:hover {
    scale: 1.03;
    filter: brightness(1.08);
    z-index: 3;
}

.staff-image-mosaic-item > img {
    display: block;
    height: 100%;
    width: auto;
    object-fit: cover;
}

.staff-image-mosaic-item.polaroid {
    background: #fff;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.staff-image-mosaic-item.polaroid > img {
    height: 100%;
}

.staff-image-mosaic-badge-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.staff-image-mosaic-badge {
    position: absolute;
    pointer-events: none;
    height: auto;
    max-height: var(--badge-size);
    object-fit: contain;
    transition: scale 0.3s ease;
}

.staff-image-mosaic-badge.is-hovered {
    scale: 1.15;
}

.staff-image-mosaic-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 15;
    padding: 10px 20px;
    line-height: 1.1;
    white-space: nowrap;
    pointer-events: auto;
    transform: rotate(-5deg);
    transform-origin: left bottom;
    border: 1px solid #FF0000;
    cursor: pointer;
    text-decoration: none;
}

.staff-image-mosaic-overlay::before {
    content: '';
    display: inline;
    transition: opacity 0.4s ease;
    opacity: 0;
}

a.staff-image-mosaic-overlay:hover,
.staff-image-mosaic-overlay:hover {
    color: #FF0000 !important;
    background-color: #FFFFFF !important;
    transition: color 0.6s ease, background-color 0.6s ease, border-color 0.6s ease;
}

a.staff-image-mosaic-overlay:hover::before,
.staff-image-mosaic-overlay:hover::before {
    content: '👉 ';
    opacity: 1;
}

@keyframes overlay-pulse {
    0%   { transform: rotate(-5deg) scale(1); }
    50%  { transform: rotate(-5deg) scale(1.06); }
    100% { transform: rotate(-5deg) scale(1); }
}

.staff-image-mosaic-overlay.is-pulsing {
    animation: overlay-pulse 1.4s ease-in-out infinite;
}

.staff-image-mosaic-overlay.is-pulsing::before {
    content: '👉 ';
    opacity: 1;
}

.staff-image-mosaic-wrapper.hide-on-mobile {
    display: block;
}

.staff-image-mosaic-wrapper.hide-on-desktop {
    display: none;
}

@media (max-width: 768px) {
    .staff-image-mosaic-wrapper {
        height: auto;
        overflow: visible;
    }

    .staff-image-mosaic-wrapper.allow-overflow {
        overflow: visible;
    }

    .staff-image-mosaic-track {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        height: var(--mosaic-mobile-height, 200px);
        gap: 10px;
        padding: 0 15px;
    }

    .staff-image-mosaic-item {
        flex: 0 0 65%;
        height: 100%;
        overflow: hidden;
        scroll-snap-align: start;
        transform: none !important;
        margin-left: 0 !important;
    }

    .staff-image-mosaic-item.polaroid {
        padding: 0;
        box-shadow: none;
        background: none;
    }

    .staff-image-mosaic-item > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4px;
    }

    .staff-image-mosaic-item:hover {
        scale: 1;
        filter: none;
        z-index: auto;
    }

    .staff-image-mosaic-badge-layer {
        display: none;
    }

    .staff-image-mosaic-overlay {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        transform-origin: center center;
        display: inline-block;
        margin: 15px 15px 0;
        font-size: 1.6rem !important;
    }

    @keyframes overlay-pulse {
        0%   { transform: scale(1); }
        50%  { transform: scale(1.08); }
        100% { transform: scale(1); }
    }

    .staff-image-mosaic-wrapper.hide-on-mobile {
        display: none;
    }

    .staff-image-mosaic-wrapper.hide-on-desktop {
        display: block;
    }
}

@media (max-width: 480px) {
    .staff-image-mosaic-track {
        height: var(--mosaic-mobile-height, 180px);
    }

    .staff-image-mosaic-item {
        flex: 0 0 75%;
    }

    .staff-image-mosaic-overlay {
        font-size: 1.3rem !important;
        padding: 8px 16px;
    }
}
