/* style/index.css */

/* General Page Styling */
.page-index {
  font-family: Arial, sans-serif;
  color: #333333; /* Default text color for light body background */
  background-color: #FFFFFF; /* Matches body background */
}

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

/* Hero Slider (Module 1) */
.page-index__hero-slider {
  position: relative;
  width: 100%;
  padding-top: 10px; /* Small top padding, body handles header offset */
  overflow: hidden;
  max-width: 1920px; /* Ensure it doesn't stretch excessively on very wide screens */
  margin: 0 auto;
  box-sizing: border-box;
}

.page-index__hero-slider-track {
  display: flex;
  width: 300%; /* For 3 slides */
  transition: transform 0.6s ease-in-out;
}

.page-index__hero-slider-slide {
  flex: 0 0 33.33%; /* Each slide takes 1/3 of the track */
  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);
}

.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;
  z-index: 10;
  font-size: 24px;
  border-radius: 4px;
  line-height: 1;
}

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

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

.page-index__hero-slider-dots {
  position: absolute;
  bottom: 15px;
  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: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
}

.page-index__hero-slider-dots button.is-active {
  background: #FFFFFF;
  border-color: #017439;
}

/* Promo Duo (Module 3) */
.page-index__promo-duo {
  max-width: 1250px;
  margin: 0 auto 30px 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 {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.page-index__promo-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  margin-top: auto; /* Push button to bottom */
  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-color: #a00606;
}

/* Decorative H1 (Module 4) */
.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;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
  /* No fixed font-size, rely on responsive scaling */
}

/* Long SEO Content (Module 5) */
.page-index__home-content {
  max-width: 900px;
  margin: 24px auto;
  height: 700px;
  padding: 10px;
  box-sizing: border-box;
  border: 5px solid #017439; /* Using brand color for border */
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(1, 116, 57, 0.4); /* Greenish shadow */
  background: rgba(255, 255, 255, 0.92); /* Slightly transparent white */
  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; /* Light blue/green for scrollbar thumb */
  border-radius: 20px;
  border: 3px solid #FFFFFF;
}

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

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

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

.page-index__home-content-inner ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 15px;
}

.page-index__home-content-inner ul li {
  margin-bottom: 5px;
  line-height: 1.5;
}

.page-index__home-content-inner figure {
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-index__home-content-inner figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

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

.page-index__home-content-inner table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
}

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

.page-index__home-content-inner th {
  background-color: #f5f5f5;
  font-weight: bold;
  color: #017439;
}

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

.page-index__blog-slider-title {
  text-align: center;
  color: #017439; /* Adjusting to brand color for better contrast on light background */
  text-transform: uppercase;
  margin-bottom: 25px;
  font-size: 28px;
}

.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;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
}

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

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

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

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

.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: 12px;
}

.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 titles */
  margin: 12px 8px 6px;
  font-size: 18px;
  line-height: 1.4;
  padding: 0 8px;
}

.page-index__post-item p {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 0 8px 15px;
  line-height: 1.5;
  height: 42px; /* Limit abstract to 2-3 lines */
  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;
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 24px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 20px;
  }
  .page-index__promo-duo-grid {
    gap: 15px;
  }
  .page-index__section-title h1 {
    font-size: clamp(24px, 4vw, 40px);
  }
  .page-index__home-content {
    height: 600px;
    margin: 20px auto;
    padding: 8px;
    border-width: 4px;
  }
  .page-index__home-content-inner {
    padding: 10px 14px;
  }
  .page-index__home-content-inner h2 {
    font-size: 22px;
  }
  .page-index__home-content-inner h3 {
    font-size: 18px;
  }
  .page-index__blog-slider-title {
    font-size: 24px;
  }
  .page-index__post-item {
    flex: 0 0 calc((100% - 30px) / 2); /* 2 cards on tablet */
  }
}

@media (max-width: 768px) {
  /* Hero Slider (Module 1) */
  .page-index__hero-slider {
    padding-top: 10px !important; /* Ensure small top padding */
    max-width: 100% !important;
    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 {
    padding: 5px 8px;
    font-size: 18px;
  }

  /* Promo Duo (Module 3) */
  .page-index__promo-duo {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box !important;
  }
  .page-index__promo-duo-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 15px;
  }
  .page-index__promo-duo-col img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__promo-cta {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    font-size: 16px;
    padding: 12px 15px;
  }

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

  /* Long SEO Content (Module 5) */
  .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 10px;
  }
  .page-index__home-content-inner h2 {
    font-size: 20px;
  }
  .page-index__home-content-inner h3 {
    font-size: 17px;
  }
  .page-index__home-content-inner p,
  .page-index__home-content-inner ul li {
    font-size: 15px;
  }
  .page-index__home-content-inner figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__home-content-inner table {
    display: block;
    overflow-x: auto; /* Enable horizontal scroll for tables */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__home-content-inner table th,
  .page-index__home-content-inner table td {
    padding: 8px;
    font-size: 14px;
  }

  /* Blog Card Slider (Module 6) */
  .page-index__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box !important;
  }
  .page-index__blog-slider-title {
    font-size: 22px;
  }
  .page-index__blog-slider-wrap {
    gap: 10px;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    padding: 8px 12px;
    font-size: 20px;
  }
  .page-index__post-item {
    flex: 0 0 100%; /* Single card on mobile */
  }
  .page-index__post-cover img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__post-item h5 {
    font-size: 16px;
  }
  .page-index__post-item p {
    font-size: 13px;
    height: auto; /* Allow more lines for abstract on mobile if needed */
    -webkit-line-clamp: unset;
  }

  /* General image and container responsiveness */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__promo-duo-col,
  .page-index__home-content-inner figure,
  .page-index__blog-slider-track {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-index__hero-slider-dots {
    bottom: 10px;
    gap: 5px;
  }
  .page-index__hero-slider-dots button {
    width: 8px;
    height: 8px;
  }
}