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

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

.page-index__section-heading {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: #FFA53A;
  position: relative;
}

.page-index__section-heading--decorated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.page-index__section-heading--decorated::before,
.page-index__section-heading--decorated::after {
  content: '';
  flex-grow: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, #A84F0C, transparent);
  max-width: 150px;
}

.page-index__section-heading--decorated::after {
  background: linear-gradient(to left, transparent, #A84F0C, transparent);
}

.page-index__section-heading span {
  background-color: #0D0E12;
  padding: 0 15px;
  z-index: 1;
  position: relative;
}

.page-index__content-text {
  font-size: 1.1em;
  margin-bottom: 20px;
  text-align: justify;
}

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

.page-index__hero-image {
  line-height: 0;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

/* Module 2: Three Access Links */
.page-index__access-links-section {
  padding: 30px 0;
  background-color: #0D0E12;
}

.page-index__access-links-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background: linear-gradient(180deg, #FFA53A 0%, #D96800 100%);
  color: #FFF3E6;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Break long words */
  box-sizing: border-box;
}

.page-index__btn-access-link:hover {
  background: linear-gradient(180deg, #FFB04D 0%, #FFA53A 100%);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5), 0 0 15px #FFB04D;
  transform: translateY(-2px);
}

/* Module 3: Brand Intro */
.page-index__brand-intro-section {
  padding: 40px 0;
  background-color: #0D0E12;
}

.page-index__brand-intro-content {
  text-align: center;
}

.page-index__brand-title {
  font-size: clamp(2.2em, 4vw, 3.2em); /* Use clamp for h1 */
  font-weight: 900;
  color: #FFB04D;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-index__brand-description {
  font-size: 1.15em;
  line-height: 1.8;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
  color: #FFF3E6;
}

.page-index__brand-link {
  color: #FFA53A;
  text-decoration: underline;
}

.page-index__features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 50px;
}

.page-index__feature-item {
  background-color: #17191F;
  padding: 25px;
  border-radius: 10px;
  text-align: left;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid #A84F0C;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 10px #FFB04D;
}

.page-index__feature-title {
  font-size: 1.5em;
  color: #FFA53A;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: bold;
}

.page-index__feature-text {
  font-size: 1em;
  color: #FFF3E6;
}

/* Module 4: Game Lobby */
.page-index__category-lobby-section {
  padding: 50px 0;
  background-color: #0D0E12;
}

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

.page-index__category-card {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  line-height: 0; /* Important to remove extra space below image */
}

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

.page-index__category-card-link:hover {
  transform: translateY(-5px) scale(1.02);
}

.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 Slider */
.page-index__blog-slider-section {
  padding: 50px 0;
  background-color: #0D0E12;
}

.page-index__blog-slider-wrapper {
  position: relative;
  margin-top: 40px;
  display: flex;
  align-items: center;
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards + 2 gaps */
  scroll-snap-align: start;
  background-color: #17191F;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid #A84F0C;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #FFF3E6;
}

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

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

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

.page-index__image-cover 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: #D96800;
  color: #FFF3E6;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: bold;
  z-index: 2;
}

.page-index__post-title {
  font-size: 1.2em;
  font-weight: bold;
  margin: 15px 15px 10px;
  color: #FFA53A;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 0.95em;
  margin: 0 15px 15px;
  color: #FFF3E6;
}

.page-index__blog-slider-nav {
  background-color: rgba(255, 165, 58, 0.8);
  color: #FFF3E6;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  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-nav:hover {
  background-color: #FFB04D;
  transform: translateY(-50%) scale(1.1);
}

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

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

.page-index__view-all-posts {
  text-align: center;
  margin-top: 40px;
}

.page-index__btn-view-all {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(180deg, #FFA53A 0%, #D96800 100%);
  color: #FFF3E6;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-index__btn-view-all:hover {
  background: linear-gradient(180deg, #FFB04D 0%, #FFA53A 100%);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5), 0 0 15px #FFB04D;
  transform: translateY(-2px);
}

/* Responsive Styles */

/* General Mobile Styles */
@media (max-width: 768px) {
  .page-index__container {
    padding: 0 15px;
  }

  .page-index__section-heading {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-index__content-text,
  .page-index__brand-description {
    font-size: 1em;
    text-align: left; /* Adjust text alignment for smaller screens */
  }

  /* Images and Containers */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__section,
  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Buttons */
  .page-index__btn-access-link,
  .page-index__btn-view-all,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    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;
  }

  .page-index__access-links-container,
  .page-index__button-group,
  .page-index__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }

  .page-index__access-links-container {
    grid-template-columns: 1fr;
  }
}

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

/* Module 2: Three Access Links Mobile */
@media (max-width: 768px) {
  .page-index__access-links-container {
    grid-template-columns: 1fr;
  }
}

/* Module 3: Brand Intro Mobile */
@media (max-width: 768px) {
  .page-index__brand-title {
    font-size: 2em; /* Adjusted for mobile */
  }
  .page-index__brand-description {
    font-size: 0.95em;
  }
  .page-index__features-grid {
    grid-template-columns: 1fr;
  }
}

/* Module 4: Game Lobby Mobile */
@media (max-width: 768px) {
  .page-index__category-lobby-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Module 5: Blog Slider Mobile */
@media (max-width: 768px) {
  .page-index__blog-slider-wrapper {
    padding: 0;
  }
  .page-index__blog-slider-track {
    gap: 10px;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* Show one card with some peek of the next */
  }
  .page-index__blog-slider-nav {
    width: 35px;
    height: 35px;
    font-size: 1.2em;
  }
  .page-index__blog-slider-prev {
    left: 5px;
  }
  .page-index__blog-slider-next {
    right: 5px;
  }
  .page-index__post-title {
    font-size: 1.1em;
  }
  .page-index__post-excerpt {
    font-size: 0.9em;
  }
}

/* Ensure no small icons or filter property on images */
.page-index img {
  filter: none !important;
}