: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 {
  font-family: 'Arial', sans-serif;
  color: var(--text-main);
  background-color: var(--deep-navy);
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Aligned with shared body padding-top, avoid double */
  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;
  aspect-ratio: 1920 / 810; /* Maintain aspect ratio */
}

/* Module 2: Access Links */
.page-index__access-links-section {
  background-color: var(--deep-navy);
  padding: 30px 15px;
  text-align: center;
}

.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: block;
  padding: 15px 20px;
  background: var(--button-gradient);
  color: var(--text-main);
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  box-sizing: border-box;
  text-align: center;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
  position: relative;
  overflow: hidden;
}

.page-index__btn-access-link::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.page-index__btn-access-link:hover::after {
  opacity: 0.3;
  transform: scale(1.2);
}

.page-index__btn-access-link:hover {
  box-shadow: 0 0 15px var(--glow-color);
  transform: translateY(-2px);
}

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

.page-index__brand-intro {
  max-width: 900px;
  margin: 0 auto;
}

.page-index__main-title {
  color: var(--gold-color);
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(242, 193, 78, 0.5);
  font-size: clamp(2em, 4vw, 3em); /* Responsive font size */
}

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

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

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

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

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

.page-index__section-title {
  color: var(--text-main);
  font-size: 2.2em;
  font-weight: bold;
  margin-bottom: 10px;
  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: var(--gold-color);
  border-radius: 2px;
}

.page-index__section-description {
  font-size: 1.05em;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-index__category-card-link:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

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

.page-index__blog-slider-container {
  max-width: 1250px;
  margin: 0 auto;
  text-align: center;
}

.page-index__blog-slider {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 30px;
}

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

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

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards per row with 16px gap */
  scroll-snap-align: start;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-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);
}

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

.page-index__post-image-wrapper {
  position: relative;
  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: rgba(var(--primary-color), 0.8);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: bold;
}

.page-index__post-title {
  font-size: 1.15em;
  color: var(--text-main);
  margin: 15px 15px 10px;
  line-height: 1.4;
  min-height: 60px; /* Ensure consistent height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-index__post-excerpt {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin: 0 15px 15px;
  line-height: 1.6;
  min-height: 70px; /* Ensure consistent height */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-index__blog-slider-nav {
  background: var(--button-gradient);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  color: var(--text-main);
  transition: background 0.3s ease, transform 0.3s ease;
}

.page-index__blog-slider-nav svg {
  width: 24px;
  height: 24px;
}

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

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

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

.page-index__view-all-posts {
  margin-top: 30px;
}

.page-index__btn-view-all {
  display: inline-block;
  padding: 12px 25px;
  background: var(--gold-color);
  color: var(--deep-navy);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1em;
  transition: all 0.3s ease;
  box-sizing: border-box;
  text-align: center;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-view-all:hover {
  background: #e0b040;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* About suncity888 Section */
.page-index__about-suncity888-section {
  background-color: var(--deep-navy);
  padding: 60px 15px;
}

.page-index__about-suncity888-content {
  max-width: 900px;
  margin: 0 auto;
}

.page-index__sub-title {
  color: var(--gold-color);
  font-size: 1.8em;
  font-weight: bold;
  margin-top: 40px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.page-index__text-block {
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: justify;
}

.page-index__feature-list {
  list-style: none;
  padding: 0;
  margin: 30px 0;
}

.page-index__feature-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  font-size: 1.05em;
  color: var(--text-main);
  line-height: 1.6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-index__feature-item strong {
  color: var(--gold-color);
  font-weight: bold;
}

.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  box-sizing: border-box;
  text-align: center;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary {
  background: var(--button-gradient);
  color: var(--text-main);
  border: 2px solid transparent;
}

.page-index__btn-primary:hover {
  box-shadow: 0 0 15px var(--glow-color);
  transform: translateY(-2px);
}

.page-index__btn-secondary {
  background: transparent;
  color: var(--gold-color);
  border: 2px solid var(--gold-color);
}

.page-index__btn-secondary:hover {
  background: var(--gold-color);
  color: var(--deep-navy);
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(242, 193, 78, 0.5);
}

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

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

  .page-index__category-lobby__grid {
    gap: 12px;
  }

  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 cards per row */
  }

  .page-index__blog-slider-nav {
    width: 35px;
    height: 35px;
  }

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

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

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

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

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

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

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

  .page-index__btn-access-link,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .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__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 10px;
  }

  /* Module 3: Brand Intro */
  .page-index__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em);
  }

  /* Module 4: Category 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;
  }

  /* Module 5: Blog Slider */
  .page-index__blog-slider-track {
    padding: 0;
  }

  .page-index__post-item {
    flex: 0 0 90%; /* Show one card at a time */
    margin-bottom: 10px;
  }

  .page-index__blog-slider-nav {
    width: 30px;
    height: 30px;
    left: -10px;
    right: -10px;
  }

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

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

  .page-index__post-title {
    font-size: 1.05em;
    min-height: auto;
  }

  .page-index__post-excerpt {
    font-size: 0.9em;
    min-height: auto;
  }

  /* About suncity888 Section */
  .page-index__sub-title {
    font-size: 1.5em;
  }

  .page-index__feature-item {
    padding: 15px;
    font-size: 1em;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr;
  }
}