/**
 * AbleCares Initiative Africa (ACI Africa)
 * Homepage-Specific Stylesheet — css/aci-home.css
 * Loaded alongside css/aci-site.css; contains video hero,
 * pillar tiles, circular photo collage, and map infographic band.
 * Design language adapted from Colorlib "Welfare" (CC BY 3.0) — see aci-site.css header.
 */

/* Transparent Masthead Over Full-Bleed Video Hero (reference .ftco-navbar-light) */
body.has-hero-video .aci-masthead {
  position: fixed;
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

body.has-hero-video .aci-masthead .aci-nav-brand span {
  color: #FFFFFF;
}

/* rgba .85 white keeps >= 4.6:1 over the 60% hero overlay */
body.has-hero-video .aci-masthead .aci-nav-link {
  color: rgba(255, 255, 255, 0.85);
}

body.has-hero-video .aci-masthead .aci-nav-link:hover {
  color: #FFFFFF;
}

body.has-hero-video .aci-masthead .aci-mobile-toggle {
  color: #FFFFFF;
}

body.has-hero-video .aci-masthead .aci-brand-logo-light {
  display: inline-block;
}

body.has-hero-video .aci-masthead .aci-brand-logo-dark {
  display: none;
}

/* Once scrolled ~30px or drawer open: solid white bar with dark links (reference .scrolled) */
body.has-hero-video .aci-masthead.is-scrolled,
body.has-hero-video .aci-masthead.is-drawer-open {
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow-nav);
}

body.has-hero-video .aci-masthead.is-scrolled .aci-nav-brand span,
body.has-hero-video .aci-masthead.is-drawer-open .aci-nav-brand span {
  color: var(--ink);
}

body.has-hero-video .aci-masthead.is-scrolled .aci-nav-link,
body.has-hero-video .aci-masthead.is-drawer-open .aci-nav-link {
  color: var(--ink);
}

body.has-hero-video .aci-masthead.is-scrolled .aci-nav-link:hover,
body.has-hero-video .aci-masthead.is-drawer-open .aci-nav-link:hover {
  color: var(--primary-text);
}

body.has-hero-video .aci-masthead.is-scrolled .aci-mobile-toggle,
body.has-hero-video .aci-masthead.is-drawer-open .aci-mobile-toggle {
  color: var(--ink);
}

body.has-hero-video .aci-masthead.is-scrolled .aci-brand-logo-light,
body.has-hero-video .aci-masthead.is-drawer-open .aci-brand-logo-light {
  display: none;
}

body.has-hero-video .aci-masthead.is-scrolled .aci-brand-logo-dark,
body.has-hero-video .aci-masthead.is-drawer-open .aci-brand-logo-dark {
  display: inline-block;
}


/* ── 6. HERO SECTION: FULL-BLEED VIDEO (reference .hero-wrap + .slider-text) ── */
.aci-hero {
  position: relative;
  overflow: hidden;
}

/* Variant 1: Full-Bleed Background Video Hero (.aci-hero--video) [Default] */
.aci-hero--video {
  width: 100%;
  min-height: max(700px, 100svh);
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 80px;
  background-color: #000000;
}

.aci-hero--video .aci-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.aci-hero--video video,
.aci-hero--video .aci-hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.aci-hero--video .aci-hero-poster {
  opacity: 1;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.aci-hero--video video.is-playing+.aci-hero-poster {
  opacity: 0;
  pointer-events: none;
}

/* Uniform overlay: centred white text stays >= 5.7:1 over any frame (AA) */
.aci-hero--video .aci-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2;
  pointer-events: none;
}

.aci-hero--video .aci-hero-container {
  position: relative;
  z-index: 3;
  width: 100%;
}

/* Reference .slider-text: centred column (~col-md-7) */
.aci-hero--video .aci-hero-content {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.aci-hero--video .aci-eyebrow {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--s-3);
}

.aci-hero--video h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-hero);
  color: #FFFFFF;
  line-height: 1.2;
  text-align: center;
  margin-bottom: var(--s-6);
}

.aci-hero--video .aci-lead {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  text-align: center;
  max-width: var(--prose, 68ch);
  margin-bottom: var(--s-6);
}

.aci-hero--video .aci-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}

/* Hero buttons: reference .btn (square, shadowed, px-4 py-3) */
.aci-hero--video .aci-btn-primary,
.aci-hero--video .aci-btn-amber {
  background-color: var(--primary-text);
  border: 1px solid var(--primary-text);
  color: #FFFFFF;
  padding: 16px 24px;
}

.aci-hero--video .aci-btn-primary:hover,
.aci-hero--video .aci-btn-amber:hover {
  background-color: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--primary-text);
}

/* Reference .btn-white.btn-outline-white */
.aci-hero--video .aci-btn-outline-white {
  background-color: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 16px 24px;
}

.aci-hero--video .aci-btn-outline-white:hover {
  background-color: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--primary-text);
}

/* Decorative 3-dot accent in reference tile colours */
.aci-dot-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.aci-dot-cluster .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.aci-dot-cluster .dot-yellow {
  background-color: var(--tertiary);
}

.aci-dot-cluster .dot-orange {
  background-color: var(--primary);
}

.aci-dot-cluster .dot-green {
  background-color: var(--quaternary);
}

/* Variant 2: Masked Africa Silhouette (.aci-hero--masked) — not used by current markup */
.aci-hero--masked {
  background-color: var(--ground);
  min-height: auto;
  padding: clamp(36px, 5vw, 68px) 0 clamp(48px, 6vw, 88px);
}

