/* Main Content */
.index-main-content {
  animation: slideIn 1.5s ease-out;
  width: 72%;
  margin: 0 auto;
}

@media screen and (max-width: 480px) {
  .index-main-content {
    width: 100% !important;
  }
}

/* Hero – locked to 16:9 so images (3840×2160) are never cropped */

.s-hero {
  aspect-ratio: 16 / 9;
  width: 72%;                     /* 100% minus the original 14% margins on each side */
  margin-left: auto;
  margin-right: auto;
  max-height: 85vh;               /* safety cap so it never gets absurdly tall  */
  overflow: hidden;
  position: relative;
  background-color: #0000001a;
  margin-top: 8rem;
  margin-bottom: 6rem;
  box-sizing: border-box;
}

.s-hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 1s ease-in-out;
  opacity: 1;
}

/* hero content */
.hero-content {
  position: relative;
  font-family: var(--font-1);
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 20px;
  /* background-color: rgba(0, 0, 0, 0.411); */
}

.hero-content-box {
  position: absolute;
  bottom: 6%;
  right: 3%;
  color: rgb(0 0 0) !important;
  background-color: rgb(255 255 255 / 81%);
  padding: clamp(10px, 1.4vw, 20px);
  border-radius: 12px;
  /* scale with hero width instead of fixed px */
  width: clamp(180px, 24%, 330px);
  height: auto;                    /* let content dictate height */
}

.hero-box__description {
  margin: 0px;
  color: rgb(62 62 62) !important;
  font-size: clamp(12px, 1.55vw, 21px);
  letter-spacing: -0.3px;
  font-weight: 400;
  line-height: 1.3;
  word-spacing: 1px;
}

.hero-box__title {
  font-size: clamp(16px, 2.1vw, 30px) !important;
  font-weight: 600;
  line-height: 1.1;
  color: rgb(0, 0, 0);
  margin-bottom: 4px;
}

@media screen and (max-width: 900px) {
  .s-hero__bg {
    display: block;
    width: 100%;
    height: 100%;
    right: 0;
    bottom: auto;
    left: auto;
  }
  .hero-content-box {
    width: clamp(180px, 55%, 330px);
    left: auto;
    right: 3%;
  }
  .s-hero {
    width: 94%;
    margin-left: auto;
    margin-right: auto;
    /* aspect-ratio inherited; just reduce max-height on tablets */
    max-height: 70vh;
  }
}

@media screen and (max-width: 400px) {
  .hero-content-box {
    width: clamp(150px, 55%, 280px);
    left: auto;
    right: 3%;
  }
  .s-hero {
    width: 98%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Main Content */
.home_main_container {
  margin: auto;
}

/* Titles and Text */
#home_main_title {
  font-size: 2.9rem;
  font-weight: 500 !important;
  color: var(--color-1);
}

#home_main_description {
  font-size: 2rem;
}

.home_main_feature_list_title {
  font-weight: 500;
  color: var(--color-1);
}

.home_main_features {
  margin-bottom: 48px;
  padding-left: 20px;
  list-style-type: disc;
}

.home_main_feature_item {
  margin-bottom: 10px;
  font-size: 1.9rem;
  line-height: 1.6;
  text-align: justify;
}

/* Image Grid layout */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-items: center;
  justify-content: center;
  align-items: start;
  margin: 0 auto;
  max-width: 75vw;
  column-gap: 48px;
  row-gap: 40px;
}

/* 5th card spans both columns and centres itself */
.challenge-card:nth-child(5) {
  grid-column: 1 / -1;
  width: calc(50% - 24px); /* same width as a single column card */
  margin: 0 auto;
}

@media (max-width: 768px) {
  .challenges-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 90vw;
  }
}

@media (max-width: 480px) {
  .challenges-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  /* let all cards flow naturally in single-column layout */
  .challenge-card:nth-child(5) {
    grid-column: auto;
    width: 100%;
    margin: 0;
  }
}

/* Individual challenge card */
.challenge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

/* Challenge image */
.challenge-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin: 0;
  border-radius: 8px;
  display: block;
}

/* Challenge caption */
.challenge-caption {
  font-weight: 500;
  font-size: 1.8rem;
  margin: 0px;
  color: var(--color-1);
}

/* Challenge description */
.challenge-detail {
  font-size: 16px;
  color: #666;
  text-align: center;
  line-height: 1.4;
}

