/* CSS cho trang chủ (index.css) */

.page-index {
  background-color: #0f0000; /* Deep dark background */
  color: #f0e6e6; /* Light text for dark background */
  font-family: Arial, sans-serif;
}

/* Module 0: 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 {
  line-height: 0;
}

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

/* Module 1: H1 + SEO Long Text */
.page-index__content-section {
  padding: 20px 0 40px;
}

.page-index__page-title {
  color: #e13923; /* 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 .page-index__title-main {
  max-width: 80%; /* Prevent title from being too wide */
}

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

.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,
.page-index__home-content h4 {
  color: #e13923; /* Red for content headings */
  margin-top: 28px;
  margin-bottom: 12px;
  font-weight: 600;
}

.page-index__home-content h2 {
  font-size: 28px;
}

.page-index__home-content h3 {
  font-size: 24px;
}

.page-index__home-content h4 {
  font-size: 20px;
}

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

.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 strong {
  color: #ffffff; /* White for strong text */
}

.page-index__home-content ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 16px;
}

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

.page-index__wp-caption {
  margin: 20px auto;
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.page-index__wp-caption-text {
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: #ddd;
  margin-top: 8px;
}

/* Module 2: Latest Blog Section */
.page-index__blog-section {
  padding: 40px 0;
  background-color: #1a0505; /* Slightly lighter dark background for contrast */
}

.page-index__blog-section-title {
  color: #e13923; /* Red for blog section title */
  text-align: center;
  margin: 0 0 24px;
  font-size: 30px;
  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; /* Prevent wrapping for slider */
  gap: 20px;
  transition: transform 0.4s ease;
  padding-bottom: 10px; /* Space for scrollbar if any */
}

.page-index__blog-slide {
  flex: 0 0 calc(33.333% - 14px); /* 3 columns with gap */
  max-width: calc(33.333% - 14px);
  min-width: 0; /* Allow shrinking */
  background-color: #0f0000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-index__blog-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.page-index__blog-card-image {
  position: relative;
  padding-top: 56%; /* 16:9 aspect ratio for images */
  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: 14px 10px;
}

.page-index__blog-card-body h5 {
  color: #e13923; /* Red for card titles */
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
  min-height: 50px; /* Ensure consistent height for titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-index__blog-card-body p {
  color: #ddd;
  font-size: 14px;
  line-height: 1.5;
  min-height: 60px; /* Consistent height for summary */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.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: '›';
}

.page-index__view-all-button-container {
  text-align: center;
  margin-top: 30px;
}

.page-index__view-all-button {
  display: inline-block;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Blue gradient button */
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 16px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__view-all-button:hover {
  background: linear-gradient(180deg, #2F6BFF 0%, #4A8BFF 100%);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__blog-slide {
    flex: 0 0 calc(50% - 10px); /* 2 columns on tablet */
    max-width: calc(50% - 10px);
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  /* HERO 主图区域 */
  .page-index__hero-section {
    padding-top: 10px !important;
  }

  /* 长文区 */
  .page-index__page-title {
    font-size: 28px;
    margin-top: 20px;
    margin-bottom: 12px;
  }
  .page-index__page-title::before,
  .page-index__page-title::after {
    width: 25px;
    margin: 0 8px;
  }
  .page-index__home-content {
    font-size: 15px;
    padding: 0 10px;
  }
  .page-index__home-content h2 {
    font-size: 24px;
  }
  .page-index__home-content h3 {
    font-size: 20px;
  }
  .page-index__home-content h4 {
    font-size: 18px;
  }

  /* 博客区 */
  .page-index__blog-section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  .page-index__blog-slider-track {
    flex-wrap: wrap; /* Allow wrapping for grid-like behavior on mobile */
    justify-content: center;
    gap: 15px;
  }
  .page-index__blog-slide {
    flex: 0 0 100% !important; /* 1 column on mobile */
    max-width: 100% !important;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .page-index__blog-card-body h5 {
    font-size: 16px;
    min-height: auto;
  }
  .page-index__blog-card-body p {
    font-size: 13px;
    min-height: auto;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    display: none; /* Hide slider navigation buttons on mobile */
  }

  /* 通用图片与容器 */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* 按钮与按钮容器 */
  .page-index__view-all-button {
    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__view-all-button-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }
}