/* Base styles for the page */
.page-index {
  background-color: #0f0000; /* Dark background as per template */
  color: #f0e6e6; /* Light text for contrast on dark background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

/* Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.page-index__hero-image {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Page Title and Home Content Section */
.page-index__content-section {
  padding: 20px 0;
}

.page-index__page-title {
  color: #e13923; /* Primary red color for h1 */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1250px;
  margin: 24px auto 16px;
  padding: 0 15px;
  font-weight: 700;
  line-height: 1.2;
}

.page-index__page-title::before,
.page-index__page-title::after {
  content: '';
  width: 40px;
  height: 3px;
  background-color: #e13923;
  margin: 0 14px;
}

.page-index__title-main {
  max-width: 800px; /* Constrain h1 width */
  display: inline-block;
  font-size: clamp(1.8rem, 4vw, 2.5rem); /* Responsive font size for H1 */
}

.page-index__home-content {
  max-width: 1250px;
  margin: 0 auto 36px;
  padding: 0 15px;
  box-sizing: border-box;
  line-height: 1.7;
  font-size: 16px;
}

.page-index__home-content h2,
.page-index__home-content h3 {
  color: #26A9E0; /* Light blue for secondary headings */
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.page-index__home-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.page-index__home-content h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
}

.page-index__home-content p {
  margin-bottom: 15px;
}

.page-index__home-content a {
  color: #2995f3; /* Accent blue for links */
  text-decoration: none;
}

.page-index__home-content a:hover {
  text-decoration: underline;
}

.page-index__home-content ul,
.page-index__home-content ol {
  margin-bottom: 15px;
  padding-left: 20px;
}

.page-index__home-content li {
  margin-bottom: 8px;
}

.page-index__wp-caption {
  margin: 20px auto;
  max-width: 100%;
  text-align: center;
}

.page-index__wp-caption img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-index__wp-caption-text {
  font-size: 14px;
  color: #bbb;
  margin-top: 10px;
}

.page-index__home-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

.page-index__home-content th,
.page-index__home-content td {
  border: 1px solid rgba(225, 57, 35, 0.5); /* Red border with transparency */
  padding: 12px 15px;
  text-align: left;
}

.page-index__home-content th {
  background-color: rgba(225, 57, 35, 0.2); /* Light red background for headers */
  color: #e13923;
  font-weight: 600;
}

.page-index__cta-container {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

.page-index__btn-primary {
  display: inline-block;
  background-color: #EA7C07; /* Login color for primary CTA */
  color: #ffffff;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary:hover {
  background-color: #d16b06;
}

/* Blog Section */
.page-index__blog-section {
  padding: 40px 0;
}

.page-index__blog-section-title {
  color: #e13923; /* Primary red for blog section title */
  text-align: center;
  margin: 0 0 30px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.page-index__blog-slider {
  position: relative;
  overflow: hidden;
  max-width: 1250px;
  margin: 0 auto 40px;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__blog-slider-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  transition: transform 0.4s ease;
}

.page-index__blog-slide {
  flex: 0 0 calc(33.333% - 14px); /* 3 columns desktop */
  max-width: calc(33.333% - 14px);
  min-width: 0;
  background-color: #1a0505; /* Slightly lighter dark background for cards */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.page-index__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-index__blog-card-image {
  position: relative;
  padding-top: 56%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.page-index__blog-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-index__blog-card-link:hover .page-index__blog-card-image img {
  transform: scale(1.05);
}

.page-index__blog-card-body {
  text-align: center;
  padding: 18px 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-index__blog-card-body h5 {
  color: #e13923; /* Red for card titles */
  margin: 0 0 10px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.page-index__blog-card-body p {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.5;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(225, 57, 35, 0.7); /* Red with transparency */
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #e13923;
}

.page-index__blog-slider-prev {
  left: 0;
}

.page-index__blog-slider-next {
  right: 0;
}

.page-index__blog-slider-prev::before {
  content: '‹';
}

.page-index__blog-slider-next::before {
  content: '›';
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }

  /* Hero Section */
  .page-index__hero-section {
    padding-top: 10px !important;
  }

  /* General image responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Content containers responsiveness */
  .page-index__content-section,
  .page-index__blog-section,
  .page-index__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Page Title */
  .page-index__page-title {
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 0 10px;
  }
  
  .page-index__title-main {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .page-index__page-title::before,
  .page-index__page-title::after {
    width: 20px;
    margin: 0 8px;
  }

  /* Home Content */
  .page-index__home-content {
    padding: 0 10px;
    font-size: 15px;
  }
  
  .page-index__home-content h2 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }
  
  .page-index__home-content h3 {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
  }

  /* Table responsiveness */
  .page-index__home-content table,
  .page-index__home-content thead,
  .page-index__home-content tbody,
  .page-index__home-content th,
  .page-index__home-content td,
  .page-index__home-content tr {
    display: block;
  }

  .page-index__home-content thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .page-index__home-content td {
    border: none;
    border-bottom: 1px solid rgba(225, 57, 35, 0.2);
    position: relative;
    padding-left: 50%;
    text-align: right;
  }

  .page-index__home-content td::before {
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
    color: #e13923;
  }

  /* Specific data labels for the table */
  .page-index__home-content td:nth-of-type(1)::before { content: "Câu hỏi:"; }
  .page-index__home-content td:nth-of-type(2)::before { content: "Trả lời:"; }

  /* Primary Button */
  .page-index__btn-primary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 15px 10px;
    font-size: 16px;
  }

  .page-index__cta-container {
    padding: 0 10px;
  }

  /* Blog Section */
  .page-index__blog-section-title {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    margin-bottom: 20px;
  }

  .page-index__blog-slider-track {
    flex-direction: column; /* Stack cards vertically on mobile */
    gap: 15px;
  }

  .page-index__blog-slide {
    flex: 0 0 100%; /* Full width for each card */
    max-width: 100%;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    display: none; /* Hide navigation buttons on mobile for stacked cards */
  }
}