/* General Styles for page-index */
.page-index {
  font-family: Arial, sans-serif;
  color: #333333;
  background-color: #F5F7FA;
  line-height: 1.6;
}

/* Section Titles */
.page-index__section-title {
  font-size: 32px;
  font-weight: 700;
  color: #E53935;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 10px;
}

.page-index__section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #FF5A4F 0%, #E53935 100%);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Hero Section (Module 1) */
.page-index__hero-section {
  padding-top: 10px; /* Aligns with shared body padding, avoids double spacing */
  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;
}

/* Access Links Section (Module 2) */
.page-index__access-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 30px 20px;
  box-sizing: border-box;
}

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

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

/* Brand Intro Section (Module 3) */
.page-index__brand-intro {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
  box-sizing: border-box;
  color: #333333;
  background-color: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 40px;
}

.page-index__main-title {
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 800;
  color: #E53935;
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.page-index__intro-text {
  font-size: 17px;
  line-height: 1.8;
  text-align: justify;
  color: #333333;
}

.page-index__intro-text a {
  color: #E53935;
  text-decoration: underline;
}

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

/* Category Lobby Section (Module 4) */
.page-index__category-lobby {
  max-width: 1250px;
  margin: 0 auto;
  padding: 40px 20px;
  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 {
  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;
  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.3s ease-in-out;
}

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

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

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

.page-index__blog-slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px; /* For scrollbar visibility */
  scrollbar-width: thin;
  scrollbar-color: #E53935 #f0f0f0;
}

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

.page-index__blog-slider-track::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background: #E53935;
  border-radius: 10px;
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 13.333px); /* 3 cards + 2 gaps */
  scroll-snap-align: start;
  background-color: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease;
  border: 1px solid #E0E0E0;
  color: #333333;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
}

.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-color: #E53935;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
}

.page-index__post-title {
  font-size: 18px;
  font-weight: 700;
  margin: 15px 15px 10px;
  color: #333333;
  line-height: 1.4;
}

.page-index__post-summary {
  font-size: 15px;
  color: #555555;
  margin: 0 15px 15px;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: #E53935;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  z-index: 10;
  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: #FF5A4F;
  transform: scale(1.1);
}

.page-index__blog-slider-prev svg,
.page-index__blog-slider-next svg {
  width: 20px;
  height: 20px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__access-links {
    gap: 15px;
    padding: 25px 15px;
  }

  .page-index__category-lobby__grid {
    gap: 12px;
  }

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

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

  .page-index__post-item {
    flex: 0 0 calc(50% - 10px); /* 2 cards + 1 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) {
  .page-index__section-title {
    font-size: 26px;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__hero-section,
  .page-index__access-links,
  .page-index__brand-intro,
  .page-index__category-lobby,
  .page-index__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Module 2: Three Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px 15px;
    flex-wrap: wrap !important;
    display: flex;
    flex-direction: column;
  }

  .page-index__btn-access-link {
    font-size: 16px;
    padding: 12px 20px;
    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: 30px 15px;
    margin-bottom: 30px;
  }

  .page-index__main-title {
    font-size: 28px;
  }

  .page-index__intro-text {
    font-size: 15px;
  }

  /* Module 4: Game Lobby Entry */
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
  }

  .page-index__category-card-link img {
    aspect-ratio: 1 / 1;
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    display: block;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

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

  .page-index__blog-slider-wrapper {
    margin-top: 20px;
  }

  .page-index__blog-slider-track {
    gap: 15px;
  }

  .page-index__post-item {
    flex: 0 0 90%; /* Single card visible on mobile */
    scroll-snap-align: center;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    left: -10px;
    right: -10px;
  }

  .page-index__blog-slider-prev svg,
  .page-index__blog-slider-next svg {
    width: 16px;
    height: 16px;
  }

  /* General image responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-index__post-item {
    flex: 0 0 95%; /* Adjust for very small screens */
  }
}

/* Contrast Fixes */
.page-index__dark-bg {
  color: #ffffff;
  background: #E53935;
}

.page-index__light-bg {
  color: #333333;
  background: #ffffff;
}

.page-index__text-block {
  color: #333333;
  background: #ffffff;
}

.page-index p,
.page-index li {
  color: #333333;
}

.page-index__card {
  background: #ffffff;
  color: #333333;
  border: 1px solid #e0e0e0;
}

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

.page-index__btn-primary {
  background: #E53935;
  color: #ffffff;
  border: 2px solid transparent;
}

.page-index__btn-secondary {
  background: #ffffff;
  color: #E53935;
  border: 2px solid #E53935;
}

@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-index__card {
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
}