/* =========================================================
   Responsive/mobile repair layer
   Keeps the original visual design while fixing viewport,
   sizing, overflow, navigation and mobile spacing.
   ========================================================= */

html,
body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-width: 0;
}

header,
main,
footer,
section,
nav,
article,
div,
form,
figure {
  min-width: 0;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

button,
input,
textarea,
select {
  max-width: 100%;
  font: inherit;
}

header {
  width: 100%;
  position: relative;
  z-index: 100;
}

.nav {
  width: 100%;
  max-width: 1500px;
  min-width: 0;
  position: relative;
}

.brand {
  min-width: 0;
  max-width: calc(100% - 64px);
}

.brand > span:last-child {
  min-width: 0;
}

.links {
  min-width: 0;
}

.hero,
.page-hero,
.founder,
.split,
.timeline,
.program,
.editorial,
.contact-page,
.cta,
.partner-box,
.story-callout,
footer {
  width: 100%;
  max-width: 100%;
}

.heroText {
  width: min(690px, 86%);
  max-width: 690px;
}

.heroText p,
.page-hero p {
  max-width: 100%;
}

.cards article,
.news article,
.valuegrid article,
.testimonial-card,
.wallet,
.formbox,
.quote-card,
.editorial-card {
  min-width: 0;
  max-width: 100%;
}

.cards p,
.news p,
.valuegrid p,
.testimonial-card blockquote,
.contact-cards span,
.wallet .address {
  overflow-wrap: anywhere;
}

.formbox input,
.formbox textarea,
.formbox select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.formbox textarea {
  resize: vertical;
}

/* Tablet */
@media (max-width: 1050px) {
  section {
    padding-left: clamp(24px, 5vw, 7%);
    padding-right: clamp(24px, 5vw, 7%);
  }

  .nav {
    padding-left: 24px;
    padding-right: 24px;
  }

  .links {
    gap: 14px;
  }

  .heroText {
    left: 6%;
    width: min(650px, 88%);
  }

  .page-hero {
    padding-left: 6%;
    padding-right: 6%;
  }
}

/* Mobile navigation and layout */
@media (max-width: 900px) {
  .nav {
    height: 76px;
    padding: 0 20px;
  }

  .menu {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    border-radius: 8px;
  }

  .menu:focus-visible {
    outline: 2px solid var(--gold2);
    outline-offset: 3px;
  }

  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    padding: 14px 20px 20px;
    margin: 0;
    background: var(--navy);
    border-top: 1px solid rgba(215, 168, 60, .35);
    box-shadow: 0 18px 30px rgba(0,0,0,.18);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    z-index: 200;
  }

  .links.open {
    display: flex;
  }

  .links a,
  .links .donate {
    width: 100%;
    display: block;
    padding: 13px 14px !important;
    border-radius: 8px !important;
    border-bottom: 0 !important;
  }

  .links a:hover,
  .links .active {
    background: rgba(255,255,255,.07);
  }

  .links .donate {
    text-align: center;
    margin-top: 7px;
  }

  .hero {
    height: min(650px, calc(100svh - 76px));
    min-height: 560px;
  }

  .heroText {
    left: 6%;
    right: 6%;
    width: auto;
    max-width: 700px;
  }

  .hero h1 {
    font-size: clamp(44px, 7vw, 60px);
  }

  .hero p {
    font-size: clamp(14px, 2vw, 17px);
  }

  .arrows {
    right: 18px;
  }

  .page-hero {
    min-height: auto;
    padding-top: 56px;
    padding-bottom: 56px;
    grid-template-columns: 1fr;
  }

  .page-hero h1 {
    font-size: clamp(48px, 8vw, 64px);
  }

  .page-hero img {
    height: auto;
    max-height: 360px;
  }

  .founder,
  .split,
  .timeline,
  .program,
  .editorial,
  .contact-page {
    grid-template-columns: 1fr;
  }

  .founder {
    gap: 28px;
  }

  .founder > img {
    width: min(100%, 380px);
    height: auto;
    aspect-ratio: 4 / 3;
    margin-inline: auto;
  }

  .founder blockquote {
    grid-column: auto;
    margin: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats div {
    min-width: 0;
  }

  .newsgrid,
  .walletgrid {
    grid-template-columns: 1fr;
  }

  .cta,
  .partner-box,
  .story-callout {
    display: block;
  }

  .cta .btn,
  .partner-box .btn,
  .story-callout .btn {
    display: inline-block;
    margin-top: 15px;
  }

  footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones */
@media (max-width: 600px) {
  .nav {
    height: 68px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand {
    gap: 9px;
    font-size: 13px;
    letter-spacing: .7px;
  }

  .brand b {
    font-size: 7px;
    letter-spacing: 2.5px;
  }

  .brand .mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-size: 18px;
  }

  .menu {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .links {
    padding: 12px 16px 18px;
  }

  section {
    padding-top: 56px;
    padding-bottom: 56px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    height: min(680px, calc(100svh - 68px));
    min-height: 590px;
  }

  .heroText {
    left: 16px;
    right: 16px;
    top: 46%;
    width: auto;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 52px);
    line-height: .98;
    margin: 14px 0;
  }

  .hero p {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 22px;
  }

  .heroText small,
  .intro small,
  .impact small,
  .news > small,
  .contact small,
  .page-hero small,
  .sectionhead small,
  .program small,
  .story-callout small {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .heroText .btn {
    width: 100%;
    max-width: 260px;
    text-align: center;
    display: block;
    margin-left: 0;
  }

  .heroText .ghost {
    margin-top: 10px;
  }

  .arrows {
    top: auto;
    right: 16px;
    bottom: 48px;
  }

  .arrows button {
    width: 40px;
    height: 40px;
  }

  .dots {
    bottom: 18px;
  }

  .intro h2,
  .impact h2,
  .news h2,
  .contact h2,
  .sectionhead h2 {
    font-size: clamp(36px, 10vw, 46px);
    line-height: 1;
  }

  .intro > p {
    margin-bottom: 32px;
    line-height: 1.75;
  }

  .cards,
  .valuegrid,
  .testimonial-grid,
  .stats,
  .steps {
    grid-template-columns: 1fr;
  }

  .cards img {
    height: 210px;
  }

  .cards p {
    min-height: 0;
  }

  .founder {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .founder h2 {
    font-size: 44px;
  }

  .founder blockquote {
    padding: 24px;
    font-size: 25px;
  }

  .impact-statement {
    margin-top: 30px;
    padding: 22px 18px;
  }

  .impact-statement p {
    font-size: 23px;
  }

  .impact-statement strong {
    font-size: clamp(34px, 10vw, 48px);
    overflow-wrap: anywhere;
  }

  .page-hero {
    padding: 48px 16px;
  }

  .page-hero h1 {
    font-size: clamp(42px, 12vw, 52px);
  }

  .page-hero p {
    font-size: 14px;
  }

  .page-hero img {
    max-height: 280px;
    border-radius: 12px;
  }

  .split h2,
  .timeline h2,
  .program h2,
  .story-callout h2,
  .partner-box h2,
  .contact-page h2,
  .editorial h2 {
    font-size: clamp(36px, 10vw, 44px);
  }

  .quote-card {
    padding: 28px 22px;
  }

  .quote-card p {
    font-size: 24px;
  }

  .program-img img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .testimonial-carousel {
    width: 100%;
    gap: 7px;
  }

  .testimonial-track {
    width: 100%;
    flex: 1 1 auto;
    gap: 10px;
  }

  .testimonial-card {
    flex: 0 0 100%;
    padding: 21px;
  }

  .tprev,
  .tnext {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 22px;
  }

  .formbox {
    padding: 22px 18px;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 44px 16px;
  }

  .copyright {
    padding: 14px 16px;
    line-height: 1.7;
  }

  .copyright span {
    display: none;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .brand {
    font-size: 11px;
  }

  .brand b {
    font-size: 6px;
    letter-spacing: 2px;
  }

  .brand .mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 16px;
  }

  .hero {
    min-height: 570px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero p {
    font-size: 13px;
  }

  section {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Keep contact/help bar available on all device sizes */
@media(max-width:900px){
  .top{display:flex;min-width:0;overflow:hidden}
}
@media(max-width:600px){
  .top{display:flex;min-width:0;overflow:hidden}
}
