/* style/index.css */

/* Base styles for page-index */
.page-index {
  color: #333333; /* Default text color for light body background */
  background-color: #f5f5f5; /* Light background for main content */
}

/* Hero Slider (Module 1) */
.page-index__hero-slider {
  position: relative;
  width: 100%;
  padding-top: 10px;
  overflow: hidden;
  max-width: 1920px; /* Ensure it doesn't get too wide on very large screens */
  margin: 0 auto;
}

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

.page-index__hero-slider-slide {
  flex: 0 0 100%;
  width: 100%;
  display: none;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  overflow: hidden;
}

.page-index__hero-slider-slide.is-active {
  display: block;
}

.page-index__hero-slider-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 200px; /* Ensure images are not too small */
}

.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;
  line-height: 1;
  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;
}

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

.page-index__hero-slider-dots button.is-active {
  background: #fff;
}

/* Spacing (Module 2) */
.page-index__spacing {
  height: 30px;
  width: 100%;
}

/* Promo Duo (Module 3) */
.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;
  align-items: center;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 15px;
}

.page-index__promo-duo-col img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  margin-bottom: 15px;
  min-height: 200px; /* Ensure images are not too small */
}

.page-index__promo-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background: #C30808; /* Alert color for CTA */
  color: #FFFF00; /* Login/Register font color */
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  transition: background-color 0.3s ease;
}

.page-index__promo-cta:hover {
  background: #a00606;
}

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

.page-index__section-title h1 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #017439; /* Primary color for H1 */
  max-width: 900px;
  margin: 0 auto;
  /* No fixed font-size to avoid mobile overflow, rely on responsive scaling */
}

/* Home Content (Module 5) */
.page-index__home-content {
  max-width: 900px;
  margin: 24px auto;
  height: 700px;
  padding: 10px;
  box-sizing: border-box;
  border: 5px solid #FFFFFF;
  border-radius: 15px;
  box-shadow: 0 0 20px #FFFFFF;
  background: rgba(255, 255, 255, 0.92);
  color: #333333;
}

.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;
  border-radius: 20px;
  border: 3px solid #FFFFFF;
}

.page-index__home-content-inner h2 {
  color: #017439;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 24px;
  font-weight: 700;
}

.page-index__home-content-inner h3 {
  color: #017439;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 600;
}

.page-index__home-content-inner p {
  margin-bottom: 10px;
  line-height: 1.6;
}

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

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

.page-index__home-content-inner figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  min-height: 200px; /* Enforce minimum size */
}

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

.page-index__home-content-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.page-index__home-content-inner table th,
.page-index__home-content-inner table td {
  border: 1px solid #e0e0e0;
  padding: 10px;
  text-align: left;
}

.page-index__home-content-inner table th {
  background-color: #f0f0f0;
  font-weight: 600;
  color: #017439;
}

.page-index__quick-access-links {
  text-align: center;
  margin: 20px 0;
  font-size: 16px;
  font-weight: 600;
}

.page-index__quick-access-links a {
  color: #017439;
  text-decoration: none;
  margin: 0 8px;
}

.page-index__quick-access-links a:hover {
  text-decoration: underline;
}

/* Blog Slider (Module 6) */
.page-index__blog-slider { 
  max-width: 1250px; 
  margin: 30px auto; 
  padding: 0 16px; 
  box-sizing: border-box;
  color: #ffffff; /* Text color for blog section */
}

.page-index__blog-slider-title { 
  text-align: center; 
  color: #017439; /* Primary color for title */
  text-transform: uppercase; 
  margin-bottom: 25px;
  font-size: 28px;
  font-weight: 700;
}

.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: rgba(0,0,0,0.2);
  border-radius: 4px;
}

.page-index__post-item {
  flex: 0 0 calc((100% - 40px) / 3); 
  scroll-snap-align: start; 
  box-sizing: border-box;
  background: #ffffff; /* White background for blog cards */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.page-index__post-item a { 
  text-decoration: none; 
  color: #333333; /* Dark text for blog card content */
  display: block; 
}

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

.page-index__post-cover img {
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block;
  min-height: 200px; /* Enforce minimum size */
}

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

