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

/* General styles for the page-index scope */
.page-index {
  font-family: 'Arial', sans-serif;
  color: var(--text-main);
  background-color: var(--deep-navy);
  line-height: 1.6;
  font-size: 16px;
}

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

.page-index__section-title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 40px;
  position: relative;
  padding-top: 20px;
}

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

.page-index__section-title::before {
  left: calc(50% - 100px);
}

.page-index__section-title::after {
  right: calc(50% - 100px);
}

.page-index__section-subtitle {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 30px;
  padding-top: 15px;
}

/* Module 1: Hero Banner */
.page-index__hero-section {
  padding-top: 10px; /* As per rule, not var(--header-offset) if body has it */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-index__hero-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 42.1875%; /* Aspect ratio 1920x810 or similar 21:9 */
  overflow: hidden;
}

.page-index__hero-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Default cover for desktop */
  display: block;
}

/* Module 2: Three Access Links Buttons */
.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 12px;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 25px;
  background: var(--button);
  color: var(--text-main);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  background: linear-gradient(180deg, #1144A6 0%, #2B73F6 100%); /* Slight hover effect */
}

/* Module 3: Brand Main Title + Intro */
.page-index__brand-intro-section {
  padding: 40px 0;
}

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

.page-index__main-title {
  font-size: clamp(28px, 4vw, 48px); /* Use clamp for H1 */
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 20px;
  line-height: 1.2;
}

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

.page-index__intro-text a {
  color: var(--gold);
  text-decoration: underline;
}

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

/* Module 4: Game Lobby Entry */
.page-index__category-lobby-section {
  padding: 60px 0;
}

.page-index__category-lobby {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
  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 {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.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.2s ease-in-out;
}

.page-index__category-card-link:hover {
  transform: scale(1.03);
}

.page-index__category-card-link img {
  aspect-ratio: 1 / 1; /* Enforce square ratio */
  width: 100%;
  height: auto;
  object-fit: contain; /* Ensure image fits without cropping */
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* Module 5: Blog Card Slider */
.page-index__blog-slider-section {
  padding: 60px 0;
}

.page-index__blog-slider-container-wrapper {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__blog-slider-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  position: relative;
}

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

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: var(--button);
  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;
  flex-shrink: 0;
  z-index: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

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

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 cards + 2 gaps */
  scroll-snap-align: start;
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  border: 1px solid var(--border);
}

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

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

.page-index__post-image {
  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.6);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
}

.page-index__post-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
  padding: 15px;
  margin: 0;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 15px;
  color: var(--text-secondary);
  padding: 0 15px 15px;
  margin: 0;
  flex-grow: 1;
}

/* Additional Content Section: Why Choose vipwwin */
.page-index__why-choose-us-section {
  padding: 60px 0;
  background-color: var(--deep-navy);
}

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

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

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

.page-index__feature-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* CTA Section */
.page-index__cta-section {
  padding: 80px 0;
  background: var(--primary);
  text-align: center;
}

.page-index__cta-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__cta-title {
  font-size: 40px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
}

.page-index__cta-description {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

.page-index__cta-description a {
  color: var(--gold);
  text-decoration: underline;
}

.page-index__cta-description a:hover {
  color: var(--glow);
}

.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 18px 35px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 180px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

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

.page-index__btn-primary:hover {
  background: linear-gradient(180deg, #1144A6 0%, #2B73F6 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

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

.page-index__btn-secondary:hover {
  background: var(--glow);
  border-color: var(--glow);
  color: #000; /* Contrast with glow */
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__section-title {
    font-size: 32px;
  }
  .page-index__section-subtitle {
    font-size: 24px;
  }
  .page-index__feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-index__cta-title {
    font-size: 36px;
  }
}

@media (max-width: 849px) {
  .page-index__hero-image img {
    object-fit: contain !important; /* Force contain for mobile banner */
    aspect-ratio: unset !important;
    max-height: none !important;
  }
  .page-index__blog-slider-prev {
    left: 0;
  }
  .page-index__blog-slider-next {
    right: 0;
  }
}

@media (max-width: 768px) {
  .page-index {
    font-size: 15px;
  }
  .page-index__container,
  .page-index__access-links,
  .page-index__brand-intro,
  .page-index__category-lobby,
  .page-index__blog-slider-container-wrapper,
  .page-index__cta-content,
  .page-index__feature-grid,
  .page-index__cta-buttons {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Module 1: Hero Banner - top padding */
  .page-index__hero-section {
    padding-top: 10px;
  }
  .page-index__hero-image {
    padding-bottom: 56.25%; /* Adjust aspect ratio for better mobile viewing if needed, 16:9 */
  }

  /* Module 2: Three Access Links Buttons */
  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 10px;
  }
  .page-index__btn-access-link {
    font-size: 16px;
    padding: 12px 20px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Module 3: Brand Main Title + Intro */
  .page-index__main-title {
    font-size: clamp(24px, 6vw, 36px);
  }
  .page-index__intro-text {
    font-size: 16px;
    text-align: left;
  }

  /* Module 4: Game Lobby Entry */
  .page-index__section-title {
    font-size: 28px;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
    gap: 10px;
  }
  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Module 5: Blog Card Slider */
  .page-index__section-subtitle {
    font-size: 22px;
  }
  .page-index__blog-slider-navigation {
    position: relative;
  }
  .page-index__blog-slider-track {
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    justify-content: flex-start;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* One card visible, with some peek of the next */
    scroll-snap-align: start;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(43, 115, 246, 0.8);
  }
  .page-index__post-title {
    font-size: 18px;
  }
  .page-index__post-excerpt {
    font-size: 14px;
  }

  /* Additional Content Section: Why Choose vipwwin */
  .page-index__feature-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
  }
  .page-index__feature-item {
    padding: 20px;
  }
  .page-index__feature-title {
    font-size: 20px;
  }
  .page-index__feature-description {
    font-size: 15px;
  }

  /* CTA Section */
  .page-index__cta-title {
    font-size: 30px;
  }
  .page-index__cta-description {
    font-size: 17px;
  }
  .page-index__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }
  .page-index__btn-primary,
  .page-index__btn-secondary {
    min-width: unset;
    padding: 15px 25px;
    font-size: 18px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Universal image responsive styles for page-index scope */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
}