/* General styles for the main content area */
.page-index {
  font-family: 'Lato', sans-serif;
  color: #FFF3E6; /* Text Main */
  background-color: #0D0E12; /* Background */
  line-height: 1.6;
}

/* Module 0: Hero Section */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding as per instruction, not var(--header-offset) */
  max-width: 1200px; /* Constrain content width */
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden; /* Ensure no overflow */
}

.page-index__hero-image {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%; /* Ensure image responsiveness */
}

/* Module 1: Service Category 4-Grid */
.page-index__service-section {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 15px;
  box-sizing: border-box;
  overflow: hidden; /* Prevent horizontal scroll */
}

.page-index__service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* Desktop: 4 columns */
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.page-index__service-item {
  min-width: 0; /* Important for flex/grid items */
  background-color: #17191F; /* Card BG */
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-index__service-link {
  display: block;
  text-decoration: none;
}

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

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

/* Module 2: H1 + SEO Long Text Area */
.page-index__content-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 15px;
  box-sizing: border-box;
  overflow: hidden; /* Prevent horizontal scroll */
}

.page-index__page-title {
  text-align: center;
  color: #FFF3E6; /* Text Main */
  margin: 20px auto 30px;
  font-weight: 700;
  line-height: 1.2;
}

.page-index__home-content {
  color: #FFF3E6; /* Text Main */
  line-height: 1.7;
}

.page-index__home-content h2 {
  color: #FFA53A; /* Auxiliary color for headings */
  margin: 28px 0 12px;
  font-weight: 600;
  line-height: 1.3;
}

.page-index__home-content h3 {
  color: #FF8C1A; /* Main color for subheadings */
  margin: 20px 0 10px;
  font-weight: 500;
  line-height: 1.4;
}

.page-index__home-content p {
  margin-bottom: 15px;
}

.page-index__home-content ul,
.page-index__home-content ol {
  margin-bottom: 15px;
  padding-left: 20px;
}

.page-index__home-content li {
  margin-bottom: 8px;
}

.page-index__home-content a {
  color: #FFA53A; /* Auxiliary color for links */
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-index__home-content a:hover {
  color: #FFB04D; /* Glow color on hover */
  text-decoration: underline;
}

.page-index__home-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background-color: #17191F; /* Card BG */
  border: 1px solid #A84F0C; /* Border color */
  border-radius: 8px;
  overflow: hidden; /* Ensure rounded corners for table */
}

.page-index__home-content thead th {
  background-color: #D96800; /* Deep Orange */
  color: #FFF3E6; /* Text Main */
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #A84F0C; /* Border color */
}

.page-index__home-content tbody td {
  border: 1px solid #A84F0C; /* Border color */
  padding: 10px 15px;
  vertical-align: top;
  color: #FFF3E6; /* Text Main */
}

.page-index__home-content figure {
  margin: 20px 0;
  text-align: center;
}

.page-index__content-image img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.page-index__home-content figcaption {
  font-style: italic;
  color: #FFA53A;
  margin-top: 10px;
  font-size: 0.9em;
}

/* CTA Buttons */
.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 30px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background: linear-gradient(180deg, #FFA53A 0%, #D96800 100%); /* Button gradient */
  color: #ffffff; /* White text for contrast */
  text-decoration: none;
  border-radius: 25px;
  font-weight: 700;
  text-align: center;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
}

.page-index__btn-primary:hover {
  background: linear-gradient(180deg, #FFB04D 0%, #E07D00 100%); /* Slightly brighter on hover */
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 165, 58, 0.4);
}

/* Module 3 (Optional): Partner/Alliance Section */
.page-index__partner-section {
  max-width: 1200px;
  margin: 40px auto 60px;
  padding: 0 15px;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden; /* Prevent horizontal scroll */
}

.page-index__partner-title {
  color: #FFF3E6; /* Text Main */
  font-size: 2em;
  margin-bottom: 20px;
  font-weight: 600;
}

.page-index__partner-section p {
  color: #FFF3E6; /* Text Main */
  line-height: 1.6;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  .page-index {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Hero Section */
  .page-index__hero-section {
    padding-top: 10px; /* Consistent small top padding */
    padding-left: 0;
    padding-right: 0;
  }

  .page-index__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  /* Service Grid */
  .page-index__service-section {
    padding: 0 10px;
  }
  
  .page-index__service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Mobile: 2 columns */
    gap: 12px;
  }

  .page-index__service-item img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Long Text Area */
  .page-index__content-section {
    padding: 0 10px;
  }

  .page-index__page-title {
    font-size: 1.8em;
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 0 5px;
  }

  .page-index__home-content {
    padding: 0 5px;
  }

  .page-index__home-content h2 {
    font-size: 1.5em;
    margin-top: 20px;
    margin-bottom: 10px;
  }

  .page-index__home-content h3 {
    font-size: 1.2em;
    margin-top: 15px;
    margin-bottom: 8px;
  }

  .page-index__home-content table {
    display: block;
    overflow-x: auto !important; /* Allow horizontal scroll for tables */
    white-space: nowrap; /* Prevent content from wrapping */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
  }

  .page-index__home-content thead, 
  .page-index__home-content tbody, 
  .page-index__home-content th, 
  .page-index__home-content td, 
  .page-index__home-content tr {
    display: block; /* Make table cells stack */
    width: 100%; /* Take full width */
  }

  .page-index__home-content thead {
    display: none; /* Hide table header on mobile */
  }
  
  .page-index__home-content td {
    border: none; /* Remove borders between stacked cells */
    border-bottom: 1px solid #A84F0C; /* Add bottom border for separation */
    padding: 8px 10px;
    white-space: normal; /* Allow text in cells to wrap */
  }

  .page-index__home-content td:first-child {
    font-weight: bold;
    background-color: rgba(255, 165, 58, 0.1); /* Slight background for first column */
  }

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

  /* CTA Buttons */
  .page-index__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
    padding: 0 10px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .page-index__btn-primary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 15px; /* Adjust padding for mobile */
  }

  /* Partner Section */
  .page-index__partner-section {
    padding: 0 10px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .page-index__partner-title {
    font-size: 1.5em;
  }
  
  /* General image and container responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__content-section,
  .page-index__service-section,
  .page-index__partner-section,
  .page-index__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Crucial for preventing horizontal scroll */
    padding-left: 10px;
    padding-right: 10px;
  }
}