.teach-title {
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
  margin: 0 0 0.75rem;
}

.teach-title-spaced { margin-top: 2rem; }

.teach-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ─── Philosophy summary / full toggle ─────────────── */
.phil-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border-card);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.phil-toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.phil-toggle-btn + .phil-toggle-btn {
  border-left: 1px solid var(--color-border-card);
}

.phil-toggle-btn:hover { color: var(--color-text-emphasized); }

.phil-toggle-btn[aria-pressed="true"] {
  background: var(--color-background-card);
  color: var(--color-primary);
}

.phil-toggle-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.teach-philosophy {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
  text-align: justify;
}

.teach-philosophy p {
  margin: 0 0 1rem;
  text-wrap: pretty; /* avoid a lone word on the last line */
}
.teach-philosophy p:last-child { margin-bottom: 0; }

@media screen and (max-width: 600px) {
  .teach-philosophy { text-align: left; }
}

/* ─── Course timeline ───────────────────────────────── */
.teach-timeline {
  list-style: none;
  padding: 0 0 0 1.6rem;
  margin: 0;
}

.teach-tl-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.teach-tl-item:last-child { padding-bottom: 0; }

/* rail segment from this node down to the next one */
.teach-tl-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(-1.6rem + 0.3rem);
  top: 0.8rem;
  bottom: -0.35rem;
  width: 1px;
  background: var(--color-border-hover);
}

/* node */
.teach-tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem + 0.3rem - 4px);
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-background);
}

.teach-tl-term {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-primary);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.teach-course {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text-emphasized);
}

.teach-place {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

.teach-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--color-background-card);
}

.teach-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── Sample class plan ─────────────────────────────── */
.teach-plan-intro {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0 0 0.75rem;
}

.teach-plan {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--color-border-card);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.teach-plan-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 1fr;
  padding: 0;
  line-height: 1.45;
  border-top: 1px solid var(--color-border);
}

.teach-plan-row:first-child { border-top: 0; }

.teach-plan-head {
  background: var(--color-background-card);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.teach-plan-head > span { padding: 0.4rem 0.75rem; }

.teach-plan-time {
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-primary);
  white-space: nowrap;
}

.teach-plan-cell { padding: 0.6rem 0.75rem; }

.teach-plan-activity { background: var(--color-background-card); }

.teach-plan-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-emphasized);
}

.teach-plan-desc {
  font-size: 0.84rem;
  color: var(--color-text);
}

@media screen and (max-width: 600px) {
  .teach-plan-head { display: none; }
  .teach-plan-row { grid-template-columns: 1fr; }
  .teach-plan-time { padding-bottom: 0; }
  .teach-plan-time + .teach-plan-cell { padding-top: 0.1rem; }
  .teach-plan-activity::before {
    content: "Activity";
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
  }
}



/* ─── Syllabus design (matches sample class plan) ───── */
.syllabus-table,
.engage-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--color-border-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  line-height: 1.45;
}

.syllabus-table th,
.syllabus-table td,
.engage-table th,
.engage-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--color-border);
}

.syllabus-table thead th,
.engage-table thead th {
  border-top: 0;
  padding: 0.4rem 0.75rem;
  background: var(--color-background-card);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.syllabus-table thead th:first-child { width: 4.5rem; }

.syllabus-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-primary);
  white-space: nowrap;
}

.syllabus-table tbody th {
  width: 38%;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-emphasized);
}

.syllabus-table tbody td:last-child {
  font-size: 0.84rem;
  color: var(--color-text);
  background: var(--color-background-card);
}

@media screen and (max-width: 600px) {
  .syllabus-table thead { display: none; }
  .syllabus-table tr,
  .syllabus-table td,
  .syllabus-table tbody th { display: block; width: auto; }
  .syllabus-table tbody tr:first-child td:first-child { border-top: 0; }
  .syllabus-table tbody th { border-top: 0; padding-top: 0.1rem; }
  .syllabus-table tbody td.syllabus-num { padding-bottom: 0; }
}

/* ─── Student engagement cases ──────────────────────── */
.engage-table td {
  font-size: 0.84rem;
  color: var(--color-text);
}

.engage-table thead th:nth-child(1) { width: 18%; }
.engage-table thead th:nth-child(2) { width: 22%; }
.engage-table thead th:nth-child(3) { width: 27%; }

.engage-table tbody th {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-emphasized);
}

.engage-num {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--color-primary);
}

/* action column shaded like the class plan's activity column */
.engage-table tbody td:last-child {
  background: var(--color-background-card);
}

@media screen and (max-width: 600px) {
  .engage-table thead { display: none; }
  .engage-table tr,
  .engage-table tbody th,
  .engage-table td { display: block; width: auto; }
  .engage-table tbody tr:first-child th { border-top: 0; }
  .engage-table td { border-top: 0; padding-top: 0.2rem; }
  .engage-table td:last-child { padding-top: 0.6rem; border-top: 1px solid var(--color-border); }
  .engage-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
  }
}
