/* ═══════════════════════════════════════════════════════
   DALA HEALTH HUB — dynamic sections (loads after style.css)
   Team · Gallery + lightbox · logo · footer · donate presets · motion
   ═══════════════════════════════════════════════════════ */

/* ─── Fixes ──────────────────────────────────────────── */
/* "Talk to Us" was dark-green-on-dark-green in the hero */
.hero-section .btn-outline { color: #fff; border-color: rgba(255,255,255,.45); }
.hero-section .btn-outline:hover { background: rgba(255,255,255,.12); border-color: var(--gold-light); color: #fff; }

/* ─── Brand logo (menu) ──────────────────────────────── */
.brand-icon.brand-logo {
  width: 46px; height: 46px; padding: 3px;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
}
.brand-icon.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.dala-nav.scrolled .brand-icon.brand-logo { box-shadow: 0 0 0 1px var(--border); }

/* ─── Footer ─────────────────────────────────────────── */
.footer-logo { display: inline-block; background: #fff; border-radius: 14px; padding: 10px 16px; margin-bottom: 1rem; }
.footer-logo img { display: block; height: 62px; width: auto; max-width: 100%; }
.footer-brand-col .fb-tag { margin: 0 0 .7rem; font-size: .8rem; letter-spacing: .04em; }
.footer-email { overflow-wrap: anywhere; }
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.3rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: #fff; font-size: .95rem;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.footer-social a:hover { background: var(--gold); color: #14170F; transform: translateY(-3px); }

/* ─── Donate window ──────────────────────────────────── */
.donate-intro { font-size: .88rem; color: var(--text-muted); margin: -.2rem 0 1rem; }
.donate-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.donate-preset {
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-b);
  border-radius: 999px; padding: .34rem .9rem; font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.donate-preset::before { content: 'KES '; opacity: .55; font-weight: 500; }
.donate-preset:hover { border-color: var(--green); transform: translateY(-1px); }
.donate-preset.is-active { background: var(--green); border-color: var(--green); color: #fff; }

/* ─── Sponsors: extra tier ───────────────────────────── */
.sponsor-tier-label.tier-partner { color: var(--green); }

/* ─── Motion & delight ───────────────────────────────── */
#scrollProgress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 1000; pointer-events: none;
  transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--green), var(--gold));
}
.btn-solid { position: relative; overflow: hidden; }
.btn-solid::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn-solid:hover::after { transform: translateX(120%); }

.section-header .section-title { position: relative; }
.section-header .section-title::after {
  content: ''; display: block; height: 3px; width: 56px; margin-top: .9rem; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease) .25s;
}
.section-header.text-center .section-title::after { margin-left: auto; margin-right: auto; transform-origin: center; }
.section-header.in .section-title::after, .section-header:not(.reveal) .section-title::after { transform: scaleX(1); }

.service-card:hover .svc-icon i { display: inline-block; animation: svcWiggle .7s ease; }
@keyframes svcWiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(9deg) scale(1.12); } }

/* ═══════════════ TEAM ═══════════════════════════════════ */
.tx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 22px; align-items: stretch; }
.tx-card { display: flex; }
.js-ready .tx-card.reveal { transition-delay: calc(min(var(--i, 0), 7) * 70ms); }

.tx-inner {
  position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-l);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
}
.tx-inner::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.tx-card:hover .tx-inner { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(201,162,39,.45); }
.tx-card:hover .tx-inner::after { transform: scaleX(1); }

