/* style/index.css */

/* Base Styles for page-index */
.page-index {
  color: #333333; /* Dark text for light body background */
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

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

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

.page-index__hero-slider-slide {
  flex: 0 0 100%;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s 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 responsiveness */
}

.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;
  line-height: 1;
  border-radius: 4px;
}

.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 > * {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

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

/* Module 2: Spacing */
.page-index__spacing-30 {
  height: 30px;
  margin: 0 auto;
  max-width: 1250px;
}

/* Module 3: Dual-column Promo Duo */
.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 {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

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

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

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

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

.page-index__main-title {
  font-size: clamp(2em, 4vw, 2.8em); /* Responsive font size for H1 */
  font-weight: 700;
  line-height: 1.2;
  color: #26A9E0;
  margin: 0;
  text-transform: uppercase;
}

/* Module 5: Long SEO Content */
.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 rgba(0,0,0,0.1);
  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 {
  font-size: 1.8em;
  color: #26A9E0;
  margin-top: 25px;
  margin-bottom: 15px;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
}

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

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

.page-index__home-content-inner ul {
  list-style: disc inside;
  margin-bottom: 10px;
  padding-left: 20px;
}

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

.page-index__home-content-inner a {
  color: #26A9E0;
  text-decoration: none;
}

.page-index__home-content-inner a:hover {
  text-decoration: underline;
}

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

.page-index__home-content-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  max-width: 100%;
}

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

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

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

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

.page-index__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: #26A9E0;
  text-transform: uppercase;
  font-size: 2em;
  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;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

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

.page-index__post-item {
  flex: 0 0 calc((100% - 40px) / 3); /* 3 cards desktop */
  scroll-snap-align: start;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  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.15);
}

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

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

.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 #26A9E0;
  border-radius: 2px;
  padding: 4px 8px;
  text-align: center;
  line-height: 1.2;
  color: #26A9E0;
  font-weight: bold;
  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-title {
  text-align: center;
  color: #26A9E0;
  margin: 12px 8px 6px;
  font-size: 1.2em;
  line-height: 1.3;
}

.page-index__post-summary {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 0 15px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}

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

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: #1e87b7;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__promo-duo-grid {
    gap: 15px;
  }
  .page-index__promo-cta {
    font-size: 16px;
    padding: 12px 15px;
  }
  .page-index__main-title {
    font-size: clamp(1.8em, 4.5vw, 2.5em);
  }
  .page-index__home-content {
    height: 600px;
  }
  .page-index__home-content-inner h2 {
    font-size: 1.6em;
  }
  .page-index__home-content-inner h3 {
    font-size: 1.3em;
  }
  .page-index__post-item {
    flex: 0 0 calc((100% - 30px) / 2); /* 2 cards tablet */
  }
}

@media (max-width: 768px) {
  /* Generic mobile image and container rules */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__hero-slider,
  .page-index__promo-duo,
  .page-index__section-title,
  .page-index__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Module 1: Hero Slider mobile */
  .page-index__hero-slider {
    padding-top: 10px !important;
    margin-bottom: 20px;
  }
  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 20px;
  }

  /* Module 3: Dual-column Promo Duo mobile */
  .page-index__promo-duo-grid {
    grid-template-columns: 1fr; /* Single column */
    gap: 15px;
  }
  .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;
  }

  /* Module 4: Decorative Main Title mobile */
  .page-index__main-title {
    font-size: clamp(1.5em, 6vw, 2em);
    margin: 20px auto;
  }

  /* Module 5: Long SEO Content mobile */
  .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: calc(100% - 24px) !important; /* Account for margin */
  }
  .page-index__home-content-inner {
    padding: 10px;
  }
  .page-index__home-content-inner h2 {
    font-size: 1.5em;
  }
  .page-index__home-content-inner h3 {
    font-size: 1.2em;
  }
  .page-index__table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .page-index__table {
    min-width: 500px; /* Ensure table content is readable */
  }

  /* Module 6: Latest Articles · Blog Card Slider mobile */
  .page-index__blog-slider-title {
    font-size: 1.5em;
    margin-bottom: 20px;
  }
  .page-index__blog-slider-wrap {
    gap: 10px;
  }
  .page-index__post-item {
    flex: 0 0 100%; /* Single card mobile */
    margin-bottom: 10px;
  }
  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}