/* License */
.home_main_license_title {
  font-size: 2.1rem;
  color: var(--color-1);
  margin-top: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  font-size: 23px;
}
.home_main_license_description {
  margin-bottom: 50px;
  font-size: 1.9rem;
  text-align: justify;
}

/* Citation */
#home_main_citation_section {
  margin-top: 40px;
  margin-bottom: 40px;
}
.home_main_citation_title {
  color: var(--color-1);
  font-weight: 600;
  margin-bottom: 6px;
}
#home_main_citation_section > p {
  font-size: 1.9rem;
  margin-bottom: 8px;
}
.home_citation_text {
  background-color: #d1cbcb;
  padding: 15px;
  margin: 10px 0 0;
  border-left: 4px solid #60605c;
  font-style: italic;
  color: rgb(44, 43, 43);
  font-size: 1.9rem;
}

/* Terms of Use */
#home_main_terms_section {
  margin-top: 40px;
  margin-bottom: 40px;
}
.home_main_terms_title {
  color: var(--color-1);
  font-weight: 600;
  margin-bottom: 6px;
}
#home_main_terms_section > p {
  font-size: 1.9rem;
  margin-bottom: 8px;
}
.home_terms_list {
  padding-left: 1.25rem;
  list-style: disc;
  font-size: 1.9rem;
  line-height: 1.8;
}

/* Contact */
#home_main_contact_section {
  margin-top: 40px;
  margin-bottom: 60px;
}
.home_main_contact_title {
  color: var(--color-1);
  font-weight: 600;
  margin-bottom: 6px;
}
.home_main_contact_text {
  font-size: 1.9rem;
  margin-bottom: 12px;
}
.home_contact_card {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background-color: #f5f4f4;
  border-left: 4px solid rgb(0, 150, 130);
  padding: 14px 20px;
  border-radius: 0 6px 6px 0;
}
.home_contact_name {
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--color-1);
}
.home_contact_role {
  font-size: 1.7rem;
  color: rgb(80, 80, 80);
}
.home_contact_email {
  font-size: 1.8rem;
  color: rgb(0, 150, 130) !important;
  text-decoration: none;
  margin-top: 4px;
  transition: opacity 0.2s ease;
}
.home_contact_email:hover {
  opacity: 0.75;
}

/* --------------------------
  Mobile view overrides
  Targets small phones (≤480px)
--------------------------- */
@media (max-width: 480px) {
  .index-main-content {
    width: 100% !important;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;
  }

  .home_main_container {
    padding: 0 12px;
  }

  .s-hero {
    margin-top: 8rem;
    width: 98%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.5rem;
    /* keep 16:9 ratio; cap on small screens */
    max-height: 75vh;
  }

  .s-hero__bg {
    background-size: cover;
    background-position: center center;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
  }

  .hero-content-box {
    position: absolute;
    bottom: 6%;
    left: auto;
    right: 3%;
    width: clamp(150px, 55%, 280px);
    height: auto;
    padding: 18px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.92);
  }

  .hero-box__title {
    font-size: clamp(16px, 2.1vw, 30px) !important;
    line-height: 1.1;
    margin-bottom: 4px;
  }

  .hero-box__description {
    font-size: clamp(12px, 1.55vw, 21px);
    line-height: 1.3;
    margin: 0;
  }

  #home_main_title {
    font-size: 2rem;
  }
  #home_main_description {
    font-size: 1.4rem;
    line-height: 2;
  }

  .home_main_feature_item {
    font-size: 1.5rem;
    line-height: 1.9;
    text-align: justify;
  }
  .home_main_features {
    padding-left: 18px;
    margin-bottom: 28px;
    padding-right: 10px;
  }

  .challenges-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 4px;
    width: 100%;
  }

  .challenge-card {
    max-width: none;
    width: 100%;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
  }

  .challenge-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    display: block;
  }

  .challenge-caption {
    font-size: 1.6rem;
    margin-top: 10px;
  }

  .challenge-detail {
    font-size: 1.2rem;
    padding: 6px 12px 0 12px;
  }

  .home_main_license_title {
    font-size: 1.8rem;
  }
  .home_main_license_description {
    font-size: 1.4rem;
    margin-bottom: 28px;
    text-align: justify;
    line-height: 1.9;
  }

  /* Reduce hero cap for very short screens */
  @media (max-height: 640px) {
    .s-hero {
      max-height: 60vh;
    }
    .hero-content-box {
      padding: 14px;
    }
  }

  /* Accessibility: bigger hit area for clickable cards */
  .challenge-card,
  .challenge-card > .challenge-caption {
    touch-action: manipulation;
  }
}
