.team-directory {
  font-family: var(--font-family-site);
  background: var(--color-bg);
}

.team-directory__controls {
  position: relative;
  z-index: 2;
  padding: clamp(52px, 6vw, 88px) 0 clamp(58px, 6.5vw, 96px);
  background: var(--color-bg);
}

.team-search {
  width: 100%;
  margin: 0;
}

.team-search__field {
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

.team-search__field .search-input {
  width: 100%;
  height: 64px;
  margin: 0;
  padding: 0 64px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-family-site);
  font-size: var(--font-size-subtitle);
  font-weight: 500;
  line-height: 64px;
  appearance: none;
}

.team-search__field .search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.team-search__field .search-input::placeholder {
  color: var(--color-text-subtle);
  opacity: 1;
}

.team-search__field .search-button {
  position: absolute;
  top: 50%;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-secondary);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 180ms ease, background-color 180ms ease;
}

.team-search__field .search-button i {
  font-size: 25px;
  line-height: 1;
}

.team-search__field .search-button:hover {
  background: var(--color-surface-hover);
  color: var(--color-primary);
}

.team-search__field:focus-within {
  border-bottom-color: var(--color-secondary);
}

.team-search__field .search-input:focus,
.team-search__field .search-input:focus-visible {
  border: 0;
  outline: 0 !important;
  box-shadow: none;
}

.team-search__field .search-button:focus-visible,
.lawyer-card__link:focus-visible,
.team-state__retry:focus-visible {
  outline: 3px solid var(--color-focus) !important;
  outline-offset: 3px;
}

.team-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  margin-top: clamp(34px, 4vw, 48px);
}

.team-filter {
  position: relative;
}

.team-filter--open {
  z-index: 10;
}

.team-filter::after {
  position: absolute;
  top: 50%;
  right: 24px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  content: '';
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.team-filter .filter-select {
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 58px 0 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-family: var(--font-family-site);
  font-size: var(--font-size-ui);
  line-height: 56px;
  cursor: pointer;
  appearance: none;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.team-filter .filter-select:hover,
.team-filter .filter-select:focus {
  border-color: var(--color-border-strong);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  outline: 0 !important;
  box-shadow: none;
}

.team-filter .filter-select:focus-visible {
  border-color: var(--color-secondary);
}

.team-filter .filter-select:disabled {
  cursor: wait;
  opacity: 0.62;
}

.team-filter__trigger,
.team-filter__menu {
  display: none;
}

.team-filter--enhanced .filter-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.team-filter--enhanced .team-filter__trigger {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 58px 0 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-family: var(--font-family-site);
  font-size: var(--font-size-ui);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.team-filter--enhanced .team-filter__trigger:hover,
.team-filter--enhanced .team-filter__trigger:focus,
.team-filter--open .team-filter__trigger {
  border-color: var(--color-border-strong);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  outline: 0;
  box-shadow: none;
}

.team-filter--enhanced .team-filter__trigger:focus-visible,
.team-filter--open .team-filter__trigger {
  border-color: var(--color-secondary);
}

.team-filter--enhanced .team-filter__trigger:disabled {
  cursor: wait;
  opacity: 0.62;
}

.team-filter--enhanced .team-filter__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: block;
  box-sizing: border-box;
  max-height: 360px;
  margin: 0;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-elevated);
  box-shadow: 0 18px 40px var(--color-shadow);
}

.team-filter--enhanced .team-filter__menu[hidden] {
  display: none;
}

.team-filter__option {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-family-site);
  font-size: var(--font-size-ui);
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.team-filter__option:hover,
.team-filter__option:focus,
.team-filter__option[aria-selected='true'] {
  background: var(--color-surface-hover);
  color: var(--color-secondary);
  outline: 0;
}

.team-filter__option:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-focus);
}

.team-filter--open::after {
  transform: translateY(-25%) rotate(225deg);
}

.team-directory__results {
  min-height: 420px;
  padding: clamp(54px, 6vw, 84px) 0 clamp(76px, 8vw, 118px);
  background: var(--color-bg-muted);
}

.team-result-status {
  min-height: 24px;
  margin: 0 0 clamp(26px, 3vw, 40px);
  color: var(--color-text-subtle);
  font-size: var(--font-size-small);
  line-height: 24px;
}

.lawyer-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(52px, 5vw, 72px) clamp(24px, 3vw, 40px);
}

.lawyer-card {
  display: flex;
  min-width: 0;
  margin: 0;
}

.lawyer-card__link {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
  text-decoration: none;
  transition: color 220ms ease, transform 220ms ease;
}

.lawyer-card__media {
  position: relative;
  flex: 0 0 auto;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  overflow: visible;
  background: transparent;
}

.lawyer-card__media::before {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 76%;
  height: 78%;
  background: linear-gradient(135deg,
      rgba(var(--brand-aubergine-rgb), 0.16),
      rgba(var(--brand-blue-rgb), 0.09) 58%,
      rgba(var(--brand-cyan-rgb), 0.03));
  content: '';
  pointer-events: none;
  transition: width 300ms ease, height 300ms ease, opacity 300ms ease;
}

