/* General styles for the page-index */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #FFF5E1; /* Text Main from custom colors */
  background-color: var(--background-color, #B71C1C); /* Background from custom colors */
}

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

.page-index__link-inline {
  color: #FFD86A; /* Gold-ish color for inline links */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__link-inline:hover {
  color: #F4D34D; /* Lighter gold on hover */
}

.page-index__section-title {
  font-size: 32px;
  font-weight: bold;
  color: #FFF5E1; /* Text Main */
  text-align: center;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 15px;
}

.page-index__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FFD86A, transparent);
  border-radius: 2px;
}

.page-index__section-intro-text {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
  font-size: 17px;
  color: #E5E5E5;
}

/* Buttons */
.page-index__btn-primary,
.page-index__btn-access-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  color: #7A0E0E; /* Deep Red for text on Gold button */
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button custom color */
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-index__btn-primary:hover,
.page-index__btn-access-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 15px #FFCC66; /* Glow custom color */
  color: #7A0E0E;
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* shared 已给 body 留白时禁止 var(--header-offset) */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  margin-bottom: 30px;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* Module 2: Access Links */
.page-index__access-links {
  margin-bottom: 40px;
  padding: 30px 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-index__access-title {
  font-size: 28px;
  color: #FFF5E1;
  text-align: center;
  margin-bottom: 25px;
  font-weight: bold;
}

.page-index__buttons-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.page-index__btn-access-link {
  width: 100%;
  box-sizing: border-box;
}

/* Module 3: Brand Intro */
.page-index__brand-intro {
  margin-bottom: 50px;
}

.page-index__text-block {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-index__main-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #FFD86A; /* Gold-ish for H1 */
  text-align: center;
  margin-bottom: 25px;
  line-height: 1.2;
  text-shadow: 0 0 10px rgba(255, 216, 106, 0.5);
  max-width: 100%; /* Ensure H1 does not overflow */
  box-sizing: border-box;
  padding: 0 10px;
}

.page-index__description {
  font-size: 17px;
  color: #E5E5E5;
  text-align: justify;
  margin-bottom: 15px;
}

/* Module 4: Category Lobby */
.page-index__category-lobby {
  margin-bottom: 50px;
}

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

.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;
  width: 100%;
  height: 100%;
}

.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, box-shadow 0.3s ease;
}

.page-index__category-card-link:hover img {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 15px #FFCC66; /* Glow effect on hover */
}

.page-index__game-description {
  font-size: 16px;
  color: #E5E5E5;
  margin-bottom: 20px;
  line-height: 1.7;
  text-align: justify;
}

/* Module 5: Blog Slider */
.page-index__blog-slider {
  margin-bottom: 50px;
}

.page-index__slider-wrapper {
  position: relative;
  margin-top: 40px;
  display: flex;
  align-items: center;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 15px; /* Space for scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #C91F17 #7A0E0E;
}

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

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

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background-color: #C91F17;
  border-radius: 10px;
  border: 2px solid #7A0E0E;
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 13.333px); /* 3 cards with 20px gap */
  scroll-snap-align: start;
  background-color: #D32F2F; /* Card BG */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid #F2B544; /* Border custom color */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 15px #FFCC66;
}

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

.page-index__post-image 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: #C91F17; /* Primary color */
  color: #FFF5E1;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
}

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

.page-index__post-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.page-index__post-title a {
  color: #FFF5E1; /* Text Main */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__post-title a:hover {
  color: #FFD86A; /* Gold-ish on hover */
}

.page-index__post-content p {
  font-size: 15px;
  color: #E5E5E5;
  line-height: 1.5;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: #C91F17; /* Primary color */
  color: #FFF5E1;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  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: #E53935; /* Secondary color */
  transform: translateY(-50%) scale(1.05);
}

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

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

/* About Us Summary */
.page-index__about-us-summary {
  margin-bottom: 60px;
}

.page-index__cta-button-wrapper {
  text-align: center;
  margin-top: 30px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__main-title {
    font-size: 2.8rem;
  }
  .page-index__buttons-wrapper {
    gap: 15px;
  }
  .page-index__category-lobby__grid {
    gap: 15px;
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 10px); /* 2 cards */
  }
  .page-index__blog-slider-prev {
    left: 0;
  }
  .page-index__blog-slider-next {
    right: 0;
  }
}

@media (max-width: 849px) {
  .page-index__hero-image img {
    object-fit: contain !important; 
    aspect-ratio: unset !important;
    max-height: none !important;
    border-radius: 0; /* Remove border-radius on mobile for full width */
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-index__hero-section {
    margin-bottom: 20px;
  }
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__container {
    padding: 0 10px;
  }
  .page-index__section-title {
    font-size: 28px;
    margin-bottom: 20px;
  }
  .page-index__section-intro-text {
    font-size: 15px;
    margin-bottom: 30px;
  }
  .page-index__access-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  .page-index__buttons-wrapper {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 90%;
  }
  .page-index__btn-access-link,
  .page-index__btn-primary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 15px;
    font-size: 16px;
  }
  .page-index__main-title {
    font-size: 2.2rem;
    margin-bottom: 20px;
    padding: 0;
  }
  .page-index__description,
  .page-index__game-description {
    font-size: 15px;
    line-height: 1.6;
  }
  .page-index__text-block {
    padding: 20px;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 30px;
  }
  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* Single card visible on mobile */
    margin: 0 10px;
  }
  .page-index__blog-slider-track {
    padding-bottom: 10px;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  .page-index__blog-slider-prev {
    left: 0px;
  }
  .page-index__blog-slider-next {
    right: 0px;
  }
  .page-index__post-title {
    font-size: 18px;
  }
  .page-index__post-content p {
    font-size: 14px;
  }
  .page-index__cta-button-wrapper {
    margin-top: 20px;
  }
  .page-index__about-us-summary .page-index__text-block {
    padding-left: 10px;
    padding-right: 10px;
  }
  /* Universal image responsive for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__hero-image,
  .page-index__access-links .page-index__container,
  .page-index__brand-intro .page-index__container,
  .page-index__category-lobby .page-index__container,
  .page-index__blog-slider .page-index__container,
  .page-index__about-us-summary .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 10px;
    padding-right: 10px;
  }
}