/* NHLDS — National Health Laboratory and Diagnostic Services */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Work+Sans:wght@500;600;700&display=swap");

:root {
  --color-primary: #0c5c6e;
  --color-primary-dark: #083d4a;
  --color-primary-light: #0e8a9e;
  --color-accent: #10b981;
  --color-accent-emerald: #10b981;
  --color-accent-sky: #0ea5e9;
  --color-accent-violet: #8b5cf6;
  --color-accent-coral: #f97316;
  --color-accent-amber: #f59e0b;
  --color-accent-rose: #f43f5e;
  --color-accent-soft: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-surface-mint: #ecfdf5;
  --color-surface-sky: #f0f9ff;
  --color-surface-violet: #f5f3ff;
  --color-surface-warm: #fffbeb;
  --color-text: #0f2830;
  --color-text-muted: #5b7280;
  --color-border: #cce5eb;
  --color-uganda-red: #d90000;
  --color-uganda-yellow: #fcd116;
  --color-uganda-black: #1a1a1a;
  --font-display: "Work Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --shadow-sm: 0 1px 3px rgba(8, 61, 74, 0.07);
  --shadow-md: 0 8px 24px rgba(8, 61, 74, 0.1);
  --shadow-lg: 0 20px 48px rgba(8, 61, 74, 0.12);
  --shadow-glow-emerald: 0 8px 28px rgba(16, 185, 129, 0.22);
  --radius: 12px;
  --radius-lg: 20px;
  --header-top-h: 36px;
  --header-main-h: 72px;
  --header-nav-h: 48px;
  --header-h: calc(var(--header-top-h) + var(--header-main-h));
  --header-sticky-h: calc(var(--header-top-h) + var(--header-main-h) + var(--header-nav-h));
  --max-width: 1200px;
  --transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

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

a {
  color: var(--color-primary-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-emerald);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-primary-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1rem; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
  font-weight: 600;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* Header — MakSPH-style: utility bar, logo row, horizontal nav / slide drawer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.header-top {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8125rem;
}

.header-top-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.4rem 1.5rem;
  min-height: var(--header-top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-top-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.header-top-address {
  color: inherit;
}

.header-top-divider {
  opacity: 0.55;
}

.header-top a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.header-top a:hover {
  color: #fff;
}

.header-top-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-top-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.header-main {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-main-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-search {
  flex: 1 1 14rem;
  max-width: 24rem;
  display: flex;
  align-items: center;
  margin-left: auto;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-surface-elevated);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 2rem;
}

.header-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--color-text);
}

.header-search-input:focus {
  outline: none;
}

.header-search:focus-within {
  border-color: var(--color-accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  border: none;
  background: var(--color-primary-dark);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}

.header-search-btn svg {
  width: 15px;
  height: 15px;
}

.header-search-btn:hover {
  background: var(--color-primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover { color: inherit; }

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent-emerald);
  border: 3px solid var(--color-accent-sky);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand-mark[data-has-logo="true"],
.brand-mark:has(.brand-logo-img) {
  width: auto;
  max-width: 180px;
  height: 48px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.brand-mark .brand-logo-img {
  width: auto;
  height: 48px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--color-primary-dark);
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  color: var(--color-primary-dark);
  flex-shrink: 0;
}

.nav-toggle-icon--close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon--open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon--close {
  display: block;
}

.header-nav-wrap {
  background: var(--color-primary-dark);
}

.main-nav {
  position: relative;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-drawer-close {
  display: none;
}

.nav-item {
  position: relative;
}

.nav-parent-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.nav-parent-link {
  flex: 1;
  text-decoration: none;
}

.nav-submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  color: inherit;
  font-family: var(--font-body);
}

.nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  width: 100%;
  text-align: left;
}

.nav-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.has-children.is-hover .nav-chevron,
.has-children.is-open .nav-chevron {
  transform: rotate(180deg);
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

.submenu .nav-item {
  width: 100%;
}

.submenu a {
  display: block;
  text-decoration: none;
  font-weight: 600;
  color: inherit;
  transition: background var(--transition), color var(--transition);
}

/* Desktop: horizontal nav bar with hover dropdowns */
@media (min-width: 1024px) {
  .header-nav-wrap {
    display: block;
    position: static;
    width: auto;
    height: auto;
    transform: none;
    visibility: visible;
    overflow: visible;
    box-shadow: none;
  }

  .main-nav > ul {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    height: var(--header-nav-h);
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
  }

  .main-nav > ul > .nav-item {
    display: flex;
    align-items: stretch;
  }

  .main-nav > ul > .nav-item > a,
  .main-nav > ul > .nav-item > .nav-parent-row > .nav-parent-link,
  .main-nav > ul > .nav-item > .nav-parent {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
  }

  .main-nav > ul > .nav-item > a:hover,
  .main-nav > ul > .nav-item > .nav-parent-row > .nav-parent-link:hover,
  .main-nav > ul > .nav-item > .nav-parent:hover,
  .has-children.is-hover > .nav-parent,
  .has-children.is-hover > .nav-parent-row > .nav-parent-link {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .main-nav > ul > .nav-item > a[aria-current="page"],
  .main-nav > ul > .nav-item > .nav-parent-row > .nav-parent-link[aria-current="page"] {
    color: var(--color-uganda-yellow);
    box-shadow: inset 0 -3px 0 var(--color-uganda-yellow);
  }

  .nav-submenu-toggle {
    display: none;
  }

  .has-children .submenu {
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.35rem 0;
    z-index: 200;
    transform: translateY(4px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  }

  .has-children.is-hover .submenu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .submenu a {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: var(--color-text);
    border-radius: 0;
  }

  .submenu a:hover,
  .submenu a[aria-current="page"] {
    background: var(--color-accent-sky);
    color: #fff;
  }

  .submenu .has-children {
    position: relative;
  }

  .submenu .has-children > .nav-parent,
  .submenu .has-children > .nav-parent-row > .nav-parent-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
  }

  .submenu .has-children > .nav-parent:hover,
  .submenu .has-children.is-hover > .nav-parent,
  .submenu .has-children > .nav-parent-row > .nav-parent-link:hover,
  .submenu .has-children.is-hover > .nav-parent-row > .nav-parent-link {
    background: var(--color-accent-sky);
    color: #fff;
  }

  .submenu .has-children .nav-chevron {
    transform: rotate(-90deg);
  }

  .submenu .has-children > .submenu {
    top: 0;
    left: 100%;
    border-radius: var(--radius);
    transform: translateX(4px);
  }

  .submenu .has-children.is-hover > .submenu {
    transform: translateX(0);
  }
}

/* Mobile / tablet: slide-in drawer with accordion submenus */
@media (max-width: 1023px) {
  .nav-toggle {
    display: flex;
  }

  .header-nav-wrap {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 90vw);
    background: var(--color-surface);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -6px 0 32px rgba(8, 61, 74, 0.18);
    visibility: hidden;
  }

  .header-nav-wrap.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 61, 74, 0.5);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .nav-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--color-primary-dark);
    z-index: 2;
  }

  .main-nav > ul {
    padding: 3.5rem 0 2rem;
  }

  .main-nav > ul > .nav-item > a,
  .main-nav > ul > .nav-item > .nav-parent,
  .main-nav > ul > .nav-item > .nav-parent-row > .nav-parent-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: color var(--transition), background var(--transition);
  }

  .main-nav > ul > .nav-item > a[aria-current="page"],
  .main-nav > ul > .nav-item > .nav-parent-row > .nav-parent-link[aria-current="page"] {
    color: var(--color-uganda-red);
  }

  .nav-parent {
    justify-content: space-between;
    padding: 1rem 1.5rem;
    font-size: 1.0625rem;
    font-weight: 700;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-submenu-toggle {
    width: 52px;
    border-left: 1px solid var(--color-border);
    color: var(--color-text-muted);
  }

  .has-children .nav-parent-row {
    border-bottom: 1px solid var(--color-border);
  }

  .has-children .nav-parent-row .nav-parent-link {
    border-bottom: none;
  }

  .has-children.is-open .submenu {
    display: block;
    background: var(--color-surface-sky);
    padding: 0.25rem 0 0.5rem;
  }

  .submenu a {
    padding: 0.75rem 1.5rem 0.75rem 2rem;
    font-size: 0.9375rem;
    color: var(--color-text);
    border-bottom: 1px solid rgba(204, 229, 235, 0.6);
  }

  .submenu a[aria-current="page"] {
    color: var(--color-uganda-red);
    font-weight: 700;
  }

  .submenu a:last-child {
    border-bottom: none;
  }

  .submenu .has-children > .nav-parent,
  .submenu .has-children > .nav-parent-row > .nav-parent-link {
    padding: 0.75rem 1.5rem 0.75rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid rgba(204, 229, 235, 0.6);
  }

  .submenu .submenu a {
    padding-left: 2.75rem;
  }
}

