/* General Styles */
.page-index {
  color: #FFF6D6; /* Text Main for dark background */
  background-color: #0A0A0A; /* Background color */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

.page-index a {
  color: #F2C14E;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index a:hover {
  color: #FFD36B;
}

.page-index__section-title,
.page-index__section-subtitle {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  color: #FFF6D6;
}

.page-index__section-title::after,
.page-index__section-subtitle::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #F2C14E, transparent);
  margin: 10px auto 0;
}

/* Module 1: Hero Banner */
.page-index__hero-section {
  padding-top: 10px; /* shared already 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 25px;
  text-align: center;
  background: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%); /* Button custom color */
  color: #111111; /* Dark text for bright button */
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 211, 107, 0.5);
}

/* 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-size: clamp(2em, 4vw, 3.2em); /* Use clamp for responsive font-size */
  font-weight: 700;
  line-height: 1.2;
  color: #FFF6D6;
  margin-bottom: 20px;
}

.page-index__intro-text {
  font-size: 1.1em;
  color: #FFF6D6;
  max-width: 800px;
  margin: 0 auto;
  text-align: justify;
}

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

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

.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.2s ease;
}

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

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

.page-index__blog-slider-wrapper {
  position: relative;
  margin-top: 30px;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px; /* Space for scrollbar */
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items per row, accounting for gap */
  scroll-snap-align: start;
  background-color: #111111; /* Card BG */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
  color: #FFF6D6;
}

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

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

.page-index__post-item__date {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(242, 193, 78, 0.9); /* F2C14E with transparency */
  color: #111111;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: bold;
}

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

.page-index__post-item__title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__post-item__title a {
  color: #FFF6D6;
  transition: color 0.3s ease;
}

.page-index__post-item__title a:hover {
  color: #FFD36B;
}

.page-index__post-item__summary {
  font-size: 0.95em;
  color: #FFF6D6;
}

.page-index__blog-slider-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none; /* Allow clicks on items */
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: rgba(242, 193, 78, 0.8); /* F2C14E with transparency */
  border: none;
  color: #111111;
  font-size: 1.5em;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 10;
  pointer-events: auto; /* Re-enable clicks for buttons */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin: 0 10px;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #F2C14E;
  color: #0A0A0A;
}

/* Responsive Styles */

/* Mobile-specific overrides for all sections and elements */
@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: 15px;
    line-height: 1.5;
  }

  .page-index__section-title,
  .page-index__section-subtitle {
    margin-bottom: 20px;
  }
  
  /* Module 1: Hero Banner - already covered above */

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

  .page-index__btn-access-link {
    padding: 12px 20px;
    font-size: 1em;
    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__brand-intro {
    padding: 15px 15px;
  }

  .page-index__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em);
    margin-bottom: 15px;
  }

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

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

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

  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

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

  .page-index__blog-slider-track {
    padding-bottom: 10px;
  }

  .page-index__post-item {
    flex: 0 0 85%; /* Show approximately 1 item, but allow partial next item */
    margin-right: 10px;
  }

  .page-index__post-item__content {
    padding: 10px;
  }

  .page-index__post-item__title {
    font-size: 1.1em;
  }

  .page-index__post-item__summary {
    font-size: 0.9em;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    font-size: 1.2em;
    padding: 8px 12px;
    margin: 0 5px;
  }

  /* Universal image responsive override */
  .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__post-item__image-cover,
  .page-index__post-item__content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
  }

  .page-index__category-lobby,
  .page-index__blog-slider {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr; /* Still 2 columns for smaller mobile */
  }
}