.tx-photo {
  position: relative; aspect-ratio: 5 / 6; overflow: hidden;
  background: linear-gradient(160deg, var(--green-light), var(--green-xlight));
}
.tx-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.tx-card:hover .tx-photo img { transform: scale(1.05); }
.tx-photo::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; pointer-events: none;
  background: linear-gradient(to top, rgba(10,38,12,.22), transparent);
}
.tx-initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 6vw, 3.5rem);
  color: var(--gold-light); letter-spacing: .02em;
  background: radial-gradient(circle at 30% 20%, #2c7a31, #0f3d13 70%);
}
/* people without a photo get a compact banner instead of a tall empty block */
.tx-photo:has(> .tx-initials) { aspect-ratio: 16 / 7; }
.tx-photo:has(> .tx-initials) .tx-initials { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.tx-chip {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--gold); color: #14170F; font-size: .64rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; padding: .22rem .65rem; border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

.tx-body { padding: 1.05rem 1.15rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.tx-name { font-size: 1.12rem; margin: 0 0 .2rem; line-height: 1.25; }
.tx-role { font-size: .82rem; font-weight: 600; line-height: 1.4; color: var(--gold-dark); margin: 0 0 .55rem; }
[data-theme="dark"] .tx-role { color: var(--gold-light); }
.tx-bio {
  font-size: .86rem; line-height: 1.65; color: var(--text-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tx-bio.is-open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.tx-more { align-self: flex-start; background: none; border: 0; padding: 0; margin-top: .45rem; font-size: .78rem; font-weight: 700; color: var(--green); cursor: pointer; }
[data-theme="dark"] .tx-more { color: var(--gold-light); }
.tx-more:hover { text-decoration: underline; }
.tx-more[hidden] { display: none; }

/* Featured (founder): wide, side-by-side, full bio */
.tx-card.is-featured { grid-column: span 2; }
.tx-card.is-featured .tx-inner { flex-direction: row; }
.tx-card.is-featured .tx-photo { flex: 0 0 42%; aspect-ratio: auto; min-height: 340px; }
.tx-card.is-featured .tx-body { justify-content: center; padding: 1.6rem 1.7rem; }
.tx-card.is-featured .tx-name { font-size: 1.5rem; }
.tx-card.is-featured .tx-role { font-size: .9rem; margin-bottom: .8rem; }
.tx-card.is-featured .tx-bio { font-size: .94rem; line-height: 1.75; display: block; -webkit-line-clamp: unset; overflow: visible; }
.tx-card.is-featured .tx-more { display: none; }

.tx-advisors { margin-top: 5rem; padding-top: 4rem; border-top: 1px solid var(--border); }
.tx-subtitle { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.tx-members { margin-top: 3.2rem; text-align: center; }
.tx-members p { font-size: .9rem; font-style: italic; color: var(--text-muted); margin: 0 0 .9rem; }
.tx-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tx-chips span {
  padding: .4rem .95rem; border: 1.5px solid var(--border); border-radius: 999px; background: var(--bg-card);
  font-size: .84rem; font-weight: 500; color: var(--text-b); transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.tx-chips span:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ═══════════════ GALLERY ════════════════════════════════ */
.gx-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.7rem; }
.gx-filter {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-b);
  border-radius: 999px; padding: .5rem 1.05rem; font-size: .82rem; font-weight: 600;
  transition: background .25s var(--ease), border-color .25s, color .25s, transform .25s, box-shadow .25s;
}
.gx-filter span {
  font-size: .68rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px;
  background: var(--bg-alt); color: var(--text-muted); transition: background .25s, color .25s;
}
.gx-filter:hover { border-color: var(--green); color: var(--green); transform: translateY(-1px); }
[data-theme="dark"] .gx-filter:hover { color: var(--gold-light); border-color: var(--gold); }
.gx-filter.is-active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: var(--shadow-md); }
.gx-filter.is-active span { background: rgba(255,255,255,.22); color: #fff; }

.gx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; grid-auto-flow: row dense; align-items: start; }
.gx-grid.is-masonry { grid-auto-rows: 8px; row-gap: 0; }

.gx-item {
  position: relative; margin: 0; overflow: hidden; cursor: zoom-in; outline: none;
  aspect-ratio: var(--ar, 1.3333); border-radius: var(--radius-m); box-shadow: var(--shadow-sm);
  background: linear-gradient(110deg, var(--bg-alt) 8%, var(--border) 18%, var(--bg-alt) 33%); background-size: 200% 100%;
  transition: box-shadow .4s var(--ease);
}
.gx-item:not(.is-loaded) { animation: gxShimmer 1.4s linear infinite; }
@keyframes gxShimmer { to { background-position-x: -200%; } }
.gx-item[hidden] { display: none; }
.gx-item.is-wide { grid-column: span 2; }
.gx-item:hover, .gx-item:focus-visible { box-shadow: var(--shadow-lg); }
.gx-item:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.gx-item.gx-enter { animation: gxIn .5s var(--ease) both; animation-delay: calc(min(var(--k, 0), 10) * 45ms); }
@keyframes gxIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }

.gx-item img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block;
  transition: transform .8s var(--ease), filter .5s;
}
.gx-item:hover img, .gx-item:focus-visible img { transform: scale(1.07); }

.gx-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; gap: 5px; padding: 3rem 1rem .95rem; color: #fff;
  background: linear-gradient(to top, rgba(8,30,10,.86), rgba(8,30,10,0));
  opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.gx-item:hover .gx-cap, .gx-item:focus-visible .gx-cap { opacity: 1; transform: none; }
.gx-tag {
  align-self: flex-start; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--gold); color: #14170F; border-radius: 999px; padding: .18rem .6rem;
}
.gx-title { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.25; }
.gx-zoom {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; background: rgba(255,255,255,.94); color: var(--green);
  opacity: 0; transform: scale(.7); transition: opacity .3s, transform .3s var(--ease);
}
.gx-item:hover .gx-zoom, .gx-item:focus-visible .gx-zoom { opacity: 1; transform: none; }
@media (hover: none) {
  .gx-cap { opacity: 1; transform: none; padding-top: 1.8rem; }
  .gx-zoom { display: none; }
}

