/* General styles for the page-index scope */
.page-index {
  font-family: Arial, sans-serif;
  color: var(--text-main, #FFF6D6); /* Default text color from customColors */
  background: var(--background, #0A0A0A); /* Default background from customColors */
  line-height: 1.6;
  padding-bottom: 50px; /* Add some padding at the bottom */
}

/* Section spacing */
.page-index section {
  padding: 40px 15px;
  max-width: 1250px;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary, #F2C14E);
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

.page-index__section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary, #F2C14E);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Module 1: Hero Section (Banner) */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, assuming body has --header-offset */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}

.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: block;
  padding: 15px 20px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main, #FFF6D6);
  background: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%); /* Button gradient */
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  max-width: 100%; /* Ensure button adapts to width */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background-color: rgba(255, 255, 255, 0.15);
  transition: all 0.6s ease-out;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 0;
}

.page-index__btn-access-link:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
}

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px var(--glow, #FFD36B); /* Glow on hover */
}

/* Module 3: Brand Intro */
.page-index__brand-intro {
  text-align: center;
  padding: 20px 15px;
  max-width: 900px;
}

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

.page-index__lead-paragraph {
  font-size: 17px;
  color: var(--text-main, #FFF6D6);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Module 4: Game Lobby */
.page-index__category-lobby {
  padding-top: 50px;
  padding-bottom: 50px;
}

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

.page-index__category-card {
  display: block;
}

.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.3s ease;
}

.page-index__category-card-link:hover {
  transform: translateY(-5px);
}

.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 Slider */
.page-index__blog-slider {
  padding-top: 50px;
  padding-bottom: 50px;
  position: relative;
}

.page-index__blog-slider-wrapper {
  position: relative;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 40px; /* Space for arrows */
}

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

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

.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: #FFF6D6;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  font-size: 24px;
  border-radius: 5px;
  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: 0;
}

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

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items per row on desktop, considering gap */
  scroll-snap-align: start;
  background: var(--card-bg, #111111); /* Card background */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 280px; /* Minimum width to prevent cards from becoming too small */
}

.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px var(--glow, #FFD36B);
}

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

.page-index__image-cover {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: #222; /* Placeholder background */
}

.page-index__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: rgba(0, 0, 0, 0.7);
  color: #FFF6D6;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  z-index: 5;
}

.page-index__post-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary, #F2C14E);
  padding: 15px 15px 5px;
  margin: 0;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 14px;
  color: #DDD;
  padding: 0 15px 15px;
  margin: 0;
  line-height: 1.5;
}

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

.page-index__btn-view-all {
  display: inline-block;
  padding: 12px 25px;
  background: var(--primary, #F2C14E);
  color: #0A0A0A; /* Dark text for primary button */
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-index__btn-view-all:hover {
  background: var(--glow, #FFD36B);
  transform: translateY(-2px);
}

/* About Us Summary Section */
.page-index__about-us-summary {
  padding-top: 50px;
  padding-bottom: 50px;
}

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

.page-index__about-us-text {
  flex: 1;
}

.page-index__about-us-text p {
  margin-bottom: 15px;
  color: var(--text-main, #FFF6D6);
  font-size: 16px;
  line-height: 1.7;
  text-align: justify;
}

.page-index__btn-read-more {
  display: inline-block;
  padding: 10px 20px;
  background: transparent;
  color: var(--primary, #F2C14E);
  border: 2px solid var(--primary, #F2C14E);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-index__btn-read-more:hover {
  background: var(--primary, #F2C14E);
  color: #0A0A0A;
}

.page-index__about-us-image {
  flex: 0 0 45%;
  max-width: 45%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.page-index__about-us-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Features Section */
.page-index__features-section {
  padding-top: 50px;
  padding-bottom: 50px;
}

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

.page-index__feature-card {
  background: var(--card-bg, #111111);
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-index__feature-card img {
  width: 200px; /* Enforce min size 200x200 */
  height: 200px;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block;
}

.page-index__feature-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary, #F2C14E);
  margin-bottom: 10px;
}

.page-index__feature-description {
  font-size: 15px;
  color: #DDD;
  line-height: 1.6;
}

/* CTA Section */
.page-index__cta-section {
  background: linear-gradient(135deg, #111111 0%, #0A0A0A 100%);
  padding: 60px 15px;
  text-align: center;
  border-radius: 10px;
  margin: 50px auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-width: 1000px;
}

.page-index__cta-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary, #F2C14E);
  margin-bottom: 20px;
}

.page-index__cta-description {
  font-size: 18px;
  color: var(--text-main, #FFF6D6);
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

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

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 15px 35px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
}

.page-index__btn-primary {
  background: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%); /* Button gradient */
  color: #0A0A0A; /* Dark text for primary button */
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-index__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px var(--glow, #FFD36B);
}

.page-index__btn-secondary {
  background: transparent;
  color: var(--primary, #F2C14E);
  border: 2px solid var(--primary, #F2C14E);
  box-shadow: none;
}

.page-index__btn-secondary:hover {
  transform: translateY(-3px);
  background: var(--primary, #F2C14E);
  color: #0A0A0A;
  box-shadow: 0 0 15px var(--glow, #FFD36B);
}

/* --- Responsive Styles --- */

/* @media (max-width: 1024px) */
@media (max-width: 1024px) {
  .page-index__features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* @media (max-width: 849px) for hero image */
@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) - Mobile specific styles */
@media (max-width: 768px) {
  .page-index section {
    padding: 30px 15px;
  }

  .page-index__section-title {
    font-size: 28px;
    margin-bottom: 25px;
  }

  /* Banner */
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__hero-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 10px;
    padding: 20px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .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 */
  .page-index__main-title {
    font-size: clamp(24px, 7vw, 36px); /* Adjust H1 for smaller screens */
  }
  .page-index__lead-paragraph {
    font-size: 15px;
  }

  /* Game Lobby */
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
    gap: 10px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  /* Blog Slider */
  .page-index__blog-slider-wrapper {
    padding: 0 15px; /* Adjust padding for arrows */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* Show one card + part of next on mobile */
    min-width: unset; /* Remove min-width to allow flex basis to work */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    padding: 8px 12px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.6);
  }
  .page-index__image-cover img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__post-title {
    font-size: 16px;
  }
  .page-index__post-excerpt {
    font-size: 13px;
  }
  .page-index__btn-view-all {
    padding: 10px 20px;
    font-size: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* About Us Summary */
  .page-index__about-us-content {
    flex-direction: column; /* Stack content vertically */
    gap: 20px;
  }
  .page-index__about-us-image {
    flex: 0 0 100%;
    max-width: 100%;
  }
}