/* ============================================================
   SICOMP — TEAM.CSS
   صفحات لیست اعضای تیم + تک عضو
   نسخه: 3.0 — آواتار ۴۰۰px + سایر اعضا ۴ ستونی + رفع باگ
   ============================================================ */

/* ==================== Hero لیست تیم ==================== */
.team-hero { height: 245px; position: relative; overflow: hidden; background: #eaf3ff; }
.team-hero__bg { position: absolute; inset: 0; background: url('../images/soft.png') left center/cover no-repeat; }
.team-hero__shade { position: absolute; inset: 0; background: linear-gradient(270deg, #f7faff 0%, #f7faffed 27%, #f7faff80 55%, #f7faff08 85%); }
.team-hero__inner { height: 100%; display: flex; align-items: center; position: relative; }
.team-hero__copy { width: 100%; margin-right: auto; border-right: 4px solid var(--red); padding: 8px 18px 8px 0; }
.team-hero h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 900; line-height: 1.5; margin: 0 0 8px; }
.team-hero p { font-size: 14px; font-weight: 600; margin: 0; }

/* ==================== لیست اعضا ==================== */
.team-main { padding-top: 28px; padding-bottom: 30px; }
.team-toolbar { display: grid; grid-template-columns: 1fr minmax(250px, 370px); align-items: center; gap: 25px; }
.team-toolbar .section-heading { margin: 0; }

.team-search { height: 43px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 24px; padding: 0 15px; background: #fff; color: var(--blue); }
.team-search span { font-size: 24px; }
.team-search input { width: 100%; border: 0; outline: 0; background: transparent; font: 500 12px Vazir, Tahoma, sans-serif; color: var(--ink); }

.team-list-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 14px; }
.team-list-heading h2 { font-size: 19px; }
.team-list-heading span { font-size: 11px; color: var(--muted); }

/* ==================== گرید اعضا — ۴ ستون ==================== */
.team-page-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.team-page-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 5px 18px rgba(9, 39, 92, .04);
    transition: transform .2s, box-shadow .2s;
}
.team-page-card[hidden] { display: none; }
.team-page-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* تصویر کارت — حفظ نسبت آواتار ۴۰۰px */
.team-page-card__image {
    height: 400px;            /* ← ارتفاع مناسب برای آواتار ۴۰۰px */
    position: relative;
    overflow: hidden;
    background: #edf3fa;
}
.team-page-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;   /* ← صورت بالای کادر باشه */
    transition: transform .3s;
}
.team-page-card:hover .team-page-card__image img { transform: scale(1.04); }

.team-page-card__avatar {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0878dc, #06275f);
    color: #fff;
    font-size: 48px;
    font-weight: 900;
}

