/* AXIA — MEET THE TEAM PAGE CSS — SECOND PASS */

/* =========================================================
   AXIA MEET THE TEAM — COMPLETE
   ========================================================= */

/* =========================================================
   PAGE TITLE
   Only applies to pages containing the team directory
   ========================================================= */
body:has(.axia-team-directory) .wp-block-post-title {
    box-sizing: border-box;
    width: min(1600px, calc(100% - 48px)) !important;
    max-width: none !important;
    margin:
        clamp(30px, 4vw, 58px)
        auto
        clamp(60px, 7vw, 100px) !important;
    padding: 0 !important;
    text-align: center;
    font-size:
        clamp(4.6rem, 7vw, 7.8rem) !important;
    line-height: .88 !important;
    letter-spacing: -.065em !important;
}

/* Keep title on one line where there is actually room */
@media (min-width: 1100px) {
    body:has(.axia-team-directory)
    .wp-block-post-title {
        white-space: nowrap;
    }
}

/* =========================================================
   TEAM INTRO
   No giant background card
   ========================================================= */
body .wp-site-blocks .axia-team-intro {
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    width: min(1320px, calc(100% - 48px)) !important;
    max-width: 1320px !important;
    margin:
        0
        auto
        clamp(75px, 8vw, 115px) !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

/* =========================================================
   INTRO COLUMNS
   ========================================================= */
.axia-team-intro > .wp-block-columns {
    margin: 0 !important;
    gap:
        clamp(48px, 7vw, 105px) !important;
    align-items: center !important;
}

.axia-team-intro .wp-block-column {
    min-width: 0;
}

/* LEFT */
.axia-team-intro
.wp-block-column:first-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 !important;
}

/* Eyebrow */
.axia-team-intro
.wp-block-column:first-child
> p:first-child {
    margin:
        0
        0
        18px !important;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .15em;
    text-transform: uppercase;
    opacity: .52;
}

/* Heading */
.axia-team-intro h2 {
    width: 100%;
    max-width: 680px;
    margin:
        0
        0
        30px !important;
    font-size:
        clamp(3.5rem, 5.2vw, 5.8rem) !important;
    font-weight: 400;
    line-height: .92;
    letter-spacing: -.055em;
}

/* Copy */
.axia-team-intro
.wp-block-column:first-child
> p:last-child {
    max-width: 620px;
    margin: 0 !important;
    font-size:
        clamp(1rem, 1.15vw, 1.13rem);
    line-height: 1.72;
}

/* =========================================================
   INTRO IMAGE
   ========================================================= */
.axia-team-intro
.wp-block-column:last-child {
    position: relative;
    z-index: 2;
}

/* Soft organic shape behind photograph */
.axia-team-intro
.wp-block-column:last-child::before {
    content: "";
    position: absolute;
    inset:
        8%
        -6%
        -7%
        12%;
    background:
        linear-gradient(
            145deg,
            #f1e9f7,
            #f5eee3
        );
    border-radius:
        42% 58% 48% 52% /
        56% 45% 55% 44%;
    transform:
        rotate(-2deg);
}

.axia-team-intro
.wp-block-image {
    width: 100%;
    margin: 0 !important;
}

.axia-team-intro
.wp-block-image img {
    display: block;
    width: 100% !important;
    min-height: 380px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    border-radius:
        clamp(25px, 2.8vw, 38px);
}

/* =========================================================
   DIRECTORY WRAPPER
   ========================================================= */
body .wp-site-blocks .axia-team-directory {
    box-sizing: border-box;
    position: relative;
    width:
        min(1320px, calc(100% - 48px)) !important;
    max-width: 1320px !important;
    margin:
        0
        auto
        clamp(75px, 8vw, 115px) !important;
    padding: 0 !important;
}

/* =========================================================
   MAIN DIRECTORY LAYOUT
   ========================================================= */
