/* =========================================================
 * MUSK ABOUT - ĐỘI NGŨ CHUYÊN GIA
 *
 * - Background #020842 tràn 100vw.
 * - Nội dung vẫn theo width Column Flatsome.
 * - Shape sử dụng CSS chung.
 * - Title sử dụng hệ .musk-title chung.
 * ========================================================= */

.musk-expert-grid--about {
  position: relative;
  z-index: 0;
  isolation: isolate;
  width: 100%;
  padding: 100px 0 58px;
  background: transparent;
  color: #fff;
}

/* =========================================================
 * ÁNH SÁNG NỀN RẤT NHẸ
 * ========================================================= */

.musk-expert-grid--about::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  background: radial-gradient(
    circle at 50% 35%,
    rgba(27, 68, 184, 0.08),
    transparent 45%
  );
  transform: translateX(-50%);
  pointer-events: none;
}

/* =========================================================
 * TITLE
 *
 * Section nền tối nên tiêu đề phải đảo sang màu trắng.
 * Các CSS heading/line còn lại vẫn lấy từ hệ Musk Title chung.
 * ========================================================= */

.musk-expert-grid__header .musk-title__heading {
  color: #ffffff;
}

/* =========================================================
 * HEADER
 * ========================================================= */

.musk-expert-grid__header {
  position: relative;
  z-index: 2;
  margin-bottom: 42px;
  text-align: center;
}

.musk-expert-grid__intro {
  max-width: 720px;
  margin: 10px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 400;
  line-height: 1.6;
}

/* =========================================================
 * GRID
 *
 * Dùng flex thay vì nth-child cố định.
 * Nhờ vậy thêm 4, 5, 6, 7... người đều tự căn giữa.
 * ========================================================= */

.musk-expert-grid__slider {
  position: relative;
  z-index: 2;
  width: 100%;
}

.musk-expert-grid__grid {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  gap: 22px 20px;
}

/* =========================================================
 * NÚT ĐIỀU HƯỚNG
 *
 * Chỉ dùng ở mobile. Desktop là lưới nên ẩn hẳn.
 * ========================================================= */

.musk-expert-grid__nav {
  display: none;
}

/* =========================================================
 * CARD
 * ========================================================= */

.musk-expert-grid__card {
  position: relative;
  display: block;
  flex: 0 0 calc((100% - 40px) / 3);
  min-width: 0;
  overflow: hidden;
  border: 5px solid #e3e7ed;
  border-radius: 17px;
  background: #e7e9ed;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13);
  transform: translateZ(0);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

a.musk-expert-grid__card {
  color: #fff;
  text-decoration: none;
}

.musk-expert-grid__card:hover {
  color: #fff;
  text-decoration: none;
  transform: translateZ(0) translateY(-6px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.23);
}

.musk-expert-grid__card:focus-visible {
  outline: 3px solid rgba(80, 127, 255, 0.45);
  outline-offset: 4px;
}

/* =========================================================
 * ẢNH
 * ========================================================= */

.musk-expert-grid__media {
  position: relative;
  width: 100%;
  aspect-ratio: 0.92 / 1;
  overflow: hidden;
  background: linear-gradient(145deg, #eceef1, #d8dadd);
}

.musk-expert-grid__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 48%,
    rgba(2, 7, 31, 0.12) 100%
  );
  pointer-events: none;
}

/* =========================================================
 * IMAGE / PLACEHOLDER
 * ========================================================= */

.musk-expert-grid__media img,
.musk-expert-grid__placeholder,
.musk-expert-grid__placeholder svg {
  display: block;
  width: 100%;
  height: 100%;
}

.musk-expert-grid__media img {
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: center top;
  transform: translateZ(0) scale(1.001);
  transition: transform 0.55s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.musk-expert-grid__placeholder {
  background: #e6e8ec;
}

.musk-expert-grid__placeholder svg {
  width: 100%;
  height: 100%;
}

/* =========================================================
 * INFO BOX
 * ========================================================= */

.musk-expert-grid__card-info {
  position: absolute;
  z-index: 3;
  right: 8px;
  bottom: 8px;
  left: 8px;
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    34px;
  align-items: center;
  min-height: 66px;
  padding: 11px 10px 11px 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: rgba(3, 6, 19, 0.82);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  gap: 10px;
}

.musk-expert-grid__card-copy {
  min-width: 0;
}

/* =========================================================
 * NAME
 * ========================================================= */

.musk-expert-grid__name {
  margin: 0 0 4px;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* =========================================================
 * ROLE
 * ========================================================= */

.musk-expert-grid__role {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* =========================================================
 * ARROW
 * ========================================================= */

.musk-expert-grid__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #fff;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.musk-expert-grid__arrow svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.musk-expert-grid__card:hover .musk-expert-grid__arrow {
  transform: translateX(4px);
}

@media (hover: hover) {
  .musk-expert-grid__card:hover .musk-expert-grid__media img {
    transform: translateZ(0) scale(1.035);
  }
}

/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 767px) {
  .musk-expert-grid--about {
    padding: 74px 0 46px;
  }

  .musk-expert-grid__header {
    margin-bottom: 29px;
  }

  /* -------------------------------------------------------
   * SLIDER MỘT CỘT
   *
   * Cuộn ngang bằng scroll-snap của trình duyệt, không dùng
   * thư viện. Vuốt tay vẫn chạy, hai nút chỉ là tiện thêm.
   * Không có dot.
   * ------------------------------------------------------- */

  .musk-expert-grid__slider {
    padding-bottom: 56px;
  }

  .musk-expert-grid__grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 10px;
    gap: 16px;
  }

  .musk-expert-grid__grid::-webkit-scrollbar {
    display: none;
  }

  .musk-expert-grid__card {
    flex: 0 0 100%;
    scroll-snap-align: center;
  }

  /* Hai nút đặt giữa, ngay dưới slider. */

  .musk-expert-grid__nav {
    position: absolute;
    bottom: 0;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d5dbe5;
    border-radius: 50%;
    background: #ffffff;
    color: #0b1b3b;
    box-shadow: 0 6px 16px rgba(8, 20, 46, 0.1);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition:
      opacity 0.25s ease,
      border-color 0.25s ease,
      color 0.25s ease;
  }

  .musk-expert-grid__nav svg {
    display: block;
    width: 20px;
    height: 20px;
  }

  .musk-expert-grid__nav--prev {
    left: calc(50% - 52px);
    margin-bottom: 0px !important;
  }

  .musk-expert-grid__nav--next {
    left: calc(50% + 8px);
    margin-bottom: 0px !important;
  }

  .musk-expert-grid__nav:hover:not(:disabled) {
    border-color: #1558f4;
    color: #1558f4;
  }

  .musk-expert-grid__nav:disabled {
    opacity: 0.35;
    cursor: default;
  }

  /* Chỉ một thẻ thì JS gắn .is-static và hai nút tự ẩn. */

  .musk-expert-grid__slider.is-static .musk-expert-grid__nav {
    display: none;
  }

  .musk-expert-grid__slider.is-static {
    padding-bottom: 0;
  }

  .musk-expert-grid__media {
    aspect-ratio: 1 / 1.08;
  }

  .musk-expert-grid__intro {
    margin-top: 7px;
    line-height: 1.55;
  }

  .musk-expert-grid__card-info {
    right: 7px;
    bottom: 7px;
    left: 7px;
    min-height: 67px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .musk-expert-grid__card,
  .musk-expert-grid__media img,
  .musk-expert-grid__arrow {
    transition: none !important;
  }
}
