/* ======================================================
   CHALLENGE GRID (đồng bộ style với single-challenge)
   ====================================================== */

.bls-challenge-grid {
  --brand-green: #8cb849;
  --brand-green-hover: #1b2b01;
  --bg-white: #ffffff59;
  --text-dark: #1f1f1f;
  --text-gray: #666;
  --gold: #e0a526;

  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
  color: var(--text-dark);
}

/* ── Card ─────────────────────────────────────────────── */
.bls-challenge-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--bg-white);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.bls-challenge-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.11);
}

/* ── Thumbnail (40%) ──────────────────────────────────── */
.bls-clg-col-images {
  flex: 0 0 40%;
  width: 40%;
  max-width: 40%;
  min-width: 0;
  box-sizing: border-box;
  padding: 18px;
}
.bls-challenge-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
}
a.bls-challenge-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.bls-challenge-card:hover .bls-challenge-thumb img {
  transform: scale(1.04);
}
.bls-challenge-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

/* Badge trạng thái */
.bls-challenge-status {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.bls-challenge-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
}
.bls-challenge-status.is-closed::before {
  background: #b5b5b5;
}
.bls-challenge-status.is-result::before {
  background: var(--gold);
}

/* ── Content (60%) ────────────────────────────────────── */
.bls-clg-col-content {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 24px 26px 24px 8px;
  box-sizing: border-box;
}
.bls-clg-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}
.bls-clg-title a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}
.bls-clg-title a:hover {
  color: var(--brand-green-hover);
}

/* ── Prizes ───────────────────────────────────────────── */
.bls-challenge-prize-total {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--text-gray);
}
.bls-challenge-prize-total strong {
  color: var(--text-dark);
  font-weight: 800;
}
.bls-challenge-prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.bls-challenge-prize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}
.bls-challenge-prize-icon {
  font-size: 16px;
  line-height: 1;
}
.bls-challenge-prize-value {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Description ──────────────────────────────────────── */
.bls-clg-desc {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Deadline ─────────────────────────────────────────── */
.bls-challenge-deadline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.5;
}
.bls-challenge-deadline-icon {
  display: inline-flex;
  flex: 0 0 auto;
}
.bls-challenge-deadline strong {
  font-weight: 800;
}

/* ── Buttons ──────────────────────────────────────────── */
.bls-clg-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}
.bls-challenge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.2;
  text-decoration: none !important;
  box-sizing: border-box;
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.15s;
}
.bls-challenge-btn:active {
  transform: scale(0.98);
}
.bls-challenge-btn-detail {
  background: transparent;
  border: 2px solid var(--text-dark);
  color: var(--text-dark) !important;
}
.bls-challenge-btn-detail:hover {
  background: var(--text-dark);
  color: #fff !important;
}
.bls-challenge-btn-primary {
  background: var(--brand-green);
  border: 2px solid var(--brand-green);
  color: #fff !important;
}
.bls-challenge-btn-primary:hover {
  background: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 820px) {
  .bls-challenge-card {
    flex-direction: column;
  }
  .bls-clg-col-images {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }
  .bls-clg-col-content {
    flex: 1 1 auto;
    width: 100%;
    padding: 2px 20px 20px;
  }
  .bls-challenge-thumb {
    aspect-ratio: 16 / 9; /* Giữ tỉ lệ khung hình 16:9 chuẩn */
    height: auto;
  }
}

@media (max-width: 480px) {
  .bls-challenge-grid {
    gap: 18px;
  }
  .bls-clg-title {
    font-size: 20px;
  }
  .bls-clg-action {
    width: 100%;
  }
  .bls-challenge-btn {
    flex: 1 1 auto;
  }
}

/* ======================================================
   PHÂN TRANG
   ====================================================== */
.bls-challenge-pagination {
  --brand-green: #8cb849;
  --text-dark: #1f1f1f;
  max-width: 1100px;
  margin: 32px auto 0;
}
.bls-challenge-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.bls-challenge-pagination .page-numbers li {
  margin: 0;
}
.bls-challenge-pagination a.page-numbers,
.bls-challenge-pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--text-dark);
  background: transparent;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.bls-challenge-pagination a.page-numbers:hover {
  background: var(--text-dark);
  color: #fff;
}
.bls-challenge-pagination span.page-numbers.current {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fff;
}
.bls-challenge-pagination span.page-numbers.dots {
  border-color: transparent;
  min-width: 24px;
  padding: 0;
}