body .wp-site-blocks
.axia-team-directory
.axia-team-directory__layout {
    display: grid !important;
    grid-template-columns:
        minmax(0, 1.75fr)
        minmax(350px, .85fr);
    gap:
        clamp(24px, 3vw, 40px) !important;
    align-items: start;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Gutenberg reset */
.axia-team-directory__layout
> .wp-block-column {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    flex-basis: auto !important;
    margin: 0 !important;
}

/* =========================================================
   DEPARTMENT LIST
   ========================================================= */
.axia-team-directory__groups {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =========================================================
   DEPARTMENT COLOURS
   ========================================================= */
.axia-team-directory__groups
> .axia-team-department:nth-of-type(1) {
    --team-accent: #8062ad;
    --team-soft: #f1ebf7;
}

.axia-team-directory__groups
> .axia-team-department:nth-of-type(2) {
    --team-accent: #a37890;
    --team-soft: #f5edf1;
}

.axia-team-directory__groups
> .axia-team-department:nth-of-type(3) {
    --team-accent: #879b75;
    --team-soft: #eef2e9;
}

.axia-team-directory__groups
> .axia-team-department:nth-of-type(4) {
    --team-accent: #7965ae;
    --team-soft: #f0edf8;
}

.axia-team-directory__groups
> .axia-team-department:nth-of-type(5) {
    --team-accent: #c59a4d;
    --team-soft: #f7f0df;
}

.axia-team-directory__groups
> .axia-team-department:nth-of-type(6) {
    --team-accent: #86956f;
    --team-soft: #eef1e7;
}

.axia-team-directory__groups
> .axia-team-department:nth-of-type(7) {
    --team-accent: #b88861;
    --team-soft: #f5eee7;
}

/* =========================================================
   DETAILS / ACCORDION
   ========================================================= */
.axia-team-department {
    box-sizing: border-box;
    width: 100%;
    margin: 0 !important;
    background: #fff;
    border:
        1px solid
        rgba(36, 42, 40, .08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 8px 28px
        rgba(28, 34, 32, .035);
}

/* =========================================================
   SUMMARY
   ========================================================= */
.axia-team-department > summary {
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 68px;
    padding:
        18px
        60px
        18px
        26px;
    margin: 0;
    cursor: pointer;
    color: #293531;
    font-size:
        clamp(1rem, 1.25vw, 1.18rem);
    font-weight: 600;
    line-height: 1.3;
    list-style: none;
    transition:
        background-color 200ms ease;
}

.axia-team-department
> summary::-webkit-details-marker {
    display: none;
}

/* =========================================================
   STAR / SPARK DEPARTMENT MARKER
   Replaces generic dot
   ========================================================= */
.axia-team-department
> summary::before {
    content: "";
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-right: 16px;
    background:
        var(--team-accent);
    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 L18.4 11.8 L28 16 L18.4 18.4 L16 28 L13.6 18.4 L4 16 L13.6 13.6 Z' fill='black'/%3E%3C/svg%3E")
        center / contain
        no-repeat;
    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 L18.4 11.8 L28 16 L18.4 18.4 L16 28 L13.6 18.4 L4 16 L13.6 13.6 Z' fill='black'/%3E%3C/svg%3E")
        center / contain
        no-repeat;
}

/* =========================================================
   HAND-DRAWN CHEVRON
   ========================================================= */
.axia-team-department
> summary::after {
    content: "";
    position: absolute;
    right: 24px;
    top: 50%;
    width: 24px;
    height: 14px;
    background:
        var(--team-accent);
    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 16'%3E%3Cpath d='M2 4 C6 1 9 11 14 11 C19 11 22 1 26 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E")
        center / contain
        no-repeat;
    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 16'%3E%3Cpath d='M2 4 C6 1 9 11 14 11 C19 11 22 1 26 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E")
        center / contain
        no-repeat;
    transform:
        translateY(-50%);
    transition:
        transform 220ms ease;
}

/* =========================================================
   OPEN STATE
   ========================================================= */
.axia-team-department[open]
> summary {
    background:
        var(--team-soft);
}

.axia-team-department[open]
> summary::after {
    transform:
        translateY(-50%)
        rotate(180deg);
}

/* =========================================================
   PEOPLE GRID
   ========================================================= */
.axia-team-department__people {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding:
        18px
        20px
        22px !important;
    display: grid !important;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(210px, 1fr)
        );
    gap: 12px;
    background:
        linear-gradient(
            180deg,
            var(--team-soft) 0,
            rgba(255,255,255,.9) 55px,
            #fff 100%
        );
}

/* =========================================================
   PERSON CARD
   ========================================================= */
.axia-team-card {
    box-sizing: border-box;
    min-width: 0;
    margin: 0 !important;
    padding: 12px !important;
    display: grid !important;
    grid-template-columns:
        72px
        minmax(0, 1fr);
    grid-template-rows:
        auto
        auto
        1fr;
    column-gap: 14px;
    align-items: start;
    background: #fff;
    border:
        1px solid
        rgba(36, 42, 40, .08);
    border-radius: 15px;
    cursor: pointer;
    transition:
        transform 200ms ease,
        box-shadow 200ms ease,
        border-color 200ms ease,
        background-color 200ms ease;
}

/* Hover */
@media (hover: hover) and (pointer: fine) {
    .axia-team-card:hover {
        transform:
            translateY(-3px);
        border-color:
            color-mix(
                in srgb,
                var(--team-accent) 30%,
                transparent
            );
        box-shadow:
            0 12px 26px
            rgba(25, 30, 29, .08);
    }
}

/* Selected */
.axia-team-card.is-active {
    background:
        var(--team-soft);
    border-color:
        var(--team-accent);
    box-shadow:
        0 8px 24px
        rgba(25, 30, 29, .07);
}

/* =========================================================
   PERSON CARD IMAGE
   ========================================================= */
.axia-team-card
> .wp-block-image {
    grid-column: 1;
    grid-row:
        1 / span 4;
    width: 72px;
    height: 84px;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 12px;
    background: #eee;
}

.axia-team-card
> .wp-block-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center top;
}

/* =========================================================
   PERSON CARD TYPOGRAPHY
   ========================================================= */
.axia-team-card h3 {
    grid-column: 2;
    margin:
        2px
        0
        5px !important;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.015em;
}

.axia-team-card p {
    grid-column: 2;
    margin:
        0
        0
        4px !important;
    font-size: .78rem;
    line-height: 1.35;
    opacity: .72;
}

.axia-team-card
p:last-child {
    margin-top: 7px !important;
    font-size: .78rem;
    font-weight: 600;
    opacity: 1;
}

.axia-team-card
p:last-child a {
    color:
        var(--team-accent);
    text-decoration: none;
}

.axia-team-card
p:last-child a::after {
    content: " →";
    display: inline-block;
    margin-left: 3px;
    transition:
        transform 180ms ease;
}

.axia-team-card:hover
p:last-child a::after {
    transform:
        translateX(3px);
}

/* =========================================================
   DIRECTOR CARDS
   ========================================================= */
.axia-team-department--directors
.axia-team-card {
    grid-template-columns:
        88px
        minmax(0, 1fr);
    padding:
        14px !important;
}

.axia-team-department--directors
.axia-team-card
> .wp-block-image {
    width: 88px;
    height: 102px;
}

/* =========================================================
   PROFILE PANEL
   ========================================================= */
.axia-team-profile-panel {
    min-width: 0;
    margin: 0 !important;
}

/* Sticky */
.axia-team-profile-panel__inner {
    box-sizing: border-box;
    top: 110px;
    width: 100% !important;
    max-width: none !important;
    max-height:
        calc(100vh - 140px);
    margin: 0 !important;
    padding:
        clamp(28px, 3vw, 40px) !important;
    overflow-y: auto;
    scrollbar-gutter: stable;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #fbf8fd 100%
        );
    border:
        1px solid
        rgba(105, 78, 145, .12);
    border-radius: 28px;
    box-shadow:
        0 14px 42px
        rgba(36, 30, 43, .055);
    scrollbar-width: thin;
    scrollbar-color:
        rgba(105, 78, 145, .24)
        transparent;
}

