/* ============================================
   Uganda Climate Data Platform — Mission Site
   Palette: Salmon Paste / Cantaloupe / Lemon Posset / Yellow Green / Powder Blue
   ============================================ */

:root {
  --salmon: #E07970;
  --cantaloupe: #DE8948;
  --lemon: #F9D58D;
  --olive: #BBAB47;
  --powder-blue: #CDD7D8;

  --salmon-deep: #A8433C;
  --cantaloupe-deep: #96581E;
  --olive-deep: #6E6329;
  --blue-deep: #48595B;

  --ink: #2B2723;
  --ink-soft: #5C564C;

  --bg: #FBF3E2;
  --bg-alt: #F4E8CE;
  --card-bg: #FFFFFF;
  --border: #EAD9B0;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --shadow-sm: 0 2px 8px rgba(43, 39, 35, 0.08);
  --shadow-md: 0 10px 26px rgba(43, 39, 35, 0.14);
  --shadow-lg: 0 18px 44px rgba(43, 39, 35, 0.2);

  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--salmon-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 94%;
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Overview text keeps a readable line length even on ultrawide screens,
   but sits noticeably wider than before — no more tiny centered column. */
/* .narrow removed — Overview and Team sections now use the full-width container like the rest of the page */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 226, 0.97);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand:hover { text-decoration: none; }

.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}
.nav-link.active { color: var(--salmon-deep); }
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--salmon);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
  transform-origin: center;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: heroZoom 22s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(72, 89, 91, 0.5) 0%, rgba(43, 39, 35, 0.55) 55%, rgba(43, 39, 35, 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: 64px;
  color: var(--bg);
  animation: fadeUp 0.9s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lemon);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.8rem);
  line-height: 1.1;
  color: #FFFFFF;
  margin-bottom: 18px;
  white-space: nowrap;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 400;
  color: var(--bg);
  white-space: nowrap;
  margin-bottom: 10px;
}

@media (max-width: 760px) {
  .hero h1, .hero-sub { white-space: normal; }
}

.hero-dates {
  font-size: 0.95rem;
  color: var(--lemon);
  margin-bottom: 30px;
  letter-spacing: 0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 34px;
}

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn-primary {
  background: var(--salmon);
  color: #fff;
}
.btn-primary:hover {
  background: var(--salmon-deep);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: rgba(251, 243, 226, 0.6);
  color: var(--bg);
}
.btn-outline:hover {
  background: rgba(251, 243, 226, 0.15);
  border-color: var(--bg);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 0.82rem;
  color: rgba(251, 243, 226, 0.85);
  border-top: 1px solid rgba(251, 243, 226, 0.25);
  padding-top: 18px;
  max-width: 720px;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  background: var(--blue-deep);
  padding: 38px 0;
}

.stats-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  text-align: center;
}

.stats-divider {
  width: 1px;
  align-self: stretch;
  min-height: 44px;
  background: rgba(251, 243, 226, 0.22);
}

.partner-logos {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 56px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(251, 243, 226, 0.94);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.logo-chip:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  text-decoration: none;
}
.logo-chip img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--lemon);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(251, 243, 226, 0.85);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---------- Section basics ---------- */
.section { padding: 88px 0; }
.section.overview { background: var(--bg); }

.section-title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--cantaloupe);
  margin-top: 14px;
  border-radius: 2px;
}

.section-intro {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 640px;
  margin-top: 18px;
  margin-bottom: 8px;
}

.overview p {
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 1.03rem;
}
.overview p:first-of-type { margin-top: 30px; }

/* ---------- Mission log: timeline-card layout ---------- */
.mission-log { background: var(--bg-alt); }

.day-timeline {
  position: relative;
  margin-top: 56px;
  padding-left: 32px;
  border-left: 2px solid var(--border);
}

.day-entry {
  position: relative;
  margin-bottom: 64px;
  padding-left: 34px;
}
.day-entry:last-child { margin-bottom: 0; }

.day-marker {
  position: absolute;
  left: -49px;
  top: 4px;
}

.day-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--salmon);
  border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 2px var(--border);
}

.day-entry.accent-salmon .day-dot { background: var(--salmon-deep); }
.day-entry.accent-cantaloupe .day-dot { background: var(--cantaloupe-deep); }
.day-entry.accent-olive .day-dot { background: var(--olive-deep); }
.day-entry.accent-blue .day-dot { background: var(--blue-deep); }

