/* ============================================================
   TEAM — "Meet Our Team"
   Member list + photo panel.
   ============================================================ */

.team-section {
    /* رنگ‌های خنثی/طوسی هماهنگ با تم */
    --team-accent: rgba(160, 170, 180, 0.85);
    --team-glow: rgba(160, 170, 180, 0.25);
    --team-line: rgba(160, 170, 180, 0.28);
    --team-tint: rgba(160, 170, 180, 0.06);

    margin-top: 80px;
    padding: 64px 0 60px;
    background: transparent;
}

[data-theme="light"] .team-section {
    --team-accent: rgba(90, 100, 110, 0.85);
    --team-glow: rgba(90, 100, 110, 0.22);
    --team-line: rgba(90, 100, 110, 0.25);
    --team-tint: rgba(90, 100, 110, 0.06);
}

/* ============================================================
   HEADER — Framed box (like FAQ)
   ============================================================ */
.team-section .team-header {
    text-align: center;
    margin-bottom: 0;
    position: relative;
    padding: 60px 0;
}

/* خط افقی بالا و پایین هدر — تا لبه‌های صفحه */
.team-section .team-header::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--line-ext));
    right: calc(-1 * var(--line-ext));
    border-top: 1px solid var(--line-border);
    border-bottom: 1px solid var(--line-border);
    z-index: 2;
    pointer-events: none;
}

/* خطوط عمودی دو طرف هدر، روی لبه‌های محتوا */
.team-section .team-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-left: 1px solid var(--line-px);
    border-right: 1px solid var(--line-px);
    z-index: 2;
    pointer-events: none;
}

/* تایتل و توضیحات */
.team-section .team-header h2 {
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -1.2px;
    line-height: 1.15;
    position: relative;
    display: inline-block;
}

.team-section .team-header p {
    margin: 12px auto 0;
    max-width: 520px;
    font-size: 0.92rem;
    opacity: 0.45;
}

/* ============================================================
   HEADER DECORATIONS (Brackets)
   ============================================================ */
.team-header-deco {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 80px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--team-accent);
    opacity: 0.6;
}

.team-header-deco.left { left: 8.5%; }
.team-header-deco.right { right: 8.5%; }

/* براکت بالا */
.team-header-deco::before {
    content: '';
    position: absolute;
    top: 0;
    width: 6px;
    height: 14px;
    border-top: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
}
.team-header-deco.right::before {
    border-left: none;
    border-right: 1.5px solid currentColor;
    right: 0;
}

/* براکت پایین */
.team-header-deco::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 6px;
    height: 14px;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
}
.team-header-deco.right::after {
    border-left: none;
    border-right: 1.5px solid currentColor;
    right: 0;
}

/* فلش وسط */
.team-header-deco .deco-icon svg {
    width: 10px;
    height: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* نقطه بالای فلش */
.team-header-deco .deco-icon::before {
    content: '';
    position: absolute;
    top: calc(50% - 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
}

/* نقطه پایین فلش */
.team-header-deco .deco-icon::after {
    content: '';
    position: absolute;
    bottom: calc(50% - 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
}

/* ============================================================
   STAGE — container for content
   ============================================================ */
.team-stage {
    position: relative;
    z-index: 2;
    padding-top: 40px;
}

/* ============================================================
   LAYOUT — two columns: list / photo
   ============================================================ */
.team-layout {
    position: relative;
    display: grid;
    grid-template-columns: calc(52.7% - 2px) calc(47.3% - 2px);
    gap: 4px;
    z-index: 2;
}

/* ============================================================
   NODE — frame corner dots
   ============================================================ */
.team-node {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--team-accent);
    box-shadow: 0 0 7px var(--team-glow);
    z-index: 6;
    pointer-events: none;
}

.team-node.tl { top: -2.5px; left: -2.5px; }
.team-node.bl { bottom: -2.5px; left: -2.5px; }
.team-node.tr { top: -2.5px; right: -2.5px; }
.team-node.br { bottom: -2.5px; right: -2.5px; }
.team-node.jt { top: -2.5px; left: calc(52.7% - 0.5px); }
.team-node.jb { bottom: -2.5px; left: calc(52.7% - 0.5px); }

/* ============================================================
   LIST — left column
   ============================================================ */
.team-list {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    background: transparent;
    border: 1px solid var(--line-px);
    z-index: 3;
}

/* Closing line at the bottom of the table, out to the page edge */
.team-list::before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: 100%;
    left: calc(-1 * var(--line-ext));
    height: 1px;
    background: var(--line-px);
    pointer-events: none;
    z-index: 1;
}

.team-list-item {
    position: relative;
    flex: 1 1 0;
    min-height: 96px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px 16px 30px;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line-px);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: background 0.35s ease;
}

