/* Compact teaching rows and section spacing. */
.teaching-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.teaching-page {
    flex-grow: 1;
    padding-top: 34px;
    padding-bottom: 34px;
}

.teaching-page .team-section-title {
    margin-top: 22px;
    margin-bottom: 6px;
    padding-bottom: 7px;
    font-size: 24px;
}

.teaching-page .team-section-title:first-of-type {
    margin-top: 0;
}

.teaching-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--border-color);
}

.teaching-period {
    flex-shrink: 0;
    width: 100px;
    text-align: left;
    padding-left: 4px;
}

.teaching-period-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
    white-space: nowrap;
}

.teaching-details {
    flex: 1;
    min-width: 0;
}

.teaching-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.teaching-tags {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.teaching-page .tag {
    padding: 3px 10px;
    font-size: 13px;
}

.course-note {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-light);
    margin-left: 8px;
}

.teaching-agent-section {
    margin-top: 32px;
}

.teaching-agent-link {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 34px;
    padding: 12px 0 18px;
    border-bottom: 1px solid var(--border-color);
    color: inherit;
    text-decoration: none;
}

.teaching-agent-link:hover,
.teaching-agent-link:focus-visible {
    color: var(--primary-dark);
}

.teaching-agent-link:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

.teaching-agent-link > img {
    display: block;
    width: 100%;
    height: auto;
}

.teaching-agent-copy {
    min-width: 0;
    max-width: 550px;
}

.teaching-agent-kicker {
    color: var(--text-light);
    font-size: 14px;
    letter-spacing: .03em;
}

.teaching-agent-copy h3 {
    margin-top: 7px;
    color: var(--text-dark);
    font-size: 24px;
    line-height: 1.35;
}

.teaching-agent-copy p {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.75;
}

.teaching-agent-cta {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .teaching-page {
        padding: 24px 20px;
    }

    .teaching-row {
        gap: 12px;
    }

    .teaching-period {
        width: 90px;
    }
}

@media (max-width: 640px) {
    .teaching-agent-link {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .teaching-agent-copy h3 {
        font-size: 21px;
    }

    .teaching-page {
        padding: 20px 16px;
    }

    .teaching-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 3px 8px;
        padding: 14px 4px;
    }

    .teaching-period {
        grid-column: 1 / -1;
        width: auto;
        padding-left: 0;
    }

    .teaching-period-label {
        font-size: 13px;
    }

    .teaching-details {
        grid-column: 1 / -1;
        overflow-wrap: anywhere;
    }

    .teaching-details a {
        overflow-wrap: anywhere;
    }

    .teaching-tags {
        grid-column: 1 / -1;
        margin-top: 3px;
    }

    .teaching-page .tag {
        font-size: 11px;
        padding: 2px 8px;
    }

    .course-note {
        margin-left: 6px;
    }
}
