.st-teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* --- Размеры карточек --- */

/* Маленький размер */
.st-teachers-grid.st-size-small {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
/* Используем aspect-ratio для всех размеров, убираем фиксированную высоту */
.st-teacher-photo {
    /* height: 300px; - Убрали фиксированную высоту */
    aspect-ratio: 3 / 4; /* Портретные пропорции */
    overflow: hidden;
    background: #f4f4f4;
    position: relative;
}

.st-teachers-grid.st-size-small .st-teacher-info {
    padding: 15px;
}
.st-teachers-grid.st-size-small h3 { /* Уменьшаем заголовок для маленьких */
    font-size: 1.1em;
}

/* Большой размер */
.st-teachers-grid.st-size-large {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}
.st-teachers-grid.st-size-large .st-teacher-info {
    padding: 25px;
}

/* Стили для выравнивания (обтекания текстом) */
.st-teachers-grid.st-align-right {
    float: right;
    width: 300px; /* Фиксированная ширина для боковой колонки */
    margin-left: 30px;
    margin-bottom: 30px;
    margin-top: 10px;
    grid-template-columns: 1fr; /* Одна колонка */
}

.st-teachers-grid.st-align-left {
    float: left;
    width: 300px;
    margin-right: 30px;
    margin-bottom: 30px;
    margin-top: 10px;
    grid-template-columns: 1fr;
}

.st-teachers-grid.st-align-center {
    float: none;
    width: 300px;
    margin: 30px auto; /* По центру */
    grid-template-columns: 1fr;
}

/* Адаптивность для мобильных: убираем обтекание */
@media (max-width: 768px) {
    .st-teachers-grid.st-align-right,
    .st-teachers-grid.st-align-left,
    .st-teachers-grid.st-align-center {
        float: none;
        width: 100%;
        margin: 30px 0;
    }
}

.st-teacher-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Times New Roman', Times, serif; /* Официальный шрифт с засечками */
}

.st-teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

/* Base style for teacher photo container */
/* Note: aspect-ratio is defined above if supported, otherwise falling back or relying on overrides */

.st-teacher-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Фокус на лице */
    transition: transform 0.5s ease;
}

.st-teacher-card:hover .st-teacher-photo img {
    transform: scale(1.05);
}

.st-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    background: #eee;
}

.st-teacher-info {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.st-teacher-info h3 {
    margin: 0 0 10px;
    font-size: 1.4em;
    color: #333;
    font-weight: bold;
    font-family: 'Georgia', serif; /* Красивый заголовочный шрифт */
}

.st-position {
    color: #0073aa;
    font-weight: 700; /* Вернул стандартную жирность (Bold) */
    margin-bottom: 5px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Arial', sans-serif; /* Для должности оставим строгий гротеск */
}

.st-subject {
    color: #333;
    font-style: normal;
    margin-bottom: 15px;
    font-size: 1.1em; /* Увеличил размер шрифта */
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    font-weight: 500; /* Сделал чуть жирнее для заметности */
}

.st-bio {
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}

.st-bio p {
    margin-bottom: 10px;
}

.st-bio p:last-child {
    margin-bottom: 0;
}