@media (max-width: 480px) {
  .header-top-links {
    gap: 0.75rem;
    font-size: 0.75rem;
  }

  .header-main .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
}

.page-content {
  max-width: 48rem;
}

.page-content h2,
.page-content h3 {
  margin-top: 1.75rem;
}

.page-content:has(.team-grid),
.page-content:has(.mandate-grid),
.page-content:has(.units-accordion),
.page-content:has(.cards) {
  max-width: var(--max-width);
}

.units-intro {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 48rem;
}

.units-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.units-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.units-panel-title {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.units-panel-title::-webkit-details-marker {
  display: none;
}

.units-panel-title::after {
  content: "+";
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.units-panel[open] .units-panel-title::after {
  content: "−";
}

.units-panel-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  line-height: 1.7;
}

.units-panel-body p {
  margin: 0 0 1rem;
}

.units-panel-body h3 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.05rem;
}

.units-panel-body ul {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.units-panel-body li {
  margin-bottom: 0.35rem;
}

.units-panel-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.units-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.about-intro {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 42rem;
}

.about-cphl {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  max-width: 36rem;
}

.about-vision-mission {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.about-vision-mission.mandate-grid {
  grid-template-columns: minmax(280px, 36rem);
  justify-content: center;
}

.about-strategic {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--color-border);
}

.about-cta {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--color-border);
}

.about-cta p {
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  color: var(--color-text-muted);
}

/* Management team */
.team-intro {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
}

