/* AEHCA theme. Sits on top of Bootstrap 4.5; every color comes from the logo. */

:root {
  /* Logo colors, sampled from images/main-logo.png */
  --blue: #12a3d8;
  --yellow: #fabd16;
  --orange: #ff7f26;
  --ink: #091016;

  /* Shades of the logo colors that are dark enough for text */
  --blue-deep: #06506f;
  --blue-text: #0a6a91;

  /* Tints of the logo colors for backgrounds */
  --blue-tint: #e6f5fb;
  --yellow-tint: #fff6dc;
  --orange-tint: #fff0e5;
  --cream: #fdfaf3;

  --body: #2b363d;
  --muted: #55626a;
  --line: #e3e8ea;
  --line-dark: #b9c4c9;
  --on-ink: #d5dde1;
  --white: #fff;

  --radius: 1rem;
  --radius-lg: 1.5rem;
  --shadow: 0 2px 6px rgba(9, 16, 22, .06), 0 14px 34px rgba(9, 16, 22, .09);
  --shadow-lift: 0 4px 10px rgba(9, 16, 22, .1), 0 20px 44px rgba(9, 16, 22, .14);

  --font-head: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --stripe: linear-gradient(90deg, var(--blue) 0 33.33%, var(--yellow) 33.33% 66.66%, var(--orange) 66.66% 100%);
}

/* ---------- Base ---------- */

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

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 1.2rem + .9vw, 1.85rem); margin: 0 0 1rem; }
h3 { font-size: 1.2rem; margin: 0 0 .75rem; }

p { margin-bottom: 1.15rem; }
img { max-width: 100%; }

a { color: var(--blue-text); text-decoration: underline; text-underline-offset: .15em; }
a:hover { color: var(--ink); }

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

.text-muted { color: var(--muted) !important; }

/* The divider echoes the three heads in the logo. */
hr {
  width: 4.5rem;
  height: .7rem;
  margin: 2.75rem auto !important;
  border: 0;
  background:
    radial-gradient(circle at .35rem 50%, var(--blue) .34rem, transparent .36rem),
    radial-gradient(circle at 50% 50%, var(--yellow) .34rem, transparent .36rem),
    radial-gradient(circle at calc(100% - .35rem) 50%, var(--orange) .34rem, transparent .36rem);
}

/* ---------- Buttons ---------- */

.btn {
  padding: .7rem 1.6rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}

.btn:hover { transform: translateY(-1px); }

.btn-give { background: var(--orange); color: var(--ink); }
.btn-give:hover, .btn-give:focus { background: var(--yellow); color: var(--ink); }

.btn-give-yellow { background: var(--yellow); color: var(--ink); }
.btn-give-yellow:hover, .btn-give-yellow:focus { background: var(--white); color: var(--ink); }

.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover, .btn-ink:focus { background: var(--blue-deep); color: var(--white); }

.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover, .btn-outline:focus { background: var(--ink); color: var(--white); }
.btn-outline svg { margin: -.2rem .15rem 0 0; }

.btn-give-yellow span { font-weight: 800; }

.btn-lg { padding: .9rem 2.1rem; font-size: 1.15rem; }

/* ---------- Header ---------- */

.site-header { position: sticky; top: 0; z-index: 1030; background: var(--white); box-shadow: 0 2px 14px rgba(9, 16, 22, .07); }
.site-header::after { content: ""; display: block; height: 5px; background: var(--stripe); }

.site-header .navbar { padding-top: .6rem; padding-bottom: .6rem; }

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0;
  color: var(--ink) !important;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}

.navbar-brand img { width: auto; height: 46px; }

.site-header .nav-link {
  padding: .5rem .8rem !important;
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
}

.site-header .nav-link:hover { background: var(--blue-tint); color: var(--ink); }
.site-header .nav-link[aria-current] { background: var(--yellow-tint); box-shadow: inset 0 -3px 0 var(--yellow); border-radius: .5rem .5rem 0 0; }

.site-header .btn-give { padding: .5rem 1.25rem; }

.navbar-toggler { padding: .45rem .6rem; border: 2px solid var(--line); border-radius: .75rem; }
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23091016' stroke-linecap='round' stroke-width='2.6' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }

#google_translate_element { min-height: 40px; color: var(--muted); font-size: .75rem; line-height: 1.3; }
#google_translate_element .goog-te-combo { max-width: 100%; margin: 0; padding: .3rem .5rem; border: 1px solid var(--line-dark); border-radius: .5rem; background: var(--white); color: var(--ink); font-family: var(--font-body); font-size: .9rem; }
#google_translate_element img { vertical-align: middle; }

