/* Shared colors and dimensions: update these to change the site's appearance. */
:root {
  --page-background: #ffffff;
  --alternate-background: #f8fafb;
  --text-color: #263746;
  --accent-color: #214f68;
  --border-color: #e5eaed;
  --header-height: 195px;
  --expanded-header-height: 195px;
  --logo-section-height: 0px;
  --navigation-height: 64px;
  --content-width: 1120px;
  /* 1.5 times the previous 327px logo display width. */
  --brand-width: 490.5px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  /* Keep this space stable when the logo collapses to avoid scroll jumps. */
  padding-top: var(--expanded-header-height);
  background: var(--page-background);
  color: var(--text-color);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 5px;
  border-radius: 2px;
}

/* Keyboard users can jump directly past the navigation. */
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 20;
  padding: 8px 16px;
  transform: translateY(-200%);
  background: var(--page-background);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Fixed header; body padding keeps it from covering the page content. */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  background: var(--page-background);
  border-bottom: 1px solid var(--border-color);
  transition: transform 180ms ease;
}

/* Slide only the logo section away; navigation moves to the top of the screen. */
.site-header.is-collapsed {
  transform: translateY(calc(-1 * var(--logo-section-height)));
}

/* Brand on the far left; language and donation controls on the far right. */
.show-logo-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-link {
  position: relative;
  display: block;
  flex: 1;
  min-width: 0;
  max-width: var(--brand-width);
  text-decoration: none;
}

/* One original image keeps the lifebuoy and attached rope in proportion. */
.brand-artwork {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2172 / 475;
  overflow: hidden;
}

.brand-logo {
  position: absolute;
  display: block;
  top: -23.158%;
  left: 0;
  width: 100%;
  height: auto;
}

.brand-text {
  position: absolute;
  top: 7%;
  right: 3%;
  bottom: 26%;
  left: 25%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4.5px;
  text-align: center;
}

.brand-name {
  color: #18263b;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-mission {
  max-width: 670px;
  font-size: 13.5px;
  line-height: 1.35;
}

.header-actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.language-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.language-control label {
  font-size: 12px;
  font-weight: 600;
}

.language-control select {
  padding: 5px 8px;
  border: 1px solid #bac8d0;
  border-radius: 4px;
  background: var(--page-background);
  color: var(--text-color);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.donation-link {
  padding: 5px 14px;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  background: var(--accent-color);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.donation-link:hover,
.donation-link[aria-current="page"] {
  background: #173b50;
}

.site-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: min(100% - 40px, var(--content-width));
  min-height: var(--navigation-height);
  margin: 0 auto;
}

.site-navigation a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.site-navigation a:hover,
.site-navigation a[aria-current="page"] {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* Five blank sections, ready for future content. */
.home-section {
  min-height: 60vh;
  padding: 48px max(24px, calc((100% - var(--content-width)) / 2));
  border-bottom: 1px solid var(--border-color);
}

.home-section:nth-child(even) {
  background: var(--alternate-background);
}

/* Secondary pages start with empty page bodies. */
.empty-page {
  min-height: calc(100vh - var(--expanded-header-height) - 180px);
  padding: 48px max(24px, calc((100% - var(--content-width)) / 2));
}

/* Ministry content uses the shared font, palette, and page width. */
.ministry-section {
  padding: 56px 24px;
  border-bottom: 1px solid var(--border-color);
}

.ministry-section:nth-child(even) {
  background: var(--alternate-background);
}

.ministry-section-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 56px;
  max-width: var(--content-width);
  margin: 0 auto;
}

.ministry-image-container {
  display: flex;
  justify-content: center;
}

.ministry-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.ministry-image-globe {
  max-width: 260px;
  border-radius: 50%;
}

.ministry-text h1,
.ministry-text h2 {
  margin: 0 0 16px;
  color: var(--accent-color);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

.ministry-text p {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
}

@media (max-width: 760px) {
  .ministry-section {
    padding: 36px 24px;
  }

  .ministry-section-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .ministry-image {
    max-width: 480px;
  }

  .ministry-image-globe {
    max-width: 220px;
  }

  .ministry-text h1,
  .ministry-text h2 {
    font-size: 24px;
  }
}

.site-footer {
  min-height: 180px;
  padding: 40px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--alternate-background);
}

/* Contact form follows the existing font, colors, and page spacing. */
.contact-content {
  padding: 48px 24px 64px;
}

.contact-section {
  max-width: 720px;
  margin: 0 auto;
}

.contact-section h1 {
  margin: 0 0 12px;
  color: var(--accent-color);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

.contact-form-note {
  margin: 0 0 28px;
  font-size: 14px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-weight: 600;
}

.required-mark {
  color: var(--accent-color);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--alternate-background);
  color: var(--text-color);
  font: inherit;
}

.form-field input,
.form-field select {
  min-height: 52px;
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
}

.phone-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.phone-field legend {
  margin-bottom: 12px;
  padding: 0;
  font-weight: 600;
}

.phone-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.phone-country-field,
.phone-number-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #667985;
  opacity: 1;
}

.message-details {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
}

.contact-submit {
  align-self: flex-start;
  min-height: 44px;
  padding: 12px 24px;
  border: 0;
  border-radius: 4px;
  background: var(--accent-color);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.contact-submit:hover {
  background: #173b50;
}

.contact-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.contact-form-status {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  border-radius: 4px;
  background: var(--alternate-background);
}

.contact-form-status[hidden] {
  display: none;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  max-width: var(--content-width);
  margin: 0 auto;
}

.footer-item h2,
.footer-contact-link {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.footer-item address {
  font-style: normal;
}

.footer-item p {
  margin: 12px 0 0;
}

.footer-contact-link {
  text-underline-offset: 5px;
}

/* The copyright line follows the same typeface and colors as the footer. */
.footer-copyright {
  max-width: var(--content-width);
  margin: 32px auto 0;
  /* Leave room below the text for the fixed Back to top button on small screens. */
  padding: 20px 0 32px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  line-height: 1.6;
}

.footer-copyright small {
  font-size: 14px;
}

/* Available on every page after the visitor starts scrolling. */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-color);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 3px 12px #00000020;
  cursor: pointer;
}

.back-to-top:hover {
  background: #173b50;
}

.back-to-top[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

@media (max-width: 900px) {
  .show-logo-section {
    padding: 10px 20px;
  }
}

/* All controls remain visible and usable on small screens. */
@media (max-width: 600px) {
  .phone-inputs {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  :root {
    --header-height: 280px;
    --expanded-header-height: 280px;
    --navigation-height: 104px;
  }

  .show-logo-section {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }

  .brand-link {
    flex: auto;
    width: 100%;
  }

  .brand-text {
    top: 0;
    bottom: 22%;
    gap: 3px;
  }

  .brand-name {
    font-size: clamp(12px, 4.3vw, 21px);
  }

  .brand-mission {
    font-size: clamp(8px, 2.5vw, 13.5px);
    line-height: 1.35;
  }

  .header-actions {
    margin-left: auto;
    gap: 6px;
  }

  .language-control {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .site-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 4px 20px;
    text-align: center;
  }

  .site-navigation a {
    justify-self: center;
  }

  .footer-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}
