/* Staff Directory */

.eha-table-wrap{ overflow-x:auto; }

.eha-table{
  width: 100%;
  border-collapse: collapse;
  background: var(--eha-surface);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: var(--eha-radius);
  overflow: hidden;
  min-width: 720px;
}

.eha-table th,
.eha-table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,.10);
  text-align: left;
  color: var(--eha-text);
  vertical-align: top;
}

.eha-table th{
  background: rgba(0,0,0,.03);
  font-weight: 800;
}

.eha-table tbody tr:nth-child(even){
  background: rgba(0,0,0,.015);
}

/* Links follow Astra global color and subtle motion */
.eha-link{
  color: var(--eha-primary);
  text-decoration: none;
  transition: opacity var(--eha-trans), transform var(--eha-trans);
}

.eha-link:hover{
  opacity: .9;
  transform: translateY(-1px);
}

.eha-link:focus-visible{
  outline: 2px solid rgba(0,0,0,.35);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Cards option */
.eha-staff__cards{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 768px){
  .eha-staff__cards{ grid-template-columns: 1fr; }
}

.eha-staff__card{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: var(--eha-radius);
  background: rgba(0,0,0,.02);
  padding: 14px;
}

.eha-card__title{
  font-weight: 900;
  margin-bottom: 6px;
}

.eha-card__meta{
  opacity: .92;
  font-size: 14px;
  margin-top: 4px;
}

/* =========================================================
   Staff Directory — Responsive Table Improvements
   ========================================================= */

/* 1) Better horizontal scrolling experience (tablets + small screens) */
.eha-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  border-radius: var(--eha-radius);
}

/* Keep your existing min-width, but make it behave nicely */
.eha-table{
  width: 100%;
  border-collapse: collapse;
  background: var(--eha-surface);
  border: 1px solid var(--eha-border);
  border-radius: var(--eha-radius);
  overflow: hidden;
  min-width: 720px; /* keeps columns readable on larger screens */
}

/* 2) Mobile-first stacked rows (best readability on phones)
      - turns each row into a "card"
      - shows column headers as labels via data-label
*/
@media (max-width: 640px){

  /* Let the table shrink naturally on phones (no forced 720px) */
  .eha-table{
    min-width: 0;
    border: 0;
    background: transparent;
  }

  /* Hide the table header row (we'll show labels per cell) */
  .eha-table thead{
    display: none;
  }

  /* Each row becomes a card */
  .eha-table tbody tr{
    display: block;
    border: 1px solid var(--eha-border);
    border-radius: var(--eha-radius);
    background: var(--eha-surface);
    margin: 0 0 12px 0;
    overflow: hidden;
  }

  /* Cells become label/value rows */
  .eha-table tbody td{
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--eha-border);
    text-align: left;
  }

  .eha-table tbody td:last-child{
    border-bottom: 0;
  }

  /* The label (column name) */
  .eha-table tbody td::before{
    content: attr(data-label);
    font-weight: 800;
    opacity: .85;
    flex: 0 0 42%;
    max-width: 42%;
  }

  /* The value */
  .eha-table tbody td > *{
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Make long emails wrap nicely instead of breaking layout */
  .eha-table td a{
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Remove zebra striping in card mode */
  .eha-table tbody tr:nth-child(even){
    background: var(--eha-surface);
  }
}

/* 3) Slightly tighter spacing on mid-size devices */
@media (max-width: 900px){
  .eha-table th,
  .eha-table td{
    padding: 10px 10px;
  }
}

