.nteam-section,
.nteam-section * {
    box-sizing: border-box;
}

.nteam-section {
    --nteam-bg: #f6f1e7;
    --nteam-surface: #fff;
    --nteam-text: #18352c;
    --nteam-muted: #6d7b75;
    --nteam-accent: #2f6a57;
    --nteam-line: #dce5df;
    --nteam-cols: 5;
    --nteam-mobile-thumb-width: 96px;
    --nteam-mobile-thumb-height: 110px;
    direction: rtl;
    width: 100%;
    background: var(--nteam-bg);
    padding: 80px 24px;
}

.nteam-wrap {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
}

.nteam-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.nteam-heading-main { min-width: 0; }

.nteam-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(47,106,87,.18);
    background: rgba(255,255,255,.65);
    color: var(--nteam-accent);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}

.nteam-title {
    margin: 0 0 10px;
    color: var(--nteam-text);
    font-size: clamp(30px,4vw,52px);
    line-height: 1.3;
}

.nteam-description {
    color: var(--nteam-muted);
    max-width: 650px;
    font-size: 16px;
}

.nteam-description p,
.nteam-info-content p,
.nteam-info-content ul,
.nteam-info-content ol { margin-top: 0; }

.nteam-description p:last-child,
.nteam-info-content p:last-child,
.nteam-info-content ul:last-child,
.nteam-info-content ol:last-child { margin-bottom: 0; }

.nteam-hint {
    color: var(--nteam-muted);
    font-size: 13px;
    white-space: nowrap;
    margin-bottom: 8px;
}

.nteam-widget {
    --nteam-toggle-x: 12px;
    --nteam-toggle-y: 12px;
}

.nteam-grid {
    display: grid;
    grid-template-columns: repeat(var(--nteam-cols), minmax(0,1fr));
    gap: 14px;
    align-items: stretch;
}

.nteam-member {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: var(--nteam-surface);
    border: 1px solid var(--nteam-line);
    border-radius: 28px;
    box-shadow: 0 8px 26px rgba(29,66,54,.05);
    transition:
        transform 350ms ease,
        box-shadow 350ms ease,
        border-color 350ms ease,
        background-color 350ms ease;
}

/* v1.1: active cards never change their grid width. */
.nteam-member.is-active {
    border-color: rgba(47,106,87,.35);
    box-shadow: 0 18px 50px rgba(29,66,54,.10);
}

.nteam-member-toggle {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: right;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    appearance: none;
    -webkit-appearance: none;
}

.nteam-member-toggle:focus-visible {
    outline: 2px solid var(--nteam-accent);
    outline-offset: -3px;
}

.nteam-portrait {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 4.6;
    overflow: hidden;
    background: #dde7df;
    flex: 0 0 auto;
}

.nteam-portrait img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 15%;
    transition: transform 500ms ease, filter 300ms ease;
    filter: saturate(.88);
}

.nteam-portrait:after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 32%;
    background: linear-gradient(to top,rgba(15,43,34,.35),transparent);
    pointer-events: none;
}

.nteam-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.8);
    color: var(--nteam-accent);
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.6;
    padding: 5px 9px;
    backdrop-filter: blur(8px);
}

.nteam-member-head {
    position: relative;
    width: 100%;
    min-width: 0;
    padding: 20px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex: 1 1 auto;
    transition:
        background 300ms ease,
        background-color 300ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease;
}

.nteam-identity {
    min-width: 0;
    max-width: 100%;
}

.nteam-name {
    margin: 0;
    color: var(--nteam-text);
    font-size: 18px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    transition: color 300ms ease;
}

.nteam-role {
    display: block;
    color: var(--nteam-muted);
    font-size: 13px;
    line-height: 1.7;
    margin-top: 4px;
    overflow-wrap: anywhere;
    transition: color 300ms ease;
}

.nteam-expand-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--nteam-line);
    display: grid;
    place-items: center;
    color: var(--nteam-accent);
    flex: 0 0 auto;
    z-index: 5;
    transition: transform 300ms ease, background-color 300ms ease, color 300ms ease, border-color 300ms ease;
    background: #edf3ee;
}

.nteam-expand-icon i,
.nteam-expand-icon svg {
    display: block;
    line-height: 1;
}

.nteam-member.is-active .nteam-expand-icon {
    transform: rotate(45deg);
    background: var(--nteam-accent);
    color: #fff;
    border-color: var(--nteam-accent);
}

