/* Team photo with hotspots (Mask element team_photo)
   Layout follows the design PDF: text circle on the light green area, "+" markers on the people,
   a white window with portrait, name and role on hover.
   All sizes use container units (cqw) so the whole stage scales with the photo. */

.team-photo {
    --tp-mint: #8fc4aa;
    --tp-marker: #8fcbb0;
    --tp-text: #0d0d0d;

    font-family: 'Poppins', sans-serif;
    color: var(--tp-text);
    background: #dde9e3;            /* same light green as the left edge of the photo */
}

.team-photo *,
.team-photo *::before,
.team-photo *::after { box-sizing: border-box; }

.team-photo__stage {
    position: relative;
    container-type: inline-size;
    overflow: hidden;
    line-height: 1.25;
}

.team-photo__img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Text circle ----------
   Left edge: on large screens 15.2% of the photo (as in the design); on smaller screens it
   lines up with the site container (max 1090 px, 15 px padding, centered), whichever is further left.
   The diameter is capped so the circle never covers the people.
   Text sizes are a fraction of the circle diameter (--tp-d). */
.team-photo__circle {
    --tp-left: min(15.2cqw, max(15px, calc((100cqw - 1090px) / 2 + 15px)));
    --tp-d: min(21.6cqw, calc(38cqw - var(--tp-left)));

    position: absolute;
    z-index: 2;                    /* stays solid above the white veil, as in the design */
    left: var(--tp-left);
    top: 50%;
    transform: translateY(-50%);
    width: var(--tp-d);
    height: var(--tp-d);           /* same as width, so the circle can never become an ellipse */
    border-radius: 50%;
    background: var(--tp-mint);
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--tp-d) * .09) calc(var(--tp-d) * .11);
    overflow: hidden;
}
.team-photo__heading {
    margin: 0 0 calc(var(--tp-d) * .028);
    font-size: calc(var(--tp-d) * .09);
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}
.team-photo__text p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
/* Hard line breaks from the editor text are ignored, the text wraps inside the circle */
.team-photo__text br { content: ' '; }
.team-photo__text {
    margin: 0;
    font-size: calc(var(--tp-d) * .055);
    font-weight: 400;
    line-height: 1.25;
    color: #fff;
}

/* ---------- White veil behind the window ---------- */
.team-photo__veil {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: rgba(255, 255, 255, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
    pointer-events: none;
}
.team-photo.is-open .team-photo__veil {
    opacity: 1;
    visibility: visible;
}

/* ---------- Markers ---------- */
.team-photo__marker {
    position: absolute;
    z-index: 11;
    width: 1.6cqw;
    min-width: 28px;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--tp-marker);
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: background-color .2s, box-shadow .2s, opacity .25s;
}
.team-photo__marker::before,
.team-photo__marker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    border-radius: 2px;
    transform: translate(-50%, -50%);
}
.team-photo__marker::before { width: 50%; height: 12%; }
.team-photo__marker::after  { width: 12%; height: 50%; }

.team-photo__marker:hover,
.team-photo__marker.is-active {
    background: #000;
    box-shadow: 0 0 0 2px #fff;
}
.team-photo__marker.is-active { z-index: 13; }   /* the active marker stays visible on the window edge, as in the design */
.team-photo__marker:focus-visible {
    outline: 3px solid #000;
    outline-offset: 3px;
}
.team-photo.is-open .team-photo__marker:not(.is-active) { opacity: .35; }

/* ---------- Window ---------- */
.team-photo__card {
    position: absolute;
    z-index: 12;
    left: 47.5%;                   /* default only, JS places the window next to the marker */
    top: 21%;
    width: 31%;
    display: flex;
    gap: 1.2cqw;
    padding: .9cqw;
    border-radius: 1.3cqw;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 .5cqw 2cqw rgba(0, 0, 0, .25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(.8cqw);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.team-photo__card.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.team-photo__portrait {
    flex: 0 0 47%;
}
.team-photo__portrait img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 347 / 505;
    object-fit: cover;
    border-radius: 1cqw;
}
.team-photo__info {
    flex: 1 1 auto;
    align-self: center;
    padding-right: .6cqw;
}
.team-photo__name {
    margin: 0 0 .5cqw;
    font-size: max(14px, 1.5cqw);
    font-weight: 600;
    line-height: 1.2;
}
.team-photo__role {
    margin: 0;
    font-size: max(12px, 1.27cqw);
    font-weight: 400;
    line-height: 1.2;
}
.team-photo__more {
    display: inline-block;
    margin-top: 1cqw;
    font-size: max(12px, 1.2cqw);
    font-weight: 600;
    color: #000;
    text-decoration: underline;
}

.team-photo__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Small screens: no markers (the portrait grid below the banner is used),
   the text circle becomes a block above the photo ---------- */
@media (max-width: 767px) {
    .team-photo__stage { overflow: visible; display: flex; flex-direction: column-reverse; }
    .team-photo__img {
        height: auto;
        min-height: 200px;
        object-fit: cover;
        object-position: 82% center;
    }
    .team-photo__circle {
        position: static;
        transform: none;
        width: auto;
        height: auto;
        border-radius: 0;
        overflow: visible;
        padding: 24px 16px;
    }
    .team-photo__heading { font-size: 22px; margin-bottom: 8px; }
    .team-photo__text { font-size: 15px; }
    .team-photo__marker,
    .team-photo__card,
    .team-photo__veil { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .team-photo__veil,
    .team-photo__marker,
    .team-photo__card { transition: none; }
}
