/* ════ EXPERT CTA BLOCK — Modular Structure ═══════════════════════════════ */
/*
 * All classes use "cta-ex-" prefix to avoid collision with .nac-card etc.
 *
 * 3 logical groups:
 *   .cta-ex-info    — Badge + Title (left)
 *   .cta-ex-avatar  — Expert photo (middle, overflow top)
 *   .cta-ex-actions — 3 action cards (right)
 */

/* ── Base Container ── */
.cta-ex-block {
  display: grid;
  background-color: #F4F7FC;
  border-radius: 16px;
  margin: 40px 0;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}

/* ── Group 1: Info ── */
.cta-ex-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.cta-ex-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid #93C5FD;
  padding: 4px 12px;
  border-radius: 100px;
  font-family: var(--fb);
  font-size: 9.5px;
  font-weight: 700;
  color: #2563EB;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  width: fit-content;
}

.cta-ex-title {
  font-family: var(--fd);
  font-weight: 700;
  color: #121A2F;
  line-height: 1.25;
  margin: 0;
}

.cta-ex-desc {
  font-family: var(--fb);
  font-size: 13px;
  color: #4A5568;
  line-height: 1.5;
  margin: 0;
}

/* ── Group 2: Avatar ── */
.cta-ex-avatar {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  z-index: 1;
  pointer-events: none;
}

.cta-ex-avatar-img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* ── Group 3: Action Cards ── */
.cta-ex-actions {
  display: grid;
  gap: 12px;
  z-index: 2;
}

.cta-ex-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #121A2F;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.cta-ex-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.cta-ex-card:active {
  background-color: #F3F4F6;
}

.cta-ex-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.cta-ex-text-wrap {
  flex: 1;
  min-width: 0;
}

.cta-ex-text {
  font-family: var(--fd);
  font-size: 14px;
  font-weight: 600;
  white-space: normal;
  word-wrap: break-word;
}

.cta-ex-arrow {
  color: #9CA3AF;
  font-size: 18px;
  flex-shrink: 0;
}

/* Card description — hidden on mobile by default */
.cta-ex-card-desc {
  display: none;
}

/* Hide partner logos on desktop — only shown on mobile */
.cta-ex-footer {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ── DESKTOP (>=901px) ──────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {
  .cta-ex-block {
    grid-template-columns: minmax(140px, 1fr) 120px 3fr;
    align-items: center;
    min-height: 140px;
    padding: 0 15px 0 15px;
    margin-top: 80px;
    /* Chừa chỗ cho avatar overflow lên trên */
  }

  .cta-ex-info {
    max-width: 220px;
  }

  .cta-ex-avatar {
    position: relative;
    height: 100%;
    width: 100%;
    /* Đảm bảo wrapper chiếm hết cột 120px */
    overflow: visible;
  }

  .cta-ex-avatar-img {
    position: absolute;
    /* Dùng 0px để đè khít lên border dưới của container */
    bottom: 0px;

    /* Dùng số âm để kéo ảnh lùi về bên trái, tạo khoảng trống với Buttons bên phải */
    left: -30px;

    height: 220px;
    /* Chiều cao vượt khung */
    width: auto;
    object-fit: contain;
    z-index: 5;
  }

  .cta-ex-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  /* Card description — visible on desktop */
  .cta-ex-card-desc {
    display: block;
    font-family: var(--fb);
    font-size: 12px;
    color: #6B7280;
    line-height: 1.4;
    margin-top: 2px;
  }
}

.cta-ex-desc {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ── MOBILE & TABLET (<=900px) ──────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .cta-ex-block {
    display: grid;
    /* 2 cột: Ảnh (2fr) | Nội dung (3fr) — fr-based to prevent overflow */
    /* 3 hàng: Info | Actions | Logos (nếu có) */
    grid-template-columns: 2fr 3fr;
    grid-template-rows: auto auto auto;

    background-color: #F4F7FC;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
    overflow: hidden;
    border: none;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ── Cột trái: Avatar & Circle Decor ── */
  .cta-ex-avatar {
    grid-column: 1;
    grid-row: 1 / 3;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background-color: transparent;
    overflow: visible;
    min-height: 280px;
  }

  /* Circle decoration removed — clean avatar on mobile */

  .cta-ex-avatar-img {
    position: absolute;
    bottom: 0px;
    /* Chạm sát line dưới */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: bottom center;
  }

  /* ── Cột phải: Info ── */
  .cta-ex-info {
    grid-column: 2;
    grid-row: 1;
    padding: 30px 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .cta-ex-badge {
    background: #E0E9FF;
    color: #2563EB;
    border: none;
    font-size: 8.5px;
    padding: 6px 12px;
  }

  .cta-ex-title {
    font-size: 24px;
    /* To và đậm như hình mẫu */
    color: #1E3A8A;
    line-height: 1.1;
  }

  .cta-ex-desc {
    display: block;
    font-size: 13px;
    line-height: 1.4;
    color: #4B5563;
    margin-top: 5px;
  }

  /* ── Cột phải: Actions (Dàn hàng dọc) ── */
  .cta-ex-actions {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    /* Luôn là 1 cột trên mobile */
    gap: 8px;
    padding: 0 0 20px 10px;
  }

  .cta-ex-card {
    padding: 10px 12px;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #F3F4F6;
  }

  .cta-ex-text {
    font-size: 12.5px;
    color: #1F2937;
  }

  .cta-ex-icon {
    width: 28px;
    height: 28px;
  }

  /* ── Hàng đáy: Logos Đối tác ── */
  .cta-ex-footer {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    background: #F4F7FC;
    border-top: 0.5px solid #E2E8F0;
    border-radius: 0 0 24px 24px;
    position: relative;
  }

  /* Fixed center divider */
  .cta-ex-footer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.5px;
    height: 50%;
    background: #CBD5E1;
    pointer-events: none;
  }

  .cta-ex-logo-img {
    height: 70px;
    width: auto;
    padding: 0 20px;
    margin-top: 5px;
    margin-bottom: 5px;
  }

  /* Invest logo (first) */
  .cta-ex-logo-img:first-child {
    height: 50px;
  }
}