.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.team-card-photo {
  aspect-ratio: 4 / 5;
  background: var(--color-accent-soft);
  overflow: hidden;
}

.team-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.team-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  text-align: center;
}

.team-card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: var(--color-primary-dark);
}

.team-role {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.team-bio {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.team-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--color-primary-light);
  background: linear-gradient(180deg, var(--color-accent-soft), #eef2f7);
}

/* Awards */
.page-content:has(.awards-grid) {
  max-width: var(--max-width);
}

.awards-intro {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.award-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.award-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.award-card-media {
  aspect-ratio: 4 / 3;
  background: var(--color-accent-soft);
  overflow: hidden;
}

.award-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.award-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: var(--color-uganda-yellow);
  background: linear-gradient(135deg, var(--color-primary-dark), #334155);
}

.award-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.award-date {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.award-card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: var(--color-primary-dark);
}

.award-recipient {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
}

.award-description {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* Partners */
.page-content:has(.partners-grid) {
  max-width: var(--max-width);
}

.partners-intro {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.75rem 1.25rem;
}

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.partner-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
}

a.partner-card-logo:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.partner-card-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.partner-card-placeholder {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-accent-soft);
}

.partner-card-name {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-primary-dark);
  text-decoration: none;
}

a.partner-card-name:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

.partner-admin-thumb {
  object-fit: contain;
  background: #fff;
  padding: 0.25rem;
}

/* Content log */
.page-content:has(.content-log-table-wrap) {
  max-width: var(--max-width);
}

.content-log-intro {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.content-log-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.content-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.content-log-table th,
.content-log-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

.content-log-table th {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-accent-soft);
}

.content-log-table tbody tr:last-child td {
  border-bottom: none;
}

.content-log-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.8);
}