/* =========================================================
   PROFILE IMAGE
   ========================================================= */
.axia-team-profile-panel__inner
.wp-block-image {
    width:
        clamp(130px, 12vw, 180px);
    aspect-ratio: 1 / 1;
    margin:
        0
        auto
        28px !important;
    overflow: hidden;
    border-radius: 27px;
    background: #eee;
}

.axia-team-profile-panel__inner
.wp-block-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center top;
}

/* =========================================================
   PROFILE TYPOGRAPHY
   ========================================================= */
.axia-team-profile-panel__inner h2 {
    width: 100%;
    max-width: none !important;
    margin:
        0
        0
        7px !important;
    font-size:
        clamp(2rem, 2.6vw, 2.9rem);
    line-height: .98;
    letter-spacing: -.04em;
    text-wrap: balance;
    word-break: normal;
}

.axia-team-profile-panel__inner
h2 + p {
    margin:
        0
        0
        24px !important;
    color: #7656a0;
    font-size: 1rem;
    font-weight: 500;
}

.axia-team-profile-panel__inner h3 {
    margin:
        30px
        0
        10px !important;
    color: #704e9b;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.3;
}

.axia-team-profile-panel__inner p {
    margin:
        0
        0
        14px !important;
    font-size: .95rem;
    line-height: 1.65;
}

