:root {
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --button-gradient: linear-gradient(180deg, #FFA53A 0%, #D96800 100%);
  --card-bg-color: #17191F;
  --background-color: #0D0E12;
  --text-main-color: #FFF3E6;
  --border-color: #A84F0C;
  --glow-color: #FFB04D;
  --deep-orange-color: #D96800;
}

.page-index {
  font-family: 'Arial', sans-serif;
  color: var(--text-main-color); /* Main text color for dark background */
  background-color: var(--background-color); /* This should be set on body in shared.css, but for safety. */
}

/* Module 1: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* As per fixed header rule, small top padding */
  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 */
.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;
  background: var(--button-gradient);
  color: #ffffff; /* Ensure white text on gradient button */
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1em;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  max-width: 100%; /* Button responsive rule */
  box-sizing: border-box; /* Button responsive rule */
  white-space: normal; /* Button responsive rule */
  word-wrap: break-word; /* Button responsive rule */
}

.page-index__btn-access-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3), 0 0 15px var(--glow-color);
}

/* Module 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, 2.8em); /* H1 font size rule */
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary-color); /* Using secondary color for H1 */
  margin-bottom: 15px;
  text-shadow: 0 0 8px rgba(255, 165, 58, 0.5);
}

.page-index__intro-text {
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--text-main-color);
  text-align: justify;
  margin-bottom: 30px;
}

.page-index__intro-text a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
}

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

/* Section Titles */
.page-index__section-title {
  text-align: center;
  font-size: clamp(1.8em, 3.5vw, 2.5em);
  font-weight: 600;
  color: var(--primary-color);
  margin: 40px auto 25px;
  position: relative;
  padding-bottom: 10px;
}

.page-index__section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--glow-color);
  margin: 10px auto 0;
  border-radius: 2px;
}


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

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

.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;
  transition: transform 0.2s ease;
}

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

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

/* Module 5: Blog Slider */
.page-index__blog-slider {
  max-width: 1250px;
  margin: 40px auto;
  padding: 20px 12px;
  box-sizing: border-box;
  position: relative;
}

.page-index__blog-slider-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background: var(--button-gradient);
  border: none;
  color: #ffffff;
  font-size: 2em;
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.3s ease;
  position: absolute; /* Position relative to slider container */
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-index__blog-slider-prev {
  left: -20px; /* Adjust as needed */
}

.page-index__blog-slider-next {
  right: -20px; /* Adjust as needed */
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: var(--deep-orange-color);
  transform: translateY(-50%) scale(1.1);
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px; /* For scrollbar visibility */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.page-index__blog-slider-track::-webkit-scrollbar {
  height: 8px;
}

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 10px;
}

.page-index__blog-slider-track::-webkit-scrollbar-track {
  background: var(--card-bg-color);
  border-radius: 10px;
}


.page-index__post-item {
  flex: 0 0 calc(33.333% - 11px); /* 3 items per row, accounting for gap */
  scroll-snap-align: start;
  background: var(--card-bg-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  max-width: 100%; /* Image responsive rule */
  box-sizing: border-box; /* Image responsive rule */
}

.page-index__post-item:hover {
  transform: translateY(-5px);
}

.page-index__image-cover {
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  overflow: hidden;
}

.page-index__image-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.page-index__post-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary-color);
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: bold;
  z-index: 2;
}

.page-index__post-title {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--secondary-color);
  line-height: 1.4;
}

.page-index__post-title a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
  max-width: 100%; /* Text inside link responsive rule */
  box-sizing: border-box; /* Text inside link responsive rule */
  white-space: normal; /* Text inside link responsive rule */
  word-wrap: break-word; /* Text inside link responsive rule */
}

.page-index__post-title a:hover {
  color: var(--glow-color);
  text-decoration: underline;
}

.page-index__post-summary {
  font-size: 0.95em;
  color: var(--text-main-color);
  line-height: 1.6;
}

.page-index__view-all-posts {
  text-align: center;
  margin-top: 30px;
}

.page-index__view-all-button {
  display: inline-block;
  padding: 12px 25px;
  background: var(--primary-color);
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
  max-width: 100%; /* Button responsive rule */
  box-sizing: border-box; /* Button responsive rule */
  white-space: normal; /* Button responsive rule */
  word-wrap: break-word; /* Button responsive rule */
}

.page-index__view-all-button:hover {
  background: var(--deep-orange-color);
  transform: translateY(-2px);
}

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

/* General container responsive rule */
.page-index__section,
.page-index__card,
.page-index__container,
.page-index__content-area,
.page-index__text-block {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__hero-section {
    padding-top: 10px;
  }
  .page-index__access-links {
    grid-template-columns: repeat(3, 1fr);
    padding: 25px 10px;
  }
  .page-index__btn-access-link {
    font-size: 1em;
    padding: 12px 15px;
  }
  .page-index__main-title {
    font-size: clamp(2em, 4.5vw, 2.5em);
  }
  .page-index__intro-text {
    font-size: 1em;
  }
  .page-index__section-title {
    font-size: clamp(1.6em, 3.8vw, 2.2em);
    margin: 30px auto 20px;
  }
  .page-index__category-lobby__grid {
    gap: 12px;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    font-size: 1.8em;
    padding: 8px 12px;
    width: 45px;
    height: 45px;
  }
  .page-index__blog-slider-prev {
    left: -15px;
  }
  .page-index__blog-slider-next {
    right: -15px;
  }
  .page-index__post-item {
    flex: 0 0 calc(50% - 8px); /* 2 items per row */
  }
  .page-index__post-title {
    font-size: 1.1em;
  }
}

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

@media (max-width: 768px) {
  /* General mobile styles */
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-index__hero-section {
    padding-top: 10px; /* Still 10px, as body has padding-top */
  }

  /* Access Links */
  .page-index__access-links {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 20px 15px;
    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: 1em;
  }

  /* Brand Intro */
  .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.2em); /* Adjusted for smaller screens */
  }
  .page-index__intro-text {
    font-size: 0.95em;
  }
  .page-index__section-title {
    font-size: clamp(1.5em, 6vw, 2em);
    margin: 25px auto 15px;
  }

  /* Category Lobby */
  .page-index__category-lobby {
    padding: 15px;
    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 on mobile */
    gap: 10px;
  }
  .page-index__category-card-link img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Blog Slider */
  .page-index__blog-slider {
    padding: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    font-size: 1.5em;
    padding: 5px 10px;
    width: 40px;
    height: 40px;
    top: calc(50% + 20px); /* Adjust position due to smaller height */
  }
  .page-index__blog-slider-prev {
    left: 0px; /* Adjust to be within padding */
  }
  .page-index__blog-slider-next {
    right: 0px; /* Adjust to be within padding */
  }
  .page-index__post-item {
    flex: 0 0 85%; /* Single item view with some peek of next/prev */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__image-cover img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__post-title {
    font-size: 1em;
  }
  .page-index__post-summary {
    font-size: 0.9em;
  }
  .page-index__view-all-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* General image responsive rule for all images within .page-index */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* General container responsive rule */
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__content-area,
  .page-index__text-block {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}