.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text color for light body background */
  background-color: #FFFFFF; /* Matches var(--secondary-color) from shared.css */
}

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

/* Module 1: Hero Banner */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, assuming shared.css handles body padding-top */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

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

/* Module 2: Three-link Main Button Bar */
.page-index__access-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 30px 12px;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: block;
  background-color: #C30808; /* Custom color for Register/Login */
  color: #FFFF00; /* Custom font color for Register/Login */
  text-align: center;
  padding: 15px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  background-color: #a30606;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Module 3: Brand Main Title + Introduction */
.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px 12px;
  box-sizing: border-box;
  text-align: center;
}

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

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

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

.page-index__intro-text .page-index__highlight-text {
  font-weight: bold;
  color: #017439;
}

/* Module 4: Game Lobby Entrance */
.page-index__category-lobby {
  padding: 40px 0;
}

.page-index__section-title {
  font-size: 2.2em;
  color: #017439;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

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

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

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

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

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

.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;
  transition: transform 0.3s ease-in-out;
}

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

/* Module 5: Member Info / Blog Card Slider */
.page-index__blog-slider {
  padding: 40px 0;
  background-color: #f9f9f9;
}

.page-index__blog-slider .page-index__section-title {
  margin-bottom: 40px;
}

.page-index__blog-slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 40px;
}

.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__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.page-index__blog-slider-prev {
  left: 0;
}

.page-index__blog-slider-next {
  right: 0;
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items with 16px gap */
  scroll-snap-align: start;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  height: auto;
  min-width: 250px; /* Minimum width to ensure card visibility */
}

.page-index__post-item:hover {
  transform: translateY(-5px);
}

.page-index__post-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

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

.page-index__post-date {
  background-color: #017439;
  color: #ffffff;
  padding: 5px 10px;
  font-size: 0.85em;
  font-weight: bold;
  position: absolute;
  top: 0;
  right: 0;
  border-bottom-left-radius: 8px;
}

.page-index__post-item h5.page-index__post-title {
  font-size: 1.2em;
  color: #017439;
  margin: 15px 15px 10px;
  line-height: 1.4;
}

.page-index__post-item p.page-index__post-excerpt {
  font-size: 0.9em;
  color: #555;
  margin: 0 15px 15px;
  flex-grow: 1;
}

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

.page-index__btn-view-all {
  display: inline-block;
  background-color: #017439;
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-view-all:hover {
  background-color: #005f2f;
}

/* General Image & Button Responsive styles */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-index__section,
.page-index__card,
.page-index__container {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Media Queries */
/* Module 1: Hero Banner - mobile */
@media (max-width: 849px) {
  .page-index__hero-image img {
    object-fit: contain !important;
    aspect-ratio: unset !important;
    max-height: none !important;
  }
}

/* General mobile styles for 768px and below */
@media (max-width: 768px) {
  .page-index {
    font-size: 15px;
    line-height: 1.5;
  }

  .page-index__container {
    padding: 0 15px;
  }

  /* Module 2: Access Links - mobile */
  .page-index__access-links {
    grid-template-columns: 1fr;
    padding: 20px 15px;
    gap: 10px;
  }

  .page-index__btn-access-link {
    padding: 12px 15px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Module 3: Brand Intro - mobile */
  .page-index__brand-intro {
    padding: 15px;
  }

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

  .page-index__intro-text {
    font-size: 1em;
    text-align: left;
  }

  /* Module 4: Game Lobby - mobile */
  .page-index__category-lobby {
    padding: 30px 0;
  }

  .page-index__section-title {
    font-size: 1.8em;
    margin-bottom: 25px;
  }

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

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

  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .page-index__category-card-link img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: contain;
  }

  /* Module 5: Blog Slider - mobile */
  .page-index__blog-slider {
    padding: 30px 0;
  }

  .page-index__blog-slider-wrapper {
    padding: 0 15px;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .page-index__blog-slider-prev {
    left: 0;
  }
  .page-index__blog-slider-next {
    right: 0;
  }

  .page-index__post-item {
    flex: 0 0 85%; /* Show roughly 1 item on mobile */
    min-width: 280px;
  }

  .page-index__post-item h5.page-index__post-title {
    font-size: 1.1em;
    margin: 10px 10px 8px;
  }

  .page-index__post-item p.page-index__post-excerpt {
    font-size: 0.85em;
    margin: 0 10px 10px;
  }

  .page-index__btn-view-all {
    padding: 10px 20px;
    font-size: 1em;
  }

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

  .page-index__section,
  .page-index__card,
  .page-index__container,
  .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;
    flex-wrap: wrap !important; /* Ensure buttons wrap if in flex container */
    gap: 10px;
  }
}