.aci-hero--masked .aci-hero-overlay {
  display: none !important;
}

.aci-hero--masked .aci-hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 4.5vw, 64px);
  align-items: center;
}

.aci-hero--masked .aci-hero-bg {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 681 / 722;
  margin: 0 auto;
  mask-image: url('../images/africa-silhouette.svg');
  -webkit-mask-image: url('../images/africa-silhouette.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.aci-hero--masked .aci-hero-bg video,
.aci-hero--masked .aci-hero-bg .aci-hero-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.aci-hero--masked .aci-hero-bg video.is-playing+.aci-hero-poster {
  opacity: 0;
  pointer-events: none;
}

.aci-hero--masked .aci-hero-content {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 2;
}

.aci-hero--masked h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  margin-bottom: var(--s-4);
  line-height: 1.2;
  color: var(--ink);
}

.aci-hero--masked .aci-lead {
  font-family: var(--font-body);
  margin-bottom: var(--s-6);
  color: var(--ink-muted);
}

.aci-hero--masked .aci-btn-outline-white {
  color: var(--ink);
  border-color: var(--ink);
}

.aci-hero--masked .aci-btn-outline-white:hover {
  background-color: var(--ink);
  color: #FFFFFF;
}

/* Reduced Motion & Save-Data Fallbacks */
@media (prefers-reduced-motion: reduce) {
  .aci-hero video {
    display: none !important;
  }

  .aci-hero .aci-hero-poster {
    opacity: 1 !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
  .aci-hero--masked .aci-hero-container {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .aci-hero--masked .aci-hero-bg {
    grid-column: 1;
    grid-row: 2;
    max-width: 380px;
  }

  .aci-hero--masked .aci-hero-content {
    grid-column: 1;
    grid-row: 1;
  }
}

@media (max-width: 767px) {
  .aci-hero--video {
    min-height: 600px;
    padding-top: 112px;
    padding-bottom: 64px;
  }

  .aci-hero--video .aci-hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }

  .aci-hero--video .aci-btn-primary,
  .aci-hero--video .aci-btn-amber,
  .aci-hero--video .aci-btn-outline-white {
    width: 100%;
    text-align: center;
  }
}

/* ── 7. PILLAR TILES OVERLAP THE HERO (reference .ftco-intro margin-top: -80px) ── */
@media (min-width: 768px) {
  .aci-hero--video {
    padding-bottom: 160px;
  }

  .aci-feature-row-wrap {
    position: relative;
    z-index: 5;
    margin-top: -80px;
  }
}


/* ── 8. ABOUT SECTION WITH CIRCULAR COLLAGE (reference .staff round photos) ── */
.aci-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.aci-about-grid p {
  max-width: var(--prose, 68ch);
}

.aci-collage-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.aci-collage-orbital {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  border: 2px dashed var(--primary-light);
  border-radius: 50%;
  pointer-events: none;
}

.aci-circle-main {
  position: absolute;
  top: 8%;
  left: 8%;
  width: 66%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #F0F0F0;
  box-shadow: var(--shadow-card);
  z-index: 2;
}

.aci-circle-sub {
  position: absolute;
  bottom: 8%;
  right: 6%;
  width: 48%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #F0F0F0;
  box-shadow: var(--shadow-card);
  z-index: 3;
}

.aci-circle-main img,
.aci-circle-sub img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reference pill badge: primary fill, dark text (7.3:1) */
.aci-badge-pill {
  position: absolute;
  top: 10%;
  right: 4%;
  background: var(--primary);
  color: #000000;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  z-index: 4;
}

@media (max-width: 991px) {
  .aci-about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}


/* ── 10. METRICS: STAT TILES (reference .block-18) & AFRICA MAP ── */
.aci-metrics-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.aci-stats-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 32px;
}

.aci-stat-item {
  display: flex;
  flex-direction: column;
  padding: 30px;
  color: #000000;
}

.aci-stat-item:nth-child(1) { background-color: var(--primary); }
.aci-stat-item:nth-child(2) { background-color: var(--secondary); }
.aci-stat-item:nth-child(3) { background-color: var(--tertiary); }
.aci-stat-item:nth-child(4) { background-color: var(--quaternary); }

.aci-stat-dot-num {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

/* Colour dots are redundant on solid colour tiles */
.aci-stat-dot {
  display: none;
}

.aci-stat-val {
  font-family: var(--font-body);
  font-size: clamp(2.75rem, 2rem + 2.5vw, 3.75rem);
  font-weight: 300;
  line-height: 1;
  color: #000000;
  font-variant-numeric: tabular-nums;
}

.aci-stat-item .aci-stat-label {
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
  margin-top: 0;
  color: rgba(0, 0, 0, 0.85);
}

.aci-metrics-grid p {
  max-width: var(--prose, 68ch);
}

.aci-map-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aci-map-wrap svg,
.aci-map-wrap img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(248, 111, 45, 0.15));
}

/* CSS overrides the SVG's inline gradient stop colours */
.aci-map-wrap stop:first-child {
  stop-color: var(--primary);
}

.aci-map-wrap stop:last-child {
  stop-color: var(--tertiary);
}

@media (max-width: 860px) {
  .aci-metrics-grid {
    grid-template-columns: 1fr;
  }

  .aci-map-wrap {
    order: 2;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .aci-stats-2x2 {
    grid-template-columns: 1fr;
  }
}
