/* Team modal - Детальніше button & modal, mobile-first */

@scope (.team-with-description) {
  .row {
    justify-content: center;
  }

  .new-team-item-experience {
    margin-bottom: 0 !important;
  }

  a.team-vacansii {
    margin-top: 0;
  }

  .new-team .section-title {
    margin: 7px 0 0px 1px;
    margin-bottom: 35px !important;
    font-weight: 500;
  }

  /* Position badge: one line; font size reduced via team-modal.js when needed */
  .new-team-item {
    width: 174px;
    height: 292px;
    margin-bottom: 35px;
    padding: 0;
    margin-left: 11px;
    margin-right: 11px;
  }
  /* Бейдж по ширині тексту, до max 100% картки; лише коли не вміщується — JS зменшує шрифт */
  .new-team .new-team-item-position {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    vertical-align: top;
    /* +2px до main.css — менше візуального тиску гліфів на край капсули */
    padding-left: 12px;
    padding-right: 12px;
  }

  .new-team-item-detail-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    font-family: "Mabry Pro", sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: #fff;
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .new-team-item-detail-btn:hover,
  .new-team-item-detail-btn:focus {
    opacity: 0.85;
    color: #fff;
  }

  .team-modal-templates {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .team-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(33, 33, 33, 0.9);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 15px 40px;
  }
  .team-modal-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }

  .team-modal {
    position: relative;
    width: 100%;
    max-width: 368px;
    margin: auto;
    background: #faf8f3;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .team-modal-close {
    position: absolute;
    top: 4px;
    right: 7px;
    z-index: 10;
    padding: 0;
    border: 0;
    background: none;
    color: #212121;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
  }
  .team-modal-close:hover,
  .team-modal-close:focus {
    opacity: 0.7;
  }

  .team-modal-close-icon {
    display: block;
    font-weight: 300;
    font-family: system-ui, sans-serif;
    font-size: 32px;
    line-height: 18px;
  }

  .team-modal-content-wrapper {
    padding: 0;
    height: 706px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #faf8f3;
  }

  .team-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 24px 3px 20px 20px;
  }

  .team-modal-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 21px;
    flex-shrink: 0;
    padding-right: 20px;
  }

  .team-modal-avatar {
    flex-shrink: 0;
    width: 152px;
    height: 152px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fcba1d;
    margin-right: 4px;
  }

  .team-modal-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .team-modal-header-info {
    flex: 0 0 auto;
    min-width: 0;
    text-align: left;
    margin-right: -8px;
  }

  .team-modal-name {
    font-family: "Mabry Pro", sans-serif;
    font-weight: 400;
    font-size: 21px;
    line-height: 27px;
    text-transform: uppercase;
    color: #212121;
    margin: 0 0 4px;
  }

  .team-modal-position-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #fcba1d;
    border-radius: 25px;
    font-family: "Mabry Pro", sans-serif;
    font-weight: 300;
    font-size: 10px;
    line-height: 1.4;
    color: #212121;
    margin-bottom: 9px;
    min-height: 25px;
    align-content: center;
  }

  .team-modal-experience {
    font-family: "Mabry Pro", sans-serif;
    font-weight: 300;
    font-size: 10px;
    line-height: 14px;
    color: #212121;
    margin: 0;
  }
  .team-modal-experience span {
    font-weight: 500;
    font-size: 10px;
    color: #fcba1d;
  }

  .team-modal-body {
    font-family: "Mabry Pro", sans-serif;
    color: #212121;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Firefox: scrollbar-width/color — тільки коли webkit не підтримується (Chrome 121+ ігнорує ::-webkit-scrollbar, якщо є scrollbar-width) */
  @supports not selector(::-webkit-scrollbar) {
    .team-modal-body {
      scrollbar-width: thin;
      scrollbar-color: #212121 transparent;
    }
  }

  /* Custom scrollbar - WebKit (Chrome, Safari, Edge), mobile: 4px */
  .team-modal-body {
    --team-modal-scrollbar-thumb-max-height: 60px;
  }
  .team-modal-body::-webkit-scrollbar {
    width: 4px;
  }
  .team-modal-body::-webkit-scrollbar-button {
    display: none;
    height: 0;
  }
  .team-modal-body::-webkit-scrollbar-track {
    background: transparent;
  }
  .team-modal-body::-webkit-scrollbar-thumb {
    background: #212121;
    border-radius: 3px;
    max-height: var(--team-modal-scrollbar-thumb-max-height);
  }
  .team-modal-body::-webkit-scrollbar-thumb:hover {
    background: #212121;
  }
  .team-modal-body::-webkit-scrollbar-thumb:active {
    background: #212121;
  }
  .team-modal-body::-webkit-scrollbar-corner {
    background: transparent;
  }

  .team-modal-intro {
    font-weight: 300;
    font-size: 14px;
    line-height: 18px;
    /* margin: 0 0 24px; */
    padding-right: 10px;

    p {
      margin-bottom: 20px;
    }

    h4 {
      font-size: 18px;
      margin-bottom: 10px;
    }

    > *:last-child {
      margin-bottom: 0;
    }
  }

  .team-modal-section {
    margin-bottom: 24px;
  }
  .team-modal-section:last-child {
    margin-bottom: 0;
  }

  .team-modal-section-title {
    font-family: "Mabry Pro", sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.3;
    margin: 0 0 8px;
  }

  .team-modal-section p {
    font-weight: 300;
    font-size: 14px;
    line-height: 18px;
    margin: 0;
  }

  .new-team .new-team-item-title {
    margin-top: 14px;
    margin-bottom: 5px;
    display: block;
  }

  /* Tablet (768px+) - Figma Планшет */
  @media (min-width: 768px) {
    .new-team .section-title {
      font-size: 30px;
      line-height: 70px;
      margin-bottom: 20px !important;
    }

    .new-team-item {
      /* min-height: 444px; */
      width: 253px;
      height: 410px;
      padding: 0;
      margin-left: 26px;
      margin-right: 26px;
    }

    .new-team .new-team-item-title {
      font-size: 26px;
      margin-top: 25px;
      margin-bottom: 10px;
    }

    .new-team .new-team-item-position {
      font-size: 16px;
      line-height: 36px;
      padding: 0 16px;
      margin-bottom: 13px;
    }

    .new-team-item-detail-btn {
      font-size: 14px;
      line-height: 20px;
      margin-top: 5px;
    }

    .new-team p.new-team-item-experience {
      font-size: 12px;
    }
    .new-team p.new-team-item-experience span {
      font-size: 14px;
    }

    a.team-vacansii {
      font-size: 16px;
      line-height: 40px;
      padding: 8px 24px;
      min-width: 230px;
    }

    .team-modal-overlay {
      padding: 40px 20px 60px;
    }

    .team-modal {
      max-width: 862px;
      width: 100%;
    }

    .team-modal-content-wrapper {
      height: 596px;
      padding: 0;
      overflow: hidden;
    }

    .team-modal-inner {
      display: flex;
      flex-direction: row;
      align-items: stretch;
      width: 100%;
      height: 100%;
      padding: 25px 0;
      padding-right: 5px;
    }

    .team-modal-header {
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 293px;
      min-width: 280px;
      padding: 28px 24px;
      padding-right: 0;
      margin-bottom: 0;
      flex: 0 0 auto;
      align-self: center;
      margin-top: -5px;
    }

    .team-modal-avatar {
      width: 260px;
      height: 260px;
      flex-shrink: 0;
    }

    .team-modal-header-info {
      text-align: center;
      flex: 0 0 auto;
      min-height: 0;
      margin-top: 13px;
      margin-left: -13px;
    }

    .team-modal-name {
      font-size: 26px;
      line-height: 26px;
    }

    .team-modal-position-badge {
      font-size: 16px;
      padding: 6px 16px;
      margin-top: 7px;
    }

    .team-modal-experience {
      font-size: 12px;
      margin-top: 5px;
    }
    .team-modal-experience span {
      font-size: 14px;
    }

    .team-modal-body {
      flex: 1;
      overflow-y: auto;
      padding: 0 32px 0 23px;
      -webkit-overflow-scrolling: touch;
      /* margin-top: 26px; */
    }

    .team-modal-intro {
      p {
        margin-bottom: 27px;
      }

      h4 {
        font-size: 22px;
        margin-bottom: 9px;
      }

      > *:last-child {
        margin-bottom: 0;
      }
    }

    /* Scrollbar tablet: 3px */
    .team-modal-body::-webkit-scrollbar {
      width: 3px;
    }
    .team-modal-body::-webkit-scrollbar-thumb {
      border-radius: 3px;
    }

    .team-modal-section-title {
      font-size: 22px;
    }
  }

  @media (min-width: 768px) and (max-width: 991px) {
    .new-team .container {
      max-width: 940px;
    }
  }

  /* Laptop (992px+) - Figma Блог 1925 */
  @media (min-width: 992px) {
    .new-team .section-title {
      font-size: 28px;
    }

    .new-team .container {
        width: 100%;
        max-width: 1440px;
    }

    .new-team-item {
      /* min-height: 454px; */
      padding: unset;
      margin: 0 19px 40px;
    }

    .new-team .new-team-item-title {
      margin-top: 22px;
    }

    .new-team .new-team-item-detail-btn {
      margin-top: 4px;
    }

    .team-modal-content-wrapper {
      height: 596px;
    }

    .team-modal-inner {
      height: 596px;
    }

    .team-modal-header {
      width: 300px;
      min-width: 300px;
    }

    .team-modal-body {
      padding: 0 40px 0 30px;
      margin-right: 2px;
      /* max-height: 560px; */
      /* overflow: scroll; */
    }

    .team-modal-intro {
      font-size: 16px;
      line-height: 20px;

      p {
        margin-bottom: 27px;
      }

      h4 {
        font-size: 22px;
      }

      > *:last-child {
        margin-bottom: 0;
      }
    }

    .team-modal-section-title {
      font-size: 22px;
    }

    .team-modal-section p {
      font-size: 16px;
      line-height: 20px;
    }
  }

  /* 1200-1600 */
  @media (min-width: 1200px) {
    .team-modal-content-wrapper {
      height: 520px;
    }

    .team-modal-inner {
      height: 520px;
      padding-right: 2px;
    }

    .team-modal-body{
      max-height: unset;
      /* height: calc(100% - 36px); */
    }
    .team-modal {
      max-width: 1050px;
      width: 100%;
    }
  }

  /* Desktop (1600px+) - Figma desk */
  @media (min-width: 1600px) {
    .new-team .container {
      max-width: 1865px;
    }

    .new-team .section-title {
      font-size: 50px;
      line-height: 70px;
      margin-top: 50px;
      letter-spacing: 4px;
      margin-bottom: 60px !important;
    }

    .new-team .new-team-item-title {
      font-size: 40px;
      line-height: 50px;
      margin-top: 23px;
      margin-bottom: 5px;
    }

    .new-team .new-team-item-position {
      font-size: 22px;
      line-height: 27px;
      padding: 9px 23px;
      min-height: 45px;
    }

    .new-team-item {
      /* min-height: 621px; */
      padding: unset;
      margin: 0 41px 52px;
      width: 377px;
      height: 570px;
    }

    .new-team-item-detail-btn {
      font-size: 18px;
      line-height: 22px;
    }

    .new-team p.new-team-item-experience {
      font-size: 14px;
      margin-top: 1px;
    }

    .new-team p.new-team-item-experience span {
      font-size: 20px;
    }

    .new-team .new-team-item-detail-btn {
      margin-top: 9px;
      font-size: 20px;
    }

    a.team-vacansii {
      font-size: 22px;
      line-height: 45px;
      padding: 16px 32px;
      min-width: 323px;
      min-height: 61px;
      border-radius: 37px;
    }

    .team-modal {
      max-width: 1500px;
      width: 100%;
    }

    .team-modal-content-wrapper {
      height: 775px;
    }

    .team-modal-close {
      top: 12px;
      right: 7px;
    }

    .team-modal-close-icon {
      font-size: 50px;
    }

    .team-modal-inner {
      height: 775px;
      padding-top: 41px;
      padding-bottom: 41px;
    }

    .team-modal-header {
      width: 500px;
      min-width: 460px;
      padding: 0;
      padding-left: 5px;
    }

    .team-modal-avatar {
      width: 421px;
      height: 421px;
    }

    .team-modal-name {
      margin-bottom: 0px;
      font-size: 40px;
      line-height: 50px;
    }

    .team-modal-position-badge {
      font-size: 22px;
      padding: 9px 22px;
      min-height: 45px;
      margin-top: 5px;
      margin-bottom: 13px;
    }

    .team-modal-experience {
      font-size: 14px;
    }
    .team-modal-experience span {
      font-size: 20px;
    }

    .team-modal-body {
      padding: 0px 48px 0 3px;
      /* max-height: 706px; */
    }

    .team-modal-intro {
      font-size: 22px;
      line-height: 27px;
      p {
        margin-bottom: 40px;
      }

      h4 {
        font-size: 28px;
        margin-bottom: 12px;
      }

      > *:last-child {
        margin-bottom: 0;
      }
    }

    .team-modal-section-title {
      font-size: 28px;
      line-height: 35px;
    }

    .team-modal-section p {
      font-size: 22px;
      line-height: 27px;
    }

    /* Scrollbar desktop: 5px */
    .team-modal-body::-webkit-scrollbar {
      width: 5px;
    }
  }
}

body:has(.team-with-description .team-modal-overlay.is-open) {
  overflow: hidden;
}
