/*
 * lhl-component-selectors.css
 * Lawson Hatch, PLLC — Service Selector + Team Card Selector
 *
 * Consolidates and finalizes CSS from both experiment passes.
 * All selectors use .lhl- prefix to namespace against main theme.
 *
 * In production, --lhl-* tokens map to:
 *   --wp--preset--color--primary    → #214845  Forest Green
 *   --wp--preset--color--secondary  → #52BB31  Bright Green
 *   --wp--preset--color--accent     → #C4EA9E  Mint
 *   --wp--preset--color--surface    → #E5E8EF  Light Blue-Gray
 *   --wp--preset--font-family--heading → Frank Ruhl Libre
 *   --wp--preset--font-family--body    → DM Sans
 *
 * Enqueue:
 *   wp_enqueue_style(
 *     'lhl-component-selectors',
 *     get_template_directory_uri() . '/assets/css/lhl-component-selectors.css',
 *     array(), '1.0.0'
 *   );
 */

:root {
  /* Local aliases — update these if theme.json token names change */
  --lhl-primary:       #214845;
  --lhl-secondary:     #52BB31;
  --lhl-accent:        #C4EA9E;
  --lhl-surface:       #E5E8EF;
  --lhl-subtle:        #EFEFEF;   /* brand_dna.md: "Light gray #EFEFEF" */
  --lhl-white:         #FFFFFF;
  --lhl-near-black:    #1A1A1A;
  --lhl-body-text:     #5D5D5D;
  --lhl-muted:         #6B7280;

  --lhl-font-head:    'Frank Ruhl Libre', Georgia, serif;
  --lhl-font-body:    'DM Sans', system-ui, sans-serif;

  --lhl-radius:        4px;
  --lhl-radius-lg:     8px;
  --lhl-shadow-sm:     0 1px 4px rgba(33,72,69,.08);
  --lhl-shadow-md:     0 4px 20px rgba(33,72,69,.12);

  /*
   * Sticky selector bar top offset.
   * Set this to the actual rendered header height before merge.
   * 72px is the current header design target — tune if header renders shorter.
   */
  --lhl-header-height: 72px;
}


/* ══════════════════════════════════════════════════════════════════════
   1. SERVICE SELECTOR
   Markup: lhl-service-selector.php
   JS: lhl-service-selector.js
   ══════════════════════════════════════════════════════════════════════ */

/* Flush selector directly to the dark hero band — kills WP layout block-gap */
.lhl-service-selector {
  margin-block-start: 0 !important;
}

/* ── No-JS state: all panels visible, stacked ──────────────────────── */

.lhl-service-selector:not(.js-initialized) .lhl-service-panel {
  display: block;
}

/* ── JS-initialized state: only .is-active panel visible ────────────── */

.lhl-service-selector.js-initialized .lhl-service-panel {
  display: none;
}

.lhl-service-selector.js-initialized .lhl-service-panel.is-active {
  display: block;
}

/* ── Selector navigation bar ────────────────────────────────────────── */

.lhl-service-selector__nav {
  background-color: var(--lhl-primary);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;   /* centre tabs on desktop */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: var(--lhl-header-height);
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,.07), 0 2px 8px rgba(0,0,0,.16);
}

/* On narrow screens the five tabs overflow — revert to left-align so
   the start of the list is reachable via horizontal scroll. */
@media (max-width: 800px) {
  .lhl-service-selector__nav {
    justify-content: flex-start;
  }
}

.lhl-service-selector__nav::-webkit-scrollbar {
  display: none;
}

/* Tab buttons */
.lhl-service-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255,255,255,.62);
  cursor: pointer;
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .015em;
  padding: 1.125rem 1.5rem;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.lhl-service-tab:hover {
  color: var(--lhl-secondary);
  background-color: rgba(255,255,255,.05);
  border-bottom-color: transparent;
}

.lhl-service-tab[aria-selected="true"],
.lhl-service-tab.is-active {
  color: var(--lhl-white);
  border-bottom-color: var(--lhl-accent);
}

/* ── Panel layout ────────────────────────────────────────────────────── */

