/* style/index.css */

/* General body and content area styling for contrast */
.page-index {
  color: #333333; /* Default text color for light backgrounds */
  background: #FFFFFF; /* Ensure content area has a clear background */
}

.page-index__spacing-medium {
  margin-bottom: 30px;
}

/* Module 1: Hero Slider */
.page-index__hero-slider {
  position: relative;
  width: 100%;
  padding-top: 10px; /* Small top padding, body handles header offset */
  overflow: hidden;
  max-width: 100%; /* Ensure no overflow */
  box-sizing: border-box;
}

.page-index__hero-slider-track {
  display: flex;
  width: 100%;
  height: auto;
  transition: transform 0.6s ease-in-out;
}

.page-index__hero-slider-slide {
  flex: 0 0 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.page-index__hero-slider-slide.is-active {
  opacity: 1;
}

.page-index__hero-slider-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  max-width: 100%; /* Ensure images are responsive */
  box-sizing: border-box;
}

.page-index__hero-slider-prev,
.page-index__hero-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 24px;
  border-radius: 4px;
  z-index: 10;
}

.page-index__hero-slider-prev { left: 10px; }
.page-index__hero-slider-next { right: 10px; }

.page-index__hero-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.page-index__hero-slider-dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.page-index__hero-slider-dot.is-active { background: #FFFFFF; }

/* Module 3: Promo Duo */
.page-index__promo-duo {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.page-index__promo-duo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.page-index__promo-duo-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.page-index__promo-duo-col img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__promo-cta--alert {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background: #C30808; /* Custom color for register/login */
  color: #FFFF00; /* Custom font color for register/login */
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__promo-cta--alert:hover {
  opacity: 0.9;
}

/* Module 4: Decorative H1 */
.page-index__section-title {
  text-align: center;
  margin: 30px auto;
  max-width: 1250px;
  padding: 0 16px;
  box-sizing: border-box;
}

.page-index__section-title h1 {
  color: #017439; /* Brand color for H1 */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 100%;
  margin: 0;
}

/* Module 5: Long SEO Content (Scrolling Box) */
.page-index__home-content {
  max-width: 900px;
  margin: 24px auto;
  height: 700px; /* Fixed height for desktop */
  padding: 10px;
  box-sizing: border-box;
  border: 5px solid #FFFFFF; /* Auxiliary color for border */
  border-radius: 15px;
  box-shadow: 0 0 20px #FFFFFF; /* Auxiliary color for shadow */
  background: rgba(255, 255, 255, 0.92); /* Slightly transparent white background */
  color: #333333; /* Dark text for light background */
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
  text-align: justify;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.page-index__home-content-inner::-webkit-scrollbar {
  width: 10px;
}

.page-index__home-content-inner::-webkit-scrollbar-thumb {
  background-color: #4C9BB6; /* Light blue-green for scrollbar thumb */
  border-radius: 20px;
  border: 3px solid #FFFFFF;
}

.page-index__home-content-inner h2 {
  color: #017439; /* Brand color for H2 */
  margin-top: 25px;
  margin-bottom: 15px;
}

.page-index__home-content-inner h3 {
  color: #017439; /* Brand color for H3 */
  margin-top: 20px;
  margin-bottom: 10px;
}

.page-index__home-content-inner figure {
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
}

.page-index__home-content-inner figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__home-content-inner figcaption {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

.page-index__home-content-inner p,
.page-index__home-content-inner ul,
.page-index__home-content-inner ol {
  line-height: 1.7;
  margin-bottom: 10px;
}

.page-index__home-content-inner a {
  color: #017439;
  text-decoration: underline;
}

.page-index__home-content-inner a:hover {
  opacity: 0.8;
}

.page-index__table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
}

.page-index__content-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  min-width: 600px; /* Ensure table is wide enough for content */
}

.page-index__content-table th,
.page-index__content-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.page-index__content-table th {
  background-color: #f2f2f2;
  font-weight: bold;
  color: #333333;
}

/* Module 6: Latest Articles · Blog Card Slider */
.page-index__blog-slider {
  max-width: 1250px;
  margin: 30px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.page-index__blog-slider-title {
  text-align: center;
  color: #017439; /* Brand color for title */
  text-transform: uppercase;
  margin-bottom: 25px;
}

.page-index__blog-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px; /* Space for scrollbar */
}

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

.page-index__blog-slider-track::-webkit-scrollbar-thumb {
  background-color: #017439; /* Brand color for scrollbar thumb */
  border-radius: 10px;
}

.page-index__post-item {
  flex: 0 0 calc((100% - 40px) / 3); /* 3 items with 20px gap */
  scroll-snap-align: start;
  box-sizing: border-box;
  background: #ffffff; /* White background for card */
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

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

.page-index__post-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Fixed 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 4px;
}

.page-index__post-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}

.page-index__post-date {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: #fff;
  border: 2px solid #017439; /* Brand color border */
  border-radius: 2px;
  padding: 4px 8px;
  text-align: center;
  line-height: 1.2;
  color: #017439; /* Brand color text */
  font-size: 11px;
}

.page-index__post-date-day {
  display: block;
  font-weight: 700;
  font-size: 16px;
}

.page-index__post-date-month {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
}

.page-index__post-item h5 {
  text-align: center;
  color: #017439; /* Brand color for blog title */
  margin: 12px 8px 6px;
  font-size: 16px;
  line-height: 1.4;
}

.page-index__post-item p {
  text-align: center;
  color: #666; /* Dark grey for summary */
  font-size: 14px;
  margin: 0 8px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background: #017439; /* Brand color for buttons */
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 5;
}

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

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

/* Generic Image Responsive Styles */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
  box-sizing: border-box;
}

/* Generic Button Responsive Styles */
.page-index a[class*="cta"],
.page-index a[class*="btn"] {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

/* @media (max-width: 768px) styles */

/* Module 1: Hero Slider - Mobile */
@media (max-width: 768px) {
  .page-index__hero-slider {
    padding-top: 10px !important; /* Ensure small padding, not header offset */
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__hero-slider-slide img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__hero-slider-prev, .page-index__hero-slider-next {
    font-size: 20px;
    padding: 8px 12px;
  }
  .page-index__hero-slider-prev { left: 5px; }
  .page-index__hero-slider-next { right: 5px; }
}

/* Module 3: Promo Duo - Mobile */
@media (max-width: 768px) {
  .page-index__promo-duo {
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__promo-duo-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .page-index__promo-duo-col img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__promo-cta--alert {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Module 4: Decorative H1 - Mobile */
@media (max-width: 768px) {
  .page-index__section-title {
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__section-title h1 {
    font-size: clamp(24px, 6vw, 36px); /* Clamp font size for H1 */
  }
}

/* Module 5: Long SEO Content (Scrolling Box) - Mobile */
@media (max-width: 768px) {
  .page-index__home-content {
    height: 60vh; /* Responsive height for mobile */
    min-height: 420px;
    max-height: 560px;
    margin: 16px 12px;
    border-width: 3px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__home-content-inner {
    padding: 10px 12px;
  }
  .page-index__home-content-inner h2 {
    font-size: 20px;
  }
  .page-index__home-content-inner h3 {
    font-size: 18px;
  }
  .page-index__home-content-inner figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__table-wrapper {
    overflow-x: auto;
  }
  .page-index__content-table {
    display: block;
    min-width: 500px; /* Ensure table is still scrollable */
  }
}

/* Module 6: Latest Articles · Blog Card Slider - Mobile */
@media (max-width: 768px) {
  .page-index__blog-slider {
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-wrap {
    flex-wrap: nowrap; /* Keep it a slider on mobile */
  }
  .page-index__blog-slider-track {
    gap: 15px;
    padding-bottom: 5px;
  }
  .page-index__post-item {
    flex: 0 0 100%; /* Single item per view on mobile */
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__post-cover img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    font-size: 18px;
    padding: 6px 10px;
    top: calc(50% - 15px); /* Adjust position for smaller buttons */
  }
  .page-index__blog-slider-prev { left: -10px; }
  .page-index__blog-slider-next { right: -10px; }
}

/* General Image and Container Responsive Styles - Mobile */
@media (max-width: 768px) {
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-index__section,
  .page-index__container,
  .page-index__card,
  .page-index__text-block {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* General Button Responsive Styles - Mobile */
@media (max-width: 768px) {
  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"],
  .page-index__promo-cta--alert {
    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;
  }
  .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;
    display: flex; /* Ensure flex context for wrap */
    flex-direction: column; /* Often better for multiple buttons on mobile */
  }
}