/* =========================================================================
   GOVINTE FOR PEACE AND DEVELOPMENT — DESIGN SYSTEM
   -------------------------------------------------------------------------
   All colours, fonts and spacing for the whole website live here.
   Change a value here and it updates everywhere on the site.
   ========================================================================= */

:root {
  /* --- Brand colours (from the organisation's brand brief) --- */
  --teal: #0f4c5c;
  --teal-dark: #0a3641;
  --teal-light: #e6eef0;
  --sunflower: #e9a93a;
  --sunflower-dark: #b87a18;
  --sunflower-light: #fdf3e0;
  --terracotta: #c4553a;
  --terracotta-deep: #a8442d; /* darker shade: safe for white text on buttons */
  --terracotta-light: #fbeee9;
  --cream: #faf6ee;
  --ink: #22201d;          /* main dark text colour */
  --ink-soft: #55504a;     /* secondary text */
  --white: #ffffff;
  --line: #e4ddd0;         /* hairline borders */

  /* --- Portfolio accent colours (one per programme area) --- */
  --accent-peacebuilding: #0f4c5c;
  --accent-protection: #6b3a4e;
  --accent-resettlement: #b87a18;
  --accent-livelihoods: #4a6741;
  --accent-health: #a8442d;

  /* --- Typography --- */
  --font-heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* --- Spacing scale --- */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* --- Layout --- */
  --width-page: 1200px;
  --width-text: 68ch;
  --radius: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(34, 32, 29, 0.06), 0 2px 8px rgba(34, 32, 29, 0.05);
  --shadow-md: 0 4px 12px rgba(34, 32, 29, 0.09), 0 12px 32px rgba(34, 32, 29, 0.07);
}

/* Arabic pages swap in Arabic-native typefaces */
[lang='ar'] {
  --font-heading: 'Noto Kufi Arabic', 'Source Serif 4', serif;
  --font-body: 'Noto Naskh Arabic', 'Source Sans 3', sans-serif;
}

/* =========================================================================
   RESET & BASE
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* =========================================================================
   TYPOGRAPHY
   ========================================================================= */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-md);
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  letter-spacing: -0.015em;
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  letter-spacing: -0.01em;
}
h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}
h4 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 var(--space-md);
  max-width: var(--width-text);
}

a {
  color: var(--teal);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--terracotta-deep);
}

ul,
ol {
  padding-inline-start: 1.25em;
  max-width: var(--width-text);
}
li {
  margin-bottom: var(--space-xs);
}

strong {
  font-weight: 700;
}

blockquote {
  margin: 0;
  padding-inline-start: var(--space-lg);
  border-inline-start: 3px solid var(--sunflower);
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  color: var(--teal);
}

/* Accessibility: visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--terracotta-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Screen-reader-only text (announced aloud, not shown on screen) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for keyboard and screen-reader users */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-md);
  inset-block-start: -100px;
  z-index: 200;
  background: var(--teal);
  color: var(--white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: inset-block-start 0.15s ease;
}
.skip-link:focus {
  inset-block-start: var(--space-md);
  color: var(--white);
}

/* =========================================================================
   LAYOUT HELPERS
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--width-page);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container-narrow {
  max-width: 820px;
}

.section {
  padding-block: var(--space-2xl);
}
.section-tight {
  padding-block: var(--space-xl);
}

@media (min-width: 900px) {
  .section {
    padding-block: var(--space-3xl);
  }
}

.section-cream {
  background: var(--cream);
}
.section-white {
  background: var(--white);
}
.section-teal {
  background: var(--teal);
  color: var(--white);
}
.section-teal h1,
.section-teal h2,
.section-teal h3 {
  color: var(--white);
}
.section-teal a {
  color: var(--sunflower);
}

.stack > * + * {
  margin-block-start: var(--space-md);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================================================
   SECTION HEADINGS
   ========================================================================= */

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin-bottom: var(--space-xs);
}
.section-teal .eyebrow {
  color: var(--sunflower);
}

.lead {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-soft);
}
.section-teal .lead {
  color: rgba(255, 255, 255, 0.88);
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.85em 1.6em;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  min-height: 48px; /* comfortable tap target on phones */
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-dark);
  color: var(--white);
}

/* The donate button has its own colour, used nowhere else */
.btn-donate {
  background: var(--terracotta-deep);
  color: var(--white);
}
.btn-donate:hover {
  background: #8f3924;
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal);
}
.btn-outline:hover {
  background: var(--teal);
  color: var(--white);
}

.btn-on-dark {
  background: var(--white);
  color: var(--teal);
}
.btn-on-dark:hover {
  background: var(--sunflower-light);
  color: var(--teal-dark);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* =========================================================================
   CARDS
   ========================================================================= */

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card h3 {
  margin-bottom: var(--space-xs);
}
.card p {
  color: var(--ink-soft);
  margin-bottom: var(--space-md);
}
.card .card-link {
  margin-top: auto;
  font-weight: 700;
  text-decoration: none;
}
.card .card-link::after {
  content: ' \2192';
}
[dir='rtl'] .card .card-link::after {
  content: ' \2190';
}

/* Coloured top edge showing which portfolio a card belongs to */
.card-accent-bar {
  height: 6px;
  background: var(--card-accent, var(--teal));
}

/* =========================================================================
   IMPACT NUMBERS
   ========================================================================= */

.stat {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
}
.stat-figure {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  color: var(--teal);
  margin-bottom: var(--space-xs);
}
.section-teal .stat-figure {
  color: var(--sunflower);
}
.stat-label {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 24ch;
  margin-inline: auto;
}
.section-teal .stat-label {
  color: rgba(255, 255, 255, 0.85);
}

/* =========================================================================
   PLACEHOLDER MARKER — shows staff exactly what still needs real content
   ========================================================================= */

.tofill {
  display: inline-block;
  background: var(--sunflower-light);
  border: 1px dashed var(--sunflower-dark);
  color: #6b4708;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.15em 0.55em;
  border-radius: var(--radius);
  letter-spacing: 0.02em;
}

/* =========================================================================
   FORMS
   ========================================================================= */

.field {
  margin-bottom: var(--space-lg);
  max-width: 640px;
}
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: var(--space-2xs);
}
.field .hint {
  display: block;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-bottom: var(--space-xs);
}
.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field select,
.field textarea {
  width: 100%;
  padding: 0.7em 0.85em;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid #b9b1a4;
  border-radius: var(--radius);
  min-height: 48px;
}
.field textarea {
  min-height: 140px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
}
.required-mark {
  color: var(--terracotta-deep);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  max-width: 640px;
  margin-bottom: var(--space-lg);
}
.checkbox-row input[type='checkbox'] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--teal);
}
.checkbox-row label {
  font-weight: 400;
}

/* =========================================================================
   CALLOUT BOXES
   ========================================================================= */

.callout {
  background: var(--white);
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--teal);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-block: var(--space-lg);
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout-warning {
  border-inline-start-color: var(--terracotta-deep);
  background: var(--terracotta-light);
}
.callout-note {
  border-inline-start-color: var(--sunflower-dark);
  background: var(--sunflower-light);
}

/* =========================================================================
   TABLES
   ========================================================================= */

.table-wrap {
  overflow-x: auto;
  margin-block: var(--space-lg);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  background: var(--white);
}
th,
td {
  text-align: start;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-weight: 700;
  background: var(--teal-light);
}

/* =========================================================================
   PILL / TAG
   ========================================================================= */

.pill {
  display: inline-block;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--teal-light);
  color: var(--teal-dark);
}
