/* Base styles for the page-index */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #FFF3E6; /* Text Main color for dark background */
  background-color: #0D0E12; /* Background color */
}

/* Hero Section (Module 1) */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding, assuming body has padding-top from shared.css */
  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;
}

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

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  text-align: center;
  text-decoration: none;
  color: #FFF3E6; /* Light text for dark background */
  background: linear-gradient(180deg, #FFA53A 0%, #D96800 100%); /* Button gradient */
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(255, 165, 58, 0.4);
}

/* Brand Intro (Module 3) */
.page-index__brand-intro {
  max-width: 1250px;
  margin: 0 auto;
  padding: 20px 12px;
  box-sizing: border-box;
  text-align: center;
}

.page-index__main-title {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #FF8C1A; /* Primary color for H1 */
  margin-bottom: 15px;
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size for H1 */
}

.page-index__intro-text {
  font-size: 1.1em;
  color: #FFF3E6;
  max-width: 900px;
  margin: 0 auto 30px auto;
}

/* Category Lobby (Module 4) */
.page-index__category-lobby {
  max-width: 1250px;
  margin: 40px auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__section-title {
  text-align: center;
  color: #FF8C1A;
  font-size: clamp(1.8em, 3.5vw, 2.5em);
  margin-bottom: 30px;
  position: relative;
}

.page-index__section-title::before,
.page-index__section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 50px;
  height: 2px;
  background-color: #A84F0C; /* Border color */
  transform: translateY(-50%);
}

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

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

.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;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.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;
  max-width: 100%; /* Ensure images are responsive */
}

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

/* Blog Slider (Module 5) */
.page-index__blog-slider {
  max-width: 1250px;
  margin: 60px auto;
  padding: 0 12px;
  box-sizing: border-box;
}

.page-index__blog-slider-wrapper {
  position: relative;
  margin-top: 30px;
}

.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 */
}

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

.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* Show 3 items with gaps */
  scroll-snap-align: start;
  background-color: #17191F; /* Card BG */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  color: #FFF3E6;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

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

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

.page-index__post-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  max-width: 100%; /* Ensure images are responsive */
}

.page-index__post-link:hover .page-index__post-image-container img {
  transform: scale(1.05);
}

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

.page-index__post-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #FFB04D; /* Glow color for title */
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-index__post-excerpt {
  font-size: 0.9em;
  color: #FFF3E6;
  margin-bottom: 10px;
  flex-grow: 1;
}

.page-index__post-date {
  font-size: 0.8em;
  color: rgba(255, 243, 230, 0.7);
  align-self: flex-end;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 140, 26, 0.8); /* Primary color with transparency */
  color: #FFF3E6;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  z-index: 10;
  transition: background-color 0.3s ease;
}

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

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

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

.page-index__blog-slider-prev::before {
  content: '‹';
}

.page-index__blog-slider-next::before {
  content: '›';
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* Show 2 items with gaps */
  }
}

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

  .page-index__section-title::before,
  .page-index__section-title::after {
    width: 30px;
    left: calc(50% - 70px);
  }

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

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

  /* Access Links Module */
  .page-index__access-links {
    grid-template-columns: 1fr;
    padding: 20px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__btn-access-link {
    padding: 12px 15px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Brand Intro Module */
  .page-index__brand-intro {
    padding: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em);
  }

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

  /* Category Lobby Module */
  .page-index__category-lobby {
    margin: 30px auto;
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

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

  .page-index__category-card,
  .page-index__category-card-link {
    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;
  }

  /* Blog Slider Module */
  .page-index__blog-slider {
    margin: 40px auto;
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__blog-slider-track {
    gap: 12px;
  }

  .page-index__post-item {
    flex: 0 0 85%; /* Show 1 item, partially showing next */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

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

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 16px;
    left: -10px;
    right: -10px;
  }

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

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

  /* Generic image and button responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__section,
  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: 1fr 1fr;
  }
  .page-index__blog-slider-prev {
    left: 5px;
  }
  .page-index__blog-slider-next {
    right: 5px;
  }
}