.lhl-service-panel {
  /* No animation — prefers-reduced-motion compliant by default */
}

.lhl-service-panel-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 860px) {
  .lhl-service-panel-inner {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.25rem 3.5rem;
    gap: 2rem;
  }
}

/* Panel heading */
.lhl-service-main h2 {
  font-family: var(--lhl-font-head);
  font-size: clamp(1.625rem, 3.5vw, 2.25rem);
  color: var(--lhl-primary);
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

/* Panel prose */
.lhl-service-main p {
  font-family: var(--lhl-font-body);
  font-size: 1rem;
  color: var(--lhl-near-black);
  line-height: 1.72;
  margin-bottom: 1rem;
  max-width: 62ch;
}

/* Prose placeholder (NOT RECOVERED content) */
.lhl-prose-placeholder {
  font-size: .9375rem;
  color: var(--lhl-muted);
  font-style: italic;
  border-left: 3px solid var(--lhl-surface);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

/* Card heading above bullets — per-tab variant text, not styled differently */
.lhl-bullet-card-heading {
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--lhl-primary);
  margin-bottom: .75rem;
  margin-top: 1.75rem;
}

/* Bullet list */
.lhl-service-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  background: var(--lhl-subtle);   /* brand_dna.md: #EFEFEF bg, not white */
  border-top: 3px solid var(--lhl-primary);   /* brand_dna.md: border-top, not left */
  border-radius: 0 0 var(--lhl-radius) var(--lhl-radius);
  padding: 1rem 1.25rem;
}

.lhl-service-bullets li {
  position: relative;
  padding: .55rem 0 .55rem 1.4rem;
  font-family: var(--lhl-font-body);
  font-size: .9375rem;
  color: var(--lhl-near-black);
  border-bottom: 1px solid rgba(33,72,69,.07);
}

.lhl-service-bullets li:last-child {
  border-bottom: none;
}

.lhl-service-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--lhl-secondary);
}

/* Panel CTA row */
.lhl-panel-cta {
  margin-top: 1.75rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Sidebar card ────────────────────────────────────────────────────── */

.lhl-service-sidebar {
  position: sticky;
  top: calc(var(--lhl-header-height) + 4rem);
}

.lhl-sidebar-card {
  background: var(--lhl-white);
  border: 1px solid rgba(33,72,69,.1);
  border-top: 3px solid var(--lhl-primary);  /* Quiet top accent — primary, not secondary */
  border-radius: var(--lhl-radius);
  padding: 1.625rem 1.5rem;
  box-shadow: var(--lhl-shadow-sm);
}

.lhl-sidebar-card h3 {
  font-family: var(--lhl-font-head);
  font-size: 1.0625rem;
  color: var(--lhl-primary);
  margin-bottom: .5rem;
}

.lhl-sidebar-card p {
  font-size: .875rem;
  color: var(--lhl-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.lhl-sidebar-phone {
  display: block;
  text-align: center;
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 600;
  color: var(--lhl-primary);
  text-decoration: none;
  margin-top: .75rem;
}

.lhl-sidebar-phone:hover {
  color: var(--lhl-secondary);
}

/* ── Shared button classes ─────────────────────────────────────────────
   These are used in both patterns. If the main theme already defines
   btn styles, remove these and use the theme classes instead.       */

.lhl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.4rem;
  background: var(--lhl-primary);
  color: var(--lhl-white);
  border-radius: var(--lhl-radius);
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}

.lhl-btn-primary:hover {
  opacity: .88;
  color: var(--lhl-white);
}

.lhl-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.4rem;
  background: transparent;
  color: var(--lhl-primary);
  border: 1.5px solid rgba(33,72,69,.4);
  border-radius: var(--lhl-radius);
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s;
}

.lhl-btn-ghost:hover {
  border-color: var(--lhl-primary);
  color: var(--lhl-primary);
}


/* ══════════════════════════════════════════════════════════════════════
   2. TEAM CARD SELECTOR
   Markup: lhl-team-card-row.php
   JS: lhl-bio-selector.js
   ══════════════════════════════════════════════════════════════════════ */

/* ── No-JS state: card row visible; bio panels visible and stacked ──── */

.lhl-team-selector:not(.js-initialized) .lhl-bio-panel {
  display: block;
  margin-bottom: 1.5rem;
  border-radius: var(--lhl-radius-lg);
  border: 1px solid rgba(33,72,69,.1);
  padding: 1.5rem;
}

/* ── JS-initialized state ────────────────────────────────────────────── */

.lhl-team-selector.js-initialized .lhl-bio-panel {
  display: none;
}

.lhl-team-selector.js-initialized .lhl-bio-panel.is-active {
  display: block;
}

/* ── Card row ────────────────────────────────────────────────────────── */

.lhl-team-card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .lhl-team-card-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Profile cards — <button> elements */
.lhl-team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--lhl-white);
  border: 2px solid transparent;
  border-radius: var(--lhl-radius-lg);
  padding: 1.75rem 1.25rem 1.5rem;
  cursor: pointer;
  box-shadow: var(--lhl-shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  width: 100%;
  font-family: inherit;
  position: relative;
}

