/* ══════════════════════════════════════════════════
   SWI — Sustainable Water International
   CSS — Clean Multi-Page SPA
   ══════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ── */
:root {
  --deep:    #0D2B45;
  --mid:     #1A5276;
  --sky:     #2E86AB;
  --cream:   #F7F5F2;
  --white:   #FFFFFF;
  --ink:     #1A1A1A;
  --ink2:    #3A3A3A;
  --muted:   #7A7A78;
  --border:  #E0DDD8;
  --bordl:   #EEEBE7;

  --serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:    'Jost', 'Segoe UI', system-ui, sans-serif;

  --nav-h:   72px;
  --pad:     clamp(20px, 5vw, 60px);
  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
  --r:       4px;
}

html { font-size: 16px; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: var(--sans); cursor: pointer; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ── Page visibility ── */
.page { display: block; }
.page.hidden { display: none; }

/* ── Nav spacer (for inner pages) ── */
.nav-spacer { height: var(--nav-h); }

/* ── Site bottom spacer ── */
.site-bottom { flex: 1; }


/* ══════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.navbar.scrolled {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 1px 0 var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  max-width: 1280px;
  margin: 0 auto;
}

.nav-logo {
  position: relative;
  width: 80px; height: 58px;
  flex-shrink: 0;
}
.nav-logo img {
  position: absolute;
  top: 0; left: 0;
  width: 80px; height: auto;
  transition: opacity 0.35s var(--ease);
}
.logo-white  { opacity: 1; }
.logo-colour { opacity: 0; }
.navbar.scrolled .logo-white  { opacity: 0; }
.navbar.scrolled .logo-colour { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  position: relative;
}

.navbar.scrolled .nav-link { color: var(--ink); }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 6px; left: 14px; right: 14px;
  height: 1px;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s var(--ease);
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); transform-origin: left; }

.caret {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.has-dropdown:hover .caret { transform: rotate(180deg); }

/* Dropdown */
.has-dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  list-style: none;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 200;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown a, .dropdown li a {
  display: block;
  padding: 9px 18px;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--ink2);
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}
.dropdown a:hover { color: var(--sky); background: var(--cream); }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  width: 24px; height: 1.5px;
  background: rgba(255,255,255,0.9);
  transition: all 0.3s var(--ease);
}
.navbar.scrolled .nav-hamburger span { background: var(--ink); }


/* ══════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════ */
.hero {
  position: relative;
  height: 100svh;
  min-height: max(360px, 50svh);
  overflow: hidden;
  touch-action: pan-y;
}

.hero-slides { position: absolute; inset: 0; }

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero-slide.active { opacity: 1; }

.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: heroZoom 8s var(--ease) forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(13,43,69,.3) 0%, rgba(13,43,69,.1) 50%, rgba(13,43,69,.5) 100%);
  z-index: 1;
}

.hero-dots {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 10px;
  z-index: 2;
}
.hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: transparent;
  cursor: pointer; padding: 0;
  transition: background 0.3s, border-color 0.3s;
}
.hero-dot.active { background: var(--white); border-color: var(--white); }


/* ══════════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════════ */
.section {
  padding: 64px 0;
}
.cream-bg { background: var(--cream); }
.white-bg { background: var(--white); }


/* ══════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════ */
.page-header {
  margin-bottom: 40px;
}
.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  color: var(--deep);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 18px;
}
.center-eyebrow { text-align: center; }


/* ══════════════════════════════════════════════════
   HOME — VMO
══════════════════════════════════════════════════ */
.vmo-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 44px;
  align-items: start;
  margin-bottom: 52px;
}
.vmo-sep {
  background: var(--border);
  align-self: stretch;
}
.vmo-card p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Objectives */
.obj-block {
  border-top: 1px solid var(--border);
  padding-top: 40px;
  margin-bottom: 40px;
}
.obj-list {
  list-style: none;
  counter-reset: obj;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.obj-list li {
  counter-increment: obj;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.obj-list li::before {
  content: counter(obj, lower-roman);
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--sky);
  padding-top: 1px;
}

/* ══ STATEMENT OF VALUES — centred, bold, italic ══ */
.values-block {
  border-top: 1px solid var(--border);
  padding-top: 52px;
  padding-bottom: 8px;
  text-align: center;
}
.values-poem {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 4px;
}
.vp {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.3vw, 1.55rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.75;
  margin-bottom: 20px;
  color: #5a6370;
  text-align: center;
  letter-spacing: 0.01em;
}
.vp:last-child { margin-bottom: 0; }

/* Light italic connective text */
.vp em {
  font-style: italic;
  font-weight: 300;
  color: #5a6370;
}

/* Bold upright navy keywords — contrast against the light italic */
.vp strong {
  font-weight: 700;
  font-style: normal;
  color: var(--deep);
  letter-spacing: -0.01em;
}


/* ══════════════════════════════════════════════════
   WHO WE ARE — ACCORDION
══════════════════════════════════════════════════ */
.accordion-group {
  display: flex;
  flex-direction: column;
}
.acc-item { border-top: 1px solid var(--border); }
.acc-item:last-child { border-bottom: 1px solid var(--border); }

.acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  background: none; border: none;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  font-weight: 400;
  color: var(--deep);
  text-align: left;
  transition: color 0.2s;
}
.acc-trigger:hover { color: var(--sky); }