/* =========================================================
   HIDDEN PROFILE STORAGE
   ========================================================= */
.axia-team-profile-sources {
    display: none !important;
}

/* =========================================================
   GUIDANCE CTA
   ========================================================= */
body .wp-site-blocks .axia-team-guidance {
    box-sizing: border-box;
    position: relative;
    width:
        min(1320px, calc(100% - 48px)) !important;
    max-width: 1320px !important;
    margin:
        clamp(65px, 7vw, 95px)
        auto
        clamp(70px, 8vw, 110px) !important;
    padding:
        clamp(34px, 4vw, 54px)
        clamp(34px, 5vw, 68px) !important;
    background:
        linear-gradient(
            115deg,
            #f3ecfa 0%,
            #f8f3fb 58%,
            #f1eee4 100%
        );
    border-radius:
        clamp(26px, 3vw, 38px);
    overflow: hidden;
}

.axia-team-guidance h2 {
    max-width: 600px;
    margin:
        0
        0
        14px !important;
    font-size:
        clamp(2.2rem, 3.5vw, 3.7rem);
    line-height: 1;
    letter-spacing: -.04em;
}

.axia-team-guidance p {
    max-width: 650px;
    margin:
        0
        0
        26px !important;
    line-height: 1.65;
}

/* =========================================================
   GUIDANCE BUTTON
   Uses the same reusable classes as the homepage hero button:
   Buttons wrapper: axia-home-hero__buttons
   Individual Button: axia-button axia-button--primary
   ========================================================= */
.axia-team-guidance
.wp-block-buttons {
    margin: 0 !important;
}

.axia-team-guidance
.axia-home-hero__buttons .wp-block-button {
    flex: 1 1 0;
    margin: 0;
}

.axia-team-guidance
.axia-home-hero__buttons .wp-block-button__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 55px;
    padding: 0 18px !important;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.axia-team-guidance
.axia-button.axia-button--primary
.wp-block-button__link {
    background: #482075 !important;
    border: 2px solid #482075 !important;
    border-radius: 11px !important;
    color: #fff !important;
}

.axia-team-guidance
.axia-button.axia-button--primary
.wp-block-button__link:hover,
.axia-team-guidance
.axia-button.axia-button--primary
.wp-block-button__link:focus {
    transform: translateY(-2px);
    background: #fff !important;
    border-color: #482075 !important;
    color: #482075 !important;
}

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 1050px) {
    body .wp-site-blocks
    .axia-team-directory
    .axia-team-directory__layout {
        grid-template-columns:
            minmax(0, 1.45fr)
            minmax(300px, .9fr);
        gap:
            24px !important;
    }

    .axia-team-department__people {
        grid-template-columns:
            repeat(
                auto-fit,
                minmax(180px, 1fr)
            );
    }

    .axia-team-card {
        grid-template-columns:
            62px
            minmax(0, 1fr);
    }

    .axia-team-card
    > .wp-block-image {
        width: 62px;
        height: 74px;
    }
}

/* =========================================================
   MOBILE / SMALL TABLET
   ========================================================= */
