/* ============================================================
   Find Advocates — Services tab
   Tabs follow FF Tabs (one pill gliding between the options, the
   label reserving its semibold width). Cards and the detail dialog
   use the page's own tokens so both tabs read as one surface.
   ============================================================ */

/* ─── Tabs ─────────────────────────────────────────────── */

.fa2-tabs {
  position: relative;
  flex-shrink: 0;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 12px 20px 0;
  padding: 4px;
  border-radius: var(--fa2-radius-full);
  background: var(--ab-gray-100);
}

.fa2-tabs__pill {
  position: absolute;
  top: 4px;
  left: 0;
  width: 0;
  height: 36px;
  border-radius: var(--fa2-radius-full);
  background: var(--ab-white);
  box-shadow: var(--fa2-shadow-2);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    width 160ms cubic-bezier(0.23, 1, 0.32, 1),
    opacity 80ms ease;
}

.fa2-tabs__pill.is-visible {
  opacity: 1;
}

.fa2-tabs__pill.is-snapping {
  transition: opacity 80ms ease;
}

.fa2-tabs__tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--fa2-radius-full);
  background: transparent;
  color: var(--ab-gray-500);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition:
    background-color 80ms ease,
    color 80ms ease;
}

.fa2-tabs__tab:hover {
  color: var(--ab-navy);
}

.fa2-tabs__tab[aria-selected="false"]:hover {
  background: color-mix(in srgb, var(--ab-white) 40%, transparent);
}

.fa2-tabs__tab[aria-selected="true"] {
  color: var(--ab-navy);
}

.fa2-tabs__tab:focus-visible {
  outline: 2px solid #6b97ff;
  outline-offset: 2px;
}

/* The label reserves its semibold width so selecting never shifts it. */
.fa2-tabs__label {
  display: inline-flex;
  flex-direction: column;
}

.fa2-tabs__label::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 600;
  pointer-events: none;
}

.fa2-tabs__tab[aria-selected="true"] .fa2-tabs__label {
  font-weight: 600;
}

.fa2-tabs__new {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: var(--fa2-radius-full);
  background: color-mix(in srgb, var(--ab-yellow) 55%, var(--ab-white));
  color: var(--ab-navy);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* ─── Service cards ────────────────────────────────────── */
/* Two rows: the service itself (photo, name, summary, key facts), then a
   footer under a hairline with who offers it, the price and the action. */

.fa2-svc-list {
  container-type: inline-size;
}

.fa2-svc {
  --fa2-svc-cover-w: 120px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ab-gray-100);
  cursor: pointer;
  transition: background var(--fa2-duration) var(--fa2-ease);
}

.fa2-svc:hover,
.fa2-svc.is-active {
  background: var(--ab-gray-50);
}

.fa2-svc:has(.fa2-svc__link:focus-visible) {
  outline: 2px solid var(--ab-navy);
  outline-offset: -2px;
}

.fa2-svc__top {
  display: grid;
  grid-template-columns: var(--fa2-svc-cover-w) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.fa2-svc__cover {
  width: var(--fa2-svc-cover-w);
  border-radius: 12px;
}

.fa2-svc__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fa2-svc__name {
  margin: 0;
  color: var(--ab-navy);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.fa2-svc__link {
  color: inherit;
  text-decoration: none;
}

.fa2-svc__link:focus-visible {
  outline: none;
}

.fa2-svc__desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ab-gray-700);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.fa2-svc__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.fa2-svc__fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ab-gray-500);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.fa2-svc__fact-icon svg {
  display: block;
  width: 15px;
  height: 15px;
}

.fa2-svc__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--ab-gray-100);
}

.fa2-svc__who {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fa2-svc-avatar {
  --fa2-svc-avatar: 44px;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--fa2-svc-avatar);
  height: var(--fa2-svc-avatar);
  overflow: hidden;
  border-radius: 50%;
  background: var(--ab-gray-100);
  color: var(--ab-navy);
  font-size: 13px;
  font-weight: 600;
}

.fa2-svc-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
}

