/* Results Matter Institute — public site */

:root {
  --navy: #003c7a;
  --navy-deep: #002a57;
  --blue: #376fb5;
  --white: #ffffff;
  --ink: #1e2a3a;
  --muted: #4b5870;
  --line: #d5deea;
  --paper: #f4f6f9;
  --teal: #00aab2;
  --coral: #f1637b;
  --magenta: #dd4a9b;
  --purple: #9054a2;
  --focus: #c9d8f0;
  --serif: "Noto Serif", "Times New Roman", Times, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --wrap: 68rem;
  --header-h: 4.5rem;
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--white);
  color: var(--navy);
  padding: 0.5rem 0.85rem;
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

.visually-hidden,
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(calc(100% - 2rem), var(--wrap));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(calc(100% - 2rem), 42rem);
}

/* Header */

.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: block;
  flex: 0 1 auto;
  line-height: 0;
}

.brand img {
  display: block;
  width: min(15.5rem, 62vw);
  height: auto;
}

.nav-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--white);
  position: relative;
  transition: transform 0.2s ease;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--navy-deep);
  padding: 0.75rem 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-nav a {
  color: var(--white);
  text-decoration: none;
  display: block;
  padding: 0.65rem 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--white);
  text-decoration: underline;
}

.site-nav .nav-donate {
  margin-top: 0.5rem;
  text-align: center;
  border: 1px solid var(--coral);
  background: var(--coral);
  color: var(--white);
  padding: 0.55rem 1rem;
}

.site-nav .nav-donate:hover,
.site-nav .nav-donate[aria-current="page"] {
  background: #d94e66;
  border-color: #d94e66;
  color: var(--white);
  text-decoration: none;
}

@media (min-width: 880px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    background: transparent;
    padding: 0;
    border: 0;
  }

  .site-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 0.15rem 0.15rem;
  }

  .site-nav a {
    padding: 0.4rem 0.7rem;
    font-size: 1rem;
  }

  .site-nav .nav-donate {
    margin-top: 0;
    margin-left: 0.45rem;
    padding: 0.4rem 0.95rem;
  }
}

/* Hero and page titles */

.hero,
.page-hero {
  background-color: var(--navy);
  background-image: url("../img/star-pattern.svg");
  background-size: 112px 112px;
  color: var(--white);
  padding: 2.75rem 0 3.25rem;
}

.page-hero {
  padding: 2.25rem 0 2.4rem;
}

.hero h1,
.page-hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.85rem, 5vw, 3.15rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  max-width: 16ch;
}

.page-hero h1 {
  max-width: none;
  margin-bottom: 0.4rem;
}

.lede,
.hero .lede {
  font-size: clamp(1.15rem, 2vw, 1.3rem);
  line-height: 1.55;
  max-width: 38rem;
  margin: 0 0 1.6rem;
  color: rgba(255, 255, 255, 0.92);
}

.page-hero .lede {
  margin-bottom: 0;
  max-width: 40rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.85rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--light {
  background: var(--white);
  color: var(--navy);
}

.btn--light:hover {
  background: var(--paper);
  color: var(--navy);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.btn--navy {
  background: var(--navy);
  color: var(--white);
}

.btn--navy:hover {
  background: var(--navy-deep);
  color: var(--white);
}

.btn--line {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn--line:hover {
  background: var(--navy);
  color: var(--white);
}

/* Content */

main {
  flex: 1;
}

.section {
  padding: 3.25rem 0;
}

.section--paper {
  background: var(--paper);
}

.section h2,
.issue h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.25;
  color: var(--navy);
  margin: 0 0 0.85rem;
}

.section h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
}

.section p,
.prose p {
  margin: 0 0 1rem;
}

.section p:last-child,
.prose p:last-child {
  margin-bottom: 0;
}

.kicker {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.55rem;
}

.grid-4 {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.3rem;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 1px 0 rgba(0, 60, 122, 0.03);
}

a.card:hover {
  border-color: var(--blue);
  color: inherit;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.card__more {
  display: inline-block;
  margin-top: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  font-size: 1rem;
}

a.card:hover .card__more {
  text-decoration: underline;
}

.card--teal {
  border-top: 3px solid var(--teal);
}

.card--coral {
  border-top: 3px solid var(--coral);
}

.card--magenta {
  border-top: 3px solid var(--magenta);
}

.card--purple {
  border-top: 3px solid var(--purple);
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .split {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: start;
  }
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.address {
  font-style: normal;
  line-height: 1.55;
}

.address a {
  font-weight: 600;
}

.issue {
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.issue:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.issue__label {
  display: inline-block;
  width: 2.25rem;
  height: 4px;
  margin-bottom: 0.85rem;
}

.issue--debt .issue__label {
  background: var(--teal);
}

.issue--energy .issue__label {
  background: var(--coral);
}

.issue--lands .issue__label {
  background: var(--magenta);
}

.issue--china .issue__label {
  background: var(--purple);
}

.cta-band {
  background: var(--navy);
  color: var(--white);
  padding: 2.75rem 0;
}

.cta-band h2 {
  font-family: var(--serif);
  color: var(--white);
  margin: 0 0 0.6rem;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.cta-band p {
  margin: 0 0 1.25rem;
  max-width: 38rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Donate placeholder */

.giving-placeholder {
  border: 1px dashed #9aabc2;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem;
  margin: 1.5rem 0 0;
}

.giving-placeholder strong {
  display: block;
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.mail-block {
  margin: 1.25rem 0;
  padding: 1.15rem 1.2rem;
  border-left: 4px solid var(--navy);
  background: var(--paper);
}

.mail-block p {
  margin: 0;
}

/* Forms */

.form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
  color: var(--navy);
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #b7c3d4;
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}

.field textarea {
  min-height: 10rem;
  resize: vertical;
}

.form-status {
  margin: 0;
  min-height: 1.4em;
}

.form-status.is-ok {
  color: #0d5a3e;
}

.form-status.is-err {
  color: #8a2436;
}

.note {
  color: var(--muted);
  font-size: 1rem;
}

/* Footer */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.88);
  padding: 2.75rem 0 1.75rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

.site-footer .brand img {
  width: 8.75rem;
}

.tagline {
  font-family: var(--serif);
  color: var(--white);
  margin: 0.85rem 0 1rem;
  font-size: 1.05rem;
}

.site-footer a {
  color: var(--white);
}

.site-footer a:hover {
  color: var(--white);
}

.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  display: inline-block;
  padding: 0.25rem 0;
  font-weight: 600;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a[aria-current="page"] {
  text-decoration: underline;
}

.legal {
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.1fr 0.8fr 0.9fr;
    gap: 2.5rem;
  }
}

/* 404 */

.empty-page {
  padding: 4rem 0 5rem;
  text-align: center;
}

.empty-page h1 {
  font-family: var(--serif);
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.75rem;
}

.empty-page p {
  max-width: 32rem;
  margin: 0 auto 1.5rem;
}

@media print {
  .site-header,
  .site-nav,
  .nav-toggle,
  .cta-band,
  .site-footer .footer-nav {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: inherit;
  }
}
