/* ============================================
   SIDA — Sustainable Impact Development Agency
   Design tokens
   ============================================ */
:root {
  --ink: #1a1a16;
  --paper: #f6f3ea;
  --surface: #ffffff;
  --forest: #1e5121;
  --forest-light: #2e7d32;
  --ochre: #c97a2b;
  --ochre-dark: #a5611e;
  --green: #2e7d32;
  --line: rgba(26, 26, 22, 0.14);
  --shadow: 0 10px 30px rgba(30, 81, 33, 0.14);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 68ch;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--forest);
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { max-width: var(--measure); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header / Nav ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: 1120px;
  margin: 0 auto;
}

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

.brand img { width: 34px; height: 34px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--forest);
  letter-spacing: 0.01em;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.98rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  border-bottom-color: var(--ochre);
  color: var(--forest);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  nav.main-nav { display: none; }
  nav.main-nav.open { display: block; width: 100%; }
  nav.main-nav.open ul { flex-direction: column; gap: 4px; padding: 14px 0; }
  .nav-toggle { display: inline-block; }
  .nav-row { flex-wrap: wrap; }
}

/* ---------- Ticker / marquee ---------- */
.ticker-wrap {
  background: var(--forest);
  color: var(--paper);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid rgba(246,243,234,0.15);
}

.ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 26s linear infinite;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding-top: 9px;
  padding-bottom: 9px;
}

.ticker-track span.dot {
  color: var(--ochre);
  margin: 0 0.9em;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
}

.hero .eyebrow-free {
  color: var(--green);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero p.lede {
  font-size: 1.15rem;
  color: #3a3a33;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--ochre);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ochre-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--forest);
  color: var(--forest);
}
.btn-outline:hover { background: var(--forest); color: var(--paper); }
.btn-outline.active { background: var(--forest); color: var(--paper); }

/* ---------- Team section ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
}

.team-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 14px;
}

.team-card h3 { margin-bottom: 2px; font-size: 1.05rem; }
.team-card .student-id { color: #6b6b60; font-size: 0.9rem; }

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
  margin-top: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.carousel-viewport {
  position: relative;
  aspect-ratio: 16 / 8;
  overflow: hidden;
}

.carousel-viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-viewport img.active { opacity: 1; }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dots button {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  padding: 0;
}
.carousel-dots button.active { background: var(--ochre); }

.carousel-arrows button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  margin-left: 8px;
}

/* ---------- Programme cards (About page) ---------- */
.programme-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.programme-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 20px;
  cursor: pointer;
  position: relative;
}

.programme-card:hover { border-color: var(--ochre); }

.programme-card h3 { margin-bottom: 6px; }

.programme-card .hint {
  font-size: 0.85rem;
  color: var(--green);
  margin-top: 10px;
}

section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type { border-bottom: none; }

.section-label {
  color: var(--ochre-dark);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* ---------- Forms ---------- */
form.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin-top: 24px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  border-radius: 3px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--ochre);
  outline-offset: 1px;
  border-color: var(--ochre);
}

.field .error-msg {
  color: #a5321e;
  font-size: 0.85rem;
  margin-top: 4px;
  display: none;
}

.field.invalid .error-msg { display: block; }
.field.invalid input,
.field.invalid textarea { border-color: #a5321e; }

/* ---------- Contact info block ---------- */
.contact-meta {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.contact-meta div { border-left: 3px solid var(--ochre); padding-left: 14px; }
.contact-meta h4 { margin: 0 0 4px; font-size: 0.85rem; color: var(--green); text-transform: none; }
.contact-meta p { margin: 0; font-size: 0.95rem; }

/* ---------- Modal / popup ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 22, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--paper);
  border: 1px solid var(--line);
  max-width: 420px;
  width: 100%;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow);
}

.modal-box h3 { margin-bottom: 10px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}

/* Info popover (programme hover/click) */
.popover {
  position: absolute;
  z-index: 60;
  background: var(--forest);
  color: var(--paper);
  padding: 14px 16px;
  max-width: 260px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  display: none;
}
.popover.open { display: block; }
.popover:after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 24px;
  border: 8px solid transparent;
  border-top-color: var(--forest);
}

/* ---------- Table (dashboard) ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--surface);
}

table.data-table th,
table.data-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.94rem;
}

table.data-table th {
  background: var(--forest);
  color: var(--paper);
  font-weight: 600;
}

table.data-table tr:nth-child(even) td { background: #efece1; }

.row-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 3px 6px;
  text-decoration: underline;
}
.row-actions .del { color: #a5321e; }
.row-actions .edit { color: var(--forest); }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--forest);
  color: var(--paper);
  padding: 40px 0;
  margin-top: 40px;
}

footer.site-footer a { text-decoration: none; color: var(--paper); opacity: 0.85; }
footer.site-footer a:hover { opacity: 1; text-decoration: underline; }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.92rem;
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-muted { color: #6b6b60; }
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.pill {
  display: inline-block;
  background: rgba(74,124,89,0.14);
  color: var(--green);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.badge-flash {
  background: rgba(201,122,43,0.15);
  border: 1px solid var(--ochre);
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-top: 16px;
  display: none;
}
.badge-flash.show { display: block; }