@media (max-width: 781px) {
    body:has(.axia-team-directory)
    .wp-block-post-title {
        width:
            calc(100% - 28px) !important;
        margin:
            26px
            auto
            52px !important;
        font-size:
            clamp(3.5rem, 17vw, 5.4rem) !important;
        white-space: normal;
        text-wrap: balance;
    }

    /* INTRO */
    body .wp-site-blocks
    .axia-team-intro {
        width:
            calc(100% - 28px) !important;
        margin-bottom:
            65px !important;
    }

    .axia-team-intro
    > .wp-block-columns {
        flex-direction:
            column !important;
        gap:
            38px !important;
    }

    .axia-team-intro h2 {
        font-size:
            clamp(2.9rem, 13vw, 4.3rem) !important;
    }

    .axia-team-intro
    .wp-block-column:last-child::before {
        inset:
            10%
            -3%
            -6%
            8%;
    }

    .axia-team-intro
    .wp-block-image img {
        min-height: 0;
        aspect-ratio:
            4 / 3;
        border-radius:
            23px;
    }

    /* DIRECTORY */
    body .wp-site-blocks
    .axia-team-directory {
        width:
            calc(100% - 28px) !important;
        margin-bottom:
            70px !important;
    }

    body .wp-site-blocks
    .axia-team-directory
    .axia-team-directory__layout {
        grid-template-columns:
            1fr;
        gap:
            24px !important;
    }

    /* ACCORDIONS */
    .axia-team-department
    > summary {
        min-height: 62px;
        padding:
            17px
            52px
            17px
            20px;
    }

    .axia-team-department
    > summary::before {
        width: 19px;
        height: 19px;
        margin-right: 13px;
    }

    .axia-team-department
    > summary::after {
        right: 18px;
        width: 21px;
    }

    /* PEOPLE GRID */
    .axia-team-department__people {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        padding:
            14px !important;
    }

    /* CARDS */
    .axia-team-card,
    .axia-team-department--directors
    .axia-team-card {
        grid-template-columns:
            1fr;
        padding:
            10px !important;
        text-align: center;
    }

    .axia-team-card
    > .wp-block-image,
    .axia-team-department--directors
    .axia-team-card
    > .wp-block-image {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        height: auto;
        aspect-ratio:
            4 / 5;
        margin-bottom:
            10px !important;
        border-radius: 11px;
    }

    .axia-team-card h3,
    .axia-team-card p {
        grid-column: 1;
    }

    /* PROFILE */
    .axia-team-profile-panel__inner {
        max-height: none;
        overflow: visible;
        scrollbar-gutter: auto;
        padding:
            30px
            24px !important;
        border-radius: 24px;
    }

    /* CTA */
    body .wp-site-blocks
    .axia-team-guidance {
        width:
            calc(100% - 28px) !important;
        padding:
            32px
            26px !important;
        border-radius: 26px;
    }
}

/* =========================================================
   SMALL PHONES
   ========================================================= */
