/* EDU-021C: compact, cached public teacher media and RTL cards. */
.teacher-premium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 360px));
    justify-content: center;
    gap: 24px;
    align-items: stretch;
}

.teacher-premium-card {
    box-sizing: border-box;
    display: grid;
    min-width: 0;
    height: 100%;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 17px;
    align-items: start;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--border-color, #243754) 78%, transparent);
    border-radius: 22px;
    padding: 20px;
    background: linear-gradient(155deg, #102b4a 0%, #0b1d35 68%, #09192f 100%);
    box-shadow: 0 16px 34px rgba(4, 18, 39, .18);
    color: #edf5ff;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.teacher-premium-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--color-accent, #20c997) 66%, #d7f8ed);
    box-shadow: 0 24px 48px rgba(4, 18, 39, .31);
}

.teacher-premium-card:focus-within {
    border-color: var(--color-primary, #2f80ed);
    box-shadow: 0 0 0 3px var(--focus-ring, rgba(47, 128, 237, .36)), 0 24px 48px rgba(4, 18, 39, .31);
}

.teacher-premium-card__photo {
    display: grid;
    width: 112px;
    max-width: 100%;
    aspect-ratio: 1;
    place-items: center;
    align-self: start;
    overflow: hidden;
    border: 3px solid rgba(147, 221, 255, .5);
    border-radius: 50%;
    background: linear-gradient(135deg, #17446c, #087c62);
    color: #f4fcff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
}

.teacher-premium-card__photo > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
}

.teacher-premium-card__body {
    display: flex;
    min-width: 0;
    min-height: 168px;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
}

.teacher-premium-card__badge {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    border: 1px solid rgba(119, 234, 195, .25);
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(8, 124, 98, .22);
    color: #9ef0cf;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teacher-premium-card__body h3 {
    margin: 11px 0 6px;
    color: #fff;
    font-size: 19px;
    line-height: 1.35;
}

.teacher-premium-card__bio {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #c9d8eb;
    font-size: 13px;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.teacher-premium-card__actions {
    display: grid;
    width: 100%;
    gap: 9px;
    margin-top: auto;
    padding-top: 16px;
}

.teacher-premium-card__video,
.teacher-premium-card__profile {
    display: inline-flex;
    min-height: 38px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.teacher-premium-card__video {
    padding: 9px 12px;
    background: linear-gradient(135deg, #0d9775, #087c62);
    color: #fff;
}

.teacher-premium-card__profile {
    justify-content: flex-start;
    color: #9fc8ff;
}

.teacher-premium-card__video:hover,
.teacher-premium-card__profile:hover {
    transform: translateX(-2px);
}

.teacher-premium-card__video:focus-visible,
.teacher-premium-card__profile:focus-visible,
.public-teacher-home-link:focus-visible {
    outline: 3px solid #83bfff;
    outline-offset: 3px;
}

.teacher-premium-grid__all {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.public-teacher-page-head {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.public-teacher-home-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.public-teacher-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.teacher-profile-photo {
    display: grid;
    width: 160px;
    max-width: 100%;
    aspect-ratio: 1;
    flex: 0 0 160px;
    place-items: center;
    overflow: hidden;
    border: 4px solid color-mix(in srgb, var(--color-primary, #2f80ed) 55%, #fff);
    border-radius: 50%;
    background: linear-gradient(135deg, #17446c, #087c62);
    color: #fff;
    font-size: 36px;
    font-weight: 900;
}

.teacher-profile-photo > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
}

.teacher-intro-video {
    display: block;
    width: min(100%, 760px);
    height: auto;
    max-width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: #071729;
}

@media (max-width: 600px) {
    .teacher-premium-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .teacher-premium-card {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 14px;
        padding: 16px;
    }

    .teacher-premium-card__photo {
        width: 92px;
        font-size: 28px;
    }

    .teacher-premium-card__body {
        min-height: 156px;
    }

    .teacher-premium-card__body h3 {
        font-size: 18px;
    }

    .public-teacher-page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-teacher-home-link {
        width: 100%;
        justify-content: center;
    }

    .teacher-profile-photo {
        width: 112px;
        flex-basis: 112px;
    }

    .public-teacher-profile {
        align-items: flex-start;
        text-align: right;
    }
}

@media (prefers-reduced-motion: reduce) {
    .teacher-premium-card,
    .teacher-premium-card__video,
    .teacher-premium-card__profile {
        transition: none;
    }
}