.acc-chevron {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: transform 0.3s var(--ease), border-color 0.2s, color 0.2s;
}
.acc-trigger[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
  border-color: var(--sky);
  color: var(--sky);
}

.acc-body[hidden] { display: none; }

.acc-content {
  padding-bottom: 44px;
  width: 100%;
}
.acc-content p {
  font-size: 0.97rem;
  line-height: 1.85;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 16px;
}
.acc-content p:last-child { margin-bottom: 0; }

/* IF / THEN blocks */
.if-blocks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}
.if-block {
  font-size: 0.97rem;
  line-height: 1.82;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  padding-left: 20px;
  border-left: 2px solid var(--sky);
}
.then-block {
  background: var(--cream);
  border-left: 3px solid var(--sky);
  padding: 16px 20px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 16px;
}


/* ══════════════════════════════════════════════════
   WHERE WE WORK
══════════════════════════════════════════════════ */
.country-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.ctab {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  color: var(--muted);
  transition: all 0.2s var(--ease);
}
.ctab:hover { border-color: var(--sky); color: var(--sky); }
.ctab.active { background: var(--deep); border-color: var(--deep); color: var(--white); }

.cpanel { display: none; }
.cpanel.active { display: block; animation: panelIn 0.35s var(--ease); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Country sub-accordion */
.cacc-group { display: flex; flex-direction: column; gap: 0; }

.cacc-item {
  background: var(--white);
  border-radius: var(--r);
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid var(--bordl);
}

.cacc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: none; border: none;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--deep);
  text-align: left;
  transition: color 0.2s;
}
.cacc-trigger:hover { color: var(--sky); }
.cacc-trigger[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
  border-color: var(--sky); color: var(--sky);
}

.cacc-body[hidden] { display: none; }
.cacc-body {
  padding: 0 22px 24px;
}
.cacc-body p {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 14px;
}
.cacc-body p:last-child { margin-bottom: 0; }

.tba { font-style: italic; color: var(--muted) !important; }

/* Board */
.board-intro {
  font-size: 0.94rem;
  line-height: 1.8;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 24px;
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}
.board-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--bordl);
  border-radius: var(--r);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.board-card:hover { border-color: var(--sky); box-shadow: 0 4px 16px rgba(46,134,171,.1); }
.board-init {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--deep);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.board-info strong {
  display: block;
  font-size: 0.86rem; font-weight: 600;
  color: var(--deep);
  margin-bottom: 5px; line-height: 1.3;
}
.board-info p {
  font-size: 0.81rem;
  line-height: 1.65;
  color: var(--muted);
  text-align: left !important;
  hyphens: none !important;
  margin: 0 !important;
}


/* ══════════════════════════════════════════════════
   WHAT WE DO — SERVICES
══════════════════════════════════════════════════ */
.svc-list { display: flex; flex-direction: column; }

.svc-item { border-top: 1px solid var(--border); }
.svc-item:last-child { border-bottom: 1px solid var(--border); }

.svc-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
  background: none; border: none;
  text-align: left;
  transition: all 0.2s;
}
.svc-name {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 400;
  color: var(--deep);
  line-height: 1.3;
  transition: color 0.2s;
}
.svc-item:hover .svc-name,
.svc-trigger[aria-expanded="true"] .svc-name { color: var(--sky); }

.svc-chevron {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: transform 0.3s var(--ease), border-color 0.2s, color 0.2s;
}
.svc-trigger[aria-expanded="true"] .svc-chevron {
  transform: rotate(180deg);
  border-color: var(--sky); color: var(--sky);
}

.svc-body[hidden] { display: none; }