.content-log-table-link {
  color: var(--color-primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.content-log-table-link:hover {
  text-decoration: underline;
}

.content-log-table time {
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.content-log-type {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
  white-space: nowrap;
}

.content-log-type--news { background: #e0f2fe; color: #0369a1; }
.content-log-type--event { background: #fef3c7; color: #b45309; }
.content-log-type--award { background: #fef9c3; color: #a16207; }
.content-log-type--team { background: #ede9fe; color: #6d28d9; }
.content-log-type--page { background: #f1f5f9; color: #334155; }
.content-log-type--library { background: #dcfce7; color: #166534; }
.content-log-type--slideshow { background: #ffe4e6; color: #be123c; }
.content-log-type--partner { background: #e0e7ff; color: #4338ca; }

/* Admin session bar (visible when logged in on public site) */
.admin-session-bar {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.45rem 1.5rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--color-border);
}

.admin-session-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-session-bar a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.admin-session-bar a:hover {
  text-decoration: underline;
}

.admin-session-logout {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.admin-session-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Article slideshow (below main menu) */
.slideshow {
  background: var(--color-primary-dark);
  position: relative;
}

.slideshow-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 21 / 7;
  max-height: 540px;
  min-height: 280px;
}

@media (max-width: 640px) {
  .slideshow-viewport {
    aspect-ratio: 16 / 9;
    max-height: 320px;
    min-height: 200px;
  }
}

.slideshow-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.slideshow-slide {
  flex: 0 0 auto;
  position: relative;
  margin: 0;
  height: 100%;
  min-height: inherit;
  box-sizing: border-box;
}

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

.slideshow-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(1rem, 4vw, 2rem) clamp(1rem, 5vw, 3rem);
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.88));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slideshow-caption strong {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 600;
}

.slideshow-caption span {
  font-size: clamp(0.875rem, 2vw, 1.0625rem);
  opacity: 0.95;
  max-width: 52rem;
}

.slideshow-slide--empty {
  display: grid;
  place-items: center;
  background: var(--color-accent-soft);
  color: var(--color-text);
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.slideshow-slide--empty a {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.slideshow-slide--empty code {
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.slideshow-prev,
.slideshow-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), transform var(--transition);
}

.slideshow-prev:hover,
.slideshow-next:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.slideshow-prev { left: 1rem; }
.slideshow-next { right: 1rem; }

.slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  background: var(--color-primary-dark);
}

.slideshow-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.slideshow-dots button.is-active,
.slideshow-dots button:hover {
  background: var(--color-accent-amber);
  transform: scale(1.15);
}

.slideshow--empty .slideshow-dots {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-accent-soft) 100%);
  color: var(--color-text);
  padding: clamp(1.75rem, 4vw, 2.75rem) 1.5rem;
}

.hero::before {
  display: none;
}

.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  color: var(--color-primary-dark);
  margin-bottom: 0.625rem;
}

.hero-lead {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 40rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.badge--mint {
  background: rgba(236, 253, 245, 0.95);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.badge--sky {
  background: rgba(240, 249, 255, 0.95);
  border-color: rgba(14, 165, 233, 0.35);
  color: #0369a1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn {
  padding: 0.625rem 1.125rem;
  font-size: 0.9375rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:hover { transform: translateY(-1px); }

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

.btn-primary:hover {
  background: #059669;
  border-color: #059669;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: #fff;
  color: var(--color-accent-sky);
  border-color: var(--color-accent-sky);
}

.btn-outline:hover {
  background: var(--color-surface-sky);
  border-color: var(--color-accent-sky);
  color: #0369a1;
}

.btn-secondary {
  background: var(--color-accent-sky);
  color: #fff;
  border-color: var(--color-accent-sky);
}

.btn-secondary:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.hero-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.hero-card h3 {
  color: var(--color-primary-dark);
  margin-top: 0;
  font-size: 1.15rem;
}

.hero-card p {
  color: var(--color-text-muted);
}

.hero-arms {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  max-width: 40rem;
}

.hero-arms-label {
  margin: 0 0 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.hero-arms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.hero-arm {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.625rem;
}

.hero-arm:nth-child(1) {
  border-left: 3px solid var(--color-accent-emerald);
}

.hero-arm:nth-child(2) {
  border-left: 3px solid var(--color-accent-sky);
}

.hero-arm h3 {
  margin: 0 0 0.125rem;
  font-size: 0.875rem;
  line-height: 1.25;
}

.hero-arm h3 a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.hero-arm h3 a:hover {
  text-decoration: underline;
}

.hero-arm p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

@media (max-width: 520px) {
  .hero-arms-grid {
    grid-template-columns: 1fr;
  }
}

/* Highlights (homepage) */
.highlights-section {
  padding-block: clamp(2rem, 4vw, 2.75rem);
}

.highlights-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: start;
}

.highlights-pane--left {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  min-width: 0;
}

.highlights-pane--gallery {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.highlights-gallery {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.highlights-capabilities {
  margin-top: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.highlights-heading {
  margin: 0 0 0.875rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary-dark);
  text-align: left;
}

.highlights-col-title {
  margin: 0 0 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-emerald);
  text-align: left;
}

.highlights-network-heading {
  margin: 0 0 0.875rem;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary-light);
  text-align: left;
}

.highlights-flip {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.highlights-flip-viewport {
  perspective: 1200px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.highlights-flip-stack {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  align-content: start;
}

.highlight-flip-card {
  grid-area: 1 / 1;
  position: relative;
  opacity: 0;
  transform: rotateY(-90deg);
  transform-origin: center center;
  transition:
    transform 0.6s ease,
    opacity 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.highlight-flip-card.is-active {
  opacity: 1;
  transform: rotateY(0);
  pointer-events: auto;
  z-index: 1;
}

.highlight-flip-card.is-leaving {
  opacity: 0;
  transform: rotateY(90deg);
  z-index: 2;
}

.highlight-flip-card.is-entering {
  opacity: 1;
  transform: rotateY(0);
  z-index: 2;
}

.highlight-flip-card-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow-sm);
}

.highlights-flip-dots,
.transport-gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.625rem;
  flex-shrink: 0;
}

.highlights-flip-dots {
  margin-top: auto;
}

.transport-gallery-dots {
  margin-top: 0;
}

.highlights-flip-dot,
.transport-gallery-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
}

.highlights-flip-dot.is-active {
  transform: scale(1.2);
}

.highlights-flip-dot:nth-child(1).is-active {
  background: var(--color-accent-emerald);
}

.highlights-flip-dot:nth-child(2).is-active {
  background: var(--color-accent-sky);
}

.highlights-flip-dot:nth-child(3).is-active {
  background: var(--color-accent-violet);
}

.highlights-flip-dot:nth-child(4).is-active {
  background: var(--color-accent-coral);
}

.transport-gallery-dot.is-active {
  background: var(--color-accent-sky);
  transform: scale(1.2);
}

.transport-gallery-viewport {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

@media (min-width: 901px) {
  .transport-gallery-viewport {
    aspect-ratio: unset;
  }
}

.transport-photo {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.transport-photo.is-active {
  opacity: 1;
}

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

.transport-photo figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 1.75rem 0.875rem 0.75rem;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.88));
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.transport-gallery-empty {
  margin: 0;
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.highlight-value {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent-emerald);
}

.highlight-flip-card[data-index="1"] .highlight-value {
  color: var(--color-accent-sky);
}

.highlight-flip-card[data-index="2"] .highlight-value {
  color: var(--color-accent-violet);
}

.highlight-flip-card[data-index="3"] .highlight-value {
  color: var(--color-accent-coral);
}

.highlight-flip-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--color-primary-dark);
}

.highlight-flip-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.highlight-flip-card p + p {
  margin-top: 0.75rem;
}

.highlight-flip-card a {
  font-weight: 600;
  color: var(--color-primary-dark);
}

.highlights-newsletter {
  margin: 0;
  flex-shrink: 0;
}

.highlights-newsletter-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-violet);
}

.highlights-newsletter-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow-sm);
}

.highlights-newsletter-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--color-primary-dark);
}

