/* Base styles for page-index */
.page-index {
  font-family: Arial, sans-serif;
  color: #1F2D3D;
  background-color: #F4F7FB; /* Custom Background color */
  line-height: 1.6;
}

/* Section spacing and container */
.page-index__hero-section,
.page-index__access-links-section,
.page-index__brand-intro-section,
.page-index__category-lobby-section,
.page-index__blog-slider-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  padding: 0 15px;
  margin-bottom: 40px;
}

.page-index__hero-section {
  padding-top: 10px; /* Specific for homepage, not var(--header-offset) */
  margin-bottom: 0;
}

.page-index__access-links-section,
.page-index__brand-intro-section,
.page-index__category-lobby-section,
.page-index__blog-slider-section {
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__main-title,
.page-index__section-title {
  color: #1F2D3D; /* Custom Text Main color */
  text-align: center;
  margin-bottom: 20px;
}

.page-index__main-title {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__section-title {
  font-size: 28px;
  font-weight: 600;
  position: relative;
  padding-bottom: 10px;
}

.page-index__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: #2F6BFF;
  border-radius: 2px;
}

/* Module 1: Hero Banner */
.page-index__hero-image-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.page-index__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-width: 100%;
}

/* Module 2: Access Links */
.page-index__access-links-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 30px 0;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Custom Button color */
  color: #ffffff; /* Ensure high contrast */
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
  max-width: 100%;
}

.page-index__btn-access-link:hover {
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.4);
  transform: translateY(-2px);
}

/* Module 3: Brand Intro */
.page-index__intro-paragraph {
  font-size: 16px;
  line-height: 1.8;
  text-align: justify;
  color: #1F2D3D; /* Custom Text Main color */
  max-width: 900px;
  margin: 0 auto;
}

.page-index__brand-link {
  color: #2F6BFF;
  text-decoration: none;
  font-weight: 600;
}

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

/* Module 4: Category Lobby */
.page-index__category-lobby-container {
  padding: 40px 0;
}

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

.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;
  text-decoration: none;
}

.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.2s ease;
  max-width: 100%;
}

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

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

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

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

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

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items per row with gap */
  scroll-snap-align: start;
  background: #FFFFFF; /* Custom Card BG color */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #D6E2FF; /* Custom Border color */
}

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

.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;
  display: block;
  max-width: 100%;
}

.page-index__post-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(47, 107, 255, 0.8); /* Primary color with opacity */
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
}

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

.page-index__post-title {
  font-size: 18px;
  font-weight: 700;
  color: #1F2D3D; /* Custom Text Main color */
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-index__post-summary {
  font-size: 14px;
  color: #555555;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background-color: #2F6BFF;
  color: #ffffff;
  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 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

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

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

.page-index__blog-slider-prev::before {
  content: '‹';
  font-size: 24px;
}

.page-index__blog-slider-next::before {
  content: '›';
  font-size: 24px;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #4A8BFF;
}

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

.page-index__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
}

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

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__main-title {
    font-size: 32px;
  }
  .page-index__section-title {
    font-size: 24px;
  }
  .page-index__access-links-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .page-index__category-lobby__grid {
    gap: 12px;
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items per row with gap */
  }
  .page-index__blog-slider-prev {
    left: 0;
  }
  .page-index__blog-slider-next {
    right: 0;
  }
}

@media (max-width: 849px) {
  .page-index__hero-image {
    object-fit: contain !important;
    aspect-ratio: unset !important;
    max-height: none !important;
  }
}

@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-index__hero-section,
  .page-index__access-links-section,
  .page-index__brand-intro-section,
  .page-index__category-lobby-section,
  .page-index__blog-slider-section {
    padding: 0 10px !important; /* Smaller padding on mobile */
  }
  .page-index__main-title {
    font-size: 28px !important;
  }
  .page-index__section-title {
    font-size: 22px !important;
  }

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

  /* Module 4: Category Lobby - mobile 2 columns */
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }
  .page-index__category-card-link img {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    max-width: 100% !important;
  }

  /* Module 5: Blog Slider - mobile single card */
  .page-index__blog-slider-wrapper {
    margin-top: 20px !important;
  }
  .page-index__blog-slider-track {
    padding-bottom: 5px !important;
  }
  .page-index__post-item {
    flex: 0 0 85% !important; /* 1 item visible */
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px !important;
    height: 35px !important;
    font-size: 20px !important;
  }
  .page-index__blog-slider-prev {
    left: -10px !important;
  }
  .page-index__blog-slider-next {
    right: -10px !important;
  }
  .page-index__post-title {
    font-size: 16px !important;
  }
  .page-index__post-summary {
    font-size: 13px !important;
  }
  .page-index__blog-all-posts-link {
    margin-top: 30px !important;
  }
  .page-index__btn-primary {
    padding: 10px 20px !important;
    font-size: 15px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* General image and container responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__hero-section .page-index__hero-image-wrapper,
  .page-index__access-links-section .page-index__access-links-container,
  .page-index__brand-intro-section .page-index__brand-intro-container,
  .page-index__category-lobby-section .page-index__category-lobby-container,
  .page-index__blog-slider-section .page-index__blog-slider-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}