.gx-more-wrap { text-align: center; margin-top: 2.2rem; }
.gx-more[hidden] { display: none; }

/* Lightbox */
.gx-lb { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; color: #fff; background: rgba(6,18,8,.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gx-lb.is-open { display: flex; animation: gxLbIn .3s ease; }
@keyframes gxLbIn { from { opacity: 0; } to { opacity: 1; } }
.gx-lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 58px 78px 6px; touch-action: pan-y; }
.gx-lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.55); transition: opacity .3s, filter .3s, transform .3s; }
.gx-lb-img.is-loading { opacity: .55; filter: blur(5px); transform: scale(.99); }
.gx-lb-bar { padding: 12px 20px 22px; text-align: center; min-height: 64px; }
.gx-lb-cap { font-family: var(--font-display); font-size: 1.15rem; }
.gx-lb-meta { margin-top: 4px; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.gx-lb-btn {
  position: absolute; z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 1.05rem; color: #fff; background: rgba(255,255,255,.12);
  transition: background .2s, color .2s, transform .2s;
}
.gx-lb-btn:hover, .gx-lb-btn:focus-visible { background: var(--gold); color: #14170F; }
.gx-lb-close { top: 14px; right: 14px; }
.gx-lb-prev { left: 14px; top: 50%; margin-top: -23px; }
.gx-lb-next { right: 14px; top: 50%; margin-top: -23px; }
.gx-lb.single .gx-lb-prev, .gx-lb.single .gx-lb-next { display: none; }

/* ═══════════════ RESPONSIVE ═════════════════════════════ */
@media (max-width: 991px) {
  .tx-card.is-featured .tx-photo { flex-basis: 40%; min-height: 300px; }
}
@media (max-width: 767px) {
  .tx-card.is-featured .tx-inner { flex-direction: column; }
  .tx-card.is-featured .tx-photo { flex: none; aspect-ratio: 1 / 1; min-height: 0; }
  .tx-card.is-featured .tx-body { padding: 1.2rem 1.25rem 1.4rem; }
  .tx-advisors { margin-top: 3.5rem; padding-top: 3rem; }
  .gx-lb-stage { padding: 62px 8px 6px; }
  .gx-lb-prev, .gx-lb-next { top: auto; bottom: 92px; margin-top: 0; }
  .gx-lb-prev { left: 14px; }
  .gx-lb-next { right: 14px; }
}
@media (max-width: 575px) {
  .tx-photo:has(> .tx-initials) { aspect-ratio: 2 / 1; }
  .tx-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tx-card.is-featured { grid-column: 1 / -1; }
  .tx-body { padding: .85rem .85rem 1rem; }
  .tx-name { font-size: 1rem; }
  .tx-role { font-size: .74rem; }
  .tx-bio { font-size: .8rem; }
  .tx-chip { top: 8px; left: 8px; font-size: .56rem; padding: .18rem .5rem; }
  .gx-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gx-item.is-wide { grid-column: span 2; }
  .gx-filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 2px 12px 8px; scrollbar-width: none; }
  .gx-filters::-webkit-scrollbar { display: none; }
  .gx-filter { flex: 0 0 auto; }
  .footer-logo img { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .gx-item:not(.is-loaded) { animation: none; }
  .btn-solid::after { display: none; }
  .tx-card:hover .tx-inner, .tx-card:hover .tx-photo img, .gx-item:hover img { transform: none; }
}
