/* =========================================================
   FTA — Farming & Technology In Africa
   Design tokens
   ========================================================= */
:root {
  --forest: #1b3b1f;
  --forest-deep: #12280f;
  --leaf: #5da83f;
  --leaf-light: #8ec46c;
  --sky: #2f7fb8;
  --cream: #f7f6f1;
  --cream-deep: #efece2;
  --soil: #3d2f22;
  --sun: #e8a33d;
  --ink: #1c211b;
  --white: #ffffff;

  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Karla', 'Segoe UI', sans-serif;

  --radius-hill: 0 0 999px 999px / 0 0 60px 60px;
  --shadow-soft: 0 12px 30px -12px rgba(18, 40, 15, 0.25);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest-deep);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}
p { margin: 0 0 1em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
button { font-family: inherit; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 6px;
  font-weight: 600;
  border: 2px solid var(--forest);
  background: var(--forest);
  color: var(--white);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { background: var(--forest-deep); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: var(--white); }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--forest-deep); }
.btn-sun:hover { background: #d6912e; }

/* =========================================================
   Announcement bar
   ========================================================= */
.announcement-bar { overflow: hidden; padding: 8px 0; font-size: 0.9rem; }
.announcement-track {
  display: flex; gap: 60px; white-space: nowrap; padding: 0 20px;
}
.announcement-bar.is-scrolling .announcement-track {
  width: max-content;
  animation: marquee 22s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.announcement-bar:not(.is-scrolling) .announcement-track { justify-content: center; }
.announcement-bar:not(.is-scrolling) .announcement-track span:last-child { display: none; }

/* =========================================================
   Header / Mega menu
   ========================================================= */
.site-header { background: var(--white); box-shadow: 0 2px 12px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 200; }
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 60px; width: auto; max-width: 220px; object-fit: contain; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--forest-deep); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 6px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--forest-deep); border-radius: 2px; }

.mega-menu { display: flex; align-items: center; gap: 28px; }
.menu-top { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.menu-item { position: relative; }
.menu-item > a {
  display: block; padding: 12px 14px; font-weight: 600; color: var(--forest-deep);
  border-radius: 6px; transition: background .15s ease, color .15s ease;
}
.menu-item > a:hover, .menu-item.open > a { background: var(--cream-deep); color: var(--leaf); }

.mega-panel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow-soft);
  padding: 18px; min-width: 340px;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease;
}
.menu-item.has-children:hover .mega-panel,
.menu-item.has-children.open .mega-panel { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega-panel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mega-sub { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.mega-sub:hover { background: var(--cream); }
.mega-sub img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.mega-sub span { font-size: 0.92rem; font-weight: 500; }

.lang-switch { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem; color: var(--forest); }
.lang-switch a { padding: 4px 6px; opacity: .55; }
.lang-switch a.active { opacity: 1; color: var(--leaf); }

/* =========================================================
   Hero zone: left slider / right scrolling news
   ========================================================= */
.hero-zone {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px;
  max-width: var(--container); margin: 28px auto; padding: 0 20px;
}
.hero-slider {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 420px;
  background: var(--forest-deep); box-shadow: var(--shadow-soft);
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease;
}
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 32px;
  background: linear-gradient(0deg, rgba(18,40,15,.92) 5%, rgba(18,40,15,0) 85%);
  color: var(--white);
}
.hero-slide-overlay h2 { color: var(--white); font-size: clamp(1.4rem, 3vw, 2.1rem); max-width: 560px; }
.hero-slide-overlay p { max-width: 520px; opacity: .9; }
.hero-dots { position: absolute; bottom: 14px; right: 22px; display: flex; gap: 8px; z-index: 5; }
.hero-dots button { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.4); padding: 0; }
.hero-dots button.active { background: var(--sun); width: 22px; border-radius: 5px; }

.news-ticker {
  border-radius: 18px; background: var(--white); box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; min-height: 420px; overflow: hidden;
}
.news-ticker-head { padding: 18px 20px 10px; border-bottom: 1px solid var(--cream-deep); }
.news-ticker-head h3 { margin: 0; font-size: 1.05rem; }
.news-ticker-viewport { flex: 1; overflow: hidden; position: relative; }
.news-ticker-track { display: flex; flex-direction: column; }
.news-ticker-track.animate { animation: ticker-scroll linear infinite; }
@keyframes ticker-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.news-ticker-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--cream); }
.news-ticker-item img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.news-ticker-item h4 { margin: 0 0 4px; font-size: 0.92rem; font-family: var(--font-body); font-weight: 700; color: var(--ink); }
.news-ticker-item span { font-size: 0.78rem; color: var(--leaf); font-weight: 600; }

/* =========================================================
   Section shell + hill divider (brand motif)
   ========================================================= */