.highlights-newsletter-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.highlights-newsletter-desc {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.highlights-newsletter-preview {
  width: 100%;
  max-width: 14rem;
  margin: 0.75rem auto 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f8fafc;
  line-height: 0;
}

.highlights-newsletter-preview-canvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.highlights-newsletter-preview-loading,
.highlights-newsletter-preview-error {
  margin: 0;
  padding: 0;
  min-height: 11rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: center;
  color: var(--color-text-muted);
}

.highlights-newsletter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.highlights-newsletter-download.btn {
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  text-decoration: none;
}

.highlights-newsletter-download-btn {
  background: var(--color-accent-emerald);
  color: #fff;
  border-color: var(--color-accent-emerald);
}

.highlights-newsletter-download-btn:hover {
  background: #059669;
  border-color: #059669;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.highlights-newsletter-download.btn span {
  max-width: none;
  white-space: normal;
}

.highlights-newsletter-download:not(.highlights-newsletter-download-btn),
.highlights-newsletter-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.highlights-newsletter-download:not(.highlights-newsletter-download-btn):hover,
.highlights-newsletter-more:hover {
  text-decoration: underline;
}

.highlights-newsletter-download span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}

@media (max-width: 900px) {
  .highlights-split {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .transport-gallery-viewport {
    aspect-ratio: 16 / 10;
    height: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .highlight-flip-card,
  .transport-photo {
    transition: none;
  }

  .highlight-flip-card:not(.is-active) {
    display: none;
  }

  .highlight-flip-card.is-active {
    position: relative;
    transform: none;
    opacity: 1;
  }
}

/* Homepage impact stats (counters) */
.stats-section {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: clamp(1.5rem, 4vw, 2.25rem) 1.5rem;
}

.stats-section::before {
  display: none;
}

.stats-scroll-wrap {
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.stats-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.stats-scroll--auto {
  overflow: hidden;
}

.stats-scroll-track {
  display: flex;
  width: max-content;
  animation: stats-marquee var(--stats-duration, 22s) linear infinite;
  will-change: transform;
}

.stats-scroll-set {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  flex-shrink: 0;
  align-items: stretch;
}

.stats-scroll--auto:hover .stats-scroll-track,
.stats-scroll--auto:focus-within .stats-scroll-track {
  animation-play-state: paused;
}

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

@media (prefers-reduced-motion: reduce) {
  .stats-scroll-track {
    animation: none;
  }

  .stats-scroll--auto {
    overflow-x: auto;
  }
}

.stats-scroll:focus-visible {
  outline: 2px solid var(--color-uganda-yellow);
  outline-offset: 2px;
}

.stats-item {
  flex: 0 0 9.5rem;
  width: 9.5rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
}

.stats-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-uganda-yellow);
  margin-bottom: 0.35rem;
}

.stats-label {
  display: block;
  font-size: clamp(0.8125rem, 2vw, 0.9375rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.35;
}

.stats-empty {
  margin: 0;
  padding: 0.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat {
  text-align: center;
  padding: 1rem;
  background: var(--color-accent-soft);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--color-primary-dark);
}

.stat span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Sections */
.section {
  padding: clamp(3rem, 6vw, 5rem) 1.5rem;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 3rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  margin: 0.5rem auto 0;
  border-radius: 999px;
  background: var(--color-accent-emerald);
}

.announcements-section .section-header--row h2::after {
  background: var(--color-accent-emerald);
  margin-left: 0;
  margin-right: auto;
}

.latest-updates-section .section-header h2::after {
  background: var(--color-accent-emerald);
}

.latest-updates-section .section-header h2 {
  color: var(--color-primary-dark);
}

.highlights-heading::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: var(--color-accent-emerald);
}

.cta-band h2::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 4px;
  margin: 0.5rem auto 0;
  border-radius: 999px;
  background: var(--color-accent-emerald);
}

.cta-band h2 {
  color: var(--color-primary-dark);
}

.section-header--row h2::after {
  margin-left: 0;
  margin-right: auto;
}

.section-alt {
  background: var(--color-accent-soft);
  border-block: 1px solid var(--color-border);
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--color-surface-mint);
  color: var(--color-accent-emerald);
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
}

.cards .card:nth-child(3n + 2) .card-icon {
  background: var(--color-surface-warm);
  color: var(--color-accent-coral);
}

.cards .card:nth-child(3n) .card-icon {
  background: var(--color-surface-violet);
  color: var(--color-accent-violet);
}

.card h3 { margin-top: 0; }

.card p:last-child { margin-bottom: 0; }

/* Mandate list */
.mandate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: start;
}

.mandate-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mandate-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
}

.mandate-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 10px;
  height: 10px;
  background: var(--color-accent-emerald);
  border-radius: 2px;
  transform: rotate(45deg);
}

.mandate-list li:nth-child(2n)::before {
  background: var(--color-accent-sky);
}

.mandate-list li:nth-child(3n)::before {
  background: var(--color-accent-amber);
}

.vision-mission {
  background: var(--color-accent-soft);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.vision-mission h3 { color: var(--color-primary-dark); margin-top: 0; }
.vision-mission p { opacity: 0.92; margin-bottom: 1.5rem; }
.vision-mission p:last-child { margin-bottom: 0; }

/* News — listing grid (CPHL-style cards) */
.news-page-header {
  margin-bottom: 2rem;
  text-align: center;
}

.news-page-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.news-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--color-primary-dark);
}

.news-card-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.75rem;
}

