/* style/index.css */
.page-index {
  color: #333333; /* Mặc định chữ tối cho nền sáng */
}

.page-index__hero-slider {
  position: relative;
  width: 100%;
  padding-top: 10px;
  overflow: hidden;
  max-width: 1920px;
  margin: 0 auto;
}

.page-index__hero-slider-track {
  display: flex;
  width: 100%;
  overflow: hidden;
  position: relative;
  height: auto;
}

.page-index__hero-slider-slide {
  flex: 0 0 100%;
  transition: transform 0.5s ease-in-out;
  display: none;
}

.page-index__hero-slider-slide.is-active {
  display: block;
}

.page-index__hero-slider-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-index__hero-slider-prev,
.page-index__hero-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  font-size: 24px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.page-index__hero-slider-prev:hover,
.page-index__hero-slider-next:hover {
  opacity: 1;
}

.page-index__hero-slider-prev {
  left: 10px;
}

.page-index__hero-slider-next {
  right: 10px;
}

.page-index__hero-slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.page-index__hero-slider-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid #fff;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s ease;
}

.page-index__hero-slider-dots button.is-active {
  background: #fff;
}

.page-index__spacer {
  margin-bottom: 30px;
}

.page-index__promo-duo {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-index__promo-duo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.page-index__promo-duo-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.page-index__promo-duo-col img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-index__promo-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background: #C30808; /* Màu đỏ cho nút alert */
  color: #FFFF00; /* Màu vàng cho chữ đăng ký/tải ứng dụng */
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  transition: background-color 0.3s ease;
}

.page-index__promo-cta:hover {
  background: #e74c3c;
}

.page-index__section-title {
  text-align: center;
  margin: 30px auto;
  max-width: 1250px;
  padding: 0 16px;
}

.page-index__main-title {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #017439; /* Sử dụng màu chủ đạo */
  margin: 0;
  padding: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(24px, 4vw, 48px); /* H1 font-size clamp */
}

.page-index__home-content {
  max-width: 900px;
  margin: 24px auto;
  height: 700px;
  padding: 10px;
  box-sizing: border-box;
  border: 5px solid #FFFFFF;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
  text-align: justify;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  line-height: 1.6;
}

.page-index__home-content-inner::-webkit-scrollbar {
  width: 10px;
}

.page-index__home-content-inner::-webkit-scrollbar-thumb {
  background-color: #4C9BB6; /* Màu xanh ngọc cho thanh cuộn */
  border-radius: 20px;
  border: 3px solid #FFFFFF;
}

.page-index__home-content-inner p {
  margin-bottom: 1em;
}

.page-index__home-content-inner a {
  color: #017439;
  text-decoration: underline;
}

.page-index__quick-access {
  text-align: center;
  margin-top: 20px;
  font-weight: bold;
}

.page-index__quick-link {
  margin: 0 5px;
  color: #017439;
  text-decoration: none;
}

.page-index__quick-link:hover {
  text-decoration: underline;
}

.page-index__home-content-heading {
  color: #017439;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 24px;
  font-weight: 700;
}

.page-index__home-content-subheading {
  color: #017439;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

.page-index__home-content-inner figure {
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
}

.page-index__home-content-inner figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  min-height: 200px;
}

.page-index__home-content-inner figcaption {
  font-style: italic;
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}

.page-index__milestone-list,
.page-index__registration-steps,
.page-index__download-steps,
.page-index__contact-methods,
.page-index__future-plans {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 1em;
  padding-left: 0;
}

.page-index__milestone-list li,
.page-index__registration-steps li,
.page-index__download-steps li,
.page-index__contact-methods li,
.page-index__future-plans li {
  margin-bottom: 0.5em;
}

.page-index__table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.page-index__styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px; /* Đảm bảo bảng không quá nhỏ trên di động */
}

.page-index__styled-table th,
.page-index__styled-table td {
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
}

.page-index__styled-table th {
  background-color: #f2f2f2;
  font-weight: 600;
  color: #333333;
}

.page-index__styled-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.page-index__blog-slider {
  max-width: 1250px;
  margin: 30px auto;
  padding: 0 16px;
  background-color: #017439; /* Nền xanh lá cây cho module blog */
  padding-top: 30px;
  padding-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-index__blog-slider-title {
  text-align: center;
  color: #FFFFFF;
  text-transform: uppercase;
  margin-bottom: 25px;
  font-size: 28px;
  font-weight: 700;
}

.page-index__blog-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px; /* Khoảng trống cho thanh cuộn */
}

