/* Home page mobile/tablet corrections for three sections:
   Our Programmes, How We Help, and "Your Story Matters. Let Us Hear From You".
   Desktop (>=1025px) is untouched. Uses the existing spacing tokens. */

@media (max-width: 1024px) {
  /* ---------- Our Programmes ---------- */

  /* Root cause of the misplaced look: these headings are flex containers, so
     their text is an anonymous flex item that justify-content alone does not
     centre reliably, and the wrapper had no padding/gutters of its own. */
  .hero_programmes,
  .hero_programmes4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    margin-left: 0;
    margin-right: 0;
  }

  .hero_programmes h1,
  .hero_programmes_create,
  .hero_programmes4 h3 {
    display: block;
    text-align: center;
    margin-left: 0;
    margin-right: 0;
  }

  .hero_programmes_create {
    font-size: 1.6rem;
    line-height: var(--line-height-heading);
    margin-bottom: var(--space-3);
  }

  .hero_programmes4 h3 {
    font-size: var(--font-size-body);
    line-height: var(--line-height-base);
    max-width: 60ch;
    margin: 0 auto;
  }

  /* Card content stays inside the card at every phone width */
  .hero_programmes_3 h1 {
    width: auto;
    max-width: 100%;
    justify-content: center;
    gap: var(--space-2);
  }

  .hero_programmes_p2,
  .hero_programmes_emp_p1,
  .hero_programmes_com_p1,
  .youths2 {
    width: auto;
    max-width: 100%;
  }

  /* ---------- How We Help ---------- */

  /* Root cause: .hero_help_p was a fixed 500px-wide flex box pushed 370px to
     the right with left-aligned text, so on phones it overflowed the page and
     read as misaligned. */
  .hero_help_p {
    display: block;
    width: auto;
    max-width: 60ch;
    margin: 0 auto;
    padding: 0 var(--space-4);
    text-align: center;
    line-height: var(--line-height-base);
  }

  .hero_help_p h4 {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    margin: 0;
    line-height: var(--line-height-base);
  }

  .hero_help_h1 {
    display: block;
    text-align: center;
    margin-left: var(--space-4);
    margin-right: var(--space-4);
    padding: var(--space-5) var(--space-4);
  }

  .hero_help_listen {
    text-align: center;
    margin: var(--space-4) auto;
    padding: 0 var(--space-4);
    max-width: 40ch;
  }

  .hero_listen {
    margin: var(--space-5) var(--space-4);
    gap: var(--space-4);
  }

  .hero_listen1,
  .hero_listen2,
  .hero_listen3 {
    margin-right: 0;
    margin-left: 0;
    padding: var(--space-4);
  }

  .hero_listen p {
    margin: 0;
    line-height: var(--line-height-base);
  }

  /* ---------- Your Story Matters ---------- */

  .hero_matters {
    display: block;
    text-align: center;
    padding: 0 var(--space-4);
  }

  .hero_matters h2 {
    font-size: 1.5rem;
    line-height: var(--line-height-heading);
    margin: 0 0 var(--space-4);
  }
}

/* Buttons stack vertically on phones; tablet/desktop keep the row */
@media (max-width: 640px) {
  .hero_button {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: var(--space-3);
    padding: 0 var(--space-4);
  }

  .hero_button .hero_btn1,
  .hero_button .hero_btn2 {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-body);
    text-align: center;
    white-space: normal;
  }
}