.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background-color: #FFFFFF; /* Explicitly set for clarity */
}

.page-index__hero-section {
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-index__hero-image-wrapper {
  width: 100%;
  overflow: hidden;
}

.page-index__hero-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
}

.page-index__access-links-section {
  background-color: #FFFFFF;
  padding: 30px 0;
}

.page-index__access-links-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 20px;
  background-color: #017439; /* Primary brand color */
  color: #FFFFFF; /* White text for contrast */
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
  max-width: 100%;
}

.page-index__btn-access-link:hover {
  background-color: #005a2e; /* Slightly darker green on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-index__btn-register {
  background-color: #C30808; /* Custom register color */
  color: #FFFF00; /* Custom font color */
}

.page-index__btn-register:hover {
  background-color: #a00606; /* Darker red on hover */
}

.page-index__btn-login {
  background-color: #C30808; /* Custom login color */
  color: #FFFF00; /* Custom font color */
}

.page-index__btn-login:hover {
  background-color: #a00606; /* Darker red on hover */
}

.page-index__brand-intro-section {
  background-color: #FFFFFF;
  padding: 40px 0;
}

.page-index__brand-intro-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 12px;
  text-align: center;
  box-sizing: border-box;
}

.page-index__main-title {
  font-size: clamp(28px, 4vw, 40px); /* Responsive font size */
  font-weight: 700;
  color: #017439;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-index__intro-text {
  font-size: 16px;
  color: #333333;
  margin-bottom: 0;
  text-align: justify;
  line-height: 1.8;
}

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

.page-index__category-lobby-section {
  background-color: #FFFFFF;
  padding: 50px 0;
}

.page-index__category-lobby-container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  color: #017439;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.page-index__section-title::before,
.page-index__section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 50px;
  height: 2px;
  background-color: #017439;
}

.page-index__section-title::before {
  left: calc(50% - 100px - 50px);
}

.page-index__section-title::after {
  right: calc(50% - 100px - 50px);
}

.page-index__category-lobby-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
}

.page-index__category-card {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.page-index__category-card-link {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  transition: transform 0.3s ease;
}

.page-index__category-card-link:hover {
  transform: translateY(-5px);
}

.page-index__category-card-link img {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
  max-width: 100%; /* Ensure responsiveness */
}

.page-index__blog-slider-section {
  background-color: #f9f9f9; /* Light grey background for blog section */
  padding: 60px 0;
}

.page-index__blog-slider-container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__blog-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-index__section-subtitle {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: #017439;
  margin: 0;
}

.page-index__blog-slider-controls {
  display: flex;
  gap: 10px;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: #017439;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #005a2e;
}

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

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

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items with 16px gap */
  scroll-snap-align: start;
  background-color: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 300px; /* Minimum width for desktop cards */
}

.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.page-index__post-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

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

.page-index__post-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #017439;
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: bold;
}

.page-index__post-content {
  padding: 15px;
}

.page-index__post-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__post-title a {
  color: #017439;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__post-title a:hover {
  color: #005a2e;
}

.page-index__post-excerpt {
  font-size: 14px;
  color: #555555;
  line-height: 1.6;
  margin-bottom: 0;
}

/* --- Responsive Styles --- */

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

.page-index__hero-section,
.page-index__access-links-section,
.page-index__brand-intro-section,
.page-index__category-lobby-section,
.page-index__blog-slider-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__btn-access-link,
.page-index a[class*="button"],
.page-index a[class*="btn"] {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

@media (max-width: 1200px) {
  .page-index__category-lobby-grid {
    gap: 12px;
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items on smaller desktops */
  }
}

@media (max-width: 849px) {
  .page-index__hero-image-wrapper img {
    object-fit: contain !important;
    aspect-ratio: unset !important;
    max-height: none !important;
  }
}

@media (max-width: 768px) {
  /* General image and container responsiveness for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__hero-section,
  .page-index__access-links-section,
  .page-index__brand-intro-section,
  .page-index__category-lobby-section,
  .page-index__blog-slider-section,
  .page-index__access-links-container,
  .page-index__brand-intro-container,
  .page-index__category-lobby-container,
  .page-index__blog-slider-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Banner section */
  .page-index__hero-section {
    padding-top: 10px !important;
  }

  /* Three access links */
  .page-index__access-links-container {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  .page-index__btn-access-link {
    font-size: 16px !important;
    padding: 12px 15px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Brand intro */
  .page-index__main-title {
    font-size: clamp(24px, 7vw, 32px) !important;
  }
  .page-index__intro-text {
    font-size: 15px !important;
    text-align: left !important;
  }

  /* Category lobby */
  .page-index__section-title {
    font-size: clamp(20px, 6vw, 28px) !important;
    margin-bottom: 30px !important;
  }
  .page-index__section-title::before,
  .page-index__section-title::after {
    width: 30px !important;
    left: calc(50% - 70px - 30px) !important;
    right: calc(50% - 70px - 30px) !important;
  }
  .page-index__category-lobby-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .page-index__category-card-link img {
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Blog slider */
  .page-index__blog-slider-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .page-index__section-subtitle {
    font-size: clamp(20px, 6vw, 26px) !important;
  }
  .page-index__blog-slider-controls {
    width: 100%;
    justify-content: flex-end;
  }
  .page-index__post-item {
    flex: 0 0 85% !important; /* Single item visible on mobile */
    min-width: unset !important;
  }
  .page-index__post-title {
    font-size: 16px !important;
  }
  .page-index__post-excerpt {
    font-size: 13px !important;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Keep 2 columns for smaller mobile */
  }
}