.page-index__blog-slider-track::-webkit-scrollbar {
  height: 8px;
}

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
}

.page-index__blog-slider-track::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.page-index__post-item {
  flex: 0 0 calc((100% - 40px) / 3); /* 3 cột trên desktop với 20px gap */
  scroll-snap-align: start;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  min-width: 280px; /* Đảm bảo kích thước tối thiểu cho thẻ */
}

.page-index__post-item:hover {
  transform: translateY(-5px);
}

.page-index__post-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-index__post-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Tỷ lệ 16:9 cho ảnh bìa */
  overflow: hidden;
  border-radius: 4px;
}

.page-index__post-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-width: 200px;
  min-height: 200px;
}

.page-index__post-date {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: #fff;
  border: 2px solid #017439;
  border-radius: 2px;
  padding: 4px 8px;
  text-align: center;
  line-height: 1.2;
  color: #017439;
  font-size: 12px;
}

.page-index__post-date-day {
  display: block;
  font-weight: 700;
  font-size: 16px;
}

.page-index__post-date-month {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
}

.page-index__post-item h5 {
  text-align: center;
  color: #017439;
  margin: 12px 8px 6px;
  font-size: 18px;
  font-weight: 600;
}

.page-index__post-item p {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 0 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ==================== Responsive Styles ==================== */

@media (max-width: 1024px) {
  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 20px;
  }
  .page-index__promo-duo-grid {
    gap: 15px;
  }
  .page-index__promo-cta {
    padding: 12px 15px;
    font-size: 15px;
  }
  .page-index__main-title {
    font-size: clamp(22px, 4.5vw, 40px);
  }
  .page-index__home-content {
    height: 650px;
    margin: 20px auto;
  }
  .page-index__home-content-heading {
    font-size: 22px;
  }
  .page-index__home-content-subheading {
    font-size: 17px;
  }
  .page-index__styled-table th,
  .page-index__styled-table td {
    padding: 10px 12px;
  }
  .page-index__blog-slider-title {
    font-size: 24px;
  }
  .page-index__post-item {
    flex: 0 0 calc((100% - 20px) / 2); /* 2 cột trên tablet */
  }
}

@media (max-width: 768px) {
  .page-index__hero-slider {
    padding-top: 10px !important; /* Đảm bảo không bị đè bởi header offset */
    padding-left: 0;
    padding-right: 0;
  }
  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    display: none; /* Ẩn nút điều hướng trên di động */
  }
  .page-index__hero-slider-dots {
    bottom: 8px;
  }
  
  .page-index__promo-duo {
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-index__promo-duo-grid {
    grid-template-columns: 1fr; /* Một cột trên di động */
    gap: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__promo-duo-col img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__promo-cta {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__section-title {
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-index__main-title {
    font-size: clamp(20px, 6vw, 36px);
  }

  .page-index__home-content {
    height: 60vh; /* Chiều cao cố định tương đối trên di động */
    min-height: 420px;
    max-height: 560px;
    margin: 16px 12px;
    border-width: 3px;
    padding: 5px;
    max-width: 100% !important;
    width: calc(100% - 24px) !important; /* 12px padding mỗi bên */
    box-sizing: border-box !important;
  }
  .page-index__home-content-inner {
    padding: 8px 10px;
    font-size: 15px;
  }
  .page-index__home-content-heading {
    font-size: 20px;
  }
  .page-index__home-content-subheading {
    font-size: 16px;
  }
  .page-index__home-content-inner figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__table-wrapper {
    overflow-x: auto;
  }
  .page-index__styled-table {
    min-width: 500px; /* Vẫn giữ kích thước tối thiểu để cuộn */
  }
  .page-index__styled-table th,
  .page-index__styled-table td {
    padding: 8px 10px;
    font-size: 13px;
  }

  .page-index__blog-slider {
    padding: 20px 15px;
    margin: 20px auto;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-title {
    font-size: 22px;
    margin-bottom: 20px;
  }
  .page-index__blog-slider-wrap {
    flex-direction: row;
    gap: 0;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    display: none; /* Ẩn nút điều hướng trên di động */
  }
  .page-index__blog-slider-track {
    gap: 15px;
    width: 100%;
    padding-bottom: 0;
  }
  .page-index__post-item {
    flex: 0 0 100%; /* Một cột trên di động */
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__post-cover img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__post-item h5 {
    font-size: 16px;
  }
  .page-index__post-item p {
    font-size: 13px;
  }

  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__content-area,
  .page-index__text-block,
  .page-index__card,
  .page-index__section,
  .page-index__box {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}