.fa2-svc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fa2-svc__who-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fa2-svc__adv,
.fa2-svc__biz {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fa2-svc__adv {
  color: var(--ab-navy);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.fa2-svc__biz {
  color: var(--ab-gray-500);
  font-size: 13px;
  line-height: 1.35;
}

.fa2-svc__buy {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
}

.fa2-svc__price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-height: 40px;
  text-align: right;
}

.fa2-svc-price {
  margin: 0;
  color: var(--ab-navy);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fa2-svc-price strong {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.fa2-svc-price__lead,
.fa2-svc-price__unit {
  color: var(--ab-gray-700);
}

.fa2-svc__paused {
  margin: 0;
  color: var(--ab-gray-500);
  font-size: 12px;
}

.fa2-svc__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--fa2-radius-full);
  background: var(--ab-yellow);
  color: var(--ab-navy);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--fa2-shadow-1);
  transition:
    background 0.15s var(--fa2-ease),
    box-shadow 0.15s var(--fa2-ease);
}

.fa2-svc__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s var(--fa2-ease);
}

.fa2-svc:hover .fa2-svc__cta {
  background: var(--ab-yellow-hover);
  box-shadow: var(--fa2-shadow-2);
}

.fa2-svc:hover .fa2-svc__cta svg {
  transform: translateX(2px);
}

.fa2-svc.is-paused .fa2-svc__cta {
  background: var(--ab-white);
  box-shadow: inset 0 0 0 1px var(--ab-gray-200);
}

@container (max-width: 520px) {
  .fa2-svc {
    --fa2-svc-cover-w: 88px;
    padding: 16px;
  }

  .fa2-svc__top {
    gap: 14px;
  }

  .fa2-svc__name {
    font-size: 16px;
  }

  .fa2-svc__desc {
    -webkit-line-clamp: 2;
  }

  .fa2-svc__buy {
    gap: 12px;
  }

  .fa2-svc-price strong {
    font-size: 17px;
  }

  /* The button keeps its 40px height and becomes a round arrow, so the
     advocate keeps the room for their name and business. */
  .fa2-svc__cta {
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  .fa2-svc__cta-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .fa2-svc__cta svg {
    width: 18px;
    height: 18px;
  }
}

/* ─── Detail dialog ────────────────────────────────────── */

.fa2-svc-dialog {
  width: min(600px, calc(100vw - 24px));
  max-width: none;
  max-height: min(88dvh, 860px);
  padding: 0;
  border: 0;
  border-radius: var(--fa2-radius-lg);
  background: var(--ab-white);
  color: var(--ab-navy);
  box-shadow: var(--fa2-shadow-4);
  overflow: hidden;
}

.fa2-svc-dialog[open] {
  display: flex;
  animation: fa2-svc-in 240ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

.fa2-svc-dialog::backdrop {
  background: rgb(42 31 40 / 0.4);
}

.fa2-svc-dialog__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: min(88dvh, 860px);
}

@keyframes fa2-svc-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

.fa2-svc-d__head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px 20px 16px 24px;
  border-bottom: 1px solid var(--ab-gray-100);
}

.fa2-svc-d__cover {
  width: 88px;
  border-radius: 12px;
}

.fa2-svc-d__titles {
  min-width: 0;
}

.fa2-svc-d__cat {
  margin: 0 0 2px;
  color: var(--ab-gray-500);
  font-size: 13px;
}

.fa2-svc-d__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.fa2-svc-d__price strong {
  font-size: 18px;
}

.fa2-svc-d__close {
  align-self: start;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ab-gray-700);
  cursor: pointer;
}

.fa2-svc-d__close:hover {
  background: var(--fa2-state-hover);
  color: var(--ab-navy);
}

.fa2-svc-d__close:focus-visible {
  outline: var(--fa2-focus);
  outline-offset: -2px;
}

.fa2-svc-d__close svg {
  width: 20px;
  height: 20px;
}

.fa2-svc-d__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 24px 24px;
}

.fa2-svc-d__paused {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  font-size: 14px;
  line-height: 1.45;
}

.fa2-svc-d__section {
  padding-top: 20px;
}

.fa2-svc-d__h {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.fa2-svc-d__p {
  margin: 0;
  color: var(--ab-gray-700);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
}

.fa2-svc-d__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fa2-svc-d__list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  color: var(--ab-gray-700);
  font-size: 15px;
  line-height: 1.45;
}

.fa2-svc-d__list svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--ab-navy);
}