.team-page-card__body { display: flex; flex-direction: column; flex: 1; padding: 15px; }
.team-page-card__body h3 { font-size: 14px; margin: 0 0 4px; }
.team-page-card__body > p { font-size: 11px; color: var(--blue); font-weight: 700; margin: 0 0 10px; }
.team-page-card__more { margin-top: auto; align-self: flex-start; padding: 6px 11px; border-radius: 8px; background: #eef6ff; color: #075db7; font-size: 10px; font-weight: 800; }
.team-page-card:hover .team-page-card__more { background: #dceeff; }

.no-team { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; grid-column: 1 / -1; }

/* ==================== صفحه‌بندی مدرن ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 35px 0 15px;
    flex-wrap: wrap;
}

.pagination a {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d4e4fa;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: 700 13px Vazir, Tahoma, sans-serif;
    transition: all .2s ease;
    text-decoration: none;
}

.pagination a:hover {
    background: #eaf3ff;
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-1px);
}

.pagination a.is-current {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    box-shadow: 0 4px 12px rgba(6, 39, 95, .25);
    cursor: default;
    pointer-events: none;
}

.pagination a[aria-label] { font-size: 16px; font-weight: 900; }
.pagination a[aria-label]:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ==================== CTA پایین ==================== */
.team-contact { margin-bottom: 38px; padding: 20px 28px; border: 1px solid #d4e4fa; border-radius: 13px; background: linear-gradient(100deg, #eaf3ff, #fff); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.team-contact h2 { font-size: 17px; margin: 0 0 4px; }
.team-contact p { font-size: 11px; margin: 0; color: var(--muted); }

/* ==================== صفحه تک عضو ==================== */
.team-detail-hero { background: linear-gradient(120deg, #f5f9ff, #eaf3ff); padding: 16px 0 30px; border-bottom: 1px solid #e1ebf8; }
.team-detail-hero .breadcrumbs { display: flex; gap: 9px; align-items: center; font-size: 10px; color: #63758f; margin-bottom: 18px; }
.team-detail-hero .breadcrumbs a:hover { color: var(--blue); }
.team-detail-hero .breadcrumbs b { font-weight: 700; color: var(--ink); }
.team-detail-hero__grid { display: grid; grid-template-columns: 1fr .92fr; gap: 38px; align-items: center; }
.team-detail-hero__text h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; line-height: 1.65; margin: 8px 0; }
.team-detail-hero__text > p { font-size: 13px; line-height: 2; color: #405574; margin: 0 0 17px; max-width: 650px; }
.team-author { display: flex; align-items: center; gap: 9px; font-size: 10px; color: #62728a; }
.team-author-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 900; font-size: 13px; }

/* تصویر اصلی پروفایل — هماهنگ با آواتار ۴۰۰px */
.team-detail-hero__image {
    height: 400px;             /* ← از ۵۰۰px به ۴۰۰px کاهش یافت */
    max-width: 400px;          /* ← عرض محدود برای جلوگیری از کشیدگی */
    margin-right: auto;        /* ← تراز راست در گرید RTL */
    border: 1px solid #cbdcf7;
    border-radius: 13px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #fff;
}
.team-detail-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
.team-detail-hero__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0878dc, #06275f);
    color: #fff;
    font-size: 80px;
    font-weight: 900;
}

.team-detail-layout { display: grid; grid-template-columns: 270px minmax(0, 760px); gap: 38px; justify-content: center; align-items: start; padding-top: 35px; padding-bottom: 35px; }
.team-sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 15px; }

/* رفع باگ تایپی: sidebaشr → sidebar */
.team-sidebar .toc-box,
.team-sidebar .sidebar-contact {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 17px;
    box-shadow: var(--shadow-sm);
}

.team-sidebar .toc-box h2 { font-size: 14px; margin: 0 0 10px; padding-bottom: 9px; border-bottom: 1px solid #edf2fa; }
.team-sidebar .toc-box a { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #52647f; padding: 7px 0; border-bottom: 1px solid #f0f4fa; transition: color .2s; }
.team-sidebar .toc-box a:hover { color: var(--blue); font-weight: 800; }
.team-sidebar__empty { font-size: 11px; color: var(--muted); margin: 0; }

.team-socials { display: flex; gap: 8px; margin-top: 10px; }
.team-socials a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid #d4e4fa; color: var(--blue); font-size: 13px; transition: .2s; }
.team-socials a:hover { background: var(--blue); color: #fff; }

/* شبکه‌های اجتماعی در هیرو */
.team-detail-socials { display: flex; gap: 8px; margin-top: 15px; }
.team-detail-socials a {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #d4e4fa;
    color: var(--blue);
    font-size: 15px;
    transition: all .2s;
}
.team-detail-socials a:hover {
    background: var(--blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 120, 220, .25);
}

.team-detail-content { min-width: 0; color: #293e5d; }
.team-detail-content__meta { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #e8eef7; color: #748198; font-size: 10px; }
.team-detail-bio { font-size: 13px; line-height: 2.35; margin: 18px 0 0; text-align: justify; }
.team-detail-empty { font-size: 13px; color: var(--muted); margin: 18px 0 0; }

.team-end-cta { padding: 19px; border: 1px solid #cfe0fa; border-radius: 12px; background: linear-gradient(110deg, #eaf3ff, #fff); margin-top: 28px; }
.team-end-cta h3 { font-size: 15px; margin: 0 0 4px; }
.team-end-cta p { font-size: 11px; margin: 0 0 12px; }
.team-end-cta .btn { font-size: 11px; padding: 8px 16px; }

.team-detail-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 18px;
    border-top: 1px solid #e8eef7;
}

/* ==================== سایر اعضا — ۴ ستون ==================== */
.related-team { padding-top: 12px; padding-bottom: 28px; }
.related-team .section-heading { margin-bottom: 15px; }
.related-team__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));   /* ← ۴ ستون */
    gap: 16px;
}
.related-team__grid .team-page-card__image { height: 220px; }   /* ← ارتفاع کمتر در کارت‌های مرتبط */
.back-to-team { text-align: center; margin-top: 20px; }

/* ==================== ریسپانسیو ==================== */

/* تبلت بزرگ — ۳ ستون */
@media (max-width: 1100px) {
    .team-page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .related-team__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 950px) {
    .team-toolbar { grid-template-columns: 1fr; }
    .team-search { max-width: 100%; }
    .team-detail-hero__grid { gap: 22px; }
    .team-detail-hero__image { height: 360px; max-width: 360px; }
    .team-detail-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
}

/* موبایل بزرگ / تبلت کوچک — ۲ ستون */
@media (max-width: 760px) {
    .team-hero { height: 205px; }
    .team-hero__shade { background: linear-gradient(180deg, #f7faff55, #f7faffed 65%); }
    .team-hero__inner { align-items: flex-end; padding-bottom: 23px; }
    .team-hero__copy { width: 100%; margin: 0; text-align: center; border: 0; padding: 0; }
    .team-hero h1 { font-size: 24px; }
    .team-hero p { font-size: 11px; }
    .team-main { padding-top: 20px; }
    .team-toolbar { gap: 15px; }

    .team-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .team-page-card__image { height: 220px; }   /* ← ارتفاع کمتر در موبایل */
    .team-page-card__body { padding: 11px; }
    .team-page-card__body h3 { font-size: 12px; }
    .team-page-card__avatar { font-size: 36px; }

    .team-contact { flex-direction: column; text-align: center; padding: 17px; }
    .team-contact h2 { font-size: 14px; }
    .team-contact p { font-size: 10px; }

    .team-detail-hero { padding-bottom: 20px; }
    .team-detail-hero__grid { grid-template-columns: 1fr; gap: 15px; }
    .team-detail-hero__text h1 { font-size: 23px; }
    .team-detail-hero__text > p { font-size: 11px; }
    .team-detail-hero__image { height: 340px; max-width: 340px; margin: 0 auto; order: -1; }
    .team-detail-layout { grid-template-columns: 1fr; padding-top: 20px; gap: 15px; }
    .team-sidebar { position: static; order: 2; }
    .team-detail-content { order: 1; }
    .team-detail-bio { font-size: 12px; }

    .related-team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .related-team__grid .team-page-card__image { height: 180px; }
    .related-team__grid .team-page-card:last-child { display: none; }   /* ← حذف کارت چهارم در موبایل */
}

/* موبایل کوچک — ۱ ستون */
@media (max-width: 430px) {
    .team-page-grid { grid-template-columns: 1fr; }
    .team-page-card__image { height: 300px; }
    .related-team__grid { grid-template-columns: 1fr 1fr; }
    .related-team__grid .team-page-card__image { height: 150px; }
    .related-team__grid .team-page-card:last-child { display: none; }
    .pagination { gap: 6px; margin: 25px 0 10px; }
    .pagination a { min-width: 36px; height: 36px; font-size: 12px; padding: 0 8px; }
}