/* ══ SERVICE CONTENT — Country Profile text style ══ */
.svc-content {
  padding: 0 0 44px 0;
  width: 100%;
}

.svc-content p {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 14px;
}
.svc-content p:last-child { margin-bottom: 0; }

/* ── OUTREACH: Full-width cinematic banner image ── */
#svc-outreach .svc-img-wrap {
  width: 100%;
  height: 340px;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 28px;
  position: relative;
}
#svc-outreach .svc-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  display: block;
  filter: saturate(0.9) contrast(1.04);
  transition: transform 0.6s ease;
}
#svc-outreach .svc-img-wrap:hover img { transform: scale(1.02); }

/* ── CLARB: Two images — large left + tall right stack ── */
#svc-clarb .svc-img-pair {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 300px;
  gap: 10px;
  margin-bottom: 28px;
}
#svc-clarb .svc-img-wrap {
  border-radius: var(--r);
  overflow: hidden;
  height: 100%;
  margin-bottom: 0;
  position: relative;
}
#svc-clarb .svc-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  filter: saturate(0.88);
  transition: transform 0.6s ease;
}
#svc-clarb .svc-img-wrap:hover img { transform: scale(1.03); }

/* ── EWER: Full-width image with dramatic tinted overlay ── */
#svc-ewer .svc-img-wrap {
  width: 100%;
  height: 320px;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 28px;
  position: relative;
}
#svc-ewer .svc-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 40%;
  display: block;
  filter: saturate(0.85) contrast(1.06);
  transition: transform 0.6s ease;
}
#svc-ewer .svc-img-wrap:hover img { transform: scale(1.02); }

/* ── Generic fallback img-wrap ── */
.svc-img-wrap {
  width: 100%;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 22px;
  height: 300px;
  cursor: zoom-in;
  position: relative;
}
.svc-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  filter: saturate(0.88);
  transition: transform 0.6s ease;
}
.svc-img-wrap:hover img { transform: scale(1.02); }
.svc-img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.svc-img-pair .svc-img-wrap { height: 240px; margin-bottom: 0; }

/* ── Text card panel — matches Country Profile white block ── */
.svc-text-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 32px 24px;
  width: 100%;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.svc-text-card p:last-child { margin-bottom: 0; }
.svc-img-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(13,43,69,0.0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s;
  border-radius: var(--r);
  pointer-events: none;
}
.svc-img-overlay svg { opacity: 0; transition: opacity 0.25s; }
.svc-img-wrap:hover .svc-img-overlay { background: rgba(13,43,69,0.32); }
.svc-img-wrap:hover .svc-img-overlay svg { opacity: 1; }

/* KRA */
.kra-wrap { margin-top: 22px; border-top: 1px solid var(--bordl); padding-top: 18px; }

.kra-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none;
  font-family: var(--sans);
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky);
  padding: 0;
  transition: color 0.2s;
}
.kra-btn:hover { color: var(--deep); }
.kra-btn svg { transition: transform 0.2s; }
.kra-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.kra-list[hidden] { display: none; }
.kra-list {
  margin-top: 14px;
  padding: 0;
  list-style: none;
  counter-reset: kra;
  display: flex; flex-direction: column; gap: 10px;
}
.kra-list li {
  counter-increment: kra;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.kra-list li::before {
  content: counter(kra) '.';
  font-family: var(--serif);
  font-size: 0.95rem; font-weight: 600;
  color: var(--sky);
}

/* Gallery intro text */
.gallery-intro {
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--ink2);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin-bottom: 20px;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gitem {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  background: var(--border);
}
.gitem img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease), filter 0.35s;
  filter: saturate(0.9);
}
.gitem:hover img { transform: scale(1.07); filter: saturate(1.15); }

.gitem-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,43,69,0);
  transition: background 0.3s var(--ease);
}
.gitem-overlay svg { opacity: 0; transition: opacity 0.25s; }
.gitem:hover .gitem-overlay { background: rgba(13,43,69,0.35); }
.gitem:hover .gitem-overlay svg { opacity: 1; }


/* ══════════════════════════════════════════════════
   NEWS RIBBON
══════════════════════════════════════════════════ */
.ribbon {
  background: var(--deep);
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.ribbon-label {
  flex-shrink: 0;
  padding: 0 18px 0 var(--pad);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--mid);
  height: 100%;
  display: flex; align-items: center;
  border-right: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
  z-index: 2;
}