.lhl-team-card:hover {
  border-color: rgba(33,72,69,.18);
  box-shadow: var(--lhl-shadow-md);
  transform: translateY(-2px);
}

.lhl-team-card[aria-pressed="true"],
.lhl-team-card.is-active {
  border-color: var(--lhl-secondary);
  box-shadow: 0 0 0 3px rgba(82,187,49,.14), var(--lhl-shadow-md);
  transform: translateY(-2px);
}

/* Active caret */
.lhl-team-card::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 0 solid transparent;
  transition: border-top .15s;
}

.lhl-team-card[aria-pressed="true"]::after,
.lhl-team-card.is-active::after {
  border-top: 10px solid var(--lhl-secondary);
  bottom: -12px;
}

/* Photo */
.lhl-team-card__photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: .875rem;
  background: var(--lhl-surface);
  flex-shrink: 0;
}

.lhl-team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center !important;
}

.lhl-team-card__name {
  font-family: var(--lhl-font-head);
  font-size: 1rem;
  color: var(--lhl-primary);
  margin-bottom: .2rem;
  line-height: 1.25;
}

.lhl-team-card__role {
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lhl-secondary);
  margin-bottom: .625rem;
}

.lhl-team-card__cue {
  font-size: .8125rem;
  color: var(--lhl-muted);
}

/* Hide cue when card is active */
.lhl-team-card[aria-pressed="true"] .lhl-team-card__cue,
.lhl-team-card.is-active .lhl-team-card__cue {
  visibility: hidden;
}

/* ── Bio panel ────────────────────────────────────────────────────────── */

.lhl-bio-panel {
  background: var(--lhl-white);
  border: 1px solid rgba(33,72,69,.1);
  border-top: 4px solid var(--lhl-secondary);
  border-radius: var(--lhl-radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--lhl-shadow-md);
}

.lhl-bio-panel__inner {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 540px) {
  .lhl-bio-panel__inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.lhl-bio-panel__photo {
  width: 110px;
  height: 128px;
  border-radius: var(--lhl-radius);
  overflow: hidden;
  background: var(--lhl-surface);
  flex-shrink: 0;
}

.lhl-bio-panel__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center !important;
}

.lhl-bio-panel__name {
  font-family: var(--lhl-font-head);
  font-size: 1.375rem;
  color: var(--lhl-primary);
  margin-bottom: .2rem;
}

.lhl-bio-panel__role {
  font-family: var(--lhl-font-body);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lhl-secondary);
  margin-bottom: .875rem;
}

.lhl-bio-panel__excerpt {
  font-family: var(--lhl-font-body);
  font-size: .9375rem;
  color: var(--lhl-near-black);
  line-height: 1.72;
  margin-bottom: 1.125rem;
}

.lhl-bio-panel__cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

.lhl-email-placeholder {
  font-size: .875rem;
  font-style: italic;
  color: var(--lhl-muted);
  padding: .45rem .75rem;
  border: 1px dashed rgba(33,72,69,.25);
  border-radius: var(--lhl-radius);
}
