/* style/index.css */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: #FFFFFF; /* Default body background is white */
}

/* Module 1: Hero Section */
.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;
  object-fit: cover;
}

/* Module 2: Access Links */
.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;
  text-align: center;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
  max-width: 100%;
  box-sizing: border-box;
  border: 2px solid transparent; /* Consistent border for hover effects */
}

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Module 3: Brand Intro */
.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-weight: 700;
  line-height: 1.2;
  color: #017439; /* Brand primary color */
  margin-bottom: 20px;
  font-size: clamp(2em, 4vw, 2.5em); /* Responsive font size for H1 */
}

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

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

.page-index__link-brand {
  color: #017439;
  text-decoration: underline;
}

/* Module 4: Game Lobby Entry */
.page-index__category-lobby {
  max-width: 1250px;
  margin: 40px auto;
  padding: 0 12px;
  box-sizing: border-box;
  text-align: center;
}

.page-index__section-title {
  font-size: clamp(1.8em, 3.5vw, 2.2em);
  color: #017439;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
  padding: 0 20px;
}

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

.page-index__section-title::before {
  left: -70px; /* Adjust position */
}

.page-index__section-title::after {
  right: -70px; /* Adjust position */
}

.page-index__category-lobby__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 30px;
}

.page-index__category-card {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  overflow: hidden; /* Ensure image doesn't overflow if slightly off square */
}

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

.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; /* Use contain as per U888 style */
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
  max-width: 100%;
}

/* Module 5: Blog Card Slider */
.page-index__blog-slider {
  max-width: 1250px;
  margin: 60px auto;
  padding: 0 12px;
  box-sizing: border-box;
  text-align: center;
}

.page-index__blog-slider-wrapper {
  position: relative;
  margin-top: 30px;
  display: flex;
  align-items: center;
}

.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 */
  flex-grow: 1;
  padding-bottom: 10px; /* Space for scrollbar if present */
}

.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 visible, accounting for gap */
  scroll-snap-align: start;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 280px; /* Ensure minimum width for desktop cards */
}

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

.page-index__post-link {
  display: block;
  text-decoration: none;
  color: #333333;
}

.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;
  max-width: 100%;
}

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

.page-index__post-title {
  font-size: 1.15em;
  font-weight: bold;
  margin: 15px 15px 10px;
  color: #017439;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 0.95em;
  color: #666666;
  margin: 0 15px 15px;
  line-height: 1.5;
  height: 4.5em; /* Limit to 3 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.page-index__blog-slider-nav {
  background: #017439;
  color: #ffffff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 2em;
  line-height: 1;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-nav:hover {
  background-color: #005a2e;
}

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

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

.page-index__view-all-posts {
  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: #005a2e;
}

/* Additional content sections */
.page-index__about-mb661 {
  padding: 60px 12px;
  margin: 0 auto;
  box-sizing: border-box;
  text-align: center;
}

.page-index__dark-section {
  background-color: #017439;
  color: #ffffff;
}

.page-index__dark-section .page-index__section-title {
  color: #ffffff;
}

.page-index__dark-section .page-index__section-title::before,
.page-index__dark-section .page-index__section-title::after {
  background-color: #ffffff;
}

.page-index__container {
  max-width: 1250px;
  margin: 0 auto;
}

.page-index__content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.page-index__feature-card {
  background: rgba(255, 255, 255, 0.1); /* Slightly transparent white for dark section */
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  color: #ffffff;
}

.page-index__feature-card img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 5px;
  margin-bottom: 20px;
  display: block;
}

.page-index__card-title {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 15px;
  color: #FFFF00; /* Custom font color for titles on dark background */
}

.page-index__feature-card p {
  font-size: 0.95em;
  line-height: 1.6;
  color: #f0f0f0;
}

.page-index__promotions-cta,
.page-index__payment-methods,
.page-index__download-app {
  padding: 60px 12px;
  margin: 0 auto;
  box-sizing: border-box;
  text-align: center;
  background-color: #ffffff; /* Explicitly white background */
  color: #333333;
}

.page-index__promotions-cta .page-index__section-title,
.page-index__payment-methods .page-index__section-title,
.page-index__download-app .page-index__section-title {
  color: #017439;
}

.page-index__promotions-cta .page-index__section-title::before,
.page-index__promotions-cta .page-index__section-title::after,
.page-index__payment-methods .page-index__section-title::before,
.page-index__payment-methods .page-index__section-title::after,
.page-index__download-app .page-index__section-title::before,
.page-index__download-app .page-index__section-title::after {
  background-color: #017439;
}

.page-index__btn-primary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 30px;
  border: 2px solid transparent; /* Ensure border exists for consistency */
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.page-index__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 30px;
  border: 2px solid;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  background-color: rgba(255, 255, 255, 0.9);
}

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

@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }

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

  .page-index__hero-section,
  .page-index__access-links,
  .page-index__brand-intro,
  .page-index__category-lobby,
  .page-index__blog-slider,
  .page-index__about-mb661,
  .page-index__promotions-cta,
  .page-index__payment-methods,
  .page-index__download-app,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__btn-access-link,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    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;
  }

  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column for buttons */
    padding: 20px 15px;
    gap: 15px;
  }

  .page-index__brand-intro {
    padding: 15px;
  }

  .page-index__main-title {
    font-size: clamp(1.8em, 7vw, 2.2em); /* Adjust h1 for mobile */
  }

  .page-index__section-title {
    font-size: clamp(1.5em, 6vw, 1.8em);
    padding: 0 10px;
  }

  .page-index__section-title::before,
  .page-index__section-title::after {
    width: 30px;
    left: -45px;
    right: -45px;
  }

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

  .page-index__post-item {
    flex: 0 0 85%; /* Show one card and a bit of the next */
    min-width: unset;
  }

  .page-index__blog-slider-nav {
    padding: 8px 12px;
    font-size: 1.8em;
  }

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

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

  .page-index__content-grid {
    grid-template-columns: 1fr; /* Single column for feature cards */
    gap: 20px;
  }

  .page-index__feature-card {
    padding: 20px;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr; /* Keep 2 columns for very small screens if needed, otherwise 1fr */
  }
}