.modern-teachers .teacher-search-hero {
  --search-ink: #173650;
  container: teacher-search / inline-size;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid #dce9e5;
}

.teacher-search-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  direction: rtl;
}

.teacher-search-photo {
  position: relative;
  min-width: 0;
  margin: 0;
  aspect-ratio: 1.42;
  direction: ltr;
}

.modern-teachers .teacher-search-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% center;
  border-radius: 0;
  box-shadow: none;
}

.teacher-search-photo::after {
  position: absolute;
  inset: auto 0 0;
  height: 12%;
  background: linear-gradient(0deg, #fff, rgba(255,255,255,0));
  content: "";
  pointer-events: none;
}

.teacher-search-photo figcaption {
  position: absolute;
  z-index: 1;
  right: 1rem;
  bottom: .6rem;
  color: #526b78;
  font-size: .65rem;
}

.teacher-search-copy {
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 1.4rem max(1.25rem, env(safe-area-inset-left)) 2rem;
  direction: ltr;
  color: var(--search-ink);
}

.modern-teachers .teacher-search-copy h1 {
  margin: 0;
  color: var(--public-hero-ink);
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(1.875rem, 8.5cqi, 2.625rem);
  font-weight: 800;
  line-height: 1.23;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.teacher-search-line { display: block; }

.teacher-search-highlight {
  position: relative;
  z-index: 0;
  display: inline-block;
  white-space: nowrap;
  color: var(--public-hero-accent);
}

.teacher-search-highlight::after {
  position: absolute;
  z-index: -1;
  inset: auto -.04em .04em;
  height: .2em;
  border-radius: 999px;
  background: #c9f36b;
  content: "";
}

.teacher-search-copy .teacher-search-description {
  max-width: 31rem;
  margin: 1.25rem 0 0;
  color: #526b78;
  font-size: clamp(.9375rem, 1.35cqi, 1.125rem);
  line-height: 1.85;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.teacher-search-copy .teacher-search-online {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 1rem 0 0;
  color: var(--search-ink);
  font-size: clamp(1rem, 1.5cqi, 1.25rem);
  font-weight: 700;
  line-height: 1.5;
}

.teacher-search-online svg {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  fill: none;
  stroke: var(--lm-green, #0e9066);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modern-teachers .teacher-search-cta {
  max-width: 100%;
  min-height: 3.5rem;
  margin-top: 1.1rem;
  padding: .9rem 1.25rem;
  gap: .65rem;
  border: 0;
  border-radius: 999px;
  background: var(--lm-coral, #f0644f);
  color: #fff;
  font-size: clamp(1.1875rem, 1.35cqi, 1.25rem);
  font-weight: 800;
  text-align: center;
  transition: background-color .15s ease;
}

.modern-teachers .teacher-search-cta:hover { background: #db503c; }
.modern-teachers .teacher-search-cta:focus-visible {
  outline: 3px solid var(--search-ink);
  outline-offset: 4px;
}

@container teacher-search (min-width: 60rem) {
  .teacher-search-photo { aspect-ratio: auto; min-height: 36rem; }
  .teacher-search-photo::after {
    inset: 0 auto 0 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, #fff, rgba(255,255,255,0));
  }
  .teacher-search-photo figcaption { color: #173650; background: rgba(255,255,255,.8); padding: .1rem .35rem; }
  .teacher-search-copy {
    padding: 3rem 2.5rem;
    padding-left: max(2.5rem, calc((100cqi - 80rem) / 2));
  }
  .modern-teachers .teacher-search-copy h1 { font-size: clamp(2.5rem, 4.3cqi, 4.25rem); }
}

@media (prefers-reduced-motion: reduce) {
  .modern-teachers .teacher-search-cta { transition: none; }
}

@container teacher-search (max-width: 22rem) {
  .modern-teachers .teacher-search-cta { width: 100%; padding-inline: 1rem; white-space: nowrap; }
  .teacher-search-cta span { display: none; }
}