@media (max-width: 1199px) {
  .site-header .navbar-collapse { padding: .75rem 0 .5rem; }
  .site-header .navbar-nav + .navbar-nav { padding: .75rem .8rem 0; }
}

@media (min-width: 1200px) {
  .site-header .btn-give { order: 3; }
}

@media (max-width: 420px) {
  .navbar-brand { gap: .45rem; font-size: 1.05rem; }
  .navbar-brand img { height: 36px; }
  .site-header .btn-give { padding: .4rem .9rem; }
}

/* ---------- Page header band ---------- */

.page-header, .hero {
  position: relative;
  overflow: hidden;
  background: var(--blue-deep);
  color: var(--white);
}

.page-header { padding: 2rem 0 8.5rem; border-radius: 0 0 50% 50% / 0 0 3.5rem 3.5rem; }

.page-header::before, .hero::before {
  content: "";
  position: absolute;
  background: url("/images/logo-figures.svg") center / contain no-repeat;
  pointer-events: none;
}

.page-header::before { top: -3.5rem; right: max(-3rem, calc(50% - 46rem)); width: 24rem; height: 22.5rem; }

.page-header > * { position: relative; }
.page-header h1, .hero h1 { color: var(--white); }
.page-header h1 { max-width: 54rem; margin: 0; }

.page-header-org { margin: 0 0 .5rem; color: var(--yellow); font-family: var(--font-head); font-size: 1rem; font-weight: 600; }

.breadcrumb { margin: 0 0 1.5rem; padding: 0; background: none; font-size: 1rem; }
.breadcrumb-item a { color: var(--white); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--yellow); text-decoration: underline; }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .75); }

@media (max-width: 991px) {
  .page-header { padding: 1.5rem 0 6.5rem; }
  .page-header::before { content: none; }
}

/* ---------- Page panel ---------- */

.page-body { position: relative; margin-top: -5.5rem; padding-bottom: 4.5rem; }

.page-panel {
  max-width: 58rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4.5vw, 4rem);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}

.page-panel > .carousel:first-child { margin-top: 0; }
.page-panel ul ul { margin-bottom: 1rem; font-weight: 400; }
.page-panel > :last-child, .prose > :last-child { margin-bottom: 0; }
.page-panel img.rounded, .page-panel video { border-radius: var(--radius) !important; }
.page-panel video { background: var(--ink); }

@media (max-width: 991px) { .page-body { margin-top: -4rem; } }
@media (max-width: 575px) { .page-body { padding-right: .6rem; padding-left: .6rem; } }

.lead { color: var(--ink); font-size: clamp(1.15rem, 1.08rem + .35vw, 1.3rem); font-weight: 400; line-height: 1.6; }

