.people-directory {
  min-width: 0;
}

.people-search {
  margin-block: 2rem 2.5rem;
  padding: clamp(1.25rem, 2vw, 2rem);
  border: 1px solid var(--color-border, #cbd5df);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--color-surface-subtle, #f5f7fa);
}

.people-search__heading h2 {
  margin-block: 0 0.5rem;
}

.people-search__heading p {
  max-width: 72ch;
  margin-block: 0;
}

.people-search__form {
  display: grid;
  grid-template-columns: minmax(16rem, 1.5fr) minmax(14rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-block-start: 1.5rem;
}

.people-search__field {
  display: grid;
  gap: 0.45rem;
}

.people-search__field label {
  color: var(--color-text, #17243a);
  font-weight: 700;
}

.people-search__input-wrap {
  position: relative;
}

.people-search__input-wrap svg {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 0.9rem;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--color-text-muted, #576274);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.people-search input,
.people-search select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--color-border-strong, #8693a3);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--color-surface, #fff);
  color: var(--color-text, #17243a);
  font: inherit;
}

.people-search input {
  padding: 0.65rem 0.9rem 0.65rem 2.75rem;
}

.people-search select {
  padding: 0.65rem 2.5rem 0.65rem 0.9rem;
}

.people-search input:focus-visible,
.people-search select:focus-visible {
  outline: 3px solid var(--color-focus, #ff9e1b);
  outline-offset: 2px;
}

.people-search__clear {
  min-height: 3rem;
  white-space: nowrap;
}

.people-search__status {
  margin-block: 1.25rem 0;
  color: var(--color-text-muted, #576274);
  font-weight: 700;
}

.people-directory__results {
  display: grid;
  gap: 2rem;
}

.people-sector {
  min-width: 0;
  scroll-margin-top: 2rem;
}

.people-sector__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-block-end: 0.75rem;
  padding-block-end: 0.65rem;
  border-block-end: 3px solid var(--color-accent, #ff9e1b);
}

.people-sector__header h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.people-sector__email {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.people-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border, #cbd5df);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--color-surface, #fff);
}

.people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.people-table th,
.people-table td {
  padding: 0.8rem 0.9rem;
  border-block-end: 1px solid var(--color-border, #d8e0e8);
  text-align: start;
  vertical-align: top;
}

.people-table thead th {
  background: var(--color-primary, #052b5c);
  color: #fff;
  font-weight: 700;
}

.people-table tbody th {
  width: 24%;
  color: var(--color-text, #17243a);
  font-weight: 700;
}

.people-table tbody tr:nth-child(even) {
  background: var(--color-surface-subtle, #f5f7fa);
}

.people-table tbody tr:last-child > * {
  border-block-end: 0;
}

.people-table a {
  overflow-wrap: anywhere;
}

.people-no-results {
  padding: 2rem;
  border: 1px solid var(--color-border, #cbd5df);
  border-radius: var(--radius-lg, 0.75rem);
  text-align: center;
  background: var(--color-surface-subtle, #f5f7fa);
}

.people-no-results h2 {
  margin-block-start: 0;
}

.validation-note {
  margin-block-start: 2.5rem;
  padding: 1.25rem 1.5rem;
  border-inline-start: 0.35rem solid var(--color-accent, #ff9e1b);
  background: var(--color-surface-subtle, #f5f7fa);
}

.validation-note h2 {
  margin-block: 0 0.5rem;
  font-size: 1.25rem;
}

.validation-note p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 64rem) {
  .people-search__form {
    grid-template-columns: 1fr 1fr;
  }

  .people-search__clear {
    justify-self: start;
  }
}

@media (max-width: 44rem) {
  .people-search__form {
    grid-template-columns: 1fr;
  }

  .people-search__clear {
    width: 100%;
  }

  .people-table-wrapper {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .people-table,
  .people-table tbody,
  .people-table tr,
  .people-table th,
  .people-table td {
    display: block;
    width: 100%;
  }

  .people-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .people-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .people-table tbody tr,
  .people-table tbody tr:nth-child(even) {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border, #cbd5df);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-surface, #fff);
  }

  .people-table th,
  .people-table td {
    display: grid;
    grid-template-columns: minmax(5rem, 30%) 1fr;
    gap: 0.75rem;
    padding: 0.55rem 0;
  }

  .people-table th::before,
  .people-table td::before {
    content: attr(data-label);
    color: var(--color-text-muted, #576274);
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  .people-directory * {
    scroll-behavior: auto;
  }
}
