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

:root {
  --bg: #F4F4F1;
  --bg-alt: #F4F4F1;
  --text: #1a1d23;
  --text-muted: #5a6270;
  --primary: #166D72;
  --primary-dark: #0f5559;
  --accent: #e36414;
  --border: #e0e0dc;
  --shadow: 0 4px 20px rgba(22, 109, 114, 0.10);
  --radius: 12px;
  --font: Arial, Helvetica, sans-serif;
  --font-display: Arial, Helvetica, sans-serif;
  --max-w: 1100px;
  --header-h: 72px;
}

html { scroll-behavior: smooth; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #F4F4F1;
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .section-title, .hero h1, .logo, .exp-role, .subsection-title {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

.container {
  width: min(100% - 2.5rem, var(--max-w));
  margin-inline: auto;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(244, 244, 241, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: box-shadow 0.3s;
}

.header.scrolled { box-shadow: var(--shadow); }

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

.logo {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 1.75rem;
}

.nav a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
  padding: calc(var(--header-h) + 4.5rem) 0 5rem;
  background: #F4F4F1;
}

.hero-inner { max-width: 780px; }

.hero-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.15;
  color: #166D72;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.hero-summary {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.925rem;
  color: var(--text-muted);
}

.hero-meta a { color: var(--text-muted); }
.hero-meta a:hover { color: var(--primary); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

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

/* ===== Sections ===== */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  display: block;
  width: 100%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 2rem;
  padding: 0.85rem 1.15rem;
  color: #ffffff;
  background: var(--primary);
  border-left: 6px solid var(--accent);
  border-radius: 5px;
  position: relative;
}

.section-title::after { display: none; }

.section-intro {
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 2.5rem;
  margin-top: -1rem;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.1rem;
  color: var(--text-muted);
}

.about-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.about-card h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.about-card ul {
  list-style: none;
}

.about-card li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.about-card li:last-child { border-bottom: none; }

.about-card strong { color: var(--text); }

/* ===== Timeline / Experience ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.exp-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: box-shadow 0.25s, transform 0.25s;
}

.exp-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.exp-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.6rem;
}

.exp-role {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.exp-org {
  color: var(--primary);
  font-weight: 500;
}

.exp-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.exp-location {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.exp-points {
  list-style: none;
  margin-top: 0.5rem;
}

.exp-points li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.exp-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

.exp-toggle {
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.exp-toggle:hover { color: var(--accent); }

.exp-details { display: none; }
.exp-card.open .exp-details { display: block; }
.exp-card.open .exp-toggle::after { content: ' ▲'; }
.exp-card:not(.open) .exp-toggle::after { content: ' ▼'; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.skill-group {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.skill-group h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-tag {
  background: #e8f2f5;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

/* ===== Portfolio ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.port-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
}

.port-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.port-card .port-icon {
  width: 42px;
  height: 42px;
  background: #e8f2f5;
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.port-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.port-card p {
  font-size: 0.925rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.port-metric {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ===== Education ===== */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.subsection-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.edu-item {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.edu-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.edu-degree {
  font-weight: 600;
  font-size: 1rem;
}

.edu-school {
  color: var(--text-muted);
  font-size: 0.925rem;
}

.edu-year {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.2rem;
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cert-tag {
  background: #f0f4f7;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-info > p {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 48ch;
}

.contact-list {
  list-style: none;
}

.contact-list li {
  margin-bottom: 1.35rem;
}

.contact-list strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contact-card {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.contact-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.contact-card p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.contact-card .btn-primary {
  background: #fff;
  color: var(--primary);
}

.contact-card .btn-primary:hover {
  background: #f0f7f9;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  font-weight: 500;
  font-size: 0.95rem;
}

/* ===== Footer ===== */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about-grid,
  .edu-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #F4F4F1;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle { display: flex; }
}

@media (max-width: 540px) {
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ===== Profile Photo ===== */
.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 960px;
}

.hero-photo-wrap {
  flex-shrink: 0;
}

.profile-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 8px 30px rgba(15, 76, 92, 0.18);
  background: #e8f2f5;
}

/* ===== Gallery / Photo Archive ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e8f2f5;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 76, 92, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item .caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
}

.gallery-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.gallery-empty code {
  background: #e8f2f5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ===== Certificates Grid ===== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cert-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
  cursor: pointer;
}

.cert-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.cert-card .cert-img-wrap {
  aspect-ratio: 4/3;
  background: #f0f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cert-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

.cert-card .cert-info {
  padding: 1rem 1.15rem;
}

.cert-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.cert-card .cert-issuer {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cert-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.cert-placeholder span {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.92);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(90vw, 900px);
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.85;
}

.lightbox-close:hover { opacity: 1; }

#lightboxCaption {
  color: #fff;
  margin-top: 1rem;
  font-size: 0.95rem;
  text-align: center;
  max-width: 600px;
}

/* ===== Responsive adjustments for photo ===== */
@media (max-width: 700px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .profile-photo {
    width: 140px;
    height: 140px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-meta {
    justify-content: center;
  }
}


/* ===== Organizations & Programme Partners ===== */
.organizations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1rem;
}
.organization-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.15rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 125px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.organization-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.organization-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f2f5;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.organization-copy h3 {
  font-size: 0.98rem;
  line-height: 1.35;
  margin: 0 0 0.3rem;
}
.organization-type {
  display: inline-block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.organization-copy p {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}


/* Organization cards with positions grouped under each employer */
.organization-card { min-height: 0; }
.organization-copy { min-width: 0; flex: 1; }
.organization-positions { list-style: none; padding: 0; margin: 0.55rem 0 0; }
.organization-positions li { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.organization-positions li:first-child { border-top: 0; padding-top: 0.2rem; }
.organization-positions strong, .organization-positions span, .organization-positions small { display: block; }
.organization-positions strong { font-size: 0.86rem; line-height: 1.4; }
.organization-positions span { margin-top: 0.18rem; color: var(--text-muted); font-size: 0.78rem; }
.organization-positions small { margin-top: 0.12rem; color: var(--text-muted); font-size: 0.76rem; }
