/*--------------------------------------------------------------
# Teaching Staff Directory
#
# One flat, filterable directory: an "All" tab plus one tab per
# department that actually has a lecturer assigned to it (see
# .lecturer-tabs and LecturerPage.get_context in team/models.py), each
# showing a responsive grid of .lecturer-card. Same avatar+badge visual
# language as the Department
# Structure and Faculty Organogram cards (see
# static/css/department-structure.css, static/css/organogram.css), but a
# single accent throughout -- there's no role tier to color-code here,
# just one list of peers.
--------------------------------------------------------------*/
.lecturer-directory {
  --lect-accent: var(--accent-color, #0d6efd);
  --lect-accent-soft: color-mix(in srgb, var(--lect-accent), white 85%);
  --lect-heading: var(--heading-color, #1b1f27);
  --lect-text-muted: var(--default-color, #5a6472);
  --lect-surface: var(--surface-color, #ffffff);
}

/*--------------------------------------------------------------
# Stat strip -- quick "how many staff, how many departments" summary
# above the tabs.
--------------------------------------------------------------*/
.lecturer-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  color: var(--lect-text-muted);
  font-weight: 600;
}

.lecturer-stats strong {
  color: var(--lect-heading);
  font-weight: 700;
}

/*--------------------------------------------------------------
# Stat chips -- accent-tinted pill summary above the filter row.
--------------------------------------------------------------*/
.lect-stat-chip {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--lect-accent), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--lect-accent), transparent 72%);
  color: var(--lect-accent);
}

.lect-stat-chip strong {
  font-weight: 700;
}

.lect-stat-chip--purple {
  background: color-mix(in srgb, #6366f1, transparent 90%);
  border-color: color-mix(in srgb, #6366f1, transparent 72%);
  color: color-mix(in srgb, #6366f1, black 18%);
}

/*--------------------------------------------------------------
# Department tabs -- pill nav, one per department plus "All", each
# carrying its own count badge. Wraps on narrow screens rather than
# scrolling, since the count is usually small enough that wrapping to a
# second line reads better than a hidden horizontal scroller.
--------------------------------------------------------------*/
.lecturer-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.lecturer-tabs .nav-item {
  /* Flex items default to min-width: auto (their content's unwrapped
     width acts as a shrink floor), which silently defeats max-width and
     white-space: normal below -- overriding it is what actually lets a
     long department name's pill shrink and wrap instead of overflowing
     the viewport on narrow screens. */
  min-width: 0;
  max-width: 100%;
}

.lecturer-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  white-space: normal;
  color: var(--lect-heading);
  background: color-mix(in srgb, var(--lect-heading), transparent 95%);
  border: 1px solid color-mix(in srgb, var(--lect-heading), transparent 88%);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lecturer-tabs .nav-link:hover {
  border-color: color-mix(in srgb, var(--lect-accent), transparent 55%);
  color: var(--lect-accent);
}

.lecturer-tabs .nav-link.active {
  color: #fff;
  background: var(--lect-accent);
  border-color: var(--lect-accent);
}

.lecturer-tabs .nav-link .badge {
  font-weight: 700;
  color: inherit;
  background: color-mix(in srgb, currentColor, transparent 85%);
}

.lecturer-tabs .nav-link.active .badge {
  background: color-mix(in srgb, #fff, transparent 75%);
}

@media (prefers-reduced-motion: reduce) {
  .lecturer-tabs .nav-link {
    transition: none;
  }
}

/*--------------------------------------------------------------
# Card -- one identical shape for every lecturer.
--------------------------------------------------------------*/
.lecturer-card {
  --lect-card-radius: 1.25rem;
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lect-accent), var(--lect-surface) 95%) 0%, var(--lect-surface) 7rem);
  border: 1px solid color-mix(in srgb, var(--lect-accent), transparent 90%);
  border-radius: var(--lect-card-radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--lect-heading), transparent 93%), 0 10px 25px color-mix(in srgb, var(--lect-heading), transparent 95%);
}

/* Accent bar as its own layer (not `border-top`) so it can be a gradient
   without fighting `border-radius` rendering. */
.lecturer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--lect-accent), color-mix(in srgb, var(--lect-accent), var(--lect-heading) 35%));
}

.lecturer-card:hover,
.lecturer-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 1.25rem 2.5rem color-mix(in srgb, var(--lect-accent), transparent 85%);
  border-color: color-mix(in srgb, var(--lect-accent), transparent 60%);
}

@media (prefers-reduced-motion: reduce) {
  .lecturer-card {
    transition: none;
  }
  .lecturer-card:hover,
  .lecturer-card:focus-within {
    transform: none;
  }
}

/* Photo + role/name/department, side by side. */
.lecturer-card-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.lecturer-card-info {
  min-width: 0; /* let a long name ellipsis-wrap instead of forcing the card wider */
}

.lecturer-avatar-wrap {
  position: relative;
}

.lecturer-avatar {
  width: 4.25rem;
  height: 4.25rem;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--lect-accent-soft), 0 2px 6px color-mix(in srgb, var(--lect-heading), transparent 85%);
}

.lecturer-badge {
  position: absolute;
  right: -0.2rem;
  bottom: -0.2rem;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.7rem;
  color: #fff;
  background: var(--lect-accent);
  border: 2px solid var(--lect-surface);
}

.lecturer-role {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--lect-accent);
}

.lecturer-name {
  font-size: 1.05rem;
  color: var(--lect-heading);
}

.lecturer-meta {
  margin-top: 0.15rem;
}

.lecturer-contact {
  font-size: 0.82rem;
  color: var(--lect-text-muted);
  border-top: 1px solid color-mix(in srgb, var(--lect-accent), transparent 88%);
}

.lecturer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.lecturer-contact a:hover,
.lecturer-contact a:focus-visible {
  color: var(--lect-accent);
  text-decoration: underline;
}
