/* css/coach-directory.css — Shared styles for the CoachDirectory module.
   Used by both portal.html (marketing) and patient.html (in-app workspace).
   The module renders into a container; styles work in any host page that
   provides the warm brand palette (terra/cream/slate). */

.cd-section { display: block; }

/* ── Optional header ───────────────────────────────────────────── */
.cd-header { margin-bottom: 22px; }
.cd-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #c2754e;
  margin-bottom: 12px; text-align: center;
}
.cd-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15; margin: 0 0 14px; text-align: center;
  color: #1e2d2f; font-weight: 600;
}
.cd-title em { font-style: italic; color: #c2754e; }
.cd-sub {
  font-size: 16px; line-height: 1.55; color: #57534e;
  max-width: 620px; margin: 0 auto 24px; text-align: center;
}

/* ── Reveal animation hook (host wires IntersectionObserver) ──── */
.cd-reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.cd-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cd-reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Intent search ────────────────────────────────────────────── */
.cd-intent {
  width: 100%;
  padding: 11px 16px;
  margin: 0 0 14px;
  font-family: inherit; font-size: 14px;
  color: #1e2d2f;
  background: #fff;
  border: 1px solid #e2dbd2;
  border-radius: 999px;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.cd-intent:focus {
  outline: none;
  border-color: #c2754e;
  box-shadow: 0 0 0 3px rgba(194,117,78,0.10);
}
.cd-intent::placeholder { color: #7a9098; }

/* ── Pills row ─────────────────────────────────────────────────── */
.cd-pills {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px; margin: 0 0 18px;
}
.cd-pill {
  display: inline-block;
  padding: 5px 12px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: #1e2d2f;
  background: transparent; border: 0;
  border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.cd-pill:hover { background: #faf7f2; }
.cd-pill.active {
  background: #e2dbd2;
  color: #1e2d2f;
  font-weight: 600;
}

/* + more filters — distinct (italic terra link, not a pill) */
.cd-more-btn {
  margin-inline-start: 20px;
  padding: 6px 4px;
  font-family: 'Lora', serif;
  font-size: 12.5px; font-weight: 500;
  font-style: italic;
  color: #c2754e;
  background: transparent; border: 0; cursor: pointer;
  white-space: nowrap;
  text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: rgba(194,117,78,0.35);
  transition: color .15s, text-decoration-color .15s;
}
.cd-more-btn:hover {
  color: #a86340;
  text-decoration-color: #a86340;
}

/* ── More filters (collapsible secondary rows) ─────────────────── */
.cd-more {
  display: flex; flex-direction: column;
  gap: 8px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  padding-top: 0;
  border-top: 1px solid rgba(20,18,14,0);
  transition:
    max-height .35s cubic-bezier(.4,0,.2,1),
    opacity .25s ease,
    padding-top .35s cubic-bezier(.4,0,.2,1),
    margin-bottom .35s cubic-bezier(.4,0,.2,1),
    border-top-color .25s ease;
}
.cd-more.open {
  max-height: 720px;
  opacity: 1;
  margin-bottom: 18px;
  padding-top: 12px;
  border-top-color: rgba(20,18,14,0.08);
}
.cd-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.cd-row-label {
  font-family: 'Lora', serif;
  font-size: 12.5px; font-weight: 500; font-style: italic;
  color: #57534e;
  margin-inline-end: 8px; min-width: 96px;
}
.cd-clear {
  align-self: flex-start; margin-top: 4px;
  padding: 0;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: #57534e;
  background: transparent; border: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.cd-clear:hover { color: #c2754e; }
@media (prefers-reduced-motion: reduce) {
  .cd-more, .cd-more.open { transition: none; }
}

/* ── Card grid ─────────────────────────────────────────────────── */
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-top: 8px;
  padding: 8px 4px;
  max-height: var(--cd-preview, 640px);
  overflow: hidden;
  transition: max-height .55s cubic-bezier(.4,0,.2,1);
}
@media (max-width: 900px) {
  .cd-grid { grid-template-columns: repeat(3, 1fr); --cd-preview: 866px; }
}
@media (max-width: 600px) {
  .cd-grid { grid-template-columns: repeat(2, 1fr); --cd-preview: 866px; }
}
@media (max-width: 380px) {
  .cd-grid { grid-template-columns: 1fr; --cd-preview: 866px; }
}
@media (prefers-reduced-motion: reduce) { .cd-grid { transition: none; } }

/* ── Card ──────────────────────────────────────────────────────── */
.cd-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 12px 16px;
  background: #fff;
  border: 1px solid rgba(20,18,14,0.06);
  border-radius: 16px; cursor: pointer;
  font-family: inherit; text-align: center;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cd-card:hover {
  border-color: #c2754e;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(20,18,14,0.08);
}
.cd-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; margin-bottom: 12px;
  border: 2px solid #f5f2ee;
  background: #dae2dd;
  /* Subtle CSS breath; desynced via nth-child */
  animation: cd-breath 4.4s ease-in-out infinite;
}
.cd-card:nth-child(3n)   .cd-avatar { animation-duration: 4.8s; animation-delay: -0.7s; }
.cd-card:nth-child(3n+1) .cd-avatar { animation-duration: 4.2s; animation-delay: -1.4s; }
.cd-card:nth-child(3n+2) .cd-avatar { animation-duration: 5.1s; animation-delay: -2.1s; }
@keyframes cd-breath { 0%,100% { transform: scale(1); } 50% { transform: scale(1.018); } }
@media (prefers-reduced-motion: reduce) { .cd-avatar { animation: none; } }

.cd-name {
  font-family: 'Lora', serif; font-size: 15px; font-weight: 600;
  color: #1e2d2f; line-height: 1.2;
}
.cd-role {
  font-size: 11px; color: #c2754e;
  margin-top: 2px; line-height: 1.3;
  text-align: center; letter-spacing: .04em;
  text-transform: uppercase; font-weight: 600;
}
.cd-tag {
  font-size: 12px; color: #57534e;
  margin-top: 6px; line-height: 1.3;
  text-align: center;
}

/* ── Show more / less ──────────────────────────────────────────── */
.cd-showmore-wrap {
  display: flex; justify-content: center; margin-top: 30px;
}
.cd-showmore {
  padding: 11px 26px; border: 1px solid #1e2d2f; background: transparent;
  color: #1e2d2f; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.cd-showmore:hover { background: #1e2d2f; color: #fff; }
.cd-showmore span { margin-inline-start: 4px; }
