/* General styling for the page content, ensuring contrast with default light body background */
.page-index {
  color: #333333; /* Dark text for light background */
  background: #ffffff; /* Default white background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

/* HERO Section */
.page-index__hero-section {
  position: relative;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 10px; /* Small top padding, assuming shared handles body padding */
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
}

.page-index__hero-container {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
}

.page-index__hero-image {
  width: 100%;
  margin: 0;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover; /* Desktop default */
  aspect-ratio: 16/5; /* Desktop aspect ratio */
}

/* Products Section */
.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  box-sizing: border-box;
  background: #f5f5f5; /* Light grey background for this section */
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.page-index__products-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(6, 1fr); /* Desktop: one row, 6 columns */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__product-card {
  width: 100%;
  max-width: 300px; /* Max width for each card */
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transition: transform 0.3s ease;
  justify-self: center; /* Center cards in grid cells */
}

.page-index__product-card:hover {
  transform: translateY(-3px);
}

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

.page-index__product-card-image {
  width: 100%;
  max-width: 300px;
  overflow: hidden;
}

.page-index__product-card-image img {
  max-width: 100%;
  width: 100%;
  height: auto; /* Maintain aspect ratio */
  display: block;
}

/* Section Title (H1) */
.page-index__section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  padding: 24px 12px;
  box-sizing: border-box;
  text-align: center;
  color: #017439; /* Brand color for H1 */
}
.page-index__section-title {
  margin: 0;
  font-size: clamp(1.1rem, 4.5vw, 1.75rem); /* Responsive font size for H1 */
  line-height: 1.35;
  font-weight: bold;
}
.page-index__section-title-line {
  flex: 1;
  max-width: 80px;
  height: 2px;
  background-color: #017439; /* Brand color for lines */
  opacity: 0.6;
}

/* Article Body Section */
.page-index__article-body {
  width: 100%;
  max-width: 1200px; /* Max width for article content */
  margin: 0 auto;
  padding: 0 12px 48px;
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.page-index__article-body h2 {
  margin: 2rem 0 1rem;
  color: #017439; /* Brand color for H2 */
  font-size: 1.8rem;
  font-weight: bold;
}
.page-index__article-body h3 {
  margin: 1.25rem 0 0.75rem;
  color: #017439; /* Brand color for H3 */
  font-size: 1.4rem;
  font-weight: bold;
}
.page-index__article-body p {
  margin-bottom: 1em;
  font-size: 1rem;
}
.page-index__article-body ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 1em;
}
.page-index__article-body li {
  margin-bottom: 0.5em;
}

.page-index__article-figure {
  margin: 1.5rem auto;
  max-width: 800px; /* Max width for article images */
  text-align: center;
}
.page-index__article-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px; /* Slightly rounded corners for article images */
}
.page-index__article-figure figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #666;
  margin-top: 8px;
}

.page-index__article-quote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #017439; /* Brand color for blockquote border */
  background-color: #f9f9f9;
  font-style: italic;
  color: #555555;
  border-radius: 0 5px 5px 0;
}

/* Button links within article body */
.page-index__btn-link {
  display: inline-block;
  background-color: #C30808; /* Custom color for register/login */
  color: #FFFF00; /* Custom font color for register/login */
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-index__btn-link:hover {
  background-color: #a00606; /* Slightly darker red on hover */
}

/* Responsive styles for mobile */
@media (max-width: 849px) { /* For HERO image specific object-fit */
  .page-index__hero-image img {
    object-fit: contain !important; /* Prevent cropping on mobile */
    aspect-ratio: unset !important; /* Remove fixed aspect ratio */
    max-height: none !important; /* Remove max height */
  }
}

@media (max-width: 768px) {
  /* Global mobile adaptations for page-index content */
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }

  /* HERO Section Mobile */
  .page-index__hero-section {
    padding-top: 10px !important; /* Small top padding for mobile, overriding any larger values */
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__hero-container,
  .page-index__hero-image {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__hero-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Products Section Mobile */
  .page-index__products-section {
    padding: 40px 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__products-container,
  .page-index__products-grid {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-index__products-grid {
    grid-template-columns: repeat(2, 1fr); /* Mobile: 2 columns x 3 rows */
    gap: 15px;
  }
  .page-index__product-card,
  .page-index__product-card-image {
    max-width: 100%; /* Allow cards to take full available width in 2-column grid */
  }

  /* Section Title (H1) Mobile */
  .page-index__section-title-wrap {
    padding: 20px 15px;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .page-index__section-title {
    font-size: clamp(1.25rem, 5vw, 1.5rem); /* Adjusted clamp for mobile */
  }
  .page-index__section-title-line {
    max-width: 40px; /* Shorter lines on mobile */
  }

  /* Article Body Section Mobile */
  .page-index__article-body {
    padding: 0 15px 32px; /* Adjusted padding for mobile */
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .page-index__article-body h2 {
    font-size: clamp(1.4rem, 6vw, 1.6rem); /* Adjusted H2 for mobile */
  }
  .page-index__article-body h3 {
    font-size: clamp(1.2rem, 5vw, 1.4rem); /* Adjusted H3 for mobile */
  }
  .page-index__article-figure {
    margin: 1rem auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .page-index__article-figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__article-quote {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  /* Generic image and container responsive styles */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .page-index__section,
  .page-index__container,
  .page-index__content-area,
  .page-index__text-block {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }
  
  /* Buttons and button containers mobile */
  .page-index__btn-link {
    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;
    text-align: center; /* Center button text if it wraps */
  }
  .page-index__cta-buttons,
  .page-index__button-group,
  .page-index__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    display: flex; /* Ensure flex container */
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 10px;
  }
}