/* Biến màu sắc tùy chỉnh */
:root {
  --primary-color: #113B7A;
  --secondary-color: #1D5FD1;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --border-color: #244D84;
  --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  --card-bg-color: #10233F;
  --divider-color: #1B3357;
  --deep-navy-color: #08162B;
  --text-main-color: #F3F8FF;
  --text-secondary-color: #AFC4E8;
}

.page-index {
  background-color: var(--deep-navy-color); /* Body background from shared is deep-navy, so content text should be light */
  color: var(--text-main-color);
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

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

.page-index__section-title,
.page-index__section-subtitle {
  text-align: center;
  color: var(--text-main-color);
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

.page-index__section-title::after,
.page-index__section-subtitle::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--gold-color);
  border-radius: 2px;
}

/* 模块 1: Full-width main Banner */
.page-index__hero-section {
  padding-top: 10px; /* shared provides body padding-top, so only small top margin here */
  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;
  object-fit: cover;
}

/* 模块 2: Three-link main button bar */
.page-index__access-links-section {
  padding: 30px 0;
  background-color: transparent;
}

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

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background: var(--button-gradient);
  color: var(--text-main-color);
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  max-width: 100%; /* Ensure button adapts to container */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  box-shadow: 0 6px 20px rgba(79, 168, 255, 0.4);
  transform: translateY(-2px);
  background: linear-gradient(180deg, #4FA8FF 0%, #2B73F6 100%);
}

/* 模块 3: Brand main title + intro (h1) */
.page-index__brand-intro-section {
  padding: 20px 0 40px;
}

.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
  text-align: center;
}

.page-index__main-title {
  color: var(--gold-color);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
  /* No fixed font-size, rely on clamp for responsiveness if needed, but not fixed values */
  font-size: clamp(2.2rem, 4vw, 3.5rem);
}

.page-index__intro-text {
  color: var(--text-secondary-color);
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-align: justify;
}

.page-index__intro-text a {
  color: var(--gold-color);
  text-decoration: none;
  font-weight: bold;
}

.page-index__intro-text a:hover {
  text-decoration: underline;
}

/* 模块 4: Game Lobby entry (5 square gameshow images) */
.page-index__category-lobby-section {
  padding: 40px 0;
}

.page-index__category-lobby {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  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.3s ease;
}

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

/* About Section - For content length */
.page-index__about-section {
  padding: 40px 0;
  background-color: var(--card-bg-color);
  margin-top: 40px;
}

.page-index__about-section .page-index__text-block {
  color: var(--text-secondary-color);
  font-size: 1.05rem;
  margin-bottom: 20px;
  text-align: justify;
  line-height: 1.7;
}

/* 模块 5: Member info blog card slider */
.page-index__blog-slider-section {
  padding: 40px 0;
}

.page-index__blog-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1250px;
  margin: 0 auto 30px;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__section-subtitle {
  margin-bottom: 0;
  padding-bottom: 0;
}

.page-index__section-subtitle::after {
  display: none;
}

.page-index__blog-slider-nav button {
  background: var(--button-gradient);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 5px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.page-index__blog-slider-nav button svg {
  color: var(--text-main-color);
  width: 20px;
  height: 20px;
}

.page-index__blog-slider-nav button:hover {
  background: linear-gradient(180deg, #4FA8FF 0%, #2B73F6 100%);
  transform: scale(1.05);
}

.page-index__blog-slider {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  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 items with 16px gap */
  scroll-snap-align: start;
  background-color: var(--card-bg-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.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: rgba(0, 0, 0, 0.7);
  color: var(--text-main-color);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85rem;
}

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

.page-index__post-title {
  color: var(--gold-color);
  font-size: 1.2rem;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-index__post-excerpt {
  color: var(--text-secondary-color);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Features Section - For content length */
.page-index__features-section {
  padding: 60px 0;
  background-color: var(--deep-navy-color);
}

.page-index__features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.page-index__feature-item {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__feature-item:hover {
  transform: translateY(-7px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.page-index__feature-title {
  color: var(--gold-color);
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.page-index__feature-description {
  color: var(--text-secondary-color);
  font-size: 1rem;
  line-height: 1.6;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__main-title {
    font-size: clamp(2rem, 5vw, 3rem);
  }

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

  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items with 16px gap */
  }

  .page-index__features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@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__hero-section {
    padding-top: 10px !important;
  }
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__access-links-section,
  .page-index__brand-intro-section,
  .page-index__category-lobby-section,
  .page-index__about-section,
  .page-index__blog-slider-section,
  .page-index__features-section,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Banner */
  .page-index__hero-image img {
    object-fit: contain !important;
    aspect-ratio: unset !important;
    max-height: none !important;
  }

  /* Three-link main button bar */
  .page-index__access-links {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 15px;
  }
  .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 h1 */
  .page-index__main-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }
  .page-index__intro-text {
    font-size: 0.95rem;
    text-align: left;
  }

  /* Game Lobby */
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .page-index__category-card-link img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: contain;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

  /* Blog Slider */
  .page-index__blog-slider-header {
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }
  .page-index__section-subtitle {
    margin-bottom: 15px;
  }
  .page-index__blog-slider-nav {
    margin-top: 10px;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* 1 item visible */
  }
  .page-index__post-title {
    font-size: 1.1rem;
  }
  .page-index__post-excerpt {
    font-size: 0.9rem;
  }

  /* Features Section */
  .page-index__features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-index__feature-title {
    font-size: 1.3rem;
  }
  .page-index__feature-description {
    font-size: 0.95rem;
  }
}