.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; /* Primary color for blog card titles */
  margin: 12px 8px 6px; 
  font-size: 18px;
  line-height: 1.3;
  min-height: 46px; /* Ensure consistent title height */
}

.page-index__post-item p { 
  text-align: center; 
  color: #666; 
  font-size: 14px; 
  margin: 0 8px 8px; 
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
  min-height: 40px; /* Ensure consistent summary height */
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  background: #017439;
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: #005a2d;
}

/* General image and button responsiveness */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
  box-sizing: border-box;
}

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

.page-index__table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
}

/* Media Queries for Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .page-index__hero-slider {
    padding-top: 10px !important;
    margin: 0;
  }

  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    font-size: 20px;
    padding: 8px 12px;
  }

  .page-index__promo-duo-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .page-index__promo-duo-col {
    padding: 10px;
  }

  .page-index__promo-duo-col img {
    margin-bottom: 10px;
  }

  .page-index__promo-cta {
    font-size: 16px;
    padding: 12px 15px;
  }

  .page-index__section-title {
    margin: 30px auto 20px auto;
    padding: 0 10px;
  }

  .page-index__section-title h1 {
    font-size: clamp(24px, 6vw, 36px); /* Responsive font size for H1 */
  }

  .page-index__home-content {
    height: 60vh;
    min-height: 420px;
    max-height: 560px;
    margin: 16px 12px;
    border-width: 3px;
    padding: 8px;
  }

  .page-index__home-content-inner {
    padding: 10px 12px;
  }

  .page-index__home-content-inner h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 12px;
  }

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

  .page-index__home-content-inner p,
  .page-index__home-content-inner ul,
  .page-index__home-content-inner ol {
    font-size: 15px;
  }

  .page-index__home-content-inner figure {
    margin: 15px auto;
  }

  .page-index__home-content-inner table th,
  .page-index__home-content-inner table td {
    padding: 8px;
    font-size: 13px;
  }

  .page-index__quick-access-links {
    font-size: 15px;
    margin: 15px 0;
  }

  .page-index__quick-access-links a {
    margin: 0 5px;
  }

  .page-index__blog-slider {
    padding: 0 10px;
    margin: 25px auto;
  }

  .page-index__blog-slider-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .page-index__blog-slider-track {
    gap: 15px;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 20px;
    padding: 0;
  }

  .page-index__post-item {
    flex: 0 0 100%;
  }

  .page-index__post-item h5 {
    font-size: 16px;
    min-height: auto;
  }

  .page-index__post-item p {
    font-size: 13px;
    min-height: auto;
    -webkit-line-clamp: 3; /* Allow more lines on mobile if needed */
  }

  /* General image responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* General container responsiveness */
  .page-index__hero-slider,
  .page-index__promo-duo,
  .page-index__section-title,
  .page-index__home-content,
  .page-index__blog-slider,
  .page-index__promo-duo-col {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Button responsiveness */
  .page-index__promo-cta,
  .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;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__promo-duo-grid {
    flex-direction: column !important;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Table responsiveness */
  .page-index__home-content-inner table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap; /* Prevent text wrapping in cells for better horizontal scroll */
  }

  .page-index__home-content-inner table thead,
  .page-index__home-content-inner table tbody,
  .page-index__home-content-inner table th,
  .page-index__home-content-inner table td,
  .page-index__home-content-inner table tr {
    display: block;
  }

  .page-index__home-content-inner table th,
  .page-index__home-content-inner table td {
    width: auto !important;
    text-align: left !important;
  }
}

/* General styles for good contrast */
.page-index h1, .page-index h2, .page-index h3, .page-index h4, .page-index h5, .page-index h6 {
  color: #017439; /* Primary color for headings */
}

.page-index__card {
  background: #ffffff;
  color: #333333;
  border: 1px solid #e0e0e0;
}

.page-index__dark-section {
  background: #017439;
  color: #ffffff;
}

.page-index__btn-primary {
  background: #017439;
  color: #ffffff;
  border: 2px solid transparent;
}

.page-index__btn-secondary {
  background: #ffffff;
  color: #017439;
  border: 2px solid #017439;
}