/* style/index.css */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #FFF1E8; /* Main text color for dark background */
}

/* Base styles for sections */
.page-index__section {
  padding: 20px 0;
  margin-bottom: 20px;
}

.page-index__section-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Reusable title style for sections */
.page-index__section-title.tieudevip {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  padding: 10px 20px;
  color: #F3C54D; /* Gold from custom palette */
  border: 2px solid #6A1E1E; /* Deep Red border */
  border-radius: 8px;
  display: inline-block;
  background-color: #2A1212; /* Card BG for title box */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.page-index__btn-primary,
.page-index__btn-secondary,
.page-index__btn-download {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary {
  background: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  color: #FFF1E8;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.page-index__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.page-index__btn-secondary {
  background: #2A1212; /* Card BG as secondary button background */
  color: #F3C54D; /* Gold text */
  border: 2px solid #F3C54D; /* Gold border */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.page-index__btn-secondary:hover {
  background: #F3C54D;
  color: #2A1212;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* Module 0: Hero Carousel Section */
.page-index__hero-carousel-section {
  padding-top: 10px; /* Small top padding, relying on body padding for header offset */
  margin-bottom: 30px;
  overflow: hidden; /* To contain slides */
}

.page-index__hero-slider {
  position: relative;
  width: 100%;
  max-width: 1200px; /* Limit max width for carousel */
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.page-index__hero-slide {
  display: none;
  width: 100%;
}

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

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

.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: #FFF1E8;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5em;
  border-radius: 5px;
}

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

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

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

.page-index__hero-slider-dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.page-index__hero-slider-dot.is-active {
  background: #FFF1E8;
}

/* Module 1: Operation Guide Section */
.page-index__guide-section {
  margin-bottom: 40px;
}

.page-index__guide-box {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: #2A1212; /* Card BG color */
  border-radius: 15px;
  box-shadow: 0 0 20px #6A1E1E; /* Border color for shadow */
  text-align: center;
  box-sizing: border-box;
}

.page-index__guide-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* For staggered layout */
  justify-content: center;
  gap: 15px; /* Increased gap for better spacing */
  margin-top: 30px;
}

.page-index__guide-card {
  display: block;
  flex: 0 0 calc(20% - 12px); /* 5 cards per row, accounting for gap */
  max-width: calc(20% - 12px);
  text-decoration: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.page-index__guide-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.page-index__guide-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 250 / 350; /* Fixed aspect ratio for vertical images */
  object-fit: contain; /* Ensure image fits without cropping */
  display: block;
}

/* PC staggered layout */
.page-index__guide-card--pos-1,
.page-index__guide-card--pos-5 { padding-top: 50px; }
.page-index__guide-card--pos-2,
.page-index__guide-card--pos-4 { padding-top: 25px; }
.page-index__guide-card--pos-3 { padding-top: 0; }

/* Module 2: Home Content Long Text Section */
.page-index__home-content-section {
  margin-bottom: 40px;
}

.page-index__home-content-row {
  display: flex;
  justify-content: center;
}

.page-index__home-content-box {
  max-width: 91%; /* Match demo style */
  margin: 0 auto;
  padding: 10px 16px;
  border: 5px solid #6A1E1E; /* Border color */
  border-radius: 15px;
  box-shadow: 0 0 20px #6A1E1E; /* Shadow with border color */
  height: 700px; /* Fixed height for desktop */
  text-align: left;
  box-sizing: border-box;
  background-color: #2A1212; /* Card BG for the box */
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scroll for inner content */
  padding-right: 15px; /* Space for scrollbar */
}

/* Scrollbar styling for __home-content-inner */
.page-index__home-content-inner::-webkit-scrollbar {
  width: 8px;
}

.page-index__home-content-inner::-webkit-scrollbar-track {
  background: #140C0C; /* Dark background */
  border-radius: 10px;
}

.page-index__home-content-inner::-webkit-scrollbar-thumb {
  background: #F3C54D; /* Gold scrollbar */
  border-radius: 10px;
}

.page-index__home-content-title {
  font-size: 2.5em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #F3C54D; /* Gold for main title */
}

.page-index__home-content-subtitle {
  font-size: 1.8em;
  font-weight: bold;
  margin-top: 30px;
  margin-bottom: 15px;
  color: #F3C54D; /* Gold for subtitles */
}

.page-index__home-content-section p,
.page-index__home-content-section li {
  margin-bottom: 10px;
  color: #FFF1E8; /* Off-white text */
}

.page-index__home-content-section strong {
  color: #F3C54D; /* Highlight keywords in gold */
}

.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 10px rgba(0, 0, 0, 0.3);
}

.page-index__wp-caption figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #F3C54D; /* Gold for figcaption */
  margin-top: 10px;
}