.section { padding: 64px 0; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-alt { background: var(--cream-deep); }
.hill-divider { height: 60px; background: var(--cream); border-radius: var(--radius-hill); margin-top: -1px; }

/* =========================================================
   Focus areas (boxed, opens modal)
   ========================================================= */
.focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.focus-card {
  background: var(--white); border-radius: 16px; padding: 26px 22px; text-align: left;
  border: 1px solid var(--cream-deep); box-shadow: var(--shadow-soft);
  transition: transform .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; gap: 14px; width: 100%;
}
.focus-card:hover { transform: translateY(-4px); border-color: var(--leaf-light); }
.focus-card .focus-icon {
  width: 56px; height: 56px; border-radius: 14px; background: var(--cream-deep);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.focus-card .focus-icon img { width: 100%; height: 100%; object-fit: cover; }
.focus-card h3 { font-size: 1.15rem; margin: 0; }
.focus-card p { color: #4a5245; font-size: 0.92rem; margin: 0; }
.focus-card .focus-link { color: var(--leaf); font-weight: 700; font-size: 0.85rem; margin-top: auto; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,40,15,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .25s ease; z-index: 500;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--white); border-radius: 18px; max-width: 620px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 32px;
  transform: translateY(16px) scale(.98); transition: transform .25s ease;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-close { float: right; background: var(--cream-deep); border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; }
.modal-box img { border-radius: 12px; margin-bottom: 16px; }

/* =========================================================
   Projects — alternating asymmetric rows
   ========================================================= */
.projects-list { display: flex; flex-direction: column; gap: 46px; }
.project-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
}
.project-row:nth-child(even) { direction: rtl; }
.project-row:nth-child(even) > * { direction: ltr; }
.project-media { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-soft); aspect-ratio: 4/3; }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-badge {
  position: absolute; top: 16px; left: 16px; background: var(--sun); color: var(--forest-deep);
  font-weight: 700; font-size: 0.75rem; padding: 6px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .02em;
}
.project-body h3 { font-size: 1.6rem; }
.project-body p { color: #4a5245; }
.project-meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--leaf); font-weight: 700; margin-bottom: 14px; }

/* =========================================================
   News / Resources grids
   ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.news-card, .resource-card { background: var(--white); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; }
.news-card img, .resource-card .thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.news-card .body, .resource-card .body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--sky); background: rgba(47,127,184,.1); padding: 3px 10px; border-radius: 999px; width: fit-content; }
.news-card h3, .resource-card h3 { font-size: 1.05rem; margin: 0; }
.card-footer-link { margin-top: auto; font-weight: 700; color: var(--leaf); font-size: 0.85rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter-bar a { padding: 8px 16px; border-radius: 999px; border: 2px solid var(--cream-deep); font-weight: 600; font-size: 0.85rem; }
.filter-bar a.active, .filter-bar a:hover { border-color: var(--leaf); color: var(--leaf); }

/* =========================================================
   Rich text content areas (news/project/page detail bodies)
   ========================================================= */
.prose { max-width: 760px; margin: 0 auto; }
.prose img { border-radius: 14px; margin: 20px 0; }
.prose iframe, .prose .ql-video {
  width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 14px; margin: 20px 0; display: block;
}
.prose h2 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }

/* =========================================================
   Contact form
   ========================================================= */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }
.form-field input, .form-field textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--cream-deep); border-radius: 8px;
  font-family: inherit; font-size: 0.95rem; background: var(--white);
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--leaf); }
.alert-success { background: rgba(93,168,63,.12); border: 2px solid var(--leaf); color: var(--forest-deep); padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; }

/* =========================================================
   Breadcrumb / page hero
   ========================================================= */
.page-hero { background: var(--forest-deep); color: var(--white); padding: 56px 0 70px; margin-bottom: -40px; border-radius: var(--radius-hill); }
.page-hero h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-hero p { color: rgba(255,255,255,.8); max-width: 620px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: var(--forest-deep); color: rgba(255,255,255,.82); margin-top: 60px; }
.footer-inner {
  max-width: var(--container); margin: 0 auto; padding: 56px 20px 36px;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { height: 40px; width: auto; }
.footer-brand .brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--white); }
.footer-tagline { color: rgba(255,255,255,.65); font-size: 0.92rem; max-width: 320px; }
.site-footer h4 { color: var(--white); font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.site-footer p { margin: 0 0 8px; font-size: 0.92rem; }
.site-footer a { color: rgba(255,255,255,.82); transition: color .15s ease; }
.site-footer a:hover { color: var(--leaf-light); }
.social-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.social-links a { font-weight: 600; font-size: 0.85rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 20px; text-align: center; }
.footer-bottom p { margin: 0; font-size: 0.82rem; color: rgba(255,255,255,.55); }

@media (max-width: 780px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .hero-zone { grid-template-columns: 1fr; }
  .project-row, .project-row:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .mega-menu {
    position: fixed; top: 0; right: -100%; height: 100vh; width: 82%; max-width: 340px;
    background: var(--white); flex-direction: column; align-items: flex-start; padding: 90px 24px 24px;
    transition: right .3s ease; overflow-y: auto; box-shadow: -10px 0 30px rgba(0,0,0,.1);
  }
  .mega-menu.open { right: 0; }
  .menu-top { flex-direction: column; width: 100%; gap: 0; }
  .menu-item { width: 100%; }
  .mega-panel {
    position: static; transform: none; box-shadow: none; opacity: 1; visibility: visible;
    display: none; min-width: 0; padding: 6px 0 6px 14px;
  }
  .menu-item.open .mega-panel { display: block; }
  .mega-panel-grid { grid-template-columns: 1fr; }
  .lang-switch { margin-top: 20px; }
}

@media (max-width: 600px) {
  .header-inner { padding: 12px 16px; }
  .hero-slider, .news-ticker { min-height: 300px; }
  .section { padding: 44px 0; }
  .focus-grid { grid-template-columns: 1fr 1fr; }
}
