.page-index {
  background-color: #0f0000;
  color: #f0e6e6;
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

/* Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Adhering to the 8-16px top padding rule for first section */
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 200px; /* Minimum image size */
}

/* Content Section (H1 + Long Text) */
.page-index__content-section {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__page-title {
  color: #e13923;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto 16px;
  padding: 0 15px;
  font-weight: 700;
}

.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; /* To prevent extremely long single line on very wide screens */
}

.page-index__home-content {
  line-height: 1.7;
  margin-bottom: 36px;
}

.page-index__home-content h2,
.page-index__home-content h3 {
  color: #e13923;
  margin-top: 2em;
  margin-bottom: 0.8em;
}

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

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

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

.page-index__home-content ol,
.page-index__home-content ul {
  margin: 1em 0 1em 20px;
  padding: 0;
}

.page-index__home-content li {
  margin-bottom: 0.5em;
}

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

.page-index__home-content figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  min-height: 200px; /* Minimum image size */
}

.page-index__wp-caption-text {
  font-size: 0.9em;
  color: #ccc;
  margin-top: 8px;
}

/* CTA Buttons */
.page-index__cta-buttons {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 40px;
  width: 100%; /* Ensure container takes full width for responsive padding */
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 15px; /* Add padding to container */
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
  max-width: 100%; /* Ensure button itself is responsive */
  box-sizing: border-box;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
  text-align: center;
}

.page-index__btn-primary {
  background-color: #C30808; /* Custom color for Register/Login */
  color: #FFFF00; /* Custom font color for Register/Login */
  border: 2px solid #C30808;
}

.page-index__btn-primary:hover {
  background-color: #e13923; /* Slightly different red on hover */
  border-color: #e13923;
}

.page-index__btn-secondary {
  background-color: transparent;
  color: #C30808; /* Custom color for Register/Login */
  border: 2px solid #C30808;
}

.page-index__btn-secondary:hover {
  background-color: #C30808;
  color: #FFFF00;
}

/* Blog Section */
.page-index__blog-section {
  max-width: 1250px;
  margin: 0 auto 40px;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__blog-section-title {
  color: #e13923;
  text-align: center;
  margin: 0 0 24px;
  font-weight: 700;
}

.page-index__blog-slider {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.page-index__blog-slider-track {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping on desktop for slider effect */
  gap: 20px;
  transition: transform 0.4s ease;
  padding-bottom: 20px; /* Space for scroll buttons if needed */
}

.page-index__blog-slide {
  flex: 0 0 calc(33.333% - 14px); /* 3 columns with 20px gap */
  max-width: calc(33.333% - 14px);
  min-width: 0; /* Important for flex items in some browsers */
  background-color: #1a0505; /* Slightly lighter dark background for cards */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px 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 (9/16 = 0.5625) */
  overflow: hidden;
}

.page-index__blog-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 200px; /* Minimum image size */
}

.page-index__blog-card-body {
  text-align: center;
  padding: 14px 10px;
}

.page-index__blog-card-body h5 {
  color: #e13923;
  margin: 0 0 8px;
  font-size: 1.1em;
}

.page-index__blog-card-body p {
  font-size: 0.9em;
  color: #ccc;
  margin-bottom: 10px;
}

.page-index__blog-card-body time {
  font-size: 0.8em;
  color: #aaa;
  display: block;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #f0e6e6;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  line-height: 1;
}

.page-index__blog-slider-prev {
  left: -5px;
}

.page-index__blog-slider-next {
  right: -5px;
}

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

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

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

/* General image styling */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  /* Hero Section */
  .page-index__hero-section {
    padding-top: 10px; /* Keep consistent with desktop, relying on body padding for header offset */
  }

  /* Content Section */
  .page-index__page-title {
    margin-top: 18px;
    margin-bottom: 12px;
  }

  .page-index__page-title::before,
  .page-index__page-title::after {
    width: 20px; /* Shorter lines for mobile H1 */
    margin: 0 8px;
  }

  .page-index__home-content {
    font-size: 0.95em;
    padding: 0 15px; /* Ensure padding on mobile */
  }

  .page-index__home-content h2 {
    font-size: 1.5em;
  }

  .page-index__home-content h3 {
    font-size: 1.2em;
  }

  .page-index__home-content figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* CTA Buttons */
  .page-index__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Ensure padding */
  }

  .page-index__btn-primary,
  .page-index__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 15px; /* Adjust padding for mobile */
  }

  /* Blog Section */
  .page-index__blog-section {
    padding: 0 15px; /* Ensure padding on mobile */
  }

  .page-index__blog-slider-track {
    flex-wrap: wrap; /* Allow cards to wrap into a single column */
    justify-content: center;
    gap: 15px; /* Adjust gap for mobile */
    transform: none !important; /* Disable slider transform on mobile */
  }

  .page-index__blog-slide {
    flex: 0 0 100% !important; /* Single column layout */
    max-width: 100% !important;
    margin-bottom: 15px; /* Add margin between stacked cards */
  }

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

  /* Universal image and container rules for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__hero-image,
  .page-index__content-section,
  .page-index__blog-section,
  .page-index__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }
}