/*
 * Steiner_Mitarbeiter: styles of the team page (widget "Mitarbeiter je Standort").
 * Taken over from the <style> block of the former CMS pages "mitarbeiter" (AT/DE);
 * base styles (.personenbox, .mitarbeiterbox, .mitarbeiterbild img) come from the theme
 * (Steiner/Josefsteiner web/css/steiner-global.css). Native CSS nesting.
 */
.mitarbeitername {
    margin-top: 10px;

    h4 {
        font-size: 15px;
    }
}

.mitarbeitermail {
    font-size: 12px;
    margin-bottom: 10px;
}

.mitarbeiternummer {
    font-size: 13px;
}

/* e-mail placeholder until js/mail.js has built the link: the "@" is not in the HTML (spam protection) */
.mitarbeitermail-at::before {
    content: "\0040";
}

/* replaces the former global "h1 { clear: both; }": the widget output contains its floats */
.mitarbeiter-standort {
    display: flow-root;
}

.personenbox .mitarbeiterbox {
    @media (min-width: 1048px) {
        width: 20%;

        &:nth-of-type(5n+1) {
            clear: left;
        }
    }
    @media (min-width: 800px) and (max-width: 1047px) {
        width: 25%;

        &:nth-of-type(4n+1) {
            clear: left;
        }
    }
    @media (min-width: 543px) and (max-width: 799px) {
        width: 33.3%;

        &:nth-of-type(3n+1) {
            clear: left;
        }
    }
    @media (max-width: 542px) {
        width: 50%;

        &:nth-of-type(2n+1) {
            clear: left;
        }
    }
}

/*
 * Photo frame (SHOP-69): fixed size 248 x 244 (scales down in narrow columns, same ratio) with the grey
 * gradient of the photos as background (sampled from a photo: #f3f3f3 top to #575757 bottom).
 * Uploads with another size/ratio are cropped to the frame (head stays visible); cut-out photos
 * (transparent PNG/WebP) show the gradient behind the person.
 * Shadow only on cut-out photos (class mitarbeiterbild--cutout, set by the widget block after checking the file for
 * transparency): drop-shadow follows the outline and is NOT clipped by the frame, so it may extend beyond it
 * (light from the top right as in the photos; on desktop the mouse pointer is the light source, js/light.js).
 * Photos with a built-in background get no shadow (it would show as a rectangle around the frame).
 */
.mitarbeiterbox .mitarbeiterbild {
    width: 248px;
    max-width: 100%;
    aspect-ratio: 248 / 244;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(to bottom, #f3f3f3 0%, #dedede 25%, #bcbcbc 50%, #909090 74%, #575757 100%);

    picture {
        display: contents;
    }

    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }

    &.mitarbeiterbild--cutout img {
        /* fixed light from the top right like in the photos (shadow to the left); js/light.js sets the variables
           from the mouse position (desktop) */
        filter: drop-shadow(var(--shadow-x, -6px) var(--shadow-y, 6px) var(--shadow-blur, 6px) rgba(0, 0, 0, 0.35));
        transition: filter 0.2s ease-out;
    }
}