.ribbon-track-wrap {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 32px, black calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black 32px, black calc(100% - 32px), transparent 100%);
}

.ribbon-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: rticker 55s linear infinite;
  will-change: transform;
}
.ribbon-track:hover,
.ribbon-track:focus-within { animation-play-state: paused; }

@keyframes rticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ribbon-row { display: flex; align-items: center; }

.ri {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 30px;
  height: 52px;
  font-size: 0.79rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}
.ri:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.ri-cat { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky); }
.ri-sep { color: rgba(255,255,255,0.25); }


/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 36px var(--pad) 24px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-col address {
  font-style: normal;
  font-size: 0.84rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.7);
}
.footer-col p {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.7);
}
.footer-center { text-align: center; }
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-socials {
  display: flex; align-items: center; gap: 16px;
}
.footer-socials a {
  color: rgba(255,255,255,0.45);
  transition: color 0.2s;
}
.footer-socials a:hover { color: var(--white); }

.footer-email {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  transition: color 0.2s;
}
.footer-email:hover { color: var(--white); }

.footer-tagline {
  text-align: center;
  padding: 18px 0 8px;
  font-family: var(--serif);
  font-size: clamp(0.88rem, 2vw, 1.15rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}
.footer-copy {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.08em;
}


/* ══════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════ */
.lb {
  position: fixed; inset: 0;
  background: rgba(5,12,25,0.95);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lb.open { opacity: 1; visibility: visible; }

.lb-inner {
  max-width: 92vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.lb-inner img {
  max-width: 92vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  transform: scale(0.9);
  transition: transform 0.3s var(--ease);
}
.lb.open .lb-inner img { transform: scale(1); }

.lb-close {
  position: absolute; top: 18px; right: 24px;
  background: none; border: none;
  color: rgba(255,255,255,0.7);
  font-size: 2.2rem; line-height: 1;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  z-index: 10;
  padding: 4px 8px;
}
.lb-close:hover { color: var(--white); transform: scale(1.1); }

.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 2rem; line-height: 1;
  width: 50px; height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.22); color: var(--white); }


/* ══════════════════════════════════════════════════
   FADE-IN ANIMATION
══════════════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }


/* ══════════════════════════════════════════════════
   RESPONSIVE — TABLET ≤ 900px
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --nav-h: 60px; }

  /* ── Navbar ── */
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 24px;
    border-top: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    overflow-y: auto;
    max-height: calc(100dvh - var(--nav-h));
    z-index: 800;
  }
  .nav-links.open { display: flex; }
  .has-dropdown { position: static; }
  .nav-link {
    color: var(--ink);
    padding: 15px var(--pad);
    font-size: 0.82rem;
    width: 100%;
    min-height: 48px;
  }
  .dropdown {
    position: static;
    opacity: 1; visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--bordl);
    margin-left: calc(var(--pad) + 12px);
    border-radius: 0;
    padding: 2px 0;
    display: none;
    width: auto;
    min-width: 0;
  }
  .has-dropdown.mob-open .dropdown { display: block; }
  .dropdown a { padding: 12px 14px; font-size: 0.82rem; min-height: 44px; display: flex; align-items: center; }

  /* ── Navbar always solid on non-home pages ── */
  .navbar {
    background: transparent;
    transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  }
  .navbar.scrolled { background: rgba(255,255,255,0.98); }

  /* ── Hero ── */
  .hero-dots { bottom: 24px; }
  .hero-dot { width: 12px; height: 12px; padding: 4px; box-sizing: content-box; }

  /* ── Layout ── */
  .section { padding: 48px 0; }
  .vmo-grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 36px; }
  .vmo-sep { display: none; }
  .page-header { margin-bottom: 28px; }

  /* ── Service accordion ── */
  .svc-trigger { grid-template-columns: 1fr 32px; gap: 14px; min-height: 56px; }
  .svc-content { padding-left: 0; padding-bottom: 32px; }
  .svc-text-card { padding: 20px 18px 18px; }

  /* ── Service image overlays always visible on touch ── */
  .svc-img-overlay { background: rgba(13,43,69,0.08); }
  .svc-img-overlay svg { opacity: 0.6; }

  /* ── Justified text — 6 specific sections on tablet ── */
  /* Country Profile */
  .cacc-body p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  /* Our Story & Intervention Logic */
  #acc-story-body .acc-content p,
  #acc-logic-body .acc-content p,
  #acc-logic-body .if-block,
  #acc-logic-body .then-block {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  /* Outreach & Advocacy, CLARB, EWER */
  #svc-outreach .svc-text-card p,
  #svc-clarb .svc-text-card p,
  #svc-ewer .svc-text-card p,
  #svc-outreach .kra-list li,
  #svc-clarb .kra-list li,
  #svc-ewer .kra-list li {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  /* ── Service images on tablet ── */
  #svc-outreach .svc-img-wrap { height: 280px; }
  #svc-ewer .svc-img-wrap { height: 260px; }
  #svc-clarb .svc-img-pair { grid-template-columns: 1.4fr 1fr; grid-template-rows: 260px; }

  /* ── Country tabs ── */
  .country-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; justify-content: flex-start; gap: 6px; }
  .country-tabs::-webkit-scrollbar { height: 2px; }
  .country-tabs::-webkit-scrollbar-thumb { background: var(--sky); border-radius: 2px; }
  .country-tabs-wrap { position: relative; }
  .country-tabs-wrap::after {
    content: '';
    position: absolute; right: 0; top: 0; bottom: 6px;
    width: 44px;
    background: linear-gradient(to right, transparent, var(--cream));
    pointer-events: none;
  }
  .ctab { min-height: 44px; display: inline-flex; align-items: center; font-size: 0.72rem; padding: 8px 14px; }

  /* ── Accordion triggers ── */
  .acc-trigger { min-height: 56px; padding: 18px 0; }
  .cacc-trigger { min-height: 48px; }
  .cacc-body { padding: 0 16px 20px; }
  .kra-btn { padding: 10px 0; min-height: 44px; }

  /* ── Board ── */
  .board-grid { grid-template-columns: 1fr; }

  /* ── Gallery ── */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gitem-overlay { background: rgba(13,43,69,0.12); }
  .gitem-overlay svg { opacity: 0.7; }

  /* ── Lightbox ── */
  .lb-close { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; top: 12px; right: 12px; font-size: 1.8rem; }

  /* ── Footer ── */
  .footer-inner { grid-template-columns: 1fr; gap: 16px; text-align: center; }
  .footer-center { text-align: center; }
  .footer-right { align-items: center; }
  .footer-col { display: flex; flex-direction: column; align-items: center; }
  .footer-col address { text-align: center; }
  .footer-socials { justify-content: center; }
  .footer-copy { text-align: center; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — MOBILE ≤ 600px
══════════════════════════════════════════════════ */
@media (max-width: 600px) {
  :root { --nav-h: 56px; }

  /* ── Section spacing ── */
  .section { padding: 36px 0; }
  .page-header { margin-bottom: 22px; }

  /* ── Hero ── */
  .hero { min-height: 480px; height: 85svh; }
  .hero-dots { bottom: 18px; }

  /* ── Typography ── */
  .page-title { font-size: clamp(1.6rem, 7vw, 2rem); }
  .vp { font-size: 0.98rem; line-height: 1.7; margin-bottom: 16px; text-align: left; }
  .acc-trigger { font-size: clamp(1.1rem, 4vw, 1.4rem); padding: 16px 0; }
  .svc-name { font-size: clamp(1rem, 4vw, 1.3rem); }

  /* ── Home cards ── */
  .vmo-card p { font-size: 0.95rem; }
  .obj-list li { font-size: 0.95rem; gap: 10px; }
  .values-block { padding-top: 36px; }

  /* ── Services ── */
  .svc-trigger { grid-template-columns: 1fr 28px; gap: 10px; padding: 18px 0; min-height: 52px; }
  .svc-content { padding-bottom: 24px; }
  .svc-text-card { padding: 16px 14px 14px; }

  /* ── Service images ── */
  #svc-outreach .svc-img-wrap { height: 200px; }
  #svc-ewer .svc-img-wrap { height: 185px; }
  #svc-clarb .svc-img-pair { grid-template-columns: 1fr; grid-template-rows: auto; }
  #svc-clarb .svc-img-wrap { height: 185px; }

  /* ── Country tabs ── */
  .ctab { font-size: 0.68rem; padding: 7px 12px; }
  .cacc-body { padding: 0 12px 18px; }
  .cacc-trigger { padding: 14px 16px; font-size: 0.84rem; }

  /* ── Board cards ── */
  .board-card { padding: 14px; gap: 10px; }
  .board-init { width: 40px; height: 40px; font-size: 0.74rem; flex-shrink: 0; }

  /* ── Gallery ── */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .gitem { aspect-ratio: 1/1; } /* Square on mobile — much better than squashed 4:3 */

  /* ── KRA button tap target ── */
  .kra-btn { padding: 8px 0; min-height: 44px; }

  /* ── Ribbon ── */
  .ri { padding: 0 16px; font-size: 0.73rem; }
  .ri-cat { font-size: 0.59rem; }
  .ribbon-label { font-size: 0.59rem; padding: 0 12px 0 14px; letter-spacing: 0.14em; }

  /* ── Lightbox ── */
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 1.4rem; }

  /* ── Footer ── */
  .footer-email { font-size: 0.77rem; word-break: break-all; }
  .footer-socials a { padding: 10px; margin: -10px; }
  .footer-tagline { padding: 14px 0 6px; font-size: 0.88rem; }

  /* ── Justified text — 6 specific sections on mobile ── */
  /* Country Profile */
  .cacc-body p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  /* Our Story & Intervention Logic */
  #acc-story-body .acc-content p,
  #acc-logic-body .acc-content p,
  #acc-logic-body .if-block,
  #acc-logic-body .then-block {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  /* Outreach & Advocacy, CLARB, EWER */
  #svc-outreach .svc-text-card p,
  #svc-clarb .svc-text-card p,
  #svc-ewer .svc-text-card p,
  #svc-outreach .kra-list li,
  #svc-clarb .kra-list li,
  #svc-ewer .kra-list li {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — SMALL PHONES ≤ 390px
══════════════════════════════════════════════════ */
@media (max-width: 390px) {
  html { font-size: 15px; }
  .svc-text-card { padding: 14px 12px; }
  .cacc-body { padding: 0 10px 16px; }
  .ctab { font-size: 0.65rem; padding: 6px 10px; }
  .page-title { font-size: 1.5rem; }
  .gallery-grid { gap: 4px; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — TABLET MID 601–900px (specific overrides)
══════════════════════════════════════════════════ */
@media (min-width: 601px) and (max-width: 900px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — LARGE SCREENS ≥ 1400px
══════════════════════════════════════════════════ */
@media (min-width: 1400px) {
  .container { max-width: 1280px; }
}

/* ══════════════════════════════════════════════════
   TOUCH DEVICE OVERRIDES
══════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover transforms — prevent stuck states on touch */
  .gitem:hover img { transform: none; }
  .svc-img-wrap:hover img { transform: none; }
  .board-card:hover { border-color: var(--bordl); box-shadow: none; }
  /* Ensure tappable affordance always visible */
  .gitem-overlay { background: rgba(13,43,69,0.14) !important; }
  .gitem-overlay svg { opacity: 0.75 !important; }
  .svc-img-overlay { background: rgba(13,43,69,0.10) !important; }
  .svc-img-overlay svg { opacity: 0.65 !important; }
}

/* ══════════════════════════════════════════════════
   LIGHTBOX — VERY SMALL SCREENS ≤ 480px
══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .lb-inner img { max-width: 100vw; max-height: 80vh; border-radius: 0; }
  .lb-inner { max-width: 100vw; }
  .lb::after {
    content: '← swipe →';
    position: absolute; bottom: 18px; left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem; letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    pointer-events: none;
  }
}

/* ══════════════════════════════════════════════════
   SAFE AREA — NOTCHED PHONES (iPhone X+)
══════════════════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .nav-links { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ── Keyboard focus styles (accessibility) ── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 2px;
}
.acc-trigger:focus-visible,
.cacc-trigger:focus-visible,
.svc-trigger:focus-visible,
.kra-btn:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 4px;
  border-radius: 2px;
}
.nav-link:focus-visible {
  outline: 2px solid rgba(255,255,255,0.8);
  outline-offset: 4px;
  border-radius: 2px;
}
.navbar.scrolled .nav-link:focus-visible {
  outline-color: var(--sky);
}
.ctab:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
.nav-hamburger:focus-visible {
  outline: 2px solid rgba(255,255,255,0.8);
  outline-offset: 4px;
  border-radius: 2px;
}
.navbar.scrolled .nav-hamburger:focus-visible {
  outline-color: var(--sky);
}
.lb-close:focus-visible,
.lb-prev:focus-visible,
.lb-next:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}
.hero-dot:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}
.dropdown a:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: -2px;
  border-radius: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .ribbon-track { animation: none; }
}

/* ── Print ── */
@media print {
  .navbar, .ribbon, .hero-dots { display: none; }
  .hero { height: 30vh; }
  .page.hidden { display: block !important; }
}
