/* Africa Autism Alliance — reusable page sections and components.
   Each block is self-contained; pages combine them in the templates. */

/* ==========================================================================
   Hero — homepage; inner pages add .hero--page (further down)
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(90vh, 820px);
  padding-block: var(--space-4);
  overflow: clip;
}

.hero__grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.hero__title { margin-block: var(--space-3) var(--space-4); }

/* SplitText line masks: give descenders room so the mask doesn't clip them */
.hero-line-mask {
  padding-bottom: .14em;
  margin-bottom: -.14em;
}

.hero__sub {
  max-width: 36ch;
  color: var(--ink-soft);
  font-size: clamp(var(--fs-body), 1.5vw, 1.25rem);
}

.hero__actions { margin-top: var(--space-6); }

.hero__media {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding-block: var(--space-4);
}

.arch {
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  background: var(--primary-tint);
  box-shadow: var(--shadow-soft);
}
.arch picture,
.arch img {
  width: 100%;
  height: 100%;
}
.arch img { object-fit: cover; }

.blob {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  will-change: transform; /* own layer: drifting doesn't repaint the hero */
}
.blob--1 { top: -4%;  left: -12%;  width: 78%; fill: var(--primary-tint); }
.blob--2 { right: -14%; bottom: -2%; width: 70%; fill: var(--secondary-tint); }
.blob--3 { top: 4%;   right: 0;     width: 30%; fill: var(--brand-accent); opacity: .07; }

@media (min-width: 900px) {
  .hero { padding-bottom: var(--space-8); }
  .hero__grid {
    grid-template-columns: 55fr 45fr;
    gap: var(--space-6);
  }
  .arch { width: min(100%, 460px); }
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.info-card {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  transition: translate var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.info-card:hover {
  translate: 0 -4px;
  box-shadow: var(--shadow-lift);
}
.info-card h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}
.info-card p { color: var(--ink-soft); }

.icon-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary-ink);
}

/* ==========================================================================
   Statement band (.vision) — tinted section with one large statement
   ========================================================================== */

.vision {
  position: relative;
  overflow: clip;
  background: var(--primary-tint);
}

.vision__inner { position: relative; }

.vision__statement {
  max-width: 22ch;
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.rule {
  margin: var(--space-8) 0 var(--space-4);
  border: 0;
  border-top: 1px solid var(--rule-on-tint);
}

.vision__mission {
  max-width: 44ch;
  margin-top: var(--space-2);
}

.vision__flower {
  position: absolute;
  right: -3%;
  bottom: -6%;
  width: clamp(180px, 22vw, 320px);
  opacity: .16;
  pointer-events: none;
}

/* ==========================================================================
   Link tiles
   ========================================================================== */

.tiles {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "icon  icon"
    "title arrow"
    "text  arrow";
  column-gap: var(--space-2);
  row-gap: .25rem;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: translate var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.tile__icon {
  grid-area: icon;
  margin-bottom: var(--space-3);
  color: var(--ink-soft);
  transition: color var(--dur) var(--ease-out);
}

.tile__title {
  grid-area: title;
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}

.tile__link {
  color: var(--ink);
  text-decoration: none;
}
/* The whole tile is the link's hit area */
.tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}
.tile__link:focus-visible { outline: none; }
.tile__link:focus-visible::after {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.tile__text {
  grid-area: text;
  color: var(--ink-soft);
}

.tile__arrow {
  grid-area: arrow;
  align-self: center;
  color: var(--primary-ink);
  transition: translate var(--dur) var(--ease-out);
}

.tile:hover,
.tile:focus-within {
  translate: 0 -4px;
  box-shadow: var(--shadow-lift);
}
.tile:hover .tile__icon,
.tile:focus-within .tile__icon { color: var(--brand-primary); }
.tile:hover .tile__arrow,
.tile:focus-within .tile__arrow { translate: 4px 0; }

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

/* ==========================================================================
   Certification — seal and Train / Assess / Certify steps
   ========================================================================== */

.certify__grid {
  display: grid;
  gap: var(--space-6);
  grid-template-areas:
    "head"
    "badge"
    "steps"
    "actions";
}

.certify__head {
  grid-area: head;
  display: grid;
  gap: var(--space-3);
}

.certify__badge {
  grid-area: badge;
  justify-self: center;
  width: min(72%, 300px);
}

.certify__actions { grid-area: actions; }

/* Seal */
.seal {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.seal__edge  { fill: var(--brand-accent); }
.seal__ring  { fill: var(--brand-primary); }
.seal__inner { fill: var(--surface); }
.seal__dash {
  fill: none;
  stroke: var(--brand-secondary);
  stroke-width: 2;
  stroke-dasharray: 2 8;
  stroke-linecap: round;
}
.seal__text {
  fill: var(--on-brand);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .18em;
}
.seal__word {
  fill: var(--brand-accent);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .32em;
}

/* Steps */
.steps {
  grid-area: steps;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: var(--space-3);
  padding-bottom: var(--space-6);
}
.step:last-child { padding-bottom: 0; }

.step__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--brand-primary);
  border-radius: 50%;
  background: var(--surface);
}
.step__dot-fill {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-primary);
}
.step__num {
  position: relative;
  color: var(--on-brand);
  font-size: var(--fs-small);
  font-weight: 600;
}