.fa2-svc-d__dl {
  margin: 0;
}

.fa2-svc-d__dl > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--ab-gray-100);
  font-size: 15px;
  line-height: 1.45;
}

.fa2-svc-d__dl > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.fa2-svc-d__dl dt {
  color: var(--ab-gray-500);
}

.fa2-svc-d__dl dd {
  margin: 0;
  color: var(--ab-navy);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.fa2-svc-d__adv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  margin: 0 -12px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s var(--fa2-ease);
}

.fa2-svc-d__adv:hover {
  background: var(--ab-gray-50);
}

.fa2-svc-d__adv:focus-visible {
  outline: var(--fa2-focus);
  outline-offset: -2px;
}

.fa2-svc-d__adv-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fa2-svc-d__adv-name {
  font-size: 15px;
  font-weight: 600;
}

.fa2-svc-d__adv-meta {
  color: var(--ab-gray-500);
  font-size: 13px;
  line-height: 1.4;
}

.fa2-svc-d__adv-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ab-navy);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.fa2-svc-d__adv-go svg {
  width: 16px;
  height: 16px;
}

.fa2-svc-d__phone {
  margin: 8px 0 0;
  color: var(--ab-gray-500);
  font-size: 14px;
}

.fa2-svc-d__phone a {
  color: var(--ab-navy);
  font-variant-numeric: tabular-nums;
}

.fa2-svc-d__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--ab-gray-100);
  background: var(--ab-white);
}

.fa2-svc-d__foot-note {
  margin: 0;
  max-width: 280px;
  color: var(--ab-gray-500);
  font-size: 13px;
  line-height: 1.4;
}

.fa2-svc-d__actions {
  display: flex;
  flex: none;
  gap: 8px;
  margin-left: auto;
}

.fa2-svc-d__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--fa2-btn-h);
  padding: 0 22px;
  border-radius: var(--fa2-radius-full);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s var(--fa2-ease),
    box-shadow 0.15s var(--fa2-ease);
}

.fa2-svc-d__btn-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.fa2-svc-d__btn:focus-visible {
  outline: var(--fa2-focus);
  outline-offset: var(--fa2-focus-offset);
}

.fa2-svc-d__btn--primary {
  background: var(--ab-yellow);
  color: var(--ab-navy);
  box-shadow: var(--fa2-shadow-1);
}

.fa2-svc-d__btn--primary:hover {
  background: var(--ab-yellow-hover);
  box-shadow: var(--fa2-shadow-2);
}

.fa2-svc-d__btn--primary[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.fa2-svc-d__btn--secondary {
  background: var(--ab-white);
  color: var(--ab-navy);
  box-shadow: inset 0 0 0 1px var(--ab-gray-200);
}

.fa2-svc-d__btn--secondary:hover {
  background: var(--ab-gray-50);
  box-shadow: inset 0 0 0 1px var(--ab-navy);
}

@media (max-width: 767px) {
  .fa2-tabs {
    margin: 4px 16px 0;
  }

  .fa2-svc-dialog {
    width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--fa2-radius-lg) var(--fa2-radius-lg) 0 0;
  }

  .fa2-svc-dialog__inner {
    max-height: 92dvh;
  }

  .fa2-svc-dialog[open] {
    animation-name: fa2-svc-up;
  }

  .fa2-svc-d__head {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px 12px 12px 16px;
  }

  .fa2-svc-d__cover {
    width: 64px;
  }

  .fa2-svc-d__title {
    font-size: 19px;
  }

  .fa2-svc-d__body {
    padding: 0 16px 20px;
  }

  .fa2-svc-d__dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .fa2-svc-d__adv {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fa2-svc-d__adv-go {
    display: none;
  }

  .fa2-svc-d__foot {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .fa2-svc-d__foot-note {
    max-width: none;
  }

  /* One row: the two buttons split the width evenly. */
  .fa2-svc-d__actions {
    width: 100%;
    margin-left: 0;
  }

  .fa2-svc-d__btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 12px;
  }
}

@keyframes fa2-svc-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fa2-tabs__pill,
  .fa2-svc,
  .fa2-svc__cta,
  .fa2-svc__cta svg {
    transition: none;
  }

  .fa2-svc-dialog[open] {
    animation: none;
  }
}
