.teachers {
  padding-bottom: var(--section-spacing);
}

.teachers__text-block {
  min-width: 0;
}

.teachers__subtitle {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-primary);
  font-weight: 400;

  font-size: clamp(16px, calc(12.216px + 0.54054vw), 20px);
  line-height: 1.3;

  max-width: 48ch;
}

.teachers__card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  width: clamp(305px, calc(190.54px + 16.3514vw), 426px);

  height: clamp(505px, calc(304.46px + 28.6486vw), 717px);
}

.teachers__card-media {
  width: 100%;

  height: clamp(320px, calc(171.49px + 21.2162vw), 477px);
  margin-bottom: -40px;
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
  overflow: hidden;
  flex: none;
  position: relative;
  z-index: 0;
}
@media (max-width: 988px) {
  .teachers__card-media { border-radius: var(--radius-medium-mobile) var(--radius-medium-mobile) 0 0; }
}
.teachers__card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teachers__card-panel {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--color-cards-bg);
  border-radius: var(--radius-medium);
  position: relative;
  z-index: 1;
  box-sizing: border-box;

  padding-block: clamp(24px, calc(18.324px + 0.81081vw), 30px);
  padding-left: clamp(30px, calc(20.541px + 1.35135vw), 40px);
  padding-right: clamp(30px, calc(1.622px + 4.05405vw), 60px);
}
@media (max-width: 988px) {
  .teachers__card-panel { border-radius: var(--radius-medium-mobile); }
}

.teachers__card-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.teachers__card-name {
  margin: 0;
  color: #0f0f10;
  font-family: var(--font-family-accent);
  font-weight: 400;
  font-size: var(--font-size-name-teacher);
  line-height: 1.1;
  text-transform: lowercase;

  letter-spacing: clamp(-0.4px, calc(-0.0886px + -0.02162vw), -0.24px);
}

.teachers__card-bio {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--font-size-body-card-s);
  line-height: 1.3;
}

.teachers__card-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  /* Do not add max-width:100% — it re-imposes the label-wrapping bug. */
  align-self: flex-start;
  width: max-content;

  gap: clamp(5px, calc(1.216px + 0.54054vw), 9px);
}
/* No pills: the card hugs its text instead of keeping the frame's fixed
   height, so cards may differ in height here — her call. */
@media (max-width: 389.98px) {
  .teachers__card { height: auto; }
  .teachers__card-labels { display: none; }
}
