/* Base Styles */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: #F5F7FA; /* Body background from customColors */
}

/* Section Spacing */
.page-index__hero-section,
.page-index__access-links,
.page-index__brand-intro,
.page-index__category-lobby,
.page-index__blog-slider {
  padding: 0 12px;
  margin-bottom: 40px;
  box-sizing: border-box;
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, relying on body for header offset */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin-bottom: 20px;
}

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

/* Module 2: Access Links */
.page-index__access-links {
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 30px;
  padding-bottom: 30px;
  margin-bottom: 20px;
}

.page-index__access-links-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(229, 57, 53, 0.4);
}

/* Module 3: Brand Intro */
.page-index__brand-intro {
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.page-index__main-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: #E53935;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-index__intro-text {
  font-size: 17px;
  line-height: 1.8;
  color: #333333;
  text-align: justify;
  max-width: 900px;
  margin: 0 auto;
}

.page-index__intro-text a {
  color: #E53935;
  text-decoration: none;
  font-weight: bold;
}

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

/* Section Titles */
.page-index__section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: #333333;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 10px;
}

.page-index__section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #FF5A4F 0%, #E53935 100%);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Module 4: Category Lobby */
.page-index__category-lobby {
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50px;
}

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

.page-index__category-card {
  display: block;
  border: none;
  box-shadow: none;
  outline: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.page-index__category-card-link {
  display: block;
  text-decoration: none;
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  transition: transform 0.2s ease-in-out;
}

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

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

/* Module 5: Blog Slider */
.page-index__blog-slider {
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50px;
}

.page-index__blog-slider-wrapper {
  position: relative;
  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;
  padding-bottom: 10px; /* For scrollbar visibility */
  flex-grow: 1;
}

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items per row, accounting for gap */
  scroll-snap-align: start;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__post-item:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

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

.page-index__post-image-wrapper {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  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%;
  box-sizing: border-box;
}

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

.page-index__post-title {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-index__post-meta {
  font-size: 13px;
  color: #666666;
  margin-bottom: 10px;
}

.page-index__post-date {
  background-color: #E53935;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.page-index__post-excerpt {
  font-size: 14px;
  color: #555555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #E0E0E0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #E53935;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.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: #E53935;
  color: #ffffff;
}

/* Responsive Styles */

/* Mobile/Tablet specific styles */
@media (max-width: 1024px) {
  .page-index__access-links-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items per row */
  }
}

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

  .page-index__hero-section,
  .page-index__access-links,
  .page-index__brand-intro,
  .page-index__category-lobby,
  .page-index__blog-slider {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

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

  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    aspect-ratio: unset !important;
    max-height: none !important;
    box-sizing: border-box !important;
  }

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

  /* Module 3: Brand Intro */
  .page-index__main-title {
    font-size: 28px;
    margin-bottom: 15px;
  }
  .page-index__intro-text {
    font-size: 15px;
    text-align: left;
  }

  /* 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%;
    height: auto;
    object-fit: contain;
    border: none;
    box-shadow: none;
    border-radius: 0;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Module 5: Blog Slider */
  .page-index__section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  .page-index__blog-slider-wrapper {
    margin: 0 -15px;
  }
  .page-index__blog-slider-track {
    padding-left: 15px;
    padding-right: 15px;
    scroll-padding-left: 15px;
    scroll-padding-right: 15px;
  }
  .page-index__post-item {
    flex: 0 0 85%; /* 1 item visible, 85% width */
    scroll-snap-align: center;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    display: none; /* Hide arrows on small screens */
  }
  .page-index__post-title {
    font-size: 16px;
  }
  .page-index__post-excerpt {
    font-size: 13px;
  }

  /* General image and button responsive rules */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__section,
  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Color Contrast & Brand Colors */
.page-index {
  color: #333333; /* Text Main */
  background-color: #F5F7FA; /* Background */
}

.page-index__card {
  background: #FFFFFF; /* Card BG */
  color: #333333; /* Text Main */
  border: 1px solid #E0E0E0; /* Border */
}

.page-index__dark-section {
  background: #E53935; /* Primary color */
  color: #ffffff; /* White text for contrast */
}

.page-index__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Button gradient */
  color: #ffffff;
}

.page-index__btn-secondary {
  background: #ffffff;
  color: #E53935;
  border: 2px solid #E53935;
}

.page-index__post-date {
  background-color: #E53935;
  color: #ffffff;
}