@media (min-width: 600px) {
  .news-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .news-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.news-card {
  background: var(--color-surface-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.news-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.news-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-accent-soft);
  overflow: hidden;
}

.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.news-card:hover .news-card-media img {
  transform: scale(1.04);
}

.news-card-media--placeholder-wrap {
  display: flex;
  align-items: stretch;
}

.news-card-media--placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  color: var(--color-primary);
  background: linear-gradient(145deg, var(--color-accent-soft), #fff);
}

.news-card-media--placeholder svg {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.65;
}

.news-card-media--placeholder span {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0.8;
}

.news-card-badge {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.65rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.news-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.15rem 1.25rem;
  border-top: 3px solid var(--color-border);
}

.news-card-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.35;
  color: var(--color-primary-dark);
  transition: color var(--transition);
}

.news-card:hover .news-card-title {
  color: var(--color-primary);
}

.news-card-meta {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.news-card-meta strong {
  font-weight: 600;
  color: var(--color-text);
}

.news-card-more {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-card-more::after {
  content: " →";
}

.news-pagination {
  margin-top: 2.5rem;
}

.news-pagination-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.news-pagination-list a,
.news-pagination-list span {
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.news-pagination-list a:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.news-pagination-list .is-current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.news-pagination-ellipsis {
  border: none;
  background: none;
  min-width: auto;
  padding: 0 0.25rem;
}

.news-article-view {
  max-width: 48rem;
  margin: 0 auto;
}

.news-back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.news-back-link:hover {
  text-decoration: underline;
}

.news-article-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.news-article-hero img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-article-header h1 {
  margin: 0.5rem 0 1rem;
  font-family: var(--font-display);
  color: var(--color-primary-dark);
}

.news-article-body p {
  margin: 0 0 1rem;
  color: var(--color-text);
}

/* Homepage announcements (events scroll) */
.announcements-section {
  padding: clamp(1.25rem, 3vw, 2rem) 1.5rem;
  background: var(--color-surface);
}

.latest-updates-section {
  background: var(--color-accent-soft);
}

.announcements-section .section-header--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.announcements-section .section-header--row h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  color: var(--color-primary-dark);
}

.announcements-more-link {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent-sky);
  text-decoration: none;
  white-space: nowrap;
}

.announcements-more-link:hover {
  text-decoration: underline;
}

.announcements-scroll-wrap {
  position: relative;
}

.announcements-scroll {
  display: flex;
  gap: 0.625rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.25rem;
  padding: 0.125rem 0.25rem 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.announcements-scroll--auto {
  overflow: hidden;
  scroll-snap-type: none;
  padding-bottom: 0.375rem;
}

.announcements-scroll-track {
  display: flex;
  width: max-content;
  animation: announcements-marquee var(--announcements-duration, 24s) linear infinite;
  will-change: transform;
}

.announcements-scroll-set {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}

.announcements-scroll--auto:hover .announcements-scroll-track,
.announcements-scroll--auto:focus-within .announcements-scroll-track {
  animation-play-state: paused;
}

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

@media (prefers-reduced-motion: reduce) {
  .announcements-scroll-track {
    animation: none;
  }

  .announcements-scroll--auto {
    overflow-x: auto;
  }
}

.announcements-scroll:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.announcements-scroll::-webkit-scrollbar {
  height: 4px;
}

.announcements-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

.announcement-scroll-card {
  flex: 0 0 15rem;
  width: 15rem;
  height: 4.5rem;
  scroll-snap-align: start;
  margin: 0;
}

.announcement-scroll-card-link {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent-coral);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.announcement-scroll-card:nth-child(3n + 2) .announcement-scroll-card-link {
  border-left-color: var(--color-accent-sky);
}

.announcement-scroll-card:nth-child(3n) .announcement-scroll-card-link {
  border-left-color: var(--color-accent-emerald);
}

.announcement-scroll-card-link:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary-light);
}

.announcement-scroll-card-media {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  height: 4.5rem;
  background: var(--color-accent-soft);
  overflow: hidden;
}

.announcement-scroll-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.announcement-scroll-card-media--placeholder {
  display: grid;
  place-items: center;
  color: var(--color-primary);
}

.announcement-scroll-card-media--placeholder svg {
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.55;
}

.announcement-scroll-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.5rem 0.625rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.announcement-scroll-card-date {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  line-height: 1.2;
  flex-shrink: 0;
}

.announcement-scroll-card-title {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--color-primary-dark);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.3em;
  max-height: 1.3em;
}

.announcement-scroll-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  min-height: 1.3em;
}

.announcements-loading,
.announcements-empty {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  flex: 1 0 100%;
}

/* Homepage / compact news list */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.news-item {
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent-emerald);
  transition: box-shadow var(--transition), border-top-color var(--transition);
}

.news-item:nth-child(3n + 2) {
  border-top-color: var(--color-accent-sky);
}

.news-item:nth-child(3n) {
  border-top-color: var(--color-accent-violet);
}

.news-item:hover {
  box-shadow: var(--shadow-md);
  border-top-color: var(--color-accent-amber);
}

.news-item-content { padding: 1.5rem; }

.news-item-image {
  aspect-ratio: 16 / 9;
  background: var(--color-accent-soft);
  overflow: hidden;
}

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

.news-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-item h3 {
  font-size: 1.125rem;
  margin: 0.5rem 0;
}

.news-item--home .news-item-image {
  aspect-ratio: 16 / 10;
}