.team-list-item:first-child {
    border-top: 0;
}

/* Every row edge runs out to the left edge of the page. */
.team-list-item::after {
    content: '';
    position: absolute;
    top: -1px;
    right: 100%;
    left: calc(-1 * var(--line-ext));
    height: 1px;
    background: var(--line-px);
    pointer-events: none;
    z-index: 1;
}

.team-list-item.active {
    background: linear-gradient(
        90deg,
        var(--team-tint) 0%,
        rgba(160, 170, 180, 0.025) 48%,
        rgba(160, 170, 180, 0) 100%
    );
}

/* Text block */
.member-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.member-tag {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    line-height: 1;
    color: var(--team-accent);
    opacity: 0.8;
    transition: opacity 0.35s ease;
}

/* نقش کامل — گرادیانت از سبز به آبی، هم‌سبک با تیترها */
.member-role {
    font-size: 0.82rem;
    line-height: 1.5;
    background-image: linear-gradient(100deg, var(--hl-1, var(--accent)), var(--hl-2, #2d9fff));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
    opacity: 0.95;
}

.member-name {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.1px;
    line-height: 1.3;
    color: var(--text);
    opacity: 0.9;
}

.team-list-item.active .member-tag,
.team-list-item:hover .member-tag,
.team-list-item.active .member-name,
.team-list-item:hover .member-name {
    opacity: 1;
}

/* Chevron inside corner brackets */
.member-arrow {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    color: var(--team-accent);
    opacity: 0.45;
    transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
}

.member-arrow svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.team-list-item.active .member-arrow,
.team-list-item:hover .member-arrow {
    opacity: 1;
    transform: translateX(2px);
    filter: drop-shadow(0 0 6px var(--team-glow));
}

/* ============================================================
   PHOTO PANEL — right column
   ============================================================ */
.team-photo-panel {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    background: transparent;
    border: 1px solid var(--line-px);
    z-index: 3;
}

/* Photos — bottom aligned, plain grayscale (no halo) */
.panel-photo {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    height: calc(100% - 12px);
    width: auto;
    max-width: 94%;
    object-fit: contain;
    object-position: bottom center;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    filter: grayscale(100%) contrast(1.04);
    transition: opacity 0.5s ease;
}

.panel-photo.active {
    opacity: 1;
}

/* Decorative dot matrix */
.panel-dots {
    position: absolute;
    width: 46px;
    height: 48px;
    background-image: radial-gradient(circle, rgba(128, 128, 128, 0.6) 1.1px, transparent 1.7px);
    background-size: 11.5px 11.5px;
    opacity: 0.35;
    z-index: 4;
    pointer-events: none;
}

.panel-dots.tr { top: 34px; right: 50px; }
.panel-dots.br { bottom: 34px; right: 50px; }
.panel-dots.ml { left: 36px; top: calc(50% - 24px); }

/* ============================================================
   RULES — table edges running out to the page edges
   (داخل .team-layout، هم‌تراز با خط بالا/پایین باکس‌ها)
   ============================================================ */
.team-rule {
    position: absolute;
    height: 1px;
    background: var(--line-px);
    pointer-events: none;
    z-index: 1;
}

.team-rule.tr { top: 0; left: 100%; right: calc(-1 * var(--line-ext)); }
.team-rule.br { bottom: 0; left: 100%; right: calc(-1 * var(--line-ext)); }

/* ============================================================
   RESPONSIVE — 1280px
   ============================================================ */
@media (max-width: 1280px) {
    .team-section .team-header h2 {
        font-size: 2.1rem;
    }

    .team-list-item {
        padding: 14px 16px 14px 28px;
        min-height: 92px;
    }

    .member-name {
        font-size: 0.98rem;
    }

    .member-arrow {
        width: 38px;
        height: 38px;
    }
    
    .team-header-deco.left { left: 5%; }
    .team-header-deco.right { right: 5%; }
}

/* ============================================================
   RESPONSIVE — 1024px
   ============================================================ */
@media (max-width: 1024px) {
    .team-section {
        margin-top: 60px;
        padding: 52px 0 50px;
    }

    .team-layout {
        grid-template-columns: calc(53.5% - 2px) calc(46.5% - 2px);
    }

    .team-node.jt,
    .team-node.jb {
        left: calc(53.5% - 0.5px);
    }

    .team-list,
    .team-photo-panel {
        min-height: 370px;
    }

    .team-list-item {
        min-height: 88px;
        padding: 12px 14px 12px 26px;
    }

    .member-tag {
        font-size: 0.84rem;
        letter-spacing: 1.3px;
    }

    .member-role {
        font-size: 0.76rem;
    }

    .member-name {
        font-size: 0.93rem;
    }

    .member-arrow {
        width: 34px;
        height: 34px;
    }

    .panel-dots.tr { top: 26px; right: 34px; }
    .panel-dots.br { bottom: 26px; right: 34px; }
    .panel-dots.ml { left: 26px; }
    
    .team-section .team-header { padding: 50px 0; }
}

/* ============================================================
   RESPONSIVE — 860px — stacked
   ============================================================ */
@media (max-width: 860px) {
    .team-section .team-header h2 {
        font-size: 1.8rem;
    }

    .team-section .team-header p {
        font-size: 0.86rem;
    }

    .team-layout {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .team-node.jt,
    .team-node.jb {
        display: none;
    }

    .team-photo-panel {
        grid-row: 1;
        min-height: 360px;
    }

    .team-list {
        grid-row: 2;
        min-height: 0;
    }

    .team-list-item {
        min-height: 82px;
        padding: 14px 18px 14px 28px;
    }
    
    .team-header-deco { display: none; }
}

/* ============================================================
   RESPONSIVE — 560px
   ============================================================ */
@media (max-width: 560px) {
    .team-section {
        margin-top: 48px;
        padding: 42px 0 40px;
    }

    .team-section .team-header {
        padding: 40px 0;
    }

    .team-section .team-header h2 {
        font-size: 1.5rem;
        letter-spacing: -0.6px;
    }    .team-section .team-header p {
        font-size: 0.8rem;
    }



    .team-photo-panel {
        min-height: 300px;
    }

    .team-list-item {
        min-height: 76px;
        padding: 12px 14px 12px 26px;
        gap: 12px;
    }

    .member-tag {
        font-size: 0.78rem;
        letter-spacing: 1.1px;
    }

    .member-role {
        font-size: 0.72rem;
    }

    .member-name {
        font-size: 0.88rem;
    }

    .member-arrow {
        width: 30px;
        height: 30px;
    }

    .panel-dots {
        width: 38px;
        height: 40px;
        background-size: 10px 10px;
    }

    .panel-dots.tr { top: 20px; right: 22px; }
    .panel-dots.br { bottom: 20px; right: 22px; }
    .panel-dots.ml { left: 16px; }
}

/* ============================================================
   TOUCH — disable hover styling
   ============================================================ */
@media (hover: none) {
    .team-list-item:hover .member-tag,
    .team-list-item:hover .member-name {
        opacity: 0.55;
    }

    .team-list-item.active .member-tag,
    .team-list-item.active .member-name {
        opacity: 1;
    }

    .team-list-item:hover .member-arrow {
        opacity: 0.5;
        transform: none;
        filter: none;
    }

    .team-list-item.active .member-arrow {
        opacity: 1;
        transform: none;
        filter: drop-shadow(0 0 6px var(--team-glow));
    }
}