
:root {
  --primary-color: #1f4e5f;
  --primary-dark: #143542;
  --accent-color: #2f8f9d;
  --text-color: #1a1a1a;
  --text-muted: #555;
  --bg-color: #ffffff;
  --bg-alt: #f4f1ea;
  --bg-dark: #143542;
  --border-color: #e2ddd2;
  --max-width: 1120px;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Source Serif 4', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-color);
  line-height: 1.65;
  background: var(--bg-color);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-color); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: 0.75em; }
h3 { font-size: 1.25rem; margin-bottom: 0.5em; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4.5rem 0; }
section.alt { background: var(--bg-alt); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 2px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--primary-color);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-secondary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost-light {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.btn-ghost-light:hover { background: #fff; color: var(--primary-dark); }

/* Navigation */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
}
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary-dark);
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent-color); }
.nav-links .btn { padding: 0.55rem 1.15rem; }

@media (max-width: 800px) {
  .nav-toggle-label { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
}

/* Hero */
.hero {
  position: relative;
  background: var(--primary-dark);
  color: #fff;
  padding: 6rem 0 5rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1538300342682-cf57afb97285?w=1600&h=900&fit=crop');
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  z-index: -1;
}
.hero .container { position: relative; z-index: 1; max-width: 820px; }
.hero h1 {
  color: #fff;
  margin-bottom: 1rem;
  max-width: 18ch;
}
.hero .kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7e4e8;
  margin-bottom: 1.25rem;
}
.hero p.lede {
  font-size: 1.2rem;
  max-width: 58ch;
  margin-bottom: 2rem;
  color: #e8ecef;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Transparency statement — the big one */
.statement {
  background: var(--bg-alt);
  border-top: 4px solid var(--primary-color);
}
.statement .container { max-width: 780px; }
.statement h2 { margin-bottom: 1.25rem; }
.statement p { font-size: 1.08rem; color: #2a2a2a; }
.statement .read-more {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
}

/* About / how we work */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}
.about-grid img { border-radius: 2px; }
.about-text h2 { margin-bottom: 1rem; }

/* Impact numbers */
.impact {
  background: var(--bg-dark);
  color: #fff;
}
.impact h2 { color: #fff; text-align: center; margin-bottom: 0.5rem; }
.impact .subhead {
  text-align: center;
  color: #c7e4e8;
  margin-bottom: 2.5rem;
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
@media (max-width: 760px) {
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
}
.impact-stat .num {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.impact-stat .label {
  font-size: 0.95rem;
  color: #c7e4e8;
}

/* Projects / where we work */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2rem;
}
@media (max-width: 820px) {
  .projects-grid { grid-template-columns: 1fr; }
}
.project-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-card img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}
.project-card-body { padding: 1.5rem; }
.project-card h3 { margin-bottom: 0.35rem; }
.project-card .country {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 600;
  display: block;
  margin-bottom: 0.75rem;
}
.project-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Transparency / accounts */
.accounts .container { max-width: 820px; }
.accounts h2 { margin-bottom: 0.5rem; }
.accounts .subhead { color: var(--text-muted); margin-bottom: 2rem; }
.accounts-list {
  list-style: none;
  border-top: 1px solid var(--border-color);
}
.accounts-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.accounts-list .year {
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-size: 1.1rem;
}
.accounts-list .desc {
  flex: 1;
  min-width: 200px;
  padding: 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.accounts-list a { font-weight: 600; white-space: nowrap; }

/* Partners */
.partners .container { max-width: 820px; text-align: center; }
.partners h2 { margin-bottom: 0.75rem; }
.partners p { color: var(--text-muted); max-width: 60ch; margin: 0 auto 1.5rem; }
.partners-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-weight: 600;
  margin-top: 1.5rem;
}
.partners-list span { padding: 0.5rem 0; }

/* Give / donate band */
.give {
  background: var(--primary-color);
  color: #fff;
  text-align: center;
}
.give h2 { color: #fff; margin-bottom: 0.75rem; }
.give p { color: #d4e5e8; max-width: 55ch; margin: 0 auto 1.75rem; font-size: 1.08rem; }
.give-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* Contact */
.contact .container { max-width: 720px; }
.contact h2 { margin-bottom: 0.5rem; }
.contact .subhead { color: var(--text-muted); margin-bottom: 1.75rem; }
.ep-placeholder {
  padding: 2rem;
  background: var(--bg-alt);
  border: 1px dashed var(--border-color);
  border-radius: 2px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.contact-direct {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer */
footer {
  background: var(--bg-dark);
  color: #c7d3d8;
  padding: 3rem 0 2rem;
  font-size: 0.92rem;
}
footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 720px) {
  footer .container { grid-template-columns: 1fr; }
}
footer h4 {
  font-family: var(--font-heading);
  color: #fff;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
footer a { color: #c7d3d8; text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 0.5rem; }
.footer-brand p { max-width: 40ch; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid #2a4b58;
  font-size: 0.85rem;
  color: #8ea7ae;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Focus styles for accessibility */
a:focus-visible, button:focus-visible, .btn:focus-visible, .nav-toggle-label:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
}


/* ========================================
   PAGE TEMPLATE STYLES
   ======================================== */

.template-page .content-section {
    padding: 4rem 0;
}

.template-page .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.template-page .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.template-page .page-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.template-page .page-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
}

.template-page .page-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.template-page .page-content p {
    margin-bottom: 1.25rem;
}

.template-page .page-content a {
    text-decoration: none;
}

.template-page .page-content a:hover {
    text-decoration: underline;
}

.template-error .content-section {
    padding: 6rem 0;
    text-align: center;
}

/* Contact form on pages */
.ep-contact-form-wrapper {
    max-width: 600px;
    margin: 2rem auto;
}

.ep-contact-form input[type="text"],
.ep-contact-form input[type="email"],
.ep-contact-form textarea {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

.ep-contact-form input:focus,
.ep-contact-form textarea:focus {
    outline: none;
}

.ep-contact-form label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.ep-contact-form .form-field {
    margin-bottom: 1.5rem;
}

.ep-contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.ep-contact-form button,
.ep-contact-form input[type="submit"] {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

/* Container padding (prevents content running to browser edge) */
.container, .section-inner, [class*="-inner"] {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
    box-sizing: border-box;
}
section, [class*="section"] {
    overflow-x: hidden;
}

.site-footer {
    position: relative;
    z-index: 1;
}

/* Structural button fallbacks (colour comes from the brand CSS, never from here).
   If the brand CSS uses class names the converter renamed, the button will be
   clickable but uncoloured, which is a visible signal something needs fixing
   rather than a misleading hardcoded blue. */
.button, a.button,
a.btn-primary, a.btn-secondary, a.btn-dark, a.btn-outline, a.btn-light {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1.4;
}

a.read-more, .read-more {
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: opacity 0.2s;
}
.read-more:hover { opacity: 0.7; }

a[class*="hero-btn"] {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.hero-cta, .hero-actions, .hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Button class alias shim — converter renamed .btn-primary → .button, .btn-secondary → .button.action, .btn-ghost-light → .button.update. */
.button {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border-radius: 2px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    background: var(--primary-color);
    color: #fff;
}
.button:hover { background: var(--primary-dark); color: #fff; }
.button.action { background: transparent; color: var(--primary-dark); border-color: var(--primary-dark); }
.button.action:hover { background: var(--primary-dark); color: #fff; }
.button.update { background: transparent; color: #fff; border-color: #fff; }
.button.update:hover { background: #fff; color: var(--primary-dark); }
