/* Base styles for the page */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main-color); /* Light text for dark background */
  background-color: var(--deep-navy-color); /* Inherited from body via shared.css */
}

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

/* Section titles */
.page-index__section-title {
  font-size: 2.5em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-main-color);
  position: relative;
  padding-bottom: 15px;
}

.page-index__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gold-color); /* Using custom gold color */
  border-radius: 2px;
}

.page-index__section-title--light {
  color: var(--text-main-color);
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, assuming shared.css handles body padding-top */
  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 */
.page-index__access-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 30px 15px;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%); /* Custom button gradient */
  color: var(--text-main-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
}

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px #4FA8FF; /* Custom glow effect */
}

/* Module 3: Brand Intro */
.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px 15px 40px;
  box-sizing: border-box;
  text-align: center;
}

.page-index__main-title {
  font-size: 2.8em; /* Using slightly larger for H1, but avoiding extreme fixed sizes */
  font-weight: 800;
  margin-bottom: 20px;
  color: #F2C14E; /* Using gold for H1 for prominence */
  line-height: 1.2;
}

.page-index__intro-text {
  font-size: 1.1em;
  color: #AFC4E8;
  margin-bottom: 30px;
  text-align: justify;
}

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

/* Module 4: Game Lobby */
.page-index__category-lobby {
  padding: 60px 0;
  background-color: #10233F; /* Using custom card background color */
  border-top: 1px solid #1B3357; /* Custom divider color */
  border-bottom: 1px solid #1B3357;
}

.page-index__category-lobby__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.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 */
.page-index__blog-slider {
  padding: 60px 0;
}

.page-index__blog-slider-wrapper {
  position: relative;
  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; /* For smoother scrolling on iOS */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

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

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards on desktop, accounting for gap */
  scroll-snap-align: start;
  background: #10233F; /* Custom card background */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.page-index__post-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.page-index__post-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: #113B7A;
  color: #F3F8FF;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: bold;
}

.page-index__post-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.page-index__post-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #F3F8FF;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-index__post-divider {
  width: 50px;
  height: 2px;
  background: #1B3357;
  margin: 10px 0;
}

.page-index__post-excerpt {
  font-size: 0.95em;
  color: #AFC4E8;
  flex-grow: 1;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #F3F8FF;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5em;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: rgba(0, 0, 0, 0.7);
}

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

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

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

.page-index__btn-view-all {
  display: inline-block;
  padding: 12px 25px;
  background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  color: #F3F8FF;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__btn-view-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Additional sections */
.page-index__about-us {
  padding: 60px 0;
  background-color: #08162B;
}

.page-index__about-us .page-index__content-wrapper {
  display: flex;
  gap: 30px;
  align-items: center;
}

.page-index__about-us .page-index__text-content {
  flex: 1;
}

.page-index__about-us .page-index__text-content p {
  color: #AFC4E8;
  margin-bottom: 15px;
  text-align: justify;
}

.page-index__about-us .page-index__text-content a {
  color: #1D5FD1;
  text-decoration: underline;
}

.page-index__about-us .page-index__image-content {
  flex: 0 0 40%;
  max-width: 40%;
  text-align: center;
}

.page-index__about-us .page-index__image-content img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.page-index__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  color: #F3F8FF;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 20px;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  border: none;
}

.page-index__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-index__features-section {
  padding: 60px 0;
  background-color: #10233F;
}

.page-index__features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.page-index__feature-card {
  background: #08162B;
  border: 1px solid #244D84;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-index__feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.page-index__feature-card img {
  width: 100%;
  max-width: 250px; /* Max width for feature images */
  height: auto;
  margin-bottom: 20px;
  border-radius: 5px;
}

.page-index__feature-title {
  font-size: 1.4em;
  color: #F2C14E;
  margin-bottom: 10px;
}

.page-index__feature-card p {
  color: #AFC4E8;
  font-size: 0.95em;
}

.page-index__promotions-cta {
  padding: 80px 0;
  text-align: center;
}

.page-index__promotions-cta .page-index__container {
  background: #113B7A; /* Using primary color as background for contrast */
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.page-index__cta-text {
  font-size: 1.2em;
  color: #F3F8FF;
  margin-bottom: 30px;
}

.page-index__join-us {
  padding: 60px 0 80px;
  text-align: center;
}

.page-index__join-text {
  font-size: 1.1em;
  color: #AFC4E8;
  margin-bottom: 30px;
}

.page-index__join-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Ensure buttons wrap on mobile */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  background: transparent;
  color: #113B7A;
  text-decoration: none;
  border: 2px solid #113B7A;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__btn-secondary:hover {
  background: #113B7A;
  color: #F3F8FF;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__main-title {
    font-size: 2.2em;
  }
  .page-index__section-title {
    font-size: 2em;
  }
  .page-index__category-lobby__grid {
    gap: 12px;
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 cards on tablet */
  }
  .page-index__about-us .page-index__content-wrapper {
    flex-direction: column;
  }
  .page-index__about-us .page-index__image-content {
    flex: 0 0 60%;
    max-width: 60%;
  }
  .page-index__features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@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) {
  /* General mobile adaptations */
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }

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

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

  .page-index__main-title {
    font-size: 1.8em;
  }

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

  /* Module 1: Hero Section (already handled by 849px) */

  /* Module 2: Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr;
    padding: 20px 15px;
    gap: 10px;
  }

  .page-index__btn-access-link,
  .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;
  }

  /* Module 4: Game Lobby */
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards on mobile */
    gap: 10px;
    padding: 0 10px;
  }

  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Module 5: Blog Slider */
  .page-index__blog-slider-wrapper {
    padding: 0 10px;
  }
  .page-index__blog-slider-track {
    gap: 10px;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* 1 card on mobile, with some peek of next */
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    padding: 0;
  }
  .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;
  }

  /* Additional sections */
  .page-index__about-us .page-index__content-wrapper {
    flex-direction: column;
    gap: 20px;
  }
  .page-index__about-us .page-index__image-content {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .page-index__features-grid {
    grid-template-columns: 1fr; /* 1 card on mobile */
    gap: 20px;
  }

  .page-index__promotions-cta .page-index__container {
    padding: 30px 20px;
  }
  .page-index__cta-text {
    font-size: 1.1em;
  }

  .page-index__join-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
    padding: 0 15px;
  }

  /* Ensure all images are responsive */
  .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: 1fr 1fr; /* Still 2 columns for smaller mobile */
  }
  .page-index__post-item {
    flex: 0 0 95%; /* Make cards almost full width for very small screens */
  }
  .page-index__main-title {
    font-size: 1.6em;
  }
  .page-index__section-title {
    font-size: 1.6em;
  }
}

/* Color Contrast Enforcement (based on --deep-navy-color being dark) */
.page-index {
  color: #F3F8FF; /* Text Main */
}

.page-index__card {
  background: #10233F; /* Card BG */
  color: #F3F8FF; /* Text Main */
  border: 1px solid #244D84; /* Border */
}

.page-index__dark-section {
  background: #08162B; /* Deep Navy */
  color: #F3F8FF; /* Text Main */
}

.page-index__btn-primary {
  background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  color: #F3F8FF; /* Text Main */
}

.page-index__btn-secondary {
  background: transparent;
  color: #113B7A; /* Primary color */
  border: 2px solid #113B7A; /* Primary color */
}