.prose { max-width: 44rem; margin: 0 auto; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2.25rem; overflow-wrap: anywhere; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose li { margin-bottom: 1rem; }
.prose li strong { display: block; color: var(--ink); font-family: var(--font-head); font-size: 1rem; }

.address { display: inline-block; margin: 1rem 0 1.5rem; padding: 1.25rem 1.75rem; border-radius: var(--radius); background: var(--blue-tint); }

.byline { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.byline img { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.byline strong { display: block; color: var(--ink); font-family: var(--font-head); line-height: 1.35; }

/* Newest update at the top of a project story */
.update-latest { margin-bottom: 2.75rem; padding: clamp(1.25rem, 3.5vw, 2.5rem); border-radius: var(--radius); background: var(--yellow-tint); }
.update-latest h2 em { font-style: normal; }
.update-latest > :last-child { margin-bottom: 0; }

.photo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1.25rem; align-items: center; margin: 1.5rem 0 2rem; }
.photo-row .photo { margin: 0; }
.photo-row img { display: block; width: 100%; height: auto; max-height: 32rem; object-fit: contain; }

.photo { display: block; width: auto; max-width: 100%; max-height: 40rem; height: auto; margin: 1.75rem auto; }

figure.photo-figure { margin: 0; }
figure.photo-figure img { width: 100%; border-radius: var(--radius); }
figure.photo-figure figcaption { margin-top: .6rem; color: var(--muted); font-size: 1rem; }

/* Text beside a photo or carousel */
.split { display: grid; gap: 2rem 3rem; align-items: center; }
.split > * { min-width: 0; }
@media (min-width: 992px) { .split { grid-template-columns: 1fr 1fr; } .split-wide { grid-template-columns: 1fr 1.25fr; } }

/* ---------- Cards ---------- */

.feature { display: grid; overflow: hidden; margin-top: 2rem; border-radius: var(--radius); background: var(--blue-tint); }
.feature-yellow { background: var(--yellow-tint); }
.feature-orange { background: var(--orange-tint); }
.feature-text { align-self: center; padding: clamp(1.5rem, 3.5vw, 2.75rem); }
.feature-text > :last-child { margin-bottom: 0; }
.feature-media img { display: block; width: 100%; height: 100%; min-height: 15rem; object-fit: cover; }
.feature-stack .feature-media img { max-height: 26rem; }
.feature-media-logo { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.feature-media-logo img { width: 250px; height: auto; min-height: 0; }
@media (min-width: 768px) { .feature { grid-template-columns: 1.2fr 1fr; } .feature-stack { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1.5rem; margin: 2rem 0; }
.tile { padding: clamp(1.5rem, 3vw, 2.25rem); border-radius: var(--radius); background: var(--blue-tint); }
.tile-yellow { background: var(--yellow-tint); }
.tile > :last-child { margin-bottom: 0; }
.tile ul { margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.tile-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.countries { margin: 0; padding: 0; list-style: none; }
.countries > li { margin-bottom: .6rem; padding: .7rem 1.25rem; border-radius: .75rem; background: var(--blue-tint); color: var(--ink); font-family: var(--font-head); font-weight: 700; }
.countries > li.active { background: var(--yellow); }
.countries ul, .page-panel .countries ul { margin: .35rem 0 0; padding: 0; list-style: none; font-weight: 600; }
.countries a { color: var(--ink); }

.pdf-frame iframe { display: block; width: 100%; height: min(75vh, 50rem); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Link lists ---------- */

.list-group { gap: .75rem; }

.list-group-item,
.list-group-item + .list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border: 2px solid var(--line);
  border-radius: var(--radius) !important;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}

.list-group-item + .list-group-item.active { margin-top: 0; }
.list-group-item::after { content: "\2192" / ""; flex: none; color: var(--blue-text); font-size: 1.25rem; transition: transform .15s; }
.list-group-item:hover, .list-group-item:focus { border-color: var(--blue); background: var(--blue-tint); color: var(--ink); }
.list-group-item:hover::after { transform: translateX(4px); }
.list-group-item.active { border-color: var(--yellow); background: var(--yellow-tint); color: var(--ink); }
.list-group-item.active::after { content: none; }

.more-posts { margin-bottom: 1.25rem; color: var(--ink); font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; }

/* ---------- Carousels: photos always shown whole, captions underneath ---------- */

.carousel { display: flex; flex-direction: column; margin: 1.5rem 0; }
.carousel-inner { order: 1; border-radius: var(--radius); background: var(--blue-tint); }

.carousel-item { height: clamp(300px, 46vw, 480px); }
.carousel-item.active, .carousel-item-next, .carousel-item-prev { display: flex; flex-direction: column; }
.carousel-item > a { display: flex; flex: 1; flex-direction: column; min-height: 0; color: inherit; text-decoration: none; }
.carousel-item img { display: block; flex: 1; width: 100%; min-height: 0; object-fit: contain; border-radius: 0 !important; }

.split .carousel { margin: 0; }
.split .carousel-item { height: clamp(280px, 34vw, 400px); }

.carousel-caption, .carousel-caption.d-none {
  position: static;
  display: block !important;
  flex: none;
  padding: .85rem 1.25rem;
  background: var(--ink);
  color: var(--white);
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
  text-shadow: none;
}

.carousel-caption p { margin: 0; background: none !important; color: inherit !important; }

.carousel-indicators { position: static; order: 2; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; }
.carousel-indicators li { width: auto; height: auto; margin: 0; border: 0; background: none; opacity: 1; text-indent: 0; }
.carousel-indicators li[data-target], .carousel-indicators button {
  display: block;
  width: .8rem;
  height: .8rem;
  padding: 0;
  border: 2px solid var(--blue-text);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: width .2s, background-color .2s;
}
.carousel-indicators li[data-target].active, .carousel-indicators button.active { width: 2rem; background: var(--blue-text); }

.carousel-control-prev, .carousel-control-next {
  top: calc(50% - 1.7rem);
  bottom: auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(9, 16, 22, .25);
  opacity: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.carousel-control-prev { left: .75rem; }
.carousel-control-next { right: .75rem; }
.carousel-control-prev:hover, .carousel-control-next:hover { background: var(--yellow); opacity: 1; }
.carousel-control-prev-icon, .carousel-control-next-icon { width: 1.1rem; height: 1.1rem; }
.carousel-control-prev-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='%23091016' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='M10.5 2.5 5 8l5.5 5.5'/%3e%3c/svg%3e"); }
.carousel-control-next-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='%23091016' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='M5.5 2.5 11 8l-5.5 5.5'/%3e%3c/svg%3e"); }

/* ---------- Home ---------- */

.hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(6.5rem, 9vw, 8rem); border-radius: 0 0 50% 50% / 0 0 5rem 5rem; }
.hero::before { top: -5rem; right: max(-7rem, calc(50% - 50rem)); width: 34rem; height: 32rem; }
.hero h1 { margin-bottom: 1.25rem; }
.hero-grid { position: relative; display: grid; gap: 2.5rem 3.5rem; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero .lead { max-width: 34rem; margin-bottom: 2rem; color: var(--white); }
@media (min-width: 992px) { .hero-grid { grid-template-columns: 1fr 1.15fr; } }
@media (max-width: 991px) { .hero::before { content: none; } }

.hero .carousel { margin: 0; padding: .75rem .75rem 1rem; border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-lift); }
.hero .carousel-item { height: clamp(320px, 42vw, 500px); }
.hero .carousel-caption { display: flex !important; align-items: center; justify-content: center; min-height: 4.6rem; }

.projects { position: relative; margin-top: -3.5rem; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); gap: 1.5rem; }

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.project-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-4px); }
.project-card img { display: block; width: 100%; height: 12.5rem; object-fit: cover; }
.project-card span { display: flex; align-items: center; justify-content: space-between; flex: 1; padding: 1.1rem 1.4rem; color: var(--ink); font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; }
.project-card span::after { content: "\2192" / ""; transition: transform .15s; }
.project-card:hover span::after { transform: translateX(4px); }
.project-blue span { background: var(--blue); }
.project-yellow span { background: var(--yellow); }
.project-orange span { background: var(--orange); }

.impact { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.impact-grid { display: grid; gap: 2rem 4rem; }
.impact-grid > * { min-width: 0; }
.impact-image { max-width: 38rem; }
@media (min-width: 992px) {
  .impact-grid { grid-template: "intro image" auto "details image" 1fr / 1fr 1fr; }
  .impact-intro { grid-area: intro; }
  .impact-image { grid-area: image; }
  .impact details { grid-area: details; align-self: start; }
}
.impact h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 800; }
.impact img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.impact details { padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--blue-tint); }
.impact summary { color: var(--blue-text); font-family: var(--font-head); font-size: 1rem; font-weight: 700; cursor: pointer; }
.impact details[open] summary { margin-bottom: 1rem; }
.impact details > :last-child { margin-bottom: 0; }
.impact li { margin-bottom: .4rem; }

.give-band { padding: clamp(3.5rem, 7vw, 5.5rem) 0; border-radius: 50% 50% 0 0 / 4rem 4rem 0 0; background: var(--yellow); color: var(--ink); text-align: center; }
.give-band p { max-width: 38rem; margin: 1.25rem auto 0; font-size: 1.25rem; }

/* ---------- Footer ---------- */

.site-footer { flex-shrink: 0; background: var(--ink); color: var(--on-ink); text-align: center; }
.site-footer::before { content: ""; display: block; height: 5px; background: var(--stripe); }
.site-footer p { max-width: 46rem; margin: 0 auto; padding: 2.25rem 1.25rem; font-size: 1rem; }
.site-footer a { color: var(--yellow); }
.site-footer a:hover { color: var(--white); }

/* ---------- Standalone pages (404, thank you) ---------- */

.notice { position: relative; display: flex; align-items: center; padding: 3rem 0; overflow: hidden; background: var(--blue-deep); }
.notice::before { content: ""; position: absolute; right: -6rem; bottom: -6rem; width: 34rem; height: 32rem; max-width: 90vw; background: url("/images/logo-figures.svg") center / contain no-repeat; }
.notice .page-panel { position: relative; max-width: 46rem; }
.notice-logo { display: block; width: 22rem; margin: 0 auto 1rem; }
.notice-org { color: var(--blue-text); font-family: var(--font-head); font-weight: 600; text-align: center; }
.notice h1 { margin-bottom: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
