* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-sans);
  margin: 0;
  color: #222;
  background: var(--color-neutral);
}
.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--color-primary);
  color: white;
}
.site-header__logo { color: white; font-weight: bold; text-decoration: none; font-size: 1.2rem; }
.site-header__nav a, .site-footer__nav a { color: white; margin-left: 1rem; text-decoration: none; }
main { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.breadcrumb ol { list-style: none; display: flex; gap: 0.5rem; padding: 0; font-size: 0.9rem; color: #666; }
.breadcrumb li::after { content: '/'; margin-left: 0.5rem; }
.breadcrumb li:last-child::after { content: ''; }
.badge--verified {
  background: var(--color-secondary-dark);
  color: var(--color-primary-dark);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}
.therapist-card {
  position: relative; /* anchors .therapist-card__stretched-link's inset:0 */
  display: inline-flex;
  flex-direction: column;
  width: 160px;
  margin: 0.5rem;
  color: inherit;
}
/* Empty, fills the card, z-index below .phone-reveal so that link stays
   independently clickable — see therapistCardHtml()'s comment. */
.therapist-card__stretched-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.therapist-card__photo { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: var(--color-secondary); }
.therapist-card__name { font-weight: 600; margin-top: 0.5rem; }
.therapist-card__location { font-size: 0.85rem; color: #666; }

/* Masked-phone + "View Phone" control — shared visual language between
   the listing card (a real <a>, always navigates+reveals on the profile
   page — see phoneRevealLinkHtml() in components.js) and the profile
   page itself (a real <button>, reveals in place via phone-reveal.js,
   never navigates). z-index:2 + position:relative matters specifically
   in the card context: it must sit above .therapist-card__stretched-link
   (z-index:1) or the stretched link would swallow every click here too. */
.phone-reveal {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.phone-reveal__masked, .phone-reveal__number {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.5px;
  color: #555;
}
.phone-reveal__number { color: var(--color-primary-dark); font-weight: 600; text-decoration: none; }
.phone-reveal__number:hover { text-decoration: underline; }
.phone-reveal__btn {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-secondary-dark);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
}
.phone-reveal__btn:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.phone-reveal__btn:disabled { opacity: 0.6; cursor: default; background: var(--color-secondary); color: var(--color-primary-dark); }
.phone-reveal__error { color: #a33; font-size: 0.8rem; }

/* Visible label/button, not just an implicit whole-card click target —
   see DEVELOPMENT.md's "View Profile button" note. Stays a <span>, not a
   real link/button of its own — .therapist-card__stretched-link (see
   above) already covers this whole area and is what actually navigates. */
.therapist-card__cta {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.35rem 0.8rem;
  background: var(--color-primary);
  color: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  align-self: flex-start;
}
.therapist-card:hover .therapist-card__cta { background: var(--color-primary-dark); }

/* Wraps ONLY the cards, not the surrounding <section> (which also
   contains an <h2>). Bug fixed here: the previous rule applied `display:
   flex` directly to .area-therapists/.service-therapists, which are the
   *sections* — putting their <h2> children on the same flex row as every
   card instead of above them. See DEVELOPMENT.md's county/area therapist
   listing note. */
.therapist-card-grid { display: flex; flex-wrap: wrap; }

/* Therapist profile page hero photo — previously a bare <img> with no
   CSS at all, sized only by its width/height attributes (300x375). Now
   matches .therapist-card__photo's treatment (square, cover-cropped,
   rounded) so the photo is visually consistent everywhere it appears on
   the public site, not just in listing cards. */
.therapist-profile__photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--color-secondary);
}

/* Related-content sections at the bottom of a therapist profile —
   other therapists in the same area, nearby areas, and this therapist's
   services elsewhere in the county (see renderTherapist.js's
   relatedContentHtml). Each is its own <section> so a page missing one
   or two of them (e.g. the only therapist in a single-area county) still
   gets consistent spacing around whichever ones it does render. */
.therapist-related {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-neutral-dark);
}
.therapist-related h2 { margin-bottom: 0.75rem; }
.therapist-related .therapist-card-grid { margin-bottom: 0.5rem; }

/* Services index (/services/) — image left, header + description right,
   per direct request. Each card is one <a>, laid out as a row via flex
   on the card itself (safe here, unlike the earlier .area-therapists bug,
   because a .service-card's only children are the image and the content
   block — no heading sits as a sibling to be misaligned). */
.service-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-neutral-dark);
}
.service-card:last-child { border-bottom: none; }
.service-card__image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--color-secondary);
  flex-shrink: 0;
}
.service-card__content { flex: 1; }
.service-card__name { margin: 0 0 0.5rem; font-size: 1.15rem; }
.service-card__description { margin: 0; color: #444; }
.service-card-list { display: flex; flex-direction: column; }

/* Individual service page hero — larger version of the same image (see
   components.js's serviceHeroImageHtml() comment: one static file,
   different display size via CSS in different contexts, no
   image-resizing infrastructure). */
.service-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.service-hero__image {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--color-secondary);
  flex-shrink: 0;
}
.service-hero__content { flex: 1; min-width: 240px; }

