/* ======================================================================
   Sauce Team  —  v1.10.0
   Widget: sauce-team
   Left panel (title + filters) sticky; two team columns scroll with a slight
   parallax (left faster). Click a member -> slide-in popup from the right.
   ====================================================================== */

.sauce-team {
    --stm-gap:          40px;
    --stm-col-gap:      40px;
    --stm-name-color:   #ffffff;
    --stm-role-color:   rgba(255,255,255,0.65);
    --stm-heading-color:#ffffff;
    --stm-filter-color: #ffffff;
    --stm-accent:       var(--sauce-hot-sauce, #FF5338);
    --stm-header-h:     80px;
    --stm-sticky-offset: 40px;          /* extra offset below the header for the left panel */
    --stm-admin-bar:    0px;            /* JS sets when wp admin bar present */
    --stm-parallax-a:   260;            /* left column travel (px) */
    --stm-parallax-b:   70;             /* right column travel (px) */
    --stm-popup-bg:     var(--sauce-forest, #1B3E38);
    --stm-popup-text:   #ffffff;
    --stm-popup-muted:  rgba(255,255,255,0.7);
    background: transparent;
    width: 100%;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.stm__layout {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 2.4fr;
    gap: 60px;
    align-items: start;
}

/* Left panel sticks below the site header (and admin bar when logged in) */
.stm__left {
    position: sticky;
    top: calc(var(--stm-header-h) + var(--stm-admin-bar) + var(--stm-sticky-offset));
    align-self: start;
    z-index: 4;
}
.stm__heading {
    margin: 0 0 32px;
    color: var(--stm-heading-color);
    text-transform: uppercase;
}
.stm__filters { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.stm__filter {
    appearance: none;
    border: 1px solid #fff;
    background: transparent;
    color: var(--stm-filter-color);
    font: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 26px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.stm__filter:hover,
.stm__filter.is-active {
    background: var(--stm-accent);
    border-color: var(--stm-accent);
    color: #ffffff;
}

/* ── Team columns ────────────────────────────────────────────────────── */
.stm__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--stm-col-gap);
    align-items: start;
    transition: opacity 0.25s ease;
}
.stm__grid.is-swapping { opacity: 0; }
.stm__col { display: flex; flex-direction: column; gap: var(--stm-gap); will-change: transform; }
/* The right column starts lower for the masonry offset. */
.stm__col--b { margin-top: 80px; }

.stm__pool { display: none; }

.stm__item {
    cursor: pointer;
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    width: 100%;
}
.stm__photo {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 3 / 4;
    margin-bottom: 18px;
}
.stm__photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4,0,0.1,1);
}
.stm__item:hover .stm__photo img { transform: scale(1.05); }
.stm__name { margin: 0 0 4px; color: var(--stm-name-color); text-transform: uppercase; }
.stm__role { margin: 0; color: var(--stm-role-color); }

/* ── Popup ───────────────────────────────────────────────────────────── */
.stm__overlay {
    position: fixed;
    inset: 0;
    top: calc(var(--stm-header-h) + var(--stm-admin-bar));
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 9998;
}
.stm__overlay.is-open { opacity: 1; visibility: visible; }

.stm__popup {
    position: fixed;
    top: calc(var(--stm-header-h) + var(--stm-admin-bar));
    right: 0;
    height: calc(100% - var(--stm-header-h) - var(--stm-admin-bar));
    width: 100%;
    background: var(--stm-popup-bg);
    color: var(--stm-popup-text);
    z-index: 9999;
    transform: translateX(100%);
    visibility: hidden;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.stm__popup-inner {
    --stm-ppad: clamp(24px, 5vw, 90px);
    max-width: calc(1080px + var(--stm-ppad) * 2);
    margin: 0 auto;
    padding: 60px var(--stm-ppad) 120px;
    position: relative;
    box-sizing: border-box;
}

/* Top: back arrow + name + designation */
.stm__p-top { position: relative; margin-bottom: 48px; }
.stm__close {
    position: absolute;
    left: 0; top: 0;
    width: 54px; height: 54px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.stm__close svg { width: 22px; height: 22px; }
.stm__p-title { text-align: center; padding: 0 60px; }
.stm__p-name { margin: 0 0 8px; color: var(--stm-popup-text); text-transform: uppercase; }
.stm__p-role { margin: 0; color: var(--stm-popup-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Sticky in-popup panel (appears after scrolling past the title) */
.stm__sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 76px;
    margin: 0 0 -76px 0;          /* overlay; do not reserve flow space */
    background: var(--stm-popup-bg);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.stm__sticky.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* Inner matches the popup content width; the bar background stays full width. */
.stm__sticky-in {
    --stm-ppad: clamp(24px, 5vw, 90px);
    position: relative;
    max-width: calc(1080px + var(--stm-ppad) * 2);
    min-height: 76px;
    margin: 0 auto;
    padding: 16px var(--stm-ppad);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stm__sticky .stm__close {
    position: absolute;
    left: var(--stm-ppad);
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
}
.stm__sticky-text { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stm__sticky-name { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stm__sticky-role { color: var(--stm-popup-muted); font-size: 0.85em; text-transform: uppercase; }

/* Intro: image + bio */
.stm__p-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding-top: 36px;
    border-top: 1px solid rgba(255,255,255,0.18);
}
.stm__p-img { width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: rgba(255,255,255,0.05); }
.stm__p-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stm__p-bio { margin: 0; color: var(--stm-popup-text); }
.stm__p-bio p { margin: 0 0 1em; }
.stm__p-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    color: var(--stm-popup-text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.stm__p-linkedin .stm__li-arrow {
    width: 30px; height: 30px;
    border: 1px solid currentColor; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.stm__p-linkedin svg { width: 14px; height: 14px; }

/* Hot sauce topics */
.stm__hotsauce { text-align: center; padding: 80px 0 0; }
.stm__hotsauce-label { color: var(--stm-popup-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 20px; }
.stm__hotsauce-text { margin: 0; color: var(--stm-popup-text); text-transform: uppercase; }

/* FAQs accordion */
.stm__faqs { margin: 72px 0 0; }
.stm__faq { border-top: 1px solid rgba(255,255,255,0.18); }
.stm__faq:last-child { border-bottom: 1px solid rgba(255,255,255,0.18); }
.stm__faq-q {
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--sauce-sage, #AABCA2);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    padding: 24px 48px 24px 0;
    position: relative;
    transition: color 0.25s ease;
}
.stm__faq.is-open .stm__faq-q { color: var(--stm-popup-text, #ffffff); }
.stm__faq-q::after {
    content: '+';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    font-size: 1.4em;
    line-height: 1;
}
.stm__faq.is-open .stm__faq-q::after { content: '\2212'; } /* minus */
.stm__faq-a {
    max-height: 0;
    overflow: hidden;
    color: var(--stm-popup-text, #ffffff);
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 60px 0 0;
}
.stm__faq.is-open .stm__faq-a { max-height: 600px; padding-bottom: 24px; }
.stm__faq-a p { margin: 0 0 1em; }

/* Quote */
.stm__quote {
    margin: 90px auto 0;
    text-align: center;
    color: var(--stm-popup-text);
    max-width: 760px;
}

/* Lock the page without losing scroll position; the popup itself still
   scrolls. JS sets body.top to the negative scroll offset. */
html.stm-locked { overflow: hidden; }
body.stm-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}
/* Keep the site header visible + solid while the popup is open. The theme may
   otherwise hide it (transform/opacity) once our scroll lock changes things. */
body.stm-locked #wrapper-navbar,
body.stm-locked .uicore-navbar,
body.stm-locked #wrapper-navbar .uicore-header-wrapper,
body.stm-locked .uicore-navbar .uicore-header-wrapper {
    transform: none !important;
    translate: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
body.stm-locked .uicore-navbar .uicore-header-wrapper:before {
    background: var(--ui-custom-f6620da5-color);
    opacity: 1 !important;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .stm__layout { grid-template-columns: 1fr; gap: 32px; }
    /* Left panel moves on top and sticks below the header while scrolling. */
    .stm__left {
        position: sticky;
        top: calc(var(--stm-header-h) + var(--stm-admin-bar));
        background: var(--sauce-plum, #440E26);
        padding: 16px 0;
        margin: 0;
        z-index: 6;
    }
    .stm__heading { margin-bottom: 18px; }
    .stm__filters { flex-direction: row; flex-wrap: wrap; }
    /* One person per row. */
    .stm__grid { grid-template-columns: 1fr; gap: var(--stm-gap); }
    .stm__col--b { margin-top: 0; }
    /* Parallax disabled on stacked layout (handled in JS too). */
}
@media (max-width: 767px) {
    .stm__p-intro { grid-template-columns: 1fr; gap: 28px; }
    .stm__popup-inner { padding: 48px 22px 90px; }
    .stm__p-title { padding: 0 56px; }
}