.lawyer-card__media::after {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 14px;
  width: 34%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
  content: '';
  pointer-events: none;
  transition: width 300ms ease;
}

.lawyer-card__media img {
  position: absolute;
  z-index: 1;
  display: block;
  top: 14px;
  right: 20px;
  bottom: 0;
  left: 14px;
  width: calc(100% - 34px);
  height: calc(100% - 14px);
  margin: 0;
  object-fit: cover;
  object-position: top center;
  clip-path: none;
  box-shadow: 0 12px 30px rgba(var(--brand-aubergine-rgb), 0.09);
  transform-origin: center top;
  transition: transform 420ms ease;
}

.lawyer-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
  min-height: 100px;
  padding: 18px 14px 0;
  text-align: left;
}

.lawyer-card__name {
  position: relative;
  width: 100%;
  margin: 0 0 12px;
  padding: 0 0 10px;
  color: var(--color-primary);
  font-size: var(--font-size-heading-3);
  font-weight: 600;
  line-height: 1.22;
  transition: color 180ms ease;
}

.lawyer-card__name::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
  content: '';
  transform-origin: left center;
  transition: transform 260ms ease;
}

.lawyer-card__meta {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding-left: 13px;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: 1.6;
}

.lawyer-card__meta::before {
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 6px;
  height: 7px;
  background: var(--color-secondary);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: '';
}

.lawyer-card__duties {
  color: var(--color-text);
  font-weight: 500;
}

.lawyer-card__link:hover,
.lawyer-card__link:focus-visible {
  color: var(--color-secondary);
  transform: translateY(-3px);
}

.lawyer-card__link:hover .lawyer-card__name,
.lawyer-card__link:focus-visible .lawyer-card__name {
  color: var(--color-secondary);
}

.lawyer-card__link:hover .lawyer-card__media img,
.lawyer-card__link:focus-visible .lawyer-card__media img {
  transform: scale(1.018);
}

.lawyer-card__link:hover .lawyer-card__media::before,
.lawyer-card__link:focus-visible .lawyer-card__media::before {
  width: 82%;
  height: 84%;
  opacity: 0.9;
}

.lawyer-card__link:hover .lawyer-card__media::after,
.lawyer-card__link:focus-visible .lawyer-card__media::after {
  width: 46%;
}

.lawyer-card__link:hover .lawyer-card__name::after,
.lawyer-card__link:focus-visible .lawyer-card__name::after {
  transform: scaleX(0.72);
}

.team-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 20px;
  color: var(--color-text-muted);
  text-align: center;
}

.team-state p {
  margin: 0;
  color: inherit;
}

.team-state__retry {
  margin-top: 18px;
  padding: 10px 22px;
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  background: transparent;
  color: var(--color-primary);
  font-family: var(--font-family-site);
  font-size: var(--font-size-ui);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.team-state__retry:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

@media (max-width: 1199px) {
  .lawyer-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .team-directory__controls {
    padding-right: 4px;
    padding-left: 4px;
  }

  .lawyer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(18px, 4vw, 32px);
  }
}

@media (max-width: 575px) {
  .team-directory__controls {
    padding: 42px 0 52px;
  }

  .team-search__field .search-input {
    height: 58px;
    padding-right: 56px;
    line-height: 58px;
  }

  .team-search__field .search-button {
    width: 46px;
    height: 46px;
  }

  .team-search__field .search-button i {
    font-size: 22px;
  }

  .team-filters {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
  }

  .team-filter .filter-select {
    height: 52px;
    line-height: 52px;
  }

  .team-filter--enhanced .team-filter__trigger {
    height: 52px;
  }

  .team-filter--enhanced .team-filter__menu {
    max-height: 320px;
  }

  .team-directory__results {
    min-height: 360px;
    padding: 48px 0 72px;
  }

  .team-result-status {
    margin-bottom: 24px;
  }

  .lawyer-list {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .lawyer-card {
    width: 100%;
    max-width: 360px;
    justify-self: center;
  }

  .lawyer-card__body {
    min-height: 96px;
    padding: 17px 14px 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  .team-search__field .search-button,
  .team-filter .filter-select,
  .team-filter__trigger,
  .team-filter__option,
  .lawyer-card__link,
  .lawyer-card__media::before,
  .lawyer-card__media::after,
  .lawyer-card__media img,
  .lawyer-card__name,
  .lawyer-card__name::after,
  .team-state__retry {
    transition: none;
  }

  .lawyer-card__link:hover,
  .lawyer-card__link:focus-visible,
  .lawyer-card__link:hover .lawyer-card__media img,
  .lawyer-card__link:focus-visible .lawyer-card__media img,
  .lawyer-card__link:hover .lawyer-card__name::after,
  .lawyer-card__link:focus-visible .lawyer-card__name::after {
    transform: none;
  }
}
