/* =============================================
   USEF Center for Community Health Research — the public labs area.
   Loaded by /labs and each lab page, on top of css/styles.css.
   Tokens only: every colour here is a var() from styles.css.
   ============================================= */

/* ---------- Hero additions ---------- */
.lab-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1rem;
}
.page-hero .lab-lede {
  max-width: 720px;
  font-size: 1.12rem;
}

/* Stat strip under a hero */
.lab-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.lab-stat {
  min-width: 138px;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}
.lab-stat-n {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.lab-stat-l {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 0.15rem;
}

/* ---------- The four labs ---------- */
.lab-grid {
  display: grid;
  /* 420px so four labs land 2 x 2 on a desktop instead of 3 with one stranded. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.25rem;
}
.lab-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 1.5rem;
  transition: var(--transition);
  min-width: 0;
}
.lab-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border);
  border-top-color: var(--gold);
}
.lab-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.lab-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.22rem;
}
.lab-card p { font-size: 0.95rem; }
.lab-card-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.lab-card-meta {
  font-size: 0.82rem;
  color: var(--text-mid);   /* --text-light measures 4.31:1 on white, under 4.5 */
  min-height: 1.2em;
}
.lab-card-go {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
}

/* ---------- Prose blocks on a lab page ---------- */
.lab-prose { max-width: 760px; }
.lab-prose h3 { margin: 2rem 0 0.6rem; }
.lab-prose h3:first-child { margin-top: 0; }
.lab-prose ul {
  list-style: disc;
  padding-left: 1.15rem;
  margin-bottom: 1rem;
}
.lab-prose li {
  color: var(--text-mid);
  margin-bottom: 0.4rem;
}

/* A pulled-out statement of the research question */
.lab-question {
  border-left: 4px solid var(--gold);
  background: var(--cream);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.lab-question .lab-kicker { margin-bottom: 0.35rem; }
.lab-question p {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--green-dark);
  margin: 0;
}

/* Status / facts table */
.lab-facts {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
}
.lab-fact {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.lab-fact:last-child { border-bottom: 0; }
.lab-fact dt {
  font-weight: 700;
  color: var(--green-dark);
}
.lab-fact dd { color: var(--text-mid); }
@media (max-width: 560px) {
  .lab-fact { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- People ---------- */
.lab-people {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.lab-person {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 0.9rem 1.1rem 0.9rem 0.9rem;
  min-width: 250px;
  flex: 1 1 250px;
  max-width: 340px;
}
.lab-person--lead { border-left: 3px solid var(--gold); }
.lab-avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
}
.lab-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.lab-avatar span {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  color: var(--white);
}
.lab-person-name {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.3;
}
.lab-person-role {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.35;
  margin-top: 0.15rem;
}
.lab-more {
  font-size: 0.92rem;
  color: var(--text-mid);   /* --text-light measures 4.31:1 on white, under 4.5 */
  margin-top: 1rem;
}

/* ---------- How it works / policy ---------- */
.lab-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 1.25rem;
}
.lab-cols--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.lab-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: var(--white);
  min-width: 0;
}
.lab-note h4 { margin-bottom: 0.4rem; }
.lab-note p { font-size: 0.93rem; }


/* ---------- Person cards + the profile popup ---------- */
.lab-person-text { min-width: 0; }
.lab-person.is-clickable { cursor: pointer; transition: var(--transition); }
.lab-person.is-clickable:hover { box-shadow: var(--shadow-md); border-color: var(--green-light); }
.lab-person-more {
  font-size: 0.78rem;
  color: var(--text-mid);
  margin-top: 0.2rem;
}
.lab-avatar--lg { width: 84px; height: 84px; }
.lab-avatar--lg span { font-size: 1.6rem; }

.lab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 3000;
}
.lab-overlay.is-open { display: flex; }
.lab-modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
}
.lab-modal-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
  padding-right: 2rem;
}
.lab-modal-head h2 { font-size: 1.4rem; margin: 0; }
.lab-modal-body p { font-size: 0.97rem; margin-bottom: 0.9rem; }
.lab-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-mid);
  font-size: 1.15rem;
  line-height: 1;
}
.lab-modal-close:hover { background: var(--bg-light); color: var(--green-dark); }
@media (max-width: 560px) {
  .lab-modal-head { flex-direction: column; text-align: center; padding-right: 0; }
  .lab-modal { padding: 1.5rem 1.15rem; }
}

/* ---------- Ways in (funders, partners, students) ---------- */
.lab-ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}
.lab-way {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 1.5rem;
  min-width: 0;
}
.lab-way h4 { margin-bottom: 0.45rem; }
.lab-way p { font-size: 0.94rem; }
.lab-way .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Projects ---------- */
.lab-projects { display: grid; gap: 1rem; }
.lab-project {
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-mid);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 1.25rem 1.4rem;
  min-width: 0;
}
.lab-project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.lab-project h4 { margin: 0; font-size: 1.06rem; }
.lab-project p { font-size: 0.95rem; margin-bottom: 0; }
.lab-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--bg-light);
  color: var(--green-mid);
}
.lab-status--done { background: var(--red-soft); color: var(--gold); }

/* ---------- Skeleton (never the word that names waiting) ---------- */
.lab-skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-light), var(--cream), var(--bg-light));
  background-size: 200% 100%;
  animation: lab-shimmer 1.3s linear infinite;
  height: 1em;
  width: 12ch;
  display: inline-block;
}
@keyframes lab-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-skel { animation: none; }
  .lab-card:hover { transform: none; }
}

/* ---------- The contact form (funders, academic partners) ---------- */
.lab-modal h2 { font-size: 1.4rem; margin-bottom: 0.4rem; padding-right: 2rem; }
.lab-contact-intro { font-size: 0.95rem; margin-bottom: 1.1rem; }
.lab-field { margin-bottom: 0.9rem; }
.lab-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.3rem;
}
.lab-opt { font-weight: 400; color: var(--text-mid); }
.lab-input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text-dark);
  background: var(--white);
}
.lab-input:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px var(--bg-light);
}
textarea.lab-input { resize: vertical; min-height: 110px; }
.lab-form-err {
  background: var(--red-soft);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}
.lab-form-err[hidden], .lab-form-done[hidden] { display: none; }
.lab-form-acts { display: flex; justify-content: flex-end; gap: 0.75rem; }
.lab-form-done h3 { margin-bottom: 0.5rem; }
.lab-form-done p { margin-bottom: 1.1rem; }
