:root {
  --primary-color: #113B7A;
  --secondary-color: #1D5FD1;
  --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  --card-bg: #10233F;
  --text-main: #F3F8FF;
  --text-secondary: #AFC4E8;
  --border-color: #244D84;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --divider-color: #1B3357;
  --deep-navy: #08162B;
}

.page-index {
  color: var(--text-main); /* Default text color for the page, light for dark body */
  background-color: transparent; /* Body handles deep-navy */
}

/* General image and button responsive rules */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-index a[class*="button"],
.page-index a[class*="btn"] {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__section,
.page-index__container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  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;
}

/* Module 2: Access Links Section */
.page-index__access-links-section {
  padding: 30px 15px;
  background-color: var(--deep-navy); /* Dark background for buttons */
}

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

.page-index__btn-access-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 20px;
  background: var(--button-gradient);
  color: var(--text-main);
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-index__btn-access-link:hover {
  opacity: 0.9;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 15px var(--glow-color);
}

/* Module 3: Brand Intro Section */
.page-index__brand-intro-section {
  padding: 40px 15px;
  background-color: var(--deep-navy);
}

.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  text-align: center;
}

.page-index__main-title {
  color: var(--text-main);
  font-weight: bold;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  /* font-size will be handled by shared.css or clamp if needed, not fixed */
}

.page-index__intro-text {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
  text-align: justify;
}

.page-index__intro-link {
  color: var(--secondary-color);
  text-decoration: underline;
  font-weight: bold;
}

.page-index__intro-link:hover {
  color: var(--glow-color);
}

/* Module 4: Category Lobby Section */
.page-index__category-lobby-section {
  padding: 50px 15px;
  background-color: var(--deep-navy);
}

.page-index__category-lobby {
  max-width: 1250px;
  margin: 0 auto;
}

.page-index__section-title {
  color: var(--text-main);
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

.page-index__section-title::before,
.page-index__section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 80px;
  height: 2px;
  background-color: var(--divider-color);
  transform: translateY(-50%);
}

.page-index__section-title::before {
  left: calc(50% - 150px); /* Adjust position */
}

.page-index__section-title::after {
  right: calc(50% - 150px); /* Adjust position */
}

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

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

/* Module 5: Blog Slider Section */
.page-index__blog-slider-section {
  padding: 50px 15px;
  background-color: var(--deep-navy);
}

.page-index__blog-slider {
  max-width: 1250px;
  margin: 0 auto;
  position: relative;
}

.page-index__blog-slider-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none; /* Allow clicks on children */
  z-index: 10;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: rgba(var(--primary-color), 0.7);
  color: var(--text-main);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  pointer-events: all; /* Make buttons clickable */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.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: var(--primary-color);
  transform: scale(1.1);
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 20px; /* Space for scrollbar */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--secondary-color) var(--card-bg); /* Firefox */
}

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

.page-index__blog-slider-track::-webkit-scrollbar-track {
  background: var(--card-bg);
  border-radius: 10px;
}

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color);
  border-radius: 10px;
  border: 2px solid var(--card-bg);
}


.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards per row with 16px gap */
  scroll-snap-align: start;
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.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;
  border-radius: 10px 10px 0 0;
}

.page-index__post-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
}

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

.page-index__post-title {
  color: var(--text-main);
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__post-title:hover {
  color: var(--secondary-color);
}

.page-index__post-excerpt {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-top: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  -webkit-box-orient: vertical;
}

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

.page-index__view-all-button {
  display: inline-block;
  padding: 12px 30px;
  background: var(--button-gradient);
  color: var(--text-main);
  text-decoration: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-index__view-all-button:hover {
  opacity: 0.9;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 15px var(--glow-color);
}


/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__main-title {
    font-size: 40px;
  }
  .page-index__intro-text {
    font-size: 16px;
  }
  .page-index__section-title {
    font-size: 28px;
  }
  .page-index__section-title::before,
  .page-index__section-title::after {
    width: 60px;
  }
  .page-index__section-title::before {
    left: calc(50% - 120px);
  }
  .page-index__section-title::after {
    right: calc(50% - 120px);
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 cards per row */
  }
}


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

@media (max-width: 768px) {
  /* General mobile overrides */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

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

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

  /* Module 1: Hero Section */
  .page-index__hero-section {
    padding-top: 10px; /* Still small top padding */
  }

  /* Module 2: Access Links Section */
  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column for buttons */
    gap: 10px;
  }

  .page-index__btn-access-link {
    font-size: 16px;
    padding: 12px 15px;
  }

  /* Module 3: Brand Intro Section */
  .page-index__main-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

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

  /* Module 4: Category Lobby Section */
  .page-index__section-title {
    font-size: 24px;
    margin-bottom: 25px;
  }
  .page-index__section-title::before,
  .page-index__section-title::after {
    display: none; /* Hide decorative lines on mobile */
  }

  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for game cards */
    gap: 10px;
  }

  /* Module 5: Blog Slider Section */
  .page-index__blog-slider-controls {
    display: none; /* Hide arrows on small mobile to rely on scroll */
  }

  .page-index__blog-slider-track {
    padding-bottom: 10px;
  }

  .page-index__post-item {
    flex: 0 0 85%; /* Show one main card, part of next */
  }

  .page-index__post-title {
    font-size: 16px;
  }

  .page-index__post-excerpt {
    font-size: 14px;
  }

  .page-index__view-all-button {
    font-size: 16px;
    padding: 10px 25px;
  }
}

@media (max-width: 549px) {
  /* Further adjustments for smaller mobile screens */
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr; /* Still 2 columns, but adjust gap */
    gap: 8px;
  }
  .page-index__post-item {
    flex: 0 0 95%; /* Make card take up more width */
  }
}