.news-item--home h3 a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.news-item--home h3 a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Events */
.section--muted {
  background: var(--color-accent-soft);
  border-block: 1px solid var(--color-border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
  color: var(--color-primary-dark);
}

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

.event-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.event-card--past {
  opacity: 0.88;
}

.event-card-image {
  aspect-ratio: 16 / 9;
  background: var(--color-accent-soft);
  overflow: hidden;
}

.event-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-card-image--placeholder {
  display: grid;
  place-items: center;
  color: var(--color-primary-light);
}

.event-card-image--placeholder svg {
  width: 3rem;
  height: 3rem;
}

.event-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-card-date {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0.4rem 0 0.75rem;
  line-height: 1.3;
  color: var(--color-primary-dark);
}

.event-card-meta {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 0.9375rem;
}

.event-card-meta li {
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.event-meta-label {
  display: inline-block;
  min-width: 3.25rem;
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.event-card-desc {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  flex: 1;
}

.event-card-cta {
  align-self: flex-start;
  margin-top: auto;
}

.events-grid--past .event-card-image {
  filter: grayscale(0.35);
}

/* CTA band */
.cta-band {
  background: var(--color-surface);
  text-align: center;
}

.cta-band::before {
  display: none;
}

.cta-band .section-inner {
  position: relative;
}

.cta-band h2 { margin-bottom: 0.75rem; }

/* Page header (inner pages) */
.page-hero {
  position: relative;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 3rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.page-hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-hero h1 { color: var(--color-primary-dark); margin: 0; }
.page-hero p {
  max-width: 36rem;
  margin: 1rem auto 0;
  color: var(--color-text-muted);
}

.page-hero--has-image {
  min-height: clamp(220px, 32vw, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  border-bottom: none;
}

.page-hero--has-image .page-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero--has-image .page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(8, 61, 74, 0.55);
}

.page-hero--has-image h1 {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.page-hero--has-image p {
  color: rgba(255, 255, 255, 0.92);
}

/* Services detail */
.service-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .service-block {
    grid-template-columns: 120px 1fr;
    align-items: start;
  }
}

.service-block:last-child { border-bottom: none; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.contact-card {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.contact-card h3 { margin-top: 0; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.contact-list svg {
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 0.2rem;
}

.contact-map-intro {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--color-text-muted);
}

.contact-map-section {
  padding-inline: 0;
}

.contact-map-section > .section-inner {
  padding-inline: 1.5rem;
}

.contact-map-header {
  margin-bottom: 1.5rem;
}

.contact-map-wrap {
  position: relative;
  width: 100%;
  margin: 0;
  aspect-ratio: 21 / 8;
  min-height: 300px;
  border-block: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-accent-soft);
}

.contact-map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-map-actions {
  margin-top: 1.25rem;
}

.contact-map-actions a {
  font-weight: 600;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.contact-map-actions a:hover {
  text-decoration: underline;
}

/* Library resources */
.library-layout--admin {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .library-layout--admin {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.library-list-panel {
  grid-column: 1 / -1;
}

.library-layout--admin .library-list-panel {
  grid-column: auto;
}

.library-login-prompt {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.library-login-prompt a {
  font-weight: 600;
}

.library-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.library-list-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.library-list-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
}

.library-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.library-description {
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.library-search-field {
  margin: 0 0 0.5rem;
}

.library-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  background: var(--color-surface-elevated);
}

.library-search-input:focus {
  outline: none;
  border-color: var(--color-accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.library-search-hint {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.search-page-inner {
  max-width: 48rem;
}

.search-page-form {
  margin-bottom: 1.5rem;
}

.search-page-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-page-input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  background: var(--color-surface-elevated);
}

.search-page-input:focus {
  outline: none;
  border-color: var(--color-accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.search-status {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.search-empty {
  color: var(--color-text-muted);
  margin: 0;
}

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.search-result {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  border-left: 4px solid var(--color-accent-emerald);
}

.search-result--library {
  border-left-color: var(--color-accent-sky);
}

.search-result--news {
  border-left-color: var(--color-accent-violet);
}

.search-result--event {
  border-left-color: var(--color-accent-amber);
}

.search-result-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.search-result-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
}

.search-result-title a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.search-result-title a:hover {
  color: var(--color-accent-emerald);
  text-decoration: underline;
}

.search-result-excerpt {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.library-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.library-attachment {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.library-attachment:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.library-attachment:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.library-attachment-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--color-primary-dark);
  background: var(--color-accent-soft);
}

.library-attachment-icon svg {
  width: 2rem;
  height: 2rem;
}

.library-attachment--pdf .library-attachment-icon {
  color: #b42318;
  background: #fef3f2;
}

.library-attachment--word .library-attachment-icon {
  color: #175cd3;
  background: #eff8ff;
}

.library-attachment--excel .library-attachment-icon {
  color: #027a48;
  background: #ecfdf3;
}

.library-attachment--ppt .library-attachment-icon {
  color: #c4320a;
  background: #fff6ed;
}

.library-attachment--text .library-attachment-icon,
.library-attachment--file .library-attachment-icon {
  color: var(--color-primary-dark);
  background: var(--color-accent-soft);
}

.library-attachment-body {
  flex: 1;
  min-width: 0;
}

.library-attachment-name {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-attachment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.library-attachment-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
}

.library-attachment--pdf .library-attachment-badge {
  background: #fee4e2;
  color: #b42318;
}

.library-attachment--word .library-attachment-badge {
  background: #d1e9ff;
  color: #175cd3;
}

.library-attachment--excel .library-attachment-badge {
  background: #d1fadf;
  color: #027a48;
}

.library-attachment--ppt .library-attachment-badge {
  background: #ffead5;
  color: #c4320a;
}

.library-attachment-action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-accent-soft);
  transition: background var(--transition), color var(--transition);
}

.library-attachment:hover .library-attachment-action {
  background: var(--color-primary);
  color: #fff;
}

@media (max-width: 640px) {
  .library-attachments {
    grid-template-columns: 1fr;
  }

  .library-attachment {
    flex-wrap: wrap;
  }

  .library-attachment-action {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
  }
}

.library-files {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.library-files li {
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
}

.library-files a {
  font-weight: 600;
}

.file-preview-list {
  list-style: none;
  padding: 0;
  margin: -0.75rem 0 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.field-hint {
  display: block;
  margin: -0.75rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.admin-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.admin-status--ok {
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
}

.admin-status--err {
  background: #fde8e8;
  color: #9b1c1c;
}

form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 1.25rem;
  background: #fff;
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 1px;
}

/* LDR feature */
.feature-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .feature-split { grid-template-columns: 1fr 1fr; }
}

.feature-visual {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.feature-visual h3 {
  color: var(--color-primary-dark);
}

.flow-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.flow-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.25rem;
}

.flow-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 2rem;
  height: 2rem;
  background: #fff;
  color: var(--color-primary-dark);
  font-weight: 700;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
}

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.9);
  padding: 3rem 1.5rem 1.5rem;
}

.site-footer::before {
  display: none;
}

.footer-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.site-footer h4 {
  color: var(--color-accent-emerald);
  font-family: var(--font-body);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-footer a:hover { color: var(--color-accent-emerald); }

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li { margin-bottom: 0.5rem; }

.uganda-strip {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2rem;
  max-width: 200px;
}

.uganda-strip span { flex: 1; }
.uganda-strip .black { background: var(--color-uganda-black); }
.uganda-strip .yellow { background: var(--color-uganda-yellow); }
.uganda-strip .red { background: var(--color-uganda-red); }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}

/* Utilities */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-2 { margin-bottom: 2rem; }

/* Mobile nav — handled in header section above */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* NHLDS assistant chatbot */
:root {
  --chat-widget-gap: 0.75rem;
  --chatbot-toggle-height: 3.25rem;
}

.chatbot {
  position: fixed;
  right: clamp(1rem, 3vw, 1.5rem);
  bottom: clamp(1rem, 3vw, 1.5rem);
  z-index: 1200;
}

.chatbot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  border: none;
  border-radius: 999px;
  background: var(--color-primary-dark);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.chatbot-toggle:hover {
  transform: translateY(-2px);
  background: var(--color-primary);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

.chatbot-toggle-icon--close {
  display: none;
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chatbot-panel[hidden] {
  display: none !important;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-primary-dark);
  color: #fff;
}

.chatbot-header strong {
  display: block;
  font-size: 0.9375rem;
}

.chatbot-header span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
}

.chatbot-close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--color-accent-soft);
}

.chatbot-message {
  max-width: 92%;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chatbot-message--bot {
  align-self: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-bottom-left-radius: 0.35rem;
}

.chatbot-message--bot ul {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}

.chatbot-message--user {
  align-self: flex-end;
  background: var(--color-primary-dark);
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}

.chatbot-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.chatbot-link:hover {
  text-decoration: underline;
}

.chatbot-message--user .chatbot-link {
  color: #fff;
}

.chatbot-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.chatbot-prompt {
  padding: 0.35rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-primary-dark);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.chatbot-prompt:hover {
  border-color: var(--color-primary-light);
  background: #fff;
}

.chatbot-prompts--rating {
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.625rem;
}

.chatbot-rating-btn {
  width: 100%;
  text-align: left;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}

.chatbot-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.chatbot-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.chatbot-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.chatbot-send {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary-dark);
  color: #fff;
  cursor: pointer;
}

.chatbot-send:hover {
  background: var(--color-primary);
}

.chatbot-send:disabled,
.chatbot-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chatbot-message--typing {
  padding: 0.85rem 1rem;
}

.chatbot-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.chatbot-typing span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.35;
  animation: chatbot-typing 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatbot-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 520px) {
  .chatbot-toggle-label {
    display: none;
  }

  .whatsapp-chat-label {
    display: none;
  }

  .chatbot-panel {
    width: min(22rem, calc(100vw - 1.5rem));
  }
}

/* WhatsApp chat */
.whatsapp-chat {
  position: fixed;
  right: clamp(1rem, 3vw, 1.5rem);
  bottom: calc(clamp(1rem, 3vw, 1.5rem) + var(--chatbot-toggle-height) + var(--chat-widget-gap));
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.whatsapp-chat:hover {
  transform: translateY(-2px);
  background: #1ebe57;
  color: #fff;
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.35);
}

.whatsapp-chat:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.whatsapp-chat-icon {
  flex-shrink: 0;
}