/* Toggle placement */
.nteam-toggle-pos-inline_end .nteam-expand-icon {
    position: static;
    order: 2;
    margin-inline-start: auto;
    margin-inline-end: 0;
}
.nteam-toggle-pos-inline_start .nteam-expand-icon {
    position: static;
    order: -1;
    margin-inline-end: auto;
    margin-inline-start: 0;
}
.nteam-toggle-pos-head_top_right .nteam-expand-icon,
.nteam-toggle-pos-head_top_left .nteam-expand-icon,
.nteam-toggle-pos-head_bottom_right .nteam-expand-icon,
.nteam-toggle-pos-head_bottom_left .nteam-expand-icon {
    position: absolute;
    margin: 0;
}
.nteam-toggle-pos-head_top_right .nteam-expand-icon {
    top: var(--nteam-toggle-y); right: var(--nteam-toggle-x); left: auto;
}
.nteam-toggle-pos-head_top_left .nteam-expand-icon {
    top: var(--nteam-toggle-y); left: var(--nteam-toggle-x); right: auto;
}
.nteam-toggle-pos-head_bottom_right .nteam-expand-icon {
    bottom: var(--nteam-toggle-y); right: var(--nteam-toggle-x); left: auto;
}
.nteam-toggle-pos-head_bottom_left .nteam-expand-icon {
    bottom: var(--nteam-toggle-y); left: var(--nteam-toggle-x); right: auto;
}

/* Shared details panel - desktop/tablet */
.nteam-details-stage {
    width: 100%;
    margin-top: 18px;
}

.nteam-details-stage:not(.has-active) {
    margin-top: 0 !important;
}

.nteam-details {
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    padding: 0 20px;
    background: transparent;
    transition:
        max-height var(--nteam-duration,450ms) ease,
        opacity var(--nteam-duration,450ms) ease,
        padding var(--nteam-duration,450ms) ease,
        visibility 0s linear var(--nteam-duration,450ms);
}

.nteam-details.is-active {
    opacity: 1;
    visibility: visible;
    padding: 20px 20px 24px;
    transition:
        max-height var(--nteam-duration,450ms) ease,
        opacity var(--nteam-duration,450ms) ease,
        padding var(--nteam-duration,450ms) ease,
        visibility 0s linear 0s;
}

.nteam-details-inner {
    border-top: 1px solid var(--nteam-line);
    padding-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
    position: relative;
}

.nteam-details-inner:before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 0;
    right: -20px;
    width: 4px;
    border-radius: 999px;
    background: var(--nteam-accent);
}

.nteam-info-title {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 7px;
    color: var(--nteam-accent);
}

.nteam-info-content,
.nteam-info-content p,
.nteam-info-content li {
    color: #53635d;
    font-size: 13px;
    line-height: 1.85;
}

.nteam-info-content ul,
.nteam-info-content ol { padding-right: 18px; }

.nteam-specialties { grid-column: 1 / -1; }

.nteam-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nteam-tag {
    border: 1px solid var(--nteam-line);
    background: #edf3ee;
    color: #466056;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 767px) {
    .nteam-section { padding: 52px 16px; }

    .nteam-heading {
        display: block;
        margin-bottom: 22px;
    }

    .nteam-title { font-size: 32px; }
    .nteam-description { font-size: 14px; }

    .nteam-hide-hint-mobile-yes .nteam-hint { display: none; }

    .nteam-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .nteam-member,
    .nteam-member.is-active {
        display: block;
        width: 100%;
        border-radius: 22px;
        transform: none !important;
        min-height: 0;
    }

    .nteam-member-toggle,
    .nteam-member.is-active .nteam-member-toggle {
        display: grid;
        grid-template-columns: var(--nteam-mobile-thumb-width) minmax(0,1fr);
        min-height: var(--nteam-mobile-thumb-height);
        height: auto;
    }

    .nteam-portrait,
    .nteam-member.is-active .nteam-portrait {
        grid-column: 1;
        grid-row: 1;
        width: var(--nteam-mobile-thumb-width);
        height: var(--nteam-mobile-thumb-height);
        min-height: var(--nteam-mobile-thumb-height);
        aspect-ratio: auto !important;
    }

    .nteam-hide-badge-mobile-yes .nteam-badge { display: none; }

    .nteam-member-head,
    .nteam-member.is-active .nteam-member-head {
        grid-column: 2;
        grid-row: 1;
        padding: 18px 16px;
        min-width: 0;
    }

    .nteam-name { font-size: 16px; }
    .nteam-role { font-size: 12px; }

    /* JS moves only the selected details panel directly below its member. */
    .nteam-grid > .nteam-details {
        width: 100%;
        flex: 0 0 100%;
    }

    .nteam-grid > .nteam-details:not(.is-active) {
        display: none;
    }

    .nteam-details-stage {
        margin-top: 0 !important;
    }

    .nteam-details,
    .nteam-details.is-active {
        padding-right: 16px;
        padding-left: 16px;
    }

    .nteam-details.is-active {
        padding-bottom: 20px;
    }

    .nteam-details-inner,
    .nteam-details.is-active .nteam-details-inner {
        margin-top: 0;
        grid-template-columns: 1fr;
        gap: 16px;
        padding-top: 18px;
    }

    .nteam-specialties { grid-column: auto; }

    .nteam-details-inner:before {
        right: -16px;
        top: 18px;
    }
}