/* Connector from this dot down to the next one */
.step__line {
  position: absolute;
  top: 44px;
  left: 21px;
  width: 2px;
  height: calc(100% - 44px);
  overflow: visible;
}
.step__line-track { stroke: var(--line); stroke-width: 2; }
.step__line-draw {
  stroke: var(--brand-primary);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.step__body {
  display: grid;
  gap: .25rem;
  padding-top: .45rem;
}
.step__body h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}
.step__body p { color: var(--ink-soft); }

@media (min-width: 900px) {
  .certify__grid {
    grid-template-columns: 1.15fr .85fr;
    grid-template-areas:
      "head    badge"
      "steps   badge"
      "actions badge";
    column-gap: var(--space-8);
  }
  .certify__badge {
    align-self: center;
    width: min(100%, 420px);
  }
}

/* ==========================================================================
   Closing CTA band
   ========================================================================== */

.cta { padding-top: 0; }

.cta__band {
  position: relative;
  display: grid;
  justify-items: start;
  gap: var(--space-6);
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1.5rem, 6vw, 5.5rem);
  overflow: clip;
  border-radius: var(--radius-lg);
  background: var(--brand-primary);
  color: var(--on-brand);
}
.cta__band .h2 {
  position: relative;
  max-width: 16ch;
  color: var(--on-brand);
}
.cta__band .btn-row { position: relative; }

.cta__blob {
  position: absolute;
  top: -35%;
  right: -12%;
  width: min(70vw, 560px);
  fill: var(--cta-blob);
  opacity: .55;
  pointer-events: none;
}

/* ==========================================================================
   Inner-page hero — the homepage hero, shorter, with a smaller title.
   Without a photo, .hero__media--mark shows the logo mark among the blobs.
   ========================================================================== */

.hero--page {
  min-height: 0;
  padding-block: clamp(var(--space-4), 6vw, var(--space-8)) clamp(var(--space-6), 8vw, 7rem);
}
.hero--page .hero__title { font-size: var(--fs-page-title); }
.hero--page .hero__sub { max-width: 46ch; }
.hero--page .hero__actions { margin-top: var(--space-4); }

.hero__media--mark { display: none; }
.hero__mark {
  width: min(62%, 280px);
  height: auto;
  aspect-ratio: 109.36 / 88.74;
}

@media (min-width: 900px) {
  .hero__media--mark {
    display: grid;
    min-height: 340px;
  }
}

/* ==========================================================================
   Section helpers
   ========================================================================== */

.section--tint   { background: var(--primary-tint); }
.section--tint-2 { background: var(--secondary-tint); }
.section--flush  { padding-top: 0; }

