/* Base styles and container */
.page-index {
  font-family: Arial, sans-serif;
  color: #1F2D3D; /* Text Main */
  background-color: #F4F7FB; /* Background */
}

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

.page-index__section-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: #1F2D3D; /* Text Main */
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

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

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

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

/* Module 1: Hero Banner */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding as body already has --header-offset */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 1920 / 810;
}

/* Module 2: Three 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;
  margin-bottom: 30px;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button */
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.2);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  box-shadow: 0 6px 15px rgba(47, 107, 255, 0.4), 0 0 15px #A5C4FF; /* Glow */
  transform: translateY(-2px);
}

/* Module 3: Brand Intro (H1 + Paragraph) */
.page-index__brand-intro {
  padding: 20px 0;
  margin-bottom: 40px;
}

.page-index__main-title {
  font-size: clamp(28px, 5vw, 48px); /* Avoid fixed large font-size */
  font-weight: 800;
  line-height: 1.2;
  color: #1F2D3D; /* Text Main */
  text-align: center;
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__intro-text {
  font-size: 16px;
  line-height: 1.8;
  color: #1F2D3D; /* Text Main */
  text-align: justify;
  max-width: 900px;
  margin: 0 auto;
}

.page-index__brand-link {
  color: #2F6BFF;
  text-decoration: none;
  font-weight: 600;
}

.page-index__brand-link:hover {
  text-decoration: underline;
}

/* Module 4: Game Lobby Entrance (5 Square gameshow images) */
.page-index__category-lobby {
  padding: 40px 0;
  margin-bottom: 40px;
}

.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;
}

.page-index__category-card-link {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  transition: transform 0.2s 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;
}

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

.page-index__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: 10px;
}

.page-index__blog-slider-track::-webkit-scrollbar {
  height: 8px;
}

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background-color: #D6E2FF; /* Border */
  border-radius: 10px;
}

.page-index__blog-slider-track::-webkit-scrollbar-track {
  background: #F4F7FB; /* Background */
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards visible on desktop with 16px gap */
  scroll-snap-align: start;
  background: #FFFFFF; /* Card BG */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 280px; /* Minimum width to prevent cards from becoming too small */
}

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

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

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

.page-index__post-image-wrapper 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: rgba(47, 107, 255, 0.8); /* Primary color with transparency */
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
}

.page-index__post-title {
  font-size: 18px;
  font-weight: 700;
  color: #1F2D3D; /* Text Main */
  padding: 15px 15px 10px;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 14px;
  color: #1F2D3D; /* Text Main */
  padding: 0 15px 15px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

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

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #4A8BFF; /* Lighter primary for hover */
}

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

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

.page-index__blog-slider-prev::before {
  content: '‹';
}

.page-index__blog-slider-next::before {
  content: '›';
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__hero-image img {
    aspect-ratio: 1600 / 675;
  }
  .page-index__access-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 cards visible */
  }
}

@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 adaptations */
  .page-index__container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  .page-index__section-title {
    font-size: 24px;
    margin-bottom: 25px;
  }
  .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);
  }

  /* Hero Section */
  .page-index__hero-section {
    padding-top: 10px; /* Ensure small top padding */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr !important; /* Single column */
    gap: 15px;
    padding: 20px 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !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;
  }

  /* Brand Intro */
  .page-index__main-title {
    font-size: clamp(24px, 6vw, 36px);
  }
  .page-index__intro-text {
    font-size: 15px;
    text-align: left;
  }
  .page-index__brand-intro {
    padding: 15px 0;
  }

  /* Game Lobby */
  .page-index__category-lobby {
    padding: 30px 0;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 2 columns */
    gap: 10px;
  }
  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Blog Slider */
  .page-index__blog-slider {
    padding: 30px 0 40px;
  }
  .page-index__post-item {
    flex: 0 0 85% !important; /* One card visible, slightly wider for context */
    min-width: unset;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 20px;
    left: 5px;
    right: 5px;
  }
  .page-index__blog-slider-prev {
    left: 0;
  }
  .page-index__blog-slider-next {
    right: 0;
  }

  /* General Image & Button Adaptations */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__post-image-wrapper img {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
  }
  .page-index__section,
  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr !important; /* Still 2 columns for very small screens */
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    display: none; /* Hide arrows on very small screens if needed */
  }
  .page-index__blog-slider-track {
    padding-left: 15px;
    padding-right: 15px;
  }
}