/* General page container and text styles */
.page-index {
  font-family: Arial, sans-serif;
  color: #333333; /* Dark text for light body background */
  background-color: #FFFFFF; /* Default body background is white */
}

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

/* Module 1: Hero Section (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: 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;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background-color: #26A9E0; /* Main brand color */
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%; /* For button responsive */
  box-sizing: border-box; /* For button responsive */
  white-space: normal; /* For button responsive */
  word-wrap: break-word; /* For button responsive */
}

.page-index__btn-access-link:hover {
  background-color: #1a8cc7; /* Slightly darker on hover */
  box-shadow: 0 4px 15px rgba(38, 169, 224, 0.4);
}

/* Module 3: Brand Intro (H1 + Paragraph) */
.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(24px, 3.5vw, 48px); /* H1 font size with clamp */
  font-weight: 700;
  line-height: 1.2;
  color: #26A9E0;
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__intro-text {
  font-size: 16px;
  line-height: 1.6;
  text-align: justify;
  margin-bottom: 30px;
  color: #555555;
}

.page-index__intro-text a {
  color: #26A9E0;
  text-decoration: none;
  font-weight: bold;
}

.page-index__intro-text a:hover {
  text-decoration: underline;
}

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

/* Section titles */
.page-index__section-title {
  font-size: clamp(20px, 2.5vw, 36px);
  font-weight: 700;
  color: #333333;
  text-align: center;
  margin: 40px 0 30px;
  position: relative;
}

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

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

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

/* Module 4: Game Lobby Entry */
.page-index__category-lobby {
  padding: 40px 0;
  background-color: #f9f9f9;
}

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

.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;
  text-decoration: none;
  overflow: hidden;
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.page-index__category-card-link img {
  aspect-ratio: 1 / 1; /* Enforce square aspect ratio */
  width: 100%;
  height: auto;
  object-fit: contain; /* Ensure image content is fully visible */
  display: block;
  transition: transform 0.3s ease;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.page-index__category-card-link:hover img {
  transform: scale(1.03);
}

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

.page-index__slider-wrapper {
  position: relative;
  margin: 0 auto;
  max-width: 1250px;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
  padding: 10px 0;
  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 per row with gap */
  scroll-snap-align: start;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease;
  border: 1px solid #e0e0e0;
}

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

.page-index__post-image-link {
  display: block;
  position: relative;
  overflow: hidden;
}

.page-index__image-cover {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  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 {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(38, 169, 224, 0.9);
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10;
}

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

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

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

.page-index__post-title a:hover {
  color: #26A9E0;
}

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

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(38, 169, 224, 0.8);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

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

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

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #26A9E0;
  transform: translateY(-50%) scale(1.05);
}

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

.page-index__btn-view-all {
  display: inline-block;
  padding: 12px 25px;
  background-color: #26A9E0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-index__btn-view-all:hover {
  background-color: #1a8cc7;
  transform: translateY(-2px);
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items per row with gap */
  }
}

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

@media (max-width: 768px) {
  /* General mobile text and padding */
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-index__container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Module 1: Banner */
  .page-index__hero-section {
    padding-top: 10px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Module 2: Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column for buttons */
    gap: 10px;
    padding: 20px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-index__btn-access-link {
    font-size: 16px;
    padding: 12px 15px;
    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 */
  .page-index__main-title {
    font-size: 28px;
    margin-bottom: 15px;
  }
  .page-index__intro-text {
    font-size: 15px;
    margin-bottom: 20px;
  }
  .page-index__brand-intro {
    padding: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Module 4: Game Lobby Entry */
  .page-index__section-title {
    font-size: 24px;
    margin: 30px 0 20px;
  }
  .page-index__section-title::before,
  .page-index__section-title::after {
    width: 30px;
    left: calc(50% - 70px);
  }
  .page-index__section-title::after {
    right: calc(50% - 70px);
  }

  .page-index__category-lobby {
    padding: 20px 0;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
    gap: 10px;
    padding: 0 15px;
  }
  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Module 5: Blog Card Slider */
  .page-index__blog-slider {
    padding: 20px 0 40px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-index__slider-wrapper {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-index__blog-slider-track {
    gap: 10px;
    padding: 5px 0;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* 1 item visible, partial next item */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
  }
  .page-index__post-title {
    font-size: 16px;
  }
  .page-index__post-excerpt {
    font-size: 13px;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 20px;
    left: 0;
    right: 0;
    margin: 0 10px;
    top: calc(50% - 60px); /* Adjust position to not overlap cards */
  }
  .page-index__blog-slider-prev {
    left: 0px;
  }
  .page-index__blog-slider-next {
    right: 0px;
  }
  .page-index__view-all-posts {
    margin-top: 30px;
  }
  .page-index__btn-view-all {
    font-size: 15px;
    padding: 10px 20px;
  }

  /* Ensure all images are responsive */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Ensure all containers with images/buttons are responsive */
  .page-index__section,
  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}