/* Body copy: a stack of paragraphs under a heading */
.copy {
  display: grid;
  gap: var(--space-2);
  align-content: start;
}
.copy p { color: var(--ink-soft); }
.copy .h2 + p { margin-top: var(--space-1); }
.copy .btn-row { margin-top: var(--space-2); }

.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}

/* ==========================================================================
   Split — copy beside a framed photo; --reverse puts the photo first on desktop
   ========================================================================== */

.split {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.split__media {
  justify-self: center;
  width: min(100%, 480px);
}

.frame {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--primary-tint);
  box-shadow: var(--shadow-soft);
}
.frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 7fr 5fr;
    gap: var(--space-8);
  }
  .split--reverse { grid-template-columns: 5fr 7fr; }
  .split--reverse .split__media { order: -1; }
}

/* ==========================================================================
   Card grid — info cards in 1 → 2 → 3/4 columns
   ========================================================================== */

.card-grid {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* ==========================================================================
   Stat — one large figure with its caption
   ========================================================================== */

.stat-band {
  display: grid;
  gap: var(--space-4);
  align-items: center;
}

.stat {
  display: grid;
  gap: var(--space-1);
}
.stat__figure {
  font-family: var(--font-display);
  font-size: clamp(4rem, 11vw, 8.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--brand-accent);
}
.stat__figure em {
  font-style: italic;
  color: var(--primary-ink);
}
.stat__caption {
  max-width: 18ch;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 300;
  line-height: 1.3;
}

@media (min-width: 900px) {
  .stat-band {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-8);
  }
}

