/* Home page corrections: "We are Here to Hear From You" text centring,
   Contact section (social icons + card column), Footer, and the Youth
   Empowerment card heading size. */

/* ---- Contact social icons (all viewports: icon sizing is presentation) ---- */
.social {
  flex-wrap: wrap;
  gap: var(--space-4);
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: var(--color-primary);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}

.social a:hover {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary);
}

.social a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.social a img {
  width: 24px;
  height: 24px;
  display: block;
}

/* ---- Stage 4: Youth Empowerment heading only ----
   Root cause: .you h1 had no rule at all, so it inherited the browser default
   h1 size (~2em / 32px) inside a 500px-wide flex row, which is larger than
   the other programme card headings and made the heading wrap/overflow. Only
   the heading size is changed; the card keeps its original layout. */
.you h1 {
  width: auto;
  max-width: 100%;
  font-size: 1.5rem;
  line-height: var(--line-height-heading);
}

/* The Youth card image had no sizing rule, so it rendered at its intrinsic
   size and dominated the card. Match the 50px icon size used by the sibling
   programme cards so the composition matches. */
.you img {
  width: auto;
  height: 50px;
  max-width: 100%;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
}

@media (max-width: 1024px) {
  /* ---- Stage 1: We are Here to Hear From You ----
     Root cause: .contact_p had margin-left/right: 250px on top of a
     max-width of 650px, so its box was shoved to the right and clipped on
     phones. Centred with auto margins instead of positional offsets. */
  .contact_p {
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--space-4);
    margin-bottom: var(--space-6);
    max-width: 60ch;
    padding: 0 var(--space-4);
    text-align: center;
    line-height: var(--line-height-base);
    font-weight: var(--font-weight-regular);
  }

  /* ---- Stage 2: Contact cards in a column ---- */
  .contact-section {
    padding: var(--space-6) var(--space-4);
    margin-left: var(--space-4);
    margin-right: var(--space-4);
  }

  .contact-details {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
  }

  .contact-box1,
  .contact-box2,
  .contact-box3 {
    /* Equal external size for all three cards: the second card holds much
       less text, so without a shared min-height and centring it collapses and
       looks unbalanced next to its siblings. */
    width: 100%;
    max-width: 320px;
    min-height: 160px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4);
    line-height: var(--line-height-base);
    overflow-wrap: break-word;
  }

  .contact-box1 h3,
  .contact-box2 h3,
  .contact-box3 h3 {
    margin: 0 0 var(--space-2);
  }

  .contact-box1 p,
  .contact-box2 p,
  .contact-box3 p {
    margin: 0;
  }

  .social-media {
    margin-top: var(--space-6);
  }

  .social-media h2 {
    padding: var(--space-3) 0;
  }

  /* ---- Stage 3: Footer ---- */
  footer {
    padding: var(--space-6) var(--space-4);
  }

  .foot h1 {
    font-size: 1.25rem;
    margin: 0 0 var(--space-2);
  }

  .foot h3 {
    font-size: var(--font-size-body);
    margin: 0;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    padding: 0 var(--space-4);
  }

  .footer-links a {
    margin: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-align: center;
  }

  .footer-links a:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
  }

  .p-foot {
    font-size: var(--font-size-small);
    padding: var(--space-4);
    text-align: center;
    line-height: var(--line-height-base);
  }

  .btn {
    right: var(--space-4);
    bottom: var(--space-4);
    width: 44px;
    height: 44px;
  }

  .button_info .button {
    min-height: 44px;
  }
}