@media (max-width: 460px) {
    body .wp-site-blocks
    .axia-team-intro,
    body .wp-site-blocks
    .axia-team-directory,
    body .wp-site-blocks
    .axia-team-guidance {
        width:
            calc(100% - 20px) !important;
    }

    .axia-team-department__people {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        gap: 9px;
    }

    .axia-team-card {
        padding:
            8px !important;
    }

    .axia-team-card h3 {
        font-size: .9rem;
    }

    .axia-team-card p {
        font-size: .72rem;
    }

    .axia-team-profile-panel__inner h2 {
        font-size:
            clamp(2rem, 10vw, 2.8rem);
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .axia-team-card,
    .axia-team-department
    > summary,
    .axia-team-department
    > summary::after,
    .axia-team-guidance
    .wp-block-button__link {
        transition:
            none !important;
    }

    .axia-team-card:hover,
    .axia-team-guidance
    .wp-block-button__link:hover {
        transform:
            none !important;
    }
}

/* =========================================================
   SELECTED PROFILE CHANGE
   JS adds this briefly whenever profile changes.
   ========================================================= */
.axia-team-profile-panel__inner
> .axia-profile-enter {
    animation:
        axia-team-profile-enter
        420ms
        cubic-bezier(.2,.75,.3,1)
        both;
}

@keyframes axia-team-profile-enter {
    from {
        opacity: 0;
        transform:
            translateY(8px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}

/* =========================================================
   STICKY PROFILE FIX
   ========================================================= */

/*
 * Keep every ancestor of the sticky panel open.
 * Sticky can fail if a parent clips/scrolls.
 */
.axia-team-directory,
.axia-team-directory__layout,
.axia-team-profile-panel {
    overflow: visible !important;
}

/*
 * IMPORTANT:
 * The profile column must stretch to the full height
 * of the left-hand department list.
 */
.axia-team-profile-panel {
    align-self: stretch !important;
    height: 100%;
    min-height: 100%;
}

/*
 * Restore sticky behaviour on desktop.
 */
@media (min-width: 782px) {
    .axia-team-profile-panel__inner {
        position: sticky !important;
        top: 110px !important;
        align-self: flex-start;
        width: 100% !important;
        max-height:
            calc(100vh - 140px);
        overflow-y: auto;
    }
}

/*
 * Do NOT make the actual grid items both "start".
 * The right column needs the full row height.
 */
.axia-team-directory__layout {
    align-items: stretch !important;
}

/*
 * Left side still begins at the top normally.
 */
.axia-team-directory__groups {
    align-self: start;
}

@media (max-width: 781px) {
    .axia-team-profile-panel {
        height: auto;
        min-height: 0;
    }
}

/* =========================================================
   AXIA MEET THE TEAM
   FULL-PAGE ANIMATED DECORATIVE BACKGROUND
   ========================================================= */

/* =========================================================
   PAGE LAYERING
   ========================================================= */
body.axia-team-page .wp-site-blocks {
    position: relative;
    isolation: isolate;
}

/*
 * The full decorative layer lives behind everything.
 */
.axia-team-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

/*
 * ALL meaningful Meet the Team content
 * always sits above the decoration.
 */
body.axia-team-page .wp-block-post-title,
body.axia-team-page .axia-team-intro,
body.axia-team-page .axia-team-directory,
body.axia-team-page .axia-team-guidance {
    position: relative;
    z-index: 2;
}

/*
 * Keep the directory cards / profile panel well above
 * the decorative layer.
 */
.axia-team-directory__layout,
.axia-team-directory__groups,
.axia-team-profile-panel,
.axia-team-profile-panel__inner,
.axia-team-department,
.axia-team-card {
    position: relative;
    z-index: 2;
}

/* =========================================================
   DECORATIVE ITEM
   ========================================================= */
.axia-team-bg__item {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    color: var(--decor-colour);
    opacity: 0;
    pointer-events: none;
    animation:
        axia-team-bg-enter
        900ms
        var(--delay)
        cubic-bezier(.2,.75,.3,1)
        forwards;
}

/*
 * Separate inner wrapper means:
 * outer handles fade-in,
 * inner handles continuous movement.
 */
.axia-team-bg__inner {
    width: 100%;
    height: 100%;
    transform:
        rotate(var(--rotation));
    transform-origin: center;
    animation:
        axia-team-bg-float
        var(--float-duration)
        ease-in-out
        var(--float-delay)
        infinite
        alternate;
}

.axia-team-bg__item svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* =========================================================
   STAR / SPARK
   ========================================================= */
.axia-team-bg__star svg {
    animation:
        axia-team-star-twinkle
        var(--twinkle-duration)
        ease-in-out
        var(--twinkle-delay)
        infinite;
}

.axia-team-bg__star path {
    fill: currentColor;
}

/* Slightly lighter little spark */
.axia-team-bg__spark {
    opacity: 0;
}

.axia-team-bg__spark path {
    fill: currentColor;
}

/* =========================================================
   SQUIGGLE
   ========================================================= */
.axia-team-bg__squiggle {
    width:
        calc(var(--size) * 2.3);
    height: var(--size);
}

.axia-team-bg__squiggle path {
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    /*
     * Gives us a genuine draw-on effect.
     */
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation:
        axia-team-squiggle-draw
        1300ms
        var(--draw-delay)
        cubic-bezier(.25,.7,.2,1)
        forwards;
}

/* =========================================================
   INITIAL FADE-IN
   ========================================================= */
@keyframes axia-team-bg-enter {
    0% {
        opacity: 0;
    }

    100% {
        opacity: var(--decor-opacity);
    }
}

/* =========================================================
   CONSTANT GENTLE DRIFT
   ========================================================= */
@keyframes axia-team-bg-float {
    0% {
        transform:
            translate3d(-3px, -4px, 0)
            rotate(var(--rotation));
    }

    35% {
        transform:
            translate3d(3px, 2px, 0)
            rotate(
                calc(var(--rotation) + 2deg)
            );
    }

    70% {
        transform:
            translate3d(-1px, 5px, 0)
            rotate(
                calc(var(--rotation) - 2deg)
            );
    }

    100% {
        transform:
            translate3d(4px, -2px, 0)
            rotate(
                calc(var(--rotation) + 1deg)
            );
    }
}

/* =========================================================
   STAR TWINKLE
   ========================================================= */
@keyframes axia-team-star-twinkle {
    0% {
        opacity: .28;
        transform:
            scale(.80)
            rotate(-4deg);
    }

    22% {
        opacity: .72;
        transform:
            scale(1.08)
            rotate(2deg);
    }

    48% {
        opacity: .40;
        transform:
            scale(.94)
            rotate(-1deg);
    }

    72% {
        opacity: .82;
        transform:
            scale(1.13)
            rotate(4deg);
    }

    100% {
        opacity: .32;
        transform:
            scale(.84)
            rotate(-3deg);
    }
}

/* =========================================================
   REAL SQUIGGLE DRAW-IN
   ========================================================= */
@keyframes axia-team-squiggle-draw {
    0% {
        stroke-dashoffset: 1;
        opacity: 0;
    }

    18% {
        opacity: .35;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* =========================================================
   ADD A LITTLE DEPTH VARIATION
   ========================================================= */
.axia-team-bg__item[data-depth="back"] {
    filter:
        blur(.15px);
    opacity: 0;
}

.axia-team-bg__item[data-depth="mid"] {
    filter: none;
}

/* =========================================================
   MOBILE
   Less dense, slightly smaller + calmer
   ========================================================= */
@media (max-width: 781px) {
    .axia-team-bg__item {
        transform:
            scale(.82);
    }

    /*
     * JS creates fewer on mobile anyway,
     * but also soften them.
     */
    .axia-team-bg {
        opacity: .85;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .axia-team-bg__item,
    .axia-team-bg__inner,
    .axia-team-bg__star svg,
    .axia-team-bg__squiggle path {
        animation:
            none !important;
    }

    .axia-team-bg__item {
        opacity:
            var(--decor-opacity);
    }

    .axia-team-bg__squiggle path {
        stroke-dashoffset: 0;
    }
}

/* =========================================================
   AXIA TEAM — PAGE REVEAL ANIMATIONS
   ========================================================= */

/*
 * Animation states only activate when JS confirms
 * it is running.
 *
 * If JS ever fails, all content remains visible.
 */

/* =========================================================
   HERO / INTRO
   LEFT + RIGHT TOGETHER
   ========================================================= */
html.axia-team-reveal-ready
.axia-team-intro
.wp-block-column:first-child {
    opacity: 0;
    transform:
        translate3d(-32px, 0, 0);
}

html.axia-team-reveal-ready
.axia-team-intro
.wp-block-column:last-child {
    opacity: 0;
    transform:
        translate3d(32px, 0, 0);
}

/* Reveal both sides */
html.axia-team-reveal-ready
.axia-team-intro.is-revealed
.wp-block-column:first-child {
    animation:
        axia-team-intro-left
        850ms
        cubic-bezier(.2,.75,.25,1)
        forwards;
}

html.axia-team-reveal-ready
.axia-team-intro.is-revealed
.wp-block-column:last-child {
    animation:
        axia-team-intro-right
        850ms
        100ms
        cubic-bezier(.2,.75,.25,1)
        forwards;
}

@keyframes axia-team-intro-left {
    from {
        opacity: 0;
        transform:
            translate3d(-32px, 0, 0);
    }

    to {
        opacity: 1;
        transform:
            translate3d(0, 0, 0);
    }
}

@keyframes axia-team-intro-right {
    from {
        opacity: 0;
        transform:
            translate3d(32px, 0, 0);
    }

    to {
        opacity: 1;
        transform:
            translate3d(0, 0, 0);
    }
}

/* =========================================================
   SCROLL REVEALS
   Everything after intro fades upward
   ========================================================= */
html.axia-team-reveal-ready
.axia-team-department,
html.axia-team-reveal-ready
.axia-team-profile-panel,
html.axia-team-reveal-ready
.axia-team-guidance {
    opacity: 0;
    transform:
        translate3d(0, 26px, 0);
}

/* Revealed state */
html.axia-team-reveal-ready
.axia-team-department.is-revealed,
html.axia-team-reveal-ready
.axia-team-profile-panel.is-revealed,
html.axia-team-reveal-ready
.axia-team-guidance.is-revealed {
    animation:
        axia-team-scroll-reveal
        700ms
        cubic-bezier(.2,.75,.25,1)
        forwards;
}

@keyframes axia-team-scroll-reveal {
    from {
        opacity: 0;
        transform:
            translate3d(0, 26px, 0);
    }

    to {
        opacity: 1;
        transform:
            translate3d(0, 0, 0);
    }
}

/* =========================================================
   DEPARTMENT STAGGER
   ========================================================= */
html.axia-team-reveal-ready
.axia-team-department:nth-child(2).is-revealed {
    animation-delay: 40ms;
}

html.axia-team-reveal-ready
.axia-team-department:nth-child(3).is-revealed {
    animation-delay: 80ms;
}

html.axia-team-reveal-ready
.axia-team-department:nth-child(4).is-revealed {
    animation-delay: 120ms;
}

html.axia-team-reveal-ready
.axia-team-department:nth-child(5).is-revealed {
    animation-delay: 160ms;
}

html.axia-team-reveal-ready
.axia-team-department:nth-child(6).is-revealed {
    animation-delay: 200ms;
}

html.axia-team-reveal-ready
.axia-team-department:nth-child(7).is-revealed {
    animation-delay: 240ms;
}

/* =========================================================
   PEOPLE CARDS
   Soft reveal when a department is opened
   ========================================================= */
.axia-team-department[open]
.axia-team-card {
    animation:
        axia-team-person-open
        480ms
        cubic-bezier(.2,.75,.25,1)
        both;
}

/* Stagger visible people */
.axia-team-department[open]
.axia-team-card:nth-child(2) {
    animation-delay: 45ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(3) {
    animation-delay: 90ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(4) {
    animation-delay: 135ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(5) {
    animation-delay: 180ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(6) {
    animation-delay: 225ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(7) {
    animation-delay: 270ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(8) {
    animation-delay: 315ms;
}

.axia-team-department[open]
.axia-team-card:nth-child(9) {
    animation-delay: 360ms;
}

@keyframes axia-team-person-open {
    from {
        opacity: 0;
        transform:
            translate3d(0, 10px, 0);
    }

    to {
        opacity: 1;
        transform:
            translate3d(0, 0, 0);
    }
}

/* =========================================================
   MOBILE
   Reduce sideways movement
   ========================================================= */
@media (max-width: 781px) {
    html.axia-team-reveal-ready
    .axia-team-intro
    .wp-block-column:first-child,
    html.axia-team-reveal-ready
    .axia-team-intro
    .wp-block-column:last-child {
        transform:
            translate3d(0, 20px, 0);
    }

    html.axia-team-reveal-ready
    .axia-team-intro.is-revealed
    .wp-block-column:first-child,
    html.axia-team-reveal-ready
    .axia-team-intro.is-revealed
    .wp-block-column:last-child {
        animation-name:
            axia-team-mobile-intro;
    }

    @keyframes axia-team-mobile-intro {
        from {
            opacity: 0;
            transform:
                translate3d(0, 20px, 0);
        }

        to {
            opacity: 1;
            transform:
                translate3d(0, 0, 0);
        }
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    html.axia-team-reveal-ready
    .axia-team-intro
    .wp-block-column,
    html.axia-team-reveal-ready
    .axia-team-department,
    html.axia-team-reveal-ready
    .axia-team-profile-panel,
    html.axia-team-reveal-ready
    .axia-team-guidance,
    .axia-team-department[open]
    .axia-team-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
