.page-index {
  padding-top: 10px; /* Small top padding to ensure content starts below shared header */
}

/* Hero Slider */
.page-index__hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 40px;
}

.page-index__slide {
  width: 100%;
  flex: 0 0 100%;
  display: none;
}

.page-index__slide.is-active {
  display: block;
}

.page-index__hero-slider img {
  width: 100%;
  height: auto; /* Ensure aspect ratio is maintained */
  display: block;
  aspect-ratio: 16/5; /* Fallback for 1920x600 */
  object-fit: cover;
  object-position: center;
}

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

.page-index__slider-dots .dot {
  width: 10px;
  height: 10px;
  background-color: #FFFFFF;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.page-index__slider-dots .dot.active {
  opacity: 1;
  background-color: #017439; /* Main color for active dot */
}

.page-index__slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.page-index__slider-nav:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.page-index__slider-nav--prev {
  left: 10px;
}

.page-index__slider-nav--next {
  right: 10px;
}

/* Section Title */
.page-index__section-title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px auto;
  max-width: 1200px;
  padding: 0 15px;
}

.page-index__decoration-line {
  flex-grow: 1;
  height: 2px;
  background-color: #017439;
  margin: 0 20px;
  max-width: 150px;
}

.page-index__main-title {
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: #017439;
  letter-spacing: -0.02em;
  max-width: 600px; /* Constrain width to ensure it fits */
  font-size: clamp(1.6rem, 4.5vw, 2.8rem); /* Responsive font size for H1 */
}

/* Category Gateway */
.page-index__category-gateway {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 15px;
}

.page-index__category-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.page-index__category-card {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.page-index__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.page-index__category-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/25; /* Maintain vertical aspect ratio */
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  min-width: 200px; /* Enforce minimum size for category images */
  min-height: 200px;
}

.page-index__category-card:hover img {
  filter: grayscale(0%);
}

/* Article Body */
.page-index__article-body {
  max-width: 900px;
  margin: 60px auto;
  padding: 0 15px;
  line-height: 1.8;
  color: #333333;
}

.page-index__blockquote {
  border-left: 5px solid #017439;
  padding-left: 20px;
  margin: 40px 0;
  font-style: italic;
  color: #555555;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 5px;
}

.page-index__blockquote p {
  margin: 0;
}

.page-index__blockquote a {
  color: #017439;
  text-decoration: underline;
}

.page-index__section-heading {
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  color: #017439;
  margin-top: 50px;
  margin-bottom: 25px;
  font-weight: 600;
}

.page-index__sub-heading {
  font-size: clamp(1.1rem, 3.5vw, 1.8rem);
  color: #017439;
  margin-top: 35px;
  margin-bottom: 15px;
  font-weight: 500;
}

.page-index__article-body p {
  margin-bottom: 1em;
  font-size: 16px;
}

.page-index__article-figure {
  margin: 40px 0;
  text-align: center;
}

.page-index__article-figure--aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-index__article-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 200px; /* Enforce minimum size for article images */
  min-height: 200px;
}

.page-index__article-figure figcaption {
  font-size: 0.9em;
  color: #777777;
  margin-top: 10px;
}

.page-index__guide-list, .page-index__promo-list {
  list-style-type: disc;
  margin-left: 25px;
  margin-bottom: 1em;
  color: #333333;
  font-size: 16px;
}

.page-index__guide-list li, .page-index__promo-list li {
  margin-bottom: 0.5em;
}

.page-index__guide-list strong, .page-index__promo-list strong {
  color: #017439;
}

/* Responsive adjustments */
@media (max-width: 849px) {
  .page-index__decoration-line {
    max-width: 80px;
  }
  .page-index__main-title {
    font-size: clamp(1.4rem, 6vw, 2.5rem);
  }
  .page-index__category-gateway {
    flex-direction: column;
  }
  .page-index__category-row {
    grid-template-columns: repeat(3, 1fr); /* Keep 3 columns on mobile as per demo */
    gap: 10px;
  }
  .page-index__hero-slider img {
    aspect-ratio: 16/9; /* Adjust for common mobile aspect ratio if needed, or keep 16/5 */
  }
  .page-index__slider-nav {
    padding: 8px 12px;
    font-size: 20px;
  }
  .page-index__article-body img {
    max-width: 100%;
    height: auto; /* Ensure images scale down */
  }
}

@media (max-width: 549px) {
  .page-index__decoration-line {
    max-width: 40px;
  }
  .page-index__main-title {
    font-size: clamp(1.2rem, 7vw, 2.2rem);
  }
  .page-index__category-row {
    grid-template-columns: repeat(3, 1fr); /* Still 3 columns */
    gap: 8px;
  }
  .page-index__section-heading {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }
  .page-index__sub-heading {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
  .page-index__article-body p, .page-index__guide-list li, .page-index__promo-list li {
    font-size: 15px;
  }
  .page-index__slider-nav {
    padding: 6px 10px;
    font-size: 18px;
  }
  .page-index__article-body {
    overflow-x: hidden; /* Prevent horizontal scroll */
  }
  .page-index__article-body img {
    max-width: 100%;
    height: auto;
  }
}

/* Ensure all images within .page-index are responsive and don't overflow */
@media (max-width: 768px) {
  .page-index img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Custom colors */
.page-index__register-button {
  background-color: #C30808;
  color: #FFFF00;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-index__register-button:hover {
  background-color: #a00606;
}

.page-index__login-button {
  background-color: #C30808;
  color: #FFFF00;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-index__login-button:hover {
  background-color: #a00606;
}

body {
  background-color: #FFFFFF; /* Background color for the whole page */
}