/* General styles for page-index (assuming dark red background from shared.css var(--bg-color) which resolves to #B71C1C) */
.page-index {
  font-family: Arial, sans-serif;
  color: #FFF5E1; /* Text Main */
  line-height: 1.6;
  background-color: var(--bg-color, #B71C1C);
}

.page-index__section-title,
.page-index__section-subtitle {
  text-align: center;
  color: #FFF5E1; /* Text Main */
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

.page-index__section-title::after,
.page-index__section-subtitle::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: #F4D34D; /* Gold */
  border-radius: 2px;
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Assuming shared.css already handles body padding-top */
  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;
}

/* Module 2: Access Links Section */
.page-index__access-links-section {
  padding: 30px 12px;
  background-color: var(--bg-color, #B71C1C);
}

.page-index__access-links-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 20px;
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button Gold Gradient */
  color: #333333; /* Dark text for gold button */
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-access-link:hover {
  box-shadow: 0 6px 15px rgba(255, 204, 102, 0.4); /* Glow */
  transform: translateY(-2px);
}

/* Module 3: Brand Intro Section */
.page-index__brand-intro-section {
  padding: 40px 12px;
  background-color: var(--bg-color, #B71C1C);
}

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

.page-index__main-title {
  color: #F4D34D; /* Gold */
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size for H1 */
}

.page-index__intro-text {
  font-size: 1.1em;
  color: #FFF5E1; /* Text Main */
  max-width: 900px;
  margin: 0 auto;
  text-align: justify;
}

.page-index__intro-text a {
  color: #F4D34D; /* Gold */
  text-decoration: none;
  font-weight: bold;
}

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

/* Module 4: Category Lobby Section */
.page-index__category-lobby-section {
  padding: 40px 12px;
  background-color: var(--bg-color, #B71C1C);
}

.page-index__category-lobby-container {
  max-width: 1250px;
  margin: 0 auto;
  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;
}

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

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

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

/* Module 5: Blog Slider Section */
.page-index__blog-slider-section {
  padding: 40px 12px;
  background-color: var(--bg-color, #B71C1C);
}

.page-index__blog-slider-container {
  max-width: 1250px;
  margin: 0 auto;
  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;
  padding-bottom: 10px; /* For scrollbar visibility */
  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); /* 3 items with 16px gap */
  scroll-snap-align: start;
  background-color: #D32F2F; /* Card BG */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(255, 204, 102, 0.5); /* Glow */
}

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

.page-index__image-cover {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.page-index__post-content {
  padding: 15px;
  color: #FFF5E1; /* Text Main */
}

.page-index__post-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #F4D34D; /* Gold */
  margin-bottom: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-index__post-meta {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.page-index__post-date {
  font-size: 0.9em;
  color: #FFF5E1;
}

.page-index__post-excerpt {
  font-size: 0.95em;
  color: #FFF5E1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(201, 31, 23, 0.8); /* Primary color with opacity */
  color: #FFF5E1; /* Text Main */
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background-color: #E53935; /* Secondary color */
  transform: translateY(-50%) scale(1.1);
}

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

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

.page-index__arrow {
  font-size: 20px;
  line-height: 1;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-index__access-links-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items on tablet */
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
  .page-index__blog-slider-prev {
    left: 5px;
  }
  .page-index__blog-slider-next {
    right: 5px;
  }
}

@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: 15px;
  }

  .page-index__section-title,
  .page-index__section-subtitle {
    font-size: 1.8em;
  }

  /* Module 1: Hero Section */
  .page-index__hero-section {
    padding-left: 0;
    padding-right: 0;
  }
  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Module 2: Access Links Section */
  .page-index__access-links-section {
    padding: 20px 15px;
  }
  .page-index__access-links-container {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 10px;
    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;
  }

  /* Module 3: Brand Intro Section */
  .page-index__brand-intro-section {
    padding: 30px 15px;
  }
  .page-index__brand-intro-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__main-title {
    font-size: clamp(1.8em, 8vw, 2.5em);
  }
  .page-index__intro-text {
    font-size: 1em;
  }

  /* Module 4: Category Lobby Section */
  .page-index__category-lobby-section {
    padding: 30px 15px;
  }
  .page-index__category-lobby-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .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 Slider Section */
  .page-index__blog-slider-section {
    padding: 30px 15px;
  }
  .page-index__blog-slider-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-wrapper {
    margin-left: 15px;
    margin-right: 15px;
  }
  .page-index__blog-slider-track {
    gap: 10px;
  }
  .page-index__post-item {
    flex: 0 0 90%; /* Single item visible on mobile, with some padding */
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 16px;
    left: -10px;
    right: -10px;
  }
  .page-index__post-title {
    font-size: 1.1em;
  }
  .page-index__post-excerpt {
    font-size: 0.9em;
  }
  .page-index__post-date {
    font-size: 0.85em;
  }

  /* Ensure all images are responsive */
  .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;
  }
}