/* ======================================================
   LAYOUT TRANG CHỦ  [list_challenges layout="home"]
   Banner ảnh hero full-width + lớp phủ rọi giữa (sáng ở tâm, tối dần ra rìa)
   ====================================================== */
.bls-chl-home {
  --bls-home-title: #2f5a1e; /* màu tiêu đề khối + nút Xem tất cả */
  --bls-glow-center: rgba(8, 28, 16, 0.5); /* độ tối ở tâm (sáng nhất) */
  --bls-glow-mid: rgba(8, 28, 16, 0.78);
  --bls-glow-edge: rgba(0, 0, 0, 0.92); /* độ tối ở rìa */
  --bls-banner-h: 480px;
  --bls-banner-h-multi: 360px;
  --brand-green: #8cb849;
  --brand-green-hover: #7ea342;
  --text-dark: #1f1f1f;
  --text-gray: #666;
  --gold: #f2c14e;
  width: 100%;
  max-width: none; /* chiếm toàn bộ bề rộng container cha */
  margin: 0;
  box-sizing: border-box;
}
.bls-chl-home-title {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  color: var(--bls-home-title);
}
.bls-chl-home-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Banner */
.bls-chl-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--bls-banner-h);
  box-sizing: border-box;
  border-radius: 0;
  overflow: hidden;
  background: #16341f; /* nền dự phòng khi không có ảnh */
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.bls-chl-home-stack.is-multi .bls-chl-banner {
  min-height: var(--bls-banner-h-multi);
}
.bls-chl-banner .bls-chl-banner-bg {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  margin: 0;
  transition: transform 0.6s ease;
}
.bls-chl-banner:hover .bls-chl-banner-bg {
  transform: scale(1.03);
}
.bls-chl-banner-panel {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 75% at 50% 50%,
    var(--bls-glow-center) 0%,
    var(--bls-glow-mid) 55%,
    var(--bls-glow-edge) 100%
  );
}
.bls-chl-banner-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 36px 24px;
  box-sizing: border-box;
  text-align: center;
}
.bls-chl-banner-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}
.bls-chl-banner-sub::before,
.bls-chl-banner-sub::after {
  content: '';
  flex: 1 1 24px;
  max-width: 70px;
  height: 2px;
  background: var(--gold);
}
.bls-chl-banner-title {
  margin: 0 0 12px;
  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: 1.05;
  text-transform: uppercase;
}
.bls-chl-home-stack.is-multi .bls-chl-banner-title {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}
.bls-chl-banner-title a {
  color: #fff;
  text-decoration: none;
}
.bls-chl-banner-prize {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 2vw, 2.5rem);
  font-weight: 800;
}
.bls-chl-banner .bls-challenge-deadline {
  margin: 0 0 18px;
  color: #fff;
}
.bls-chl-banner .bls-challenge-btn-primary:hover {
  background: var(--brand-green-hover);
  border-color: var(--brand-green-hover);
}

/* Nút Xem tất cả */
.bls-chl-home-footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.bls-chl-home-more {
  padding: 9px 22px;
  border: 2px solid var(--bls-home-title);
  border-radius: 30px;
  color: var(--bls-home-title);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.bls-chl-home-more:hover {
  background: var(--bls-home-title);
  color: #fff;
}

/* Mobile */
@media (max-width: 820px) {
  .bls-chl-banner,
  .bls-chl-home-stack.is-multi .bls-chl-banner {
    min-height: 400px;
  }
  .bls-chl-banner-panel {
    background: radial-gradient(
      ellipse 95% 80% at 50% 50%,
      var(--bls-glow-center) 0%,
      var(--bls-glow-mid) 60%,
      var(--bls-glow-edge) 100%
    );
  }
  .bls-chl-banner-body {
    padding: 32px 20px;
  }
}