/* ==========================================================================
   ExploMentor — teachers directory
   ========================================================================== */

.dir-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.6rem, 6vw, 4.4rem) clamp(2rem, 4vw, 3rem);
  background: var(--ink);
  color: var(--cream);
}

.dir-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  width: 90vw;
  height: 90vw;
  max-width: 900px;
  max-height: 900px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 76, 241, 0.5), transparent 60%);
  pointer-events: none;
}

.dir-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 56rem;
}

.dir-hero h1 {
  margin: 0.2rem 0 0.5rem;
  text-wrap: balance;
}

.dir-hero p {
  max-width: 44rem;
  color: rgba(250, 247, 242, 0.68);
}

/* search + filters */

.dir-tools {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 640px;
}

.search-field svg {
  position: absolute;
  left: 1.15rem;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted-light);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

#teacher-search {
  width: 100%;
  padding: 1.05rem 3.2rem 1.05rem 3rem;
  border: 1px solid rgba(250, 247, 242, 0.18);
  border-radius: var(--r-pill);
  background: rgba(250, 247, 242, 0.06);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#teacher-search::placeholder {
  color: rgba(250, 247, 242, 0.45);
}

#teacher-search:focus {
  outline: none;
  border-color: var(--lime);
  background: rgba(250, 247, 242, 0.1);
  box-shadow: 0 0 0 4px rgba(200, 250, 90, 0.15);
}

.search-clear {
  position: absolute;
  right: 0.7rem;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 247, 242, 0.12);
  color: var(--cream);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s var(--ease);
}

.search-clear:hover {
  background: rgba(250, 247, 242, 0.24);
}

.search-field.has-value .search-clear {
  display: grid;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  padding: 0.5rem 1.05rem;
  border: 1px solid rgba(250, 247, 242, 0.2);
  border-radius: var(--r-pill);
  background: transparent;
  color: rgba(250, 247, 242, 0.8);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.chip:hover {
  border-color: rgba(250, 247, 242, 0.5);
  color: var(--cream);
  transform: translateY(-2px);
}

.chip[aria-pressed="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

/* results bar */

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.4rem;
  padding-block: 1.6rem 0.4rem;
}

.result-count {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-count b {
  color: var(--ink);
}

.view-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted-light);
}

/* directory grid */

.dir-section {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.teacher-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1.15rem;
  padding-top: 1rem;
}

.teacher-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
    border-color 0.45s var(--ease);
}

.teacher-card:hover,
.teacher-card:focus-visible {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.teacher-card:target {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

.teacher-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.teacher-card__photo {
  position: relative;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--cream-2);
  box-shadow: var(--shadow-xs);
}

.teacher-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.teacher-card:hover .teacher-card__photo img {
  transform: scale(1.09);
}

.teacher-card__subject {
  padding: 0.24rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--violet-soft);
  color: var(--violet);
  font-family: var(--font-sans);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.teacher-card h3 {
  margin-bottom: 0.15rem;
  font-size: 1.28rem;
  color: var(--ink);
}

.teacher-card .role {
  margin: 0 0 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--violet);
}

.teacher-card .about {
  margin: 0 0 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.teacher-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.teacher-card .read {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.teacher-card__arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--ink);
  font-size: 0.9rem;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.teacher-card:hover .teacher-card__arrow {
  background: var(--ink);
  color: var(--lime);
  transform: rotate(-45deg);
}

.teacher-card[hidden] {
  display: none !important;
}

/* empty state */

.empty-state {
  display: none;
  padding: clamp(2.4rem, 5vw, 3.6rem) 1.2rem;
  border: 1px dashed var(--violet-line);
  border-radius: var(--r-lg);
  background: var(--white);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.empty-state p {
  margin-bottom: 1.2rem;
  color: var(--muted);
}

/* footnote */

.dir-footnote {
  margin: 2rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .teacher-list {
    grid-template-columns: 1fr;
  }

  #teacher-search {
    font-size: 0.95rem;
  }
}