/* Module 3: Latest Blog Posts Section */
.page-index__blog-section {
  margin-bottom: 40px;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns for desktop */
  gap: 25px;
}

.page-index__blog-card {
  background: #2A1212; /* Card BG color */
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

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

.page-index__blog-media {
  position: relative;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  border-bottom: 1px solid #6A1E1E;
}

.page-index__blog-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-index__blog-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #D86A14; /* Button gradient end color */
  color: #FFF1E8;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  text-align: center;
  line-height: 1.2;
}

.page-index__blog-date span:first-child {
  display: block;
  font-weight: bold;
  font-size: 1.2em;
}

.page-index__blog-title {
  font-size: 1.2em;
  font-weight: bold;
  margin: 15px;
  color: #F3C54D; /* Gold for blog titles */
  min-height: 2.4em; /* Ensure consistent height for titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-index__blog-excerpt {
  font-size: 0.9em;
  margin: 0 15px 15px;
  color: #FFF1E8;
  min-height: 2.8em; /* Ensure consistent height for excerpts */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* Module 4: App Download Section */
.page-index__app-download-section {
  margin-bottom: 40px;
  padding: 40px 0;
  background-color: #140C0C; /* Dark background */
}

.page-index__app-download-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  background: #2A1212; /* Card BG for the box */
  border-radius: 20px;
  padding: 30px 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-index__app-download-text {
  flex: 1;
  text-align: left;
}

.page-index__app-download-title {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 20px;
  color: #F3C54D; /* Gold for title */
}

.page-index__app-download-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #FFF1E8;
}

.page-index__app-download-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-index__app-download-image {
  flex-shrink: 0;
  width: 300px; /* Fixed width for image container */
  height: auto;
}

.page-index__app-download-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

/* Responsive styles for mobile (max-width: 768px) */
@media (max-width: 768px) {
  .page-index__section {
    padding: 15px 0;
    margin-bottom: 15px;
  }

  .page-index__section-content {
    padding: 0 10px;
  }

  .page-index__section-title.tieudevip {
    font-size: 1.8em;
    margin-bottom: 20px;
    padding: 8px 15px;
  }

  /* Images and buttons general mobile styles */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__home-content-box,
  .page-index__app-download-box {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index__btn-download,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    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__app-download-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
  }

  /* Module 0: Hero Carousel Section */
  .page-index__hero-carousel-section {
    padding-top: 10px !important; /* Small top padding, no double header offset */
  }

  .page-index__hero-slider {
    border-radius: 0; /* Full width on mobile */
  }

  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 1.2em;
  }
  .page-index__hero-slider-dots {
    bottom: 5px;
    gap: 5px;
  }
  .page-index__hero-slider-dot {
    width: 8px;
    height: 8px;
  }

  /* Module 1: Operation Guide Section */
  .page-index__guide-box {
    padding: 15px;
    border-radius: 10px;
  }

  .page-index__guide-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Use grid for more control */
    gap: 10px;
    margin-top: 20px;
  }

  .page-index__guide-card {
    flex: none; /* Reset flex properties */
    max-width: none;
    padding-top: 0 !important; /* Remove staggered padding */
    border-radius: 8px;
  }
  
  /* Mobile: Top 2 cards, then bottom 3 cards */
  .page-index__guide-card--pos-1,
  .page-index__guide-card--pos-2 {
    grid-column: span 3; /* Each takes half width */
  }
  .page-index__guide-card--pos-3,
  .page-index__guide-card--pos-4,
  .page-index__guide-card--pos-5 {
    grid-column: span 2; /* Each takes one-third width */
  }

  /* Module 2: Home Content Long Text Section */
  .page-index__home-content-box {
    max-width: 100%;
    height: auto; /* Allow content to expand */
    padding: 20px 15px;
    border-radius: 10px;
    border-width: 3px; /* Slightly thinner border */
    box-shadow: 0 0 15px #6A1E1E;
  }

  .page-index__home-content-inner {
    height: auto; /* Reset fixed height */
    overflow: visible; /* Show all content */
    padding-right: 0; /* No scrollbar space needed */
  }

  .page-index__home-content-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }

  .page-index__home-content-subtitle {
    font-size: 1.5em;
    margin-top: 25px;
    margin-bottom: 10px;
  }

  /* Module 3: Latest Blog Posts Section */
  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
    gap: 15px;
  }

  .page-index__blog-card {
    border-radius: 10px;
  }

  .page-index__blog-title {
    font-size: 1.1em;
    margin: 10px;
    min-height: auto;
    -webkit-line-clamp: 3; /* Allow more lines if needed */
  }

  .page-index__blog-excerpt {
    font-size: 0.85em;
    margin: 0 10px 10px;
    min-height: auto;
    -webkit-line-clamp: 3;
  }
}