/* ==========================================================================
   Partner logos
   ========================================================================== */

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
.logo-row li {
  display: grid;
  place-items: center;
  width: min(100%, 15rem);
  height: 8rem;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.logo-row img {
  width: auto;
  max-width: 100%;
  max-height: 4.5rem;
}

/* ==========================================================================
   Checklist, note and contact details
   ========================================================================== */

.checklist {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.checklist li {
  position: relative;
  padding-left: 2.5rem;
}
/* Tinted circle with a tick drawn in the primary ink */
.checklist li::before,
.checklist li::after {
  content: "";
  position: absolute;
  top: .05em;
  left: 0;
  width: 1.625rem;
  height: 1.625rem;
}
.checklist li::before {
  border-radius: 50%;
  background: var(--primary-tint);
}
.checklist li::after {
  background: var(--primary-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9'/%3E%3C/svg%3E") center / 1.125rem no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9'/%3E%3C/svg%3E") center / 1.125rem no-repeat;
}

.note {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--secondary-tint);
}
.note p {
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

.contact-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}
.contact-list dt {
  margin-bottom: .125rem;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.contact-list dd {
  margin: 0;
  font-size: 1.125rem;
}
.contact-list .link {
  display: inline-block;
  padding-block: .5rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Directories (layouts/directory.html) — filter bar, result grid, cards, empty state
   ========================================================================== */

/* Two fields + Search by default; --1 and --3 for one or three fields */
.filters {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 750px) {
  .filters {
    grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) auto;
    align-items: end;
  }
  .filters--1 { grid-template-columns: minmax(0, 1fr) auto; }
  .filters--3 { grid-template-columns: repeat(2, minmax(0, 14rem)) minmax(0, 1fr) auto; }
}

.results-count {
  margin-bottom: var(--space-3);
  color: var(--ink-soft);
}

.listing-grid {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* School, centre, specialist or shop */
.listing-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.listing-card__logo {
  display: flex;
  align-items: center;
  height: 80px;
  margin-bottom: var(--space-1);
}
.listing-card__logo img {
  width: auto;
  max-width: min(100%, 220px);
  max-height: 80px;
  object-fit: contain;
}

/* Wide preview image (shops) */
.listing-card__cover {
  width: 100%;
  aspect-ratio: 2 / 1;
  margin-bottom: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: top;
  background: var(--bg);
}

.listing-card__text { color: var(--ink-soft); }

.listing-card__action {
  align-self: flex-start;
  margin-top: auto;
}

/* Address / phone / email / website, each with its icon */
.contact-rows {
  display: grid;
  gap: .625rem;
  margin: 0;
  padding: var(--space-2) 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: .9375rem;
  line-height: 1.5;
}
.contact-rows li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: .625rem;
  align-items: start;
}
.contact-rows svg {
  margin-top: .125rem;
  color: var(--primary-ink);
}
.contact-rows .link {
  overflow-wrap: anywhere;
}

.teacher-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: translate var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.teacher-card:hover,
.teacher-card:focus-within {
  translate: 0 -4px;
  box-shadow: var(--shadow-lift);
}

.teacher-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary-ink);
  font-size: 1.375rem;
  font-weight: 600;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-card__link {
  color: var(--ink);
  text-decoration: none;
}
/* The whole card is the link's hit area */
.teacher-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}
.teacher-card__link:focus-visible { outline: none; }
.teacher-card__link:focus-visible::after {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.teacher-card__place {
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

.teacher-card__details {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  margin: 0;
}
.teacher-card__details dt {
  color: var(--ink-soft);
  font-size: var(--fs-small);
}
.teacher-card__details dd { margin: .25rem 0 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip {
  padding: .25rem .75rem;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--primary-ink);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.teacher-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-small);
}
.teacher-card__rate strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

/* Teacher profile: bio beside an "At a glance" card */
.split--top { align-items: start; }
.teacher-facts {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}
.teacher-facts .contact-list dd { font-size: 1rem; }

@media (min-width: 900px) {
  .teacher-facts {
    position: sticky;
    top: 120px;
  }
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.empty-state .icon-badge { margin-bottom: var(--space-1); }
.empty-state p { color: var(--ink-soft); }
.empty-state .btn-row {
  justify-content: center;
  margin-top: var(--space-2);
}

/* Supporting paragraphs under a section heading match the lead's colour */
.section-head > p:not(.lead) { color: var(--ink-soft); }

/* Cards in a row stretch to the same height; keep their content at the top */
.card-grid .info-card { align-content: start; }

/* The CTA band normally sits on the page background under a padded section.
   After a tinted section it needs its own space above. */
.section--tint + .cta,
.section--tint-2 + .cta,
.vision + .cta { padding-top: var(--section-y); }

/* Buttons that close a section, below its cards */
.section-actions { margin-top: var(--space-6); }

/* The certification seal standing in for a photo beside copy */
.split__seal {
  justify-self: center;
  width: min(72%, 380px);
}

/* Statement band with a lead-in paragraph before the statement */
.vision__lead {
  max-width: 52ch;
  margin-top: var(--space-2);
  color: var(--ink-soft);
}

/* Info card that carries one sentence instead of a title and text */
.info-card--statement p {
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.5;
}

/* CTA band with a supporting sentence: sits closer to its heading than the buttons do */
.cta__text {
  position: relative;
  max-width: 52ch;
  margin-top: calc(var(--space-3) - var(--space-6));
  color: var(--on-brand);
}

/* ==========================================================================
   Current page in the navigation
   ========================================================================== */

.dropdown__toggle.is-active { color: var(--primary-ink); }
.dropdown__panel a[aria-current="page"],
.accordion a[aria-current="page"] {
  color: var(--primary-ink);
  font-weight: 600;
}
.dropdown__panel a[aria-current="page"] { background-color: var(--primary-tint); }
.footer__cols .link[aria-current="page"] { color: var(--primary-ink); }

/* ==========================================================================
   Motion preferences — nothing lifts
   ========================================================================== */

.calm .info-card:hover,
.calm .tile:hover,
.calm .tile:focus-within,
.calm .tile:hover .tile__arrow,
.calm .tile:focus-within .tile__arrow,
.calm .teacher-card:hover,
.calm .teacher-card:focus-within { translate: none; }

@media (prefers-reduced-motion: reduce) {
  .info-card:hover,
  .tile:hover,
  .tile:focus-within,
  .tile:hover .tile__arrow,
  .tile:focus-within .tile__arrow,
  .teacher-card:hover,
  .teacher-card:focus-within { translate: none; }
}