/* Homepage sections */
.home-hero { padding: 1rem 0 1.5rem; }
.home-hero p { max-width: 60ch; color: #444; }

.home-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  margin-bottom: 1rem;
  border-top: 1px solid var(--color-neutral-dark);
  border-bottom: 1px solid var(--color-neutral-dark);
}
.home-stat { display: flex; flex-direction: column; }
.home-stat strong { font-size: 1.6rem; color: var(--color-primary-dark); }
.home-stat span { font-size: 0.85rem; color: #666; }

.home-featured { margin: 2rem 0; }

.home-trust-list { padding-left: 1.2rem; color: #444; }
.home-trust-list li { margin-bottom: 0.4rem; }

.home-join-cta {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--color-secondary);
  border-radius: 10px;
  text-align: center;
}
.home-join-cta__button {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.7rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.home-join-cta__button:hover { background: var(--color-primary-dark); }

/* FAQ blocks — used by area pages, service pages, and now the homepage,
   all via the same faqHtml() component. Never had CSS at all until now;
   was rendering as unstyled browser-default <dl>/<dt>/<dd>. */
.area-faq dl, .service-faq dl, .home-faq dl, .county-faq dl { margin: 0; }
.area-faq dt, .service-faq dt, .home-faq dt, .county-faq dt {
  font-weight: 600;
  margin-top: 1.2rem;
}
.area-faq dt:first-child, .service-faq dt:first-child, .home-faq dt:first-child, .county-faq dt:first-child { margin-top: 0; }
.area-faq dd, .service-faq dd, .home-faq dd, .county-faq dd {
  margin: 0.3rem 0 0;
  color: #444;
}

/* Therapist bio — now rich-text HTML (paragraphs, bold/italic, lists),
   sanitized server-side, see worker/src/lib/richText.js and DEVELOPMENT.md's
   rich-text-editor section. Previously always exactly one plain-text <p>,
   so this section had no need for list/emphasis styling until now. */
/* Rich-text sections — bio, area neighborhood context, and service
   benefits/considerations all render sanitized HTML (paragraphs,
   bold/italic, lists) from the same rich-text editor feature (see
   worker/src/lib/richText.js and DEVELOPMENT.md's rich-text-editor
   section). One shared class instead of repeating these five rules per
   section — every rich-text container in components.js gets `rich-text`
   alongside its own section-specific class. */
.rich-text p { margin: 0 0 1rem; line-height: 1.6; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 0 0 1rem; padding-left: 1.4rem; line-height: 1.6; }
.rich-text li { margin: 0.2rem 0; }
.rich-text strong { font-weight: 700; }
.rich-text em { font-style: italic; }

/* Generic "jump to a section on this page" anchor link — currently just
   the county page's "View by Area/Estate" link (scrolls to #areas), but
   kept as its own reusable class rather than a one-off in case another
   page adds a similar in-page jump link later. Outlined rather than
   solid-filled, matching .link-chip's default (unselected) state — this
   is a secondary, supporting action, not the page's primary CTA. */
.jump-link {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.1rem;
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-secondary-dark);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.jump-link:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Shared "chip grid" for link lists that can range from 1 item to 75+ —
   county's areas, homepage's counties, an area's nearby-areas and
   services-offered lists (see components.js's linkChipGridHtml()). Wraps
   into as many rows/columns as the container width allows, rather than
   the single-column stacked list these all rendered as before (with zero
   CSS at all until now — see county-areas/area-services/nearby-areas'
   git history). flex-wrap over a fixed-column CSS grid on purpose: chip
   text length varies hugely (`CBD` vs `Mukuru Kwa Njenga`), so a rigid
   column count would either clip long names or waste space on short
   ones. */
.link-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-secondary-dark);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.link-chip:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.link-chip:hover .link-chip__count { color: white; }
.link-chip__count {
  font-size: 0.8rem;
  font-weight: 400;
  color: #888;
}

/* Therapist profile's "Services & Rates" list — distinct from
   .link-chip-grid on purpose: each row carries a duration alongside the
   link, which reads awkwardly packed into a pill button, so this stays a
   list but picks up real styling (was plain browser-default <ul> before,
   like the chip-grid lists were). */
.therapist-services-list { list-style: none; margin: 0; padding: 0; }
.therapist-services-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-neutral-dark);
}
.therapist-services-list li:last-child { border-bottom: none; }
.therapist-services-list a {
  color: var(--color-primary-dark);
  font-weight: 600;
  text-decoration: none;
}
.therapist-services-list a:hover { text-decoration: underline; }
.therapist-services-list__duration {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #888;
  background: var(--color-neutral-dark);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* Client reviews — therapist profile page. Star glyphs are plain text
   characters (★/☆), not an icon font/SVG sprite, kept deliberately simple
   since this is a directory listing, not a review platform in its own
   right. */
.rating-summary { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.rating-summary__stars { color: #d9a441; font-size: 1.1rem; letter-spacing: 0.05em; }
.rating-summary__text { color: #444; font-size: 0.9rem; }

.review-card-list { display: flex; flex-direction: column; gap: 1rem; }
.review-card {
  padding: 1rem;
  background: var(--color-secondary);
  border: 1px solid var(--color-secondary-dark);
  border-radius: 8px;
}
.review-card__header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.review-card__stars { color: #d9a441; letter-spacing: 0.05em; }
.review-card__name { font-weight: 600; font-size: 0.9rem; }
.review-card__body { margin: 0; color: #444; line-height: 1.5; }

/* Stats bar — reuses the homepage's .home-stats visual pattern (flex row,
   bold value over small label) for the same "key numbers" treatment on
   area and county pages, via one shared component (statsBarHtml() in
   components.js) instead of copy-pasting the homepage's markup. */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0 0;
  margin-top: 0.5rem;
}
.stats-bar__item { display: flex; flex-direction: column; }
.stats-bar__item strong { font-size: 1.4rem; color: var(--color-primary-dark); }
.stats-bar__item span { font-size: 0.8rem; color: #666; }

/* County page's longer "About {County}" section (counties.overview) —
   same rich-text treatment as bio/neighborhood_context, just its own
   section class for spacing. */
.county-overview { margin: 1.5rem 0; }

/* Region-grouped area links (groupedAreaLinksHtml()) — a labeled heading
   per region above its own .link-chip-grid, for counties with enough
   areas that one flat grid reads as a wall of links (Nairobi's 75). */
.county-areas__group { margin-bottom: 1.5rem; }
.county-areas__group:last-child { margin-bottom: 0; }
.county-areas__group h3 { font-size: 1rem; margin-bottom: 0.6rem; color: #444; }
