/* General styles for the page-index container */
.page-index {
  font-family: Arial, sans-serif;
  color: #FFF5E1; /* Text Main custom color */
  background-color: #B71C1C; /* Background custom color */
  line-height: 1.6;
}

.page-index__section-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 15px;
}

.page-index__section-title {
  font-size: 2.5em;
  color: #F4D34D; /* Gold custom color */
  margin-bottom: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  font-weight: bold;
}

.page-index__title-decoration {
  width: 80px;
  height: 4px;
  background: #F2B544; /* Border custom color */
  margin: 0 auto;
  border-radius: 2px;
}

/* 1. HERO Section */
.page-index__hero-section {
  padding-top: 10px; /* Important: small top padding, not --header-offset */
  width: 100%; 
  max-width: 100%; 
  overflow-x: hidden; 
  box-sizing: border-box;
}

.page-index__hero-image {
  position: relative;
  width: 100%;
  padding-bottom: 42.1875%; /* 810/1920 = 0.421875 for 1920x810 aspect ratio */
  overflow: hidden;
}

.page-index__hero-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Default to cover for desktop */
  display: block;
  border: none;
  box-shadow: none;
  filter: none; /* Ensure no filter is applied */
}

/* 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 12px; 
  box-sizing: border-box;
}

.page-index__btn-access-link {
  display: block;
  padding: 15px 25px;
  text-align: center;
  color: #FFF5E1; /* Text Main custom color */
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button custom color */
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #F2B544; /* Border custom color */
}

.page-index__btn-access-link:hover {
  box-shadow: 0 0 20px #FFCC66; /* Glow custom color */
  transform: translateY(-2px);
  color: #000000; /* Ensure text is visible on hover */
}

/* 3. Brand Intro */
.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-size: clamp(2em, 4vw, 3em); /* Use clamp for h1 font size */
  color: #F4D34D; /* Gold custom color */
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
  font-weight: 800;
  line-height: 1.2;
}

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

.page-index__intro-text a {
  color: #F4D34D; /* Gold custom color */
  text-decoration: underline;
}
.page-index__intro-text a:hover {
  color: #FFCC66; /* Glow custom color */
}

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

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

.page-index__category-card-link img {
  aspect-ratio: 1 / 1; /* Enforce square aspect ratio */
  width: 100%;
  height: auto;
  object-fit: contain; /* Ensure image content is fully visible */
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
  transition: transform 0.3s ease;
  filter: none; /* Ensure no filter is applied */
}

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

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

.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; /* For smooth scrolling on iOS */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  padding-bottom: 10px; /* Space for potential scrollbar */
}

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

.page-index__post-item { 
  flex: 0 0 calc(33.333% - 11px); /* 3 cards visible + 2 gaps */
  scroll-snap-align: start; 
  background: #D32F2F; /* Card BG custom color */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  border: 1px solid #7A0E0E; /* Deep Red custom color */
}

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

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

.page-index__image-cover {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: #333;
}

.page-index__image-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  box-shadow: none;
  filter: none; /* Ensure no filter is applied */
}

.page-index__post-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #FFF5E1; /* Text Main custom color */
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  z-index: 1;
}

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

.page-index__post-title {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: #F4D34D; /* Gold custom color */
  font-weight: bold;
}

.page-index__post-divider {
  border: 0;
  height: 1px;
  background: #F2B544; /* Border custom color */
  margin: 10px 0;
}

.page-index__post-excerpt {
  font-size: 0.9em;
  color: #FFF5E1; /* Text Main custom color */
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background: rgba(0, 0, 0, 0.6);
  color: #FFF5E1; /* Text Main custom color */
  border: none;
  padding: 10px 15px;
  font-size: 2em;
  cursor: pointer;
  z-index: 10;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 5px;
  transition: background-color 0.3s ease;
  user-select: none;
}

.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: rgba(0, 0, 0, 0.8);
}

/* --- Responsive Styles --- */
/* General mobile image and button adaptation */
@media (max-width: 768px) {
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__section, /* Generic section/container classes for mobile padding/width */
  .page-index__card,
  .page-index__container,
  .page-index__hero-section,
  .page-index__access-links,
  .page-index__brand-intro,
  .page-index__category-lobby,
  .page-index__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-index__cta-buttons,
  .page-index__button-group,
  .page-index__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }
}


/* 1. Banner responsive */
@media (max-width: 849px) {
  .page-index__hero-image img {
    object-fit: contain !important; 
    aspect-ratio: unset !important;
    max-height: none !important;
  }
  .page-index__hero-image {
    padding-bottom: unset; /* Remove fixed padding-bottom for mobile when using contain */
    height: auto; /* Allow height to adjust */
  }
}

/* 2. Access Links responsive */
@media (max-width: 768px) {
  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 20px 15px;
  }
  .page-index__btn-access-link {
    font-size: 1em;
    padding: 12px 20px;
  }
}

/* 3. Brand Intro responsive */
@media (max-width: 768px) {
  .page-index__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em); /* Adjust clamp for smaller screens */
    padding: 0 10px;
  }
  .page-index__intro-text {
    font-size: 1em;
    padding: 0 10px;
  }
}

/* 4. Category Lobby responsive */
@media (max-width: 768px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    gap: 10px;
  }
  .page-index__section-title {
    font-size: 2em;
  }
}
@media (max-width: 549px) {
  .page-index__category-lobby__grid {
    grid-template-columns: repeat(2, 1fr); /* Still 2 columns for very small screens */
  }
}

/* 5. Blog Slider responsive */
@media (max-width: 768px) {
  .page-index__blog-slider {
    margin: 40px auto;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    font-size: 1.5em;
    padding: 8px 12px;
  }
  .page-index__blog-slider-prev {
    left: 0; /* Adjust position for mobile */
  }
  .page-index__blog-slider-next {
    right: 0; /* Adjust position for mobile */
  }
  .page-index__blog-slider-track {
    padding-left: 5%; /* Adjust for centered card */
    padding-right: 5%;
    box-sizing: border-box;
  }
  .page-index__post-item {
    flex: 0 0 calc(90% - 16px); /* Roughly 1 card visible, with some peek of next */
    margin: 0 5%; /* Center the card */
  }
  .page-index__post-title {
    font-size: 1.1em;
  }
  .page-index__post-excerpt {
    font-size: 0.85em;
  }
}
@media (max-width: 480px) {
  .page-index__post-item {
    flex: 0 0 calc(100% - 16px); /* 1 card visible, no peek */
    margin: 0 8px;
  }
}