/* Board of Directors — team grid + profile modal. Shell: css/pages/inner-shell.css */

body.page-team .contact-sec.inner-explore-sec::before {
  background-image: url("../../assets/images/backgrounds/company1.jpeg");
}

body.page-team .inner-explore--single {
  grid-template-columns: 1fr;
  max-width: min(380px, 44vw);
}

body.page-team .team-content-sec {
  --team-card-role-color: color-mix(in srgb, var(--cyan-primary) 55%, var(--text-main));
}

body.page-team .team-group {
  --team-head-to-grid: clamp(20px, 2.5vw, 32px);
}

body.page-team .team-group-head.section-head {
  max-width: none;
  margin-bottom: 0;
}

body.page-team .team-group > .team-grid:first-of-type {
  margin-top: var(--team-head-to-grid);
}

body.page-team .team-group:first-child .team-group-head {
  margin-top: clamp(64px, 8vw, 100px);
}

body.page-team .team-group-title {
  font-size: clamp(2.25rem, 4.5vw, 3.125rem);
  font-weight: 700;
  line-height: 1.12;
  text-shadow: 0 2px 24px color-mix(in srgb, var(--black-void) 55%, transparent);
}

body.page-team .team-card .team-role {
  color: var(--team-card-role-color);
  font-weight: 500;
}

    /* =======================================================
       MINIMAL TEAM GRID (2 Columns - No Descriptions)
    ======================================================= */
    .team-content-sec {
      position: relative;
      z-index: 1;
      padding: 100px 0;
    }

    /* Optional test: fixed lobby bg — toggle via HTML class team-content-sec--fixed-bg */
    .team-content-sec.team-content-sec--fixed-bg {
      background-color: var(--black-void, #020407);
      background-image: linear-gradient(
          180deg,
          rgba(2, 4, 7, 0.55) 0%,
          rgba(2, 4, 7, 0.72) 45%,
          rgba(2, 4, 7, 0.82) 100%
        ),
        url('../../assets/images/backgrounds/contact-hero.jpeg');
      background-size: cover;
      background-position: center center;
      background-repeat: no-repeat;
      background-attachment: fixed;
    }

    @media (prefers-reduced-motion: reduce) {
      .team-content-sec.team-content-sec--fixed-bg {
        background-attachment: scroll;
      }
    }

    .team-content-sec--fixed-bg .team-card {
      background: rgba(14, 22, 38, 0.78);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    .team-group + .team-group {
      margin-top: clamp(72px, 9vw, 120px);
      padding-top: clamp(48px, 6vw, 72px);
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .team-group-head {
      max-width: none;
      margin-top: 0;
      margin-bottom: 0;
      text-align: center;
    }

    .team-group > .team-grid:first-of-type {
      margin-top: var(--team-head-to-grid, clamp(20px, 2.5vw, 32px));
    }

    .team-group:first-child .team-group-head {
      margin-top: clamp(64px, 8vw, 100px);
    }

    .team-group + .team-group .team-group-head {
      margin-top: clamp(56px, 7vw, 88px);
    }

    .team-group-title {
      margin: 8px 0 0;
      font-size: clamp(2.25rem, 4.5vw, 3.125rem);
      font-weight: 700;
      letter-spacing: -0.025em;
      color: #fff;
      line-height: 1.12;
      text-shadow: 0 2px 24px color-mix(in srgb, var(--black-void) 55%, transparent);
    }

    .team-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 32px;
      margin-top: 20px;
    }

    .team-group .team-grid {
      margin-top: 0;
    }

    /* Team groups: 2-card board row (880px); leadership 4-card row; management 5-card row */
    .team-group--executive {
      --team-group-head-max: 880px;
    }

    .team-group--leadership,
    .team-group--management {
      --team-group-solo-max: var(--container);
    }

    .team-group--executive .team-grid--executive-head {
      grid-template-columns: repeat(2, 1fr);
      width: min(100%, var(--team-group-head-max));
      max-width: 100%;
      margin-inline: auto;
    }

    .team-group--leadership .team-grid--leadership-solo,
    .team-group--management .team-grid--management-solo {
      width: min(100%, var(--team-group-solo-max));
      max-width: 100%;
      margin-inline: auto;
      gap: 22px;
    }

    .team-group--leadership .team-grid--leadership-solo {
      grid-template-columns: repeat(4, 1fr);
    }

    .team-group--management .team-grid--management-solo {
      grid-template-columns: repeat(5, 1fr);
    }

    .team-group--leadership .team-card:only-child,
    .team-group--management .team-card:only-child {
      grid-column: 1 / -1;
      width: min(100%, calc((100% - 32px) / 2));
      justify-self: center;
    }

    .team-group--leadership .team-grid--leadership-solo .team-card:nth-child(3) .team-img img {
      transform: scale(1.08);
    }

    .team-group--leadership .team-grid--leadership-solo .team-card:nth-child(3):hover .team-img img {
      transform: scale(1.13);
    }

    .team-card--sample .team-img img {
      object-position: center top;
    }

    /* کارتِ هر فرد */
    .team-card {
      position: relative;
      background: rgba(14, 22, 38, 0.4);
      border: 1px solid rgba(255, 255, 255, 0.05);
      border-radius: 20px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    /* افکت هاور روی کل کارت */
    .team-card:hover {
      transform: translateY(-8px);
      border-color: rgba(0, 217, 194, 0.35);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 217, 194, 0.1);
    }

    /* بخش عکس */
    .team-img {
      width: 100%;
      aspect-ratio: 3 / 4;
      /* تناسب ایده‌آل عکس پرسنلی */
      overflow: hidden;
      position: relative;
      background: rgba(255, 255, 255, 0.02);
      isolation: isolate;
    }

    .team-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.6s ease, filter 0.6s ease;
      filter: grayscale(15%) contrast(1.1);
      /* کمی جدی و شرکتی */
    }

    /* زوم و رنگی شدن عکس هنگام رفتن موس روی آن */
    .team-card:hover .team-img img {
      transform: scale(1.05);
      filter: grayscale(0%) contrast(1.1);
    }

    /* بخش اطلاعات (نام و سمت) */
    .team-info {
      padding: 24px 20px;
      text-align: center;
      background: linear-gradient(180deg, rgba(14, 22, 38, 0.2) 0%, rgba(2, 4, 7, 0.8) 100%);
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .team-name {
      font-size: 19px;
      color: #fff;
      margin-bottom: 8px;
      font-weight: 600;
      line-height: 1.3;
    }

    .team-role {
      font-family: var(--font-mono);
      font-size: 11.5px;
      color: var(--team-card-role-color, var(--cyan-primary));
      text-transform: uppercase;
      letter-spacing: 0.1em;
      font-weight: 500;
    }

    .team-card-more {
      position: absolute;
      right: 14px;
      bottom: 14px;
      z-index: 3;
      width: 46px;
      height: 46px;
      padding: 0;
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 50%;
      cursor: pointer;
      background: rgba(2, 4, 7, 0.62);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      color: rgba(255, 255, 255, 0.92);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
      display: grid;
      place-items: center;
      transition:
        transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1),
        box-shadow 0.35s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
    }

    .team-card-more__ring {
      position: absolute;
      inset: -4px;
      border-radius: 50%;
      background: transparent;
      border: 1px solid rgba(0, 217, 194, 0.22);
      opacity: 1;
      z-index: -1;
      transition: border-color 0.3s ease, opacity 0.3s ease;
    }

    .team-card:hover .team-card-more__ring {
      border-color: rgba(0, 217, 194, 0.38);
    }

    .team-card-more__icon {
      font-size: 1.65rem;
      font-weight: 300;
      line-height: 1;
      margin-top: -2px;
      transition: transform 0.35s ease;
    }

    .team-card-more:hover,
    .team-card-more:focus-visible {
      transform: scale(1.08);
      color: var(--cyan-primary, #00d9c2);
      background: rgba(2, 4, 7, 0.82);
      border-color: rgba(0, 217, 194, 0.55);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 217, 194, 0.2);
      outline: none;
    }

    .team-card-more:hover .team-card-more__ring,
    .team-card-more:focus-visible .team-card-more__ring {
      border-color: rgba(0, 217, 194, 0.5);
      opacity: 0.85;
    }

    .team-card-more:hover .team-card-more__icon,
    .team-card-more:focus-visible .team-card-more__icon {
      transform: rotate(90deg);
    }

    /* —— Profile modal —— */
    body.team-profile-open {
      overflow: hidden;
    }

    .team-profile-layer {
      position: fixed;
      inset: 0;
      z-index: 2000;
      display: grid;
      place-items: center;
      padding: clamp(16px, 4vw, 40px);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.32s ease;
    }

    .team-profile-layer.is-open {
      pointer-events: auto;
      opacity: 1;
    }

    .team-profile-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(2, 4, 7, 0.72);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    .team-profile-dialog {
      position: relative;
      width: min(920px, 100%);
      max-height: min(92vh, 720px);
      display: flex;
      flex-direction: column;
      border-radius: 24px;
      overflow: hidden;
      border: 1px solid rgba(0, 217, 194, 0.22);
      background:
        radial-gradient(120% 80% at 100% 0%, rgba(0, 144, 255, 0.12) 0%, transparent 55%),
        linear-gradient(155deg, rgba(14, 22, 38, 0.98) 0%, rgba(2, 4, 7, 0.98) 100%);
      box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
      transform: translateY(24px) scale(0.96);
      transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .team-profile-layer.is-open .team-profile-dialog {
      transform: translateY(0) scale(1);
    }

    .team-profile-close {
      position: absolute;
      top: 14px;
      right: 14px;
      z-index: 2;
      width: 40px;
      height: 40px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 50%;
      background: rgba(2, 4, 7, 0.5);
      color: #fff;
      font-size: 1.5rem;
      line-height: 1;
      cursor: pointer;
      transition: border-color 0.25s ease, background 0.25s ease;
    }

    .team-profile-close:hover,
    .team-profile-close:focus-visible {
      border-color: var(--cyan-primary, #00d9c2);
      background: rgba(0, 217, 194, 0.12);
      outline: none;
    }

    .team-profile-layout {
      display: grid;
      grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
      flex: 1 1 auto;
      min-height: 0;
      max-height: 100%;
    }

    .team-profile-visual {
      position: relative;
      min-height: 0;
      padding: clamp(16px, 2.5vw, 28px);
      display: flex;
      align-items: center;
      justify-content: center;
      background:
        linear-gradient(165deg, rgba(0, 144, 255, 0.08) 0%, transparent 45%),
        rgba(255, 255, 255, 0.02);
      border-right: 1px solid rgba(255, 255, 255, 0.06);
    }

    .team-profile-frame {
      position: relative;
      width: 100%;
      max-width: min(280px, 42vw);
      aspect-ratio: 3 / 4;
      border-radius: 18px;
      padding: 2px;
      background: linear-gradient(145deg, var(--blue-deep, #0090ff), var(--cyan-primary, #00d9c2));
      box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    }

    .team-profile-frame img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 16px;
      display: block;
      filter: contrast(1.05);
    }

    .team-profile-index {
      position: absolute;
      left: clamp(16px, 2.5vw, 28px);
      bottom: clamp(16px, 2.5vw, 28px);
      font-family: var(--font-mono);
      font-size: clamp(2.5rem, 6vw, 3.5rem);
      font-weight: 600;
      line-height: 1;
      color: transparent;
      -webkit-text-stroke: 1px rgba(0, 217, 194, 0.35);
      pointer-events: none;
      user-select: none;
    }

    .team-profile-copy {
      min-height: 0;
      padding: clamp(22px, 3vw, 36px) clamp(20px, 3vw, 36px);
      padding-right: clamp(28px, 3.5vw, 44px);
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .team-profile-eyebrow {
      font-family: var(--font-mono);
      font-size: 10px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.45);
      margin-bottom: 10px;
    }

    .team-profile-role {
      font-family: var(--font-mono);
      font-size: 11.5px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--cyan-primary);
      font-weight: 500;
      margin: 0 0 8px;
    }

    .team-profile-name {
      font-size: clamp(1.35rem, 2.4vw, 1.75rem);
      font-weight: 600;
      color: #fff;
      margin: 0;
      line-height: 1.2;
      letter-spacing: -0.02em;
    }

    .team-profile-divider {
      height: 2px;
      width: min(120px, 40%);
      margin: 14px 0 12px;
      border-radius: 2px;
      background: linear-gradient(90deg, var(--blue-deep, #0090ff), var(--cyan-primary, #00d9c2));
    }

    .team-profile-bio {
      margin: 0;
      flex: 0 1 auto;
      min-height: 0;
      max-width: none;
    }

    .team-profile-bio p {
      margin: 0;
      font-size: clamp(0.8125rem, 1.35vw, 0.9rem);
      line-height: 1.58;
      color: rgba(255, 255, 255, 0.78);
    }

    .team-profile-bio p + p {
      margin-top: 0.65em;
    }

    .team-profile-links {
      flex-shrink: 0;
      margin: 14px 0 0;
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }

    .team-profile-link {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
      border-radius: 999px;
      border: 1px solid color-mix(in srgb, var(--cyan-primary) 45%, transparent);
      background: color-mix(in srgb, var(--cyan-primary) 10%, transparent);
      color: var(--team-card-role-color, var(--cyan-primary));
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 500;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      text-decoration: none;
      transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
    }

    .team-profile-link:hover,
    .team-profile-link:focus-visible {
      color: var(--text-main);
      border-color: color-mix(in srgb, var(--cyan-primary) 65%, transparent);
      background: color-mix(in srgb, var(--cyan-primary) 22%, transparent);
      outline: none;
    }

    .team-profile-link svg {
      flex-shrink: 0;
    }

    /* --- ریسپانسیو شبکه‌ی تیم --- */
    @media (max-width: 980px) {
      .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
      }

      .team-group--leadership .team-grid--leadership-solo,
      .team-group--management .team-grid--management-solo {
        width: 100%;
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 720px) {
      .team-profile-layout {
        grid-template-columns: 1fr;
      }

      .team-profile-dialog {
        max-height: min(92vh, 720px);
      }

      .team-profile-visual {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-bottom: 12px;
      }

      .team-profile-frame {
        max-width: 240px;
      }

      .team-profile-index {
        font-size: 2rem;
      }

      .team-profile-copy {
        padding-top: 20px;
      }
    }

    @media (max-width: 600px) {
      .team-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
      }

      .team-group--leadership .team-card:only-child,
      .team-group--management .team-card:only-child {
        width: 100%;
      }

      .team-card-more {
        width: 42px;
        height: 42px;
        right: 12px;
        bottom: 12px;
      }
    }
