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

/* Module 1: Full-width main Banner */
.page-index__hero-section {
  padding-top: 10px; /* Fixed small top padding, as body handles --header-offset */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  background-color: #f0f8ff; /* Light background for banner section */
}
.page-index__hero-image {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover; /* Default for desktop */
  vertical-align: middle;
  filter: none;
}

/* Module 2: Three access links/buttons */
.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;
  background-color: #ffffff; /* White background */
}
.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background-color: #26A9E0; /* Primary color */
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}
.page-index__btn-access-link:hover {
  background-color: #1e87c0;
  box-shadow: 0 4px 12px rgba(38, 169, 224, 0.4);
  transform: translateY(-2px);
}

/* Module 3: Brand main title + intro */
.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  padding: 40px 12px;
  box-sizing: border-box;
  text-align: center;
  background-color: #f9f9f9; /* Light grey background */
}
.page-index__main-title {
  font-size: clamp(2em, 3.5vw, 2.8em); /* Use clamp for H1 */
  font-weight: 700;
  line-height: 1.2;
  color: #26A9E0; /* Primary color for H1 */
  margin-bottom: 20px;
  max-width: 100%;
}
.page-index__intro-paragraph {
  font-size: 1.1em;
  line-height: 1.8;
  text-align: justify;
  margin-bottom: 0;
  color: #333333;
}
.page-index__intro-paragraph a {
  color: #26A9E0;
  text-decoration: none;
  font-weight: bold;
}
.page-index__intro-paragraph a:hover {
  text-decoration: underline;
}
.page-index__highlight {
  font-weight: bold;
  color: #000000;
}

/* Module 4: Game lobby entrance */
.page-index__category-lobby {
  max-width: 1250px;
  margin: 0 auto;
  padding: 50px 12px;
  box-sizing: border-box;
  background-color: #ffffff;
  text-align: center;
}
.page-index__section-title {
  font-size: 2.2em;
  font-weight: 700;
  color: #26A9E0;
  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;
  height: 2px;
  background-color: #26A9E0;
}
.page-index__section-title::before {
  left: -70px;
}
.page-index__section-title::after {
  right: -70px;
}
.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;
}
.page-index__category-card-link {
  display: block;
  text-decoration: none;
  border: none;
  box-shadow: 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;
  vertical-align: middle;
  filter: none;
}

/* Module 5: Blog card slider */
.page-index__blog-slider {
  max-width: 1250px;
  margin: 0 auto;
  padding: 50px 12px;
  box-sizing: border-box;
  background-color: #f0f8ff; /* Light blue background */
  text-align: center;
}
.page-index__blog-slider-container {
  position: relative;
  margin-top: 30px;
}
.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 20px;
  -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}
.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards per row 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.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
}
.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.page-index__post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.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%;
  filter: none;
  vertical-align: middle;
}
.page-index__post-content {
  padding: 15px;
  text-align: left;
}
.page-index__post-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #26A9E0;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.4;
}
.page-index__post-title:hover {
  text-decoration: underline;
}
.page-index__post-meta {
  font-size: 0.9em;
  color: #666666;
  margin-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}
.page-index__post-summary {
  font-size: 0.95em;
  color: #333333;
  line-height: 1.6;
}
.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); /* Primary color with opacity */
  color: #ffffff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1.5em;
  font-weight: bold;
  border-radius: 50%;
  z-index: 10;
  transition: background-color 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #26A9E0;
}
.page-index__blog-slider-prev {
  left: -20px;
}
.page-index__blog-slider-next {
  right: -20px;
}
.page-index__view-all-button-container {
  margin-top: 40px;
  text-align: center;
}
.page-index__btn-view-all {
  display: inline-block;
  padding: 12px 30px;
  background-color: #EA7C07; /* Login color for CTA */
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1em;
  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: #c96806;
}

/* General image and 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;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr); /* Adjust for tablets */
  }
  .page-index__blog-slider-prev { left: 0px; }
  .page-index__blog-slider-next { right: 0px; }
}

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

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

  /* Banner __hero-section */
  .page-index__hero-section {
    padding-top: 10px; /* Still 10px, not header-offset */
  }
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__hero-section,
  .page-index__hero-image {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Three links __access-links: 768px single column */
  .page-index__access-links {
    grid-template-columns: 1fr;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__btn-access-link {
    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;
  }

  /* Brand main title + intro */
  .page-index__brand-intro {
    padding: 20px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em); /* Adjust H1 size for smaller screens */
  }
  .page-index__intro-paragraph {
    font-size: 1em;
  }

  /* Game lobby __category-lobby: aspect-ratio:1/1; no border/box-shadow */
  .page-index__category-lobby {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__section-title {
    font-size: 1.8em;
  }
  .page-index__section-title::before,
  .page-index__section-title::after {
    width: 30px; /* Shorter lines */
    left: -50px;
    right: -50px;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
    gap: 10px;
  }
  .page-index__category-card-link img {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .page-index__category-card,
  .page-index__category-card-link {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Blog slider __blog-slider: 768px single card visible */
  .page-index__blog-slider {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-track {
    gap: 10px;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* Single card visible, with some peek of next */
    scroll-snap-align: start;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__image-cover img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
}