.day-heading {
  font-size: 1.55rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.day-entry.accent-salmon .day-heading { color: var(--salmon-deep); }
.day-entry.accent-cantaloupe .day-heading { color: var(--cantaloupe-deep); }
.day-entry.accent-olive .day-heading { color: var(--olive-deep); }
.day-entry.accent-blue .day-heading { color: var(--blue-deep); }

.subsection {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.subsection:last-child { margin-bottom: 0; }
.subsection:hover { box-shadow: var(--shadow-md); }

.subsection h3 {
  font-size: 1.28rem;
  margin-bottom: 12px;
  color: var(--ink);
}

.subsection p {
  color: var(--ink-soft);
  margin-bottom: 20px;
  font-size: 0.98rem;
}

/* ---------- Photo grid ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.photo-card {
  --photo-h: 190px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.photo-card:hover,
.photo-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  outline: none;
}

.photo-card img {
  width: 100%;
  height: var(--photo-h);
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.photo-card:hover img,
.photo-card:active img {
  transform: scale(1.06);
}

/* Dark scrim behind the "View" hint so it reads over any photo */
.photo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--photo-h);
  background: rgba(30, 26, 20, 0.28);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.photo-card:hover::before,
.photo-card:focus-visible::before {
  opacity: 1;
}

.view-hint {
  position: absolute;
  top: calc(var(--photo-h) / 2);
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(251, 243, 226, 0.22);
  border: 1px solid rgba(251, 243, 226, 0.6);
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.photo-card:hover .view-hint,
.photo-card:focus-visible .view-hint {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Touch devices can't hover, so the hint isn't a dark overlay badge on
   the photo — it's a small plain line of text tucked next to the caption. */
@media (hover: none) {
  .photo-card::before { display: none; }
  .view-hint {
    position: static;
    display: inline-flex;
    transform: none;
    opacity: 0.85;
    background: none;
    border: none;
    backdrop-filter: none;
    padding: 6px 12px 0;
    margin: 0;
    border-radius: 0;
    color: var(--salmon-deep);
    font-size: 0.68rem;
    font-weight: 600;
  }
  .view-hint svg { width: 10px; height: 10px; }
  .photo-card figcaption { padding-top: 2px; }
}

.photo-card figcaption {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 10px 12px 12px;
  line-height: 1.4;
}

/* ---------- Discussion video section ---------- */
.discussion-section { background: var(--bg-alt); }
.discussion-section .section-intro { max-width: none; white-space: nowrap; }
@media (max-width: 860px) {
  .discussion-section .section-intro { white-space: normal; }
}
.video-wrap {
  max-width: 900px;
  margin: 8px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: #000;
}
.video-wrap video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* ---------- Team / acknowledgements section ---------- */
.team-section { background: var(--bg); }
.team-section .container:first-child { margin-bottom: 34px; }
.team-section .section-intro { max-width: none; white-space: nowrap; }
@media (max-width: 860px) {
  .team-section .section-intro { white-space: normal; }
}
.team-section .photo-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.team-section .photo-card img { height: 280px; }
.team-section .photo-card { --photo-h: 280px; }

@media (max-width: 520px) {
  .team-section .photo-card img { height: 220px; }
  .team-section .photo-card { --photo-h: 220px; }
}

/* ---------- Gallery section ---------- */
.gallery-section {
  background: var(--blue-deep);
}
.gallery-section .section-title,
.gallery-section .section-intro {
  color: var(--bg);
}
.gallery-section .section-title::after { background: var(--lemon); }
.gallery-section .section-intro { color: rgba(251, 243, 226, 0.75); }

.gallery-section .photo-card {
  background: rgba(251, 243, 226, 0.06);
  border-color: rgba(251, 243, 226, 0.18);
}
.gallery-section .photo-card figcaption {
  color: rgba(251, 243, 226, 0.75);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(251, 243, 226, 0.8);
  padding: 44px 0 36px;
  text-align: center;
}
.site-footer p { margin-bottom: 8px; font-size: 0.88rem; }
.site-footer a { color: var(--lemon); }
.back-to-top {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.82rem;
  color: rgba(251, 243, 226, 0.6);
  transition: color 0.2s var(--ease);
}
.back-to-top:hover { color: var(--lemon); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  padding: 40px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0s;
}

.lightbox img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92);
  transition: transform 0.35s var(--ease);
}
.lightbox.open img {
  transform: scale(1);
}

.lightbox-caption {
  color: var(--bg);
  margin-top: 18px;
  max-width: 640px;
  text-align: center;
  font-size: 0.92rem;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: var(--bg);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.lightbox-close:hover { transform: rotate(90deg); }

/* ---------- Scroll-reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-bg { animation: none; }
  .hero-content { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .container { padding: 0 18px; }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 0 18px;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease), padding 0.4s var(--ease);
  }
  .site-nav.open {
    max-height: 480px;
    opacity: 1;
    padding: 18px 18px 26px;
  }
  .site-nav .nav-link {
    width: 100%;
    padding: 10px 0;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .site-nav.open .nav-link {
    opacity: 1;
    transform: translateX(0);
  }
  .stats-band { flex-direction: column; gap: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 320px; }
  .stats-divider { width: 60%; min-height: 1px; height: 1px; align-self: center; }
  .logo-chip { width: 110px; height: 48px; }
  .stat-num { font-size: 1.6rem; }
  .section { padding: 56px 0; }

  /* Collapse the desktop timeline rail — it eats too much width on phones.
     Swap it for a simple colored left-border stripe on each day card instead. */
  .day-timeline { padding-left: 0; border-left: none; margin-top: 34px; }
  .day-entry { padding-left: 0; margin-bottom: 40px; }
  .day-marker { display: none; }
  .day-heading {
    padding-left: 14px;
    border-left: 4px solid var(--border);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 16px;
  }
  .day-entry.accent-salmon .day-heading { border-left-color: var(--salmon-deep); }
  .day-entry.accent-cantaloupe .day-heading { border-left-color: var(--cantaloupe-deep); }
  .day-entry.accent-olive .day-heading { border-left-color: var(--olive-deep); }
  .day-entry.accent-blue .day-heading { border-left-color: var(--blue-deep); }

  .subsection { padding: 20px 16px; }
  .hero { min-height: 92vh; }
}

@media (max-width: 520px) {
  .container { padding: 0 14px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo-card { --photo-h: 140px; }
  .photo-card img { height: 140px; }
  .photo-card figcaption { padding: 8px 10px 10px; font-size: 0.74rem; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .stat-label { font-size: 0.66rem; }
  .subsection { padding: 18px 14px; }
  .day-heading { padding-left: 12px; }
  .section-title { font-size: 1.7rem; }
}
