/* Africa Autism Alliance — site chrome shared by every page:
   top bar, header navigation, mobile menu and footer. */

/* ==========================================================================
   1. Top bar + navigation
   ========================================================================== */

.topbar {
  position: relative;
  z-index: 51;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--topbar-h);
  padding-inline: 3.25rem;
  background: var(--brand-primary);
  color: var(--on-brand);
  font-size: var(--fs-small);
  text-align: center;
}
.topbar-dismissed .topbar { display: none; }

.topbar__link.link {
  color: inherit;
  padding-block: .625rem;
  font-weight: 600;
}

.topbar__close {
  position: absolute;
  top: 50%;
  right: .25rem;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background-color: var(--frost);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}
/* With JS, the nav is transparent over the hero until 80px of scroll */
.js .site-header:not(.is-scrolled) {
  border-bottom-color: transparent;
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--nav-h);
}

/* Logo lockup: mark + stacked wordmark */
.logo {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: .625rem;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
}
.logo__mark {
  flex-shrink: 0;
  width: 52px;
  height: 42px;
}
.logo__text > span { display: block; }

/* Very small phones: the mark stands alone; the name stays for screen readers */
@media (max-width: 359.98px) {
  .site-header .logo__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.nav__primary,
.nav__cta { display: none; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__groups {
  display: flex;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Dropdowns */
.dropdown { position: relative; }

.dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  min-height: 44px;
  padding: 0 .875rem;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .9375rem;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out);
}
.dropdown__toggle:hover,
.dropdown__toggle[aria-expanded="true"] { background-color: var(--hover-wash); }

.chevron { transition: transform var(--dur) var(--ease-out); }
[aria-expanded="true"] > .chevron,
.accordion[open] .chevron { transform: rotate(180deg); }

.dropdown__panel {
  position: absolute;
  top: calc(100% + .5rem);
  left: 50%;
  z-index: 10;
  min-width: 15rem;
  margin: 0;
  padding: .5rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  translate: -50% 4px;
  transition:
    opacity var(--dur) var(--ease-out),
    translate var(--dur) var(--ease-out),
    visibility 0s linear var(--dur);
}
/* Bridges the gap between button and panel so hover doesn't drop */
.dropdown__panel::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: .75rem;
}
.dropdown__toggle[aria-expanded="true"] + .dropdown__panel,
.no-js .dropdown:hover > .dropdown__panel,
.no-js .dropdown:focus-within > .dropdown__panel {
  opacity: 1;
  visibility: visible;
  translate: -50% 0;
  transition-delay: 0s;
}

.dropdown__panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem .875rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: .9375rem;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.dropdown__panel a:hover {
  background-color: var(--primary-tint);
  color: var(--primary-ink);
}

/* Calm mode switch */
.calm-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 .375rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-small);
  white-space: nowrap;
  cursor: pointer;
}
.calm-toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  border: 1.5px solid var(--ink-soft);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.calm-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: var(--ink-soft);
  transition: translate var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.calm-toggle[aria-checked="true"] .calm-toggle__track {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary);
}
.calm-toggle[aria-checked="true"] .calm-toggle__thumb {
  translate: 16px 0;
  background-color: var(--on-brand);
}

/* Menu buttons */
.menu-btn,
.menu-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.menu-btn:hover,
.menu-close:hover {
  border-color: var(--rule-on-tint);
  background-color: var(--primary-tint);
}
.menu-icon__line--mid { opacity: 0; } /* hidden in the ✕ state */

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  padding-top: var(--menu-offset, 0px);
  background: var(--bg);
}
.mobile-menu.is-open,
.no-js .mobile-menu:target { display: flex; }
.menu-open { overflow: hidden; }

.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-h);
  border-bottom: 1px solid var(--line);
}

.mobile-menu__nav {
  flex: 1;
  padding-block: var(--space-2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.accordion { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  font-size: 1.375rem;
  font-weight: 300;
  list-style: none;
  cursor: pointer;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion ul {
  margin: 0;
  padding: 0 0 var(--space-2);
  list-style: none;
}
.accordion a {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
}

.mobile-menu__foot {
  padding-block: var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .nav .logo { justify-self: start; }
  .nav__primary { display: block; }
  .nav__actions { justify-self: end; }
  .nav__cta { display: inline-flex; }
  .menu-btn,
  .mobile-menu { display: none !important; }
}

/* Squeeze the nav a little between 900 and 1100 so everything fits on one row */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .dropdown__toggle { padding-inline: .5rem; font-size: .875rem; }
  .calm-toggle { font-size: .8125rem; }
  .nav__cta { padding-inline: 1rem; font-size: .875rem; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { padding-block: var(--section-y) var(--space-3); }

.footer__top {
  display: grid;
  gap: var(--space-6);
}

.footer__about {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-2);
}
.footer__about .logo { font-size: .9375rem; }
.footer__about .logo__mark { width: 64px; height: 52px; }
.footer__about p {
  max-width: 30ch;
  color: var(--ink-soft);
}
.footer__email {
  display: inline-block;
  padding-block: .625rem;
  font-weight: 600;
}

.footer__cols {
  display: grid;
  gap: var(--space-4);
}
.footer__heading {
  margin-bottom: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.footer__cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__cols .link {
  display: inline-block;
  padding-block: .625rem;
  padding-inline-end: .5rem;
  color: var(--ink);
  line-height: 1.5;
}

.footer__bottom {
  margin-top: var(--space-8);
  padding-block: var(--space-3);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

/* Decorative logotype, sized by SVG textLength to fill the container exactly */
.footer__wordmark {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--space-2);
  fill: var(--line);
}
.footer__wordmark text {
  font-family: var(--font-display);
  font-size: 100px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

@media (min-width: 600px) {
  .footer__cols { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .footer__top { grid-template-columns: 1fr 2fr; }
}
