:root {
    --bg: #f3f6fb;
    --paper: #ffffff;
    --paper-soft: #f8fafd;
    --text: #172033;
    --muted: #667085;
    --line: #dfe5ef;
    --blue: #1d4ed8;
    --blue-soft: #e8f0ff;
    --gold: #b8892f;
    --shadow: 0 18px 45px rgba(20, 32, 55, 0.1);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body.demo-body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.08), transparent 340px),
        linear-gradient(180deg, #f7f9fd 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Arial, sans-serif;
}

.demo-page {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.demo-header {
    margin-bottom: 28px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.demo-back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--blue);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
}

.demo-back:hover {
    text-decoration: underline;
}

.demo-kicker {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.demo-title {
    margin: 0 0 12px;
    max-width: 900px;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.03;
    letter-spacing: -0.04em;
}

.demo-subtitle {
    max-width: 820px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.demo-note {
    margin-top: 30px;
    padding: 18px 20px;
    border: 1px dashed #bdc7d8;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.universities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.university-card {
    display: flex;
    flex-direction: column;
    min-height: 470px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(20, 32, 55, 0.07);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.university-card:hover {
    transform: translateY(-6px);
    border-color: rgba(29, 78, 216, 0.35);
    box-shadow: 0 24px 56px rgba(20, 32, 55, 0.14);
}

.university-card__photo-wrap {
    height: 230px;
    padding: 14px;
    background: linear-gradient(135deg, #eef3fb, #ffffff);
    border-bottom: 1px solid var(--line);
}

.university-card__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 16px;
    background: #ffffff;
}

.university-card__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eef3fb;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 18px;
}

.university-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px;
}

.university-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

.badge--gold {
    background: #fff4dc;
    color: #906312;
}

.university-card__title {
    margin: 0 0 10px;
    font-size: 25px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.university-card__name {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.university-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.university-hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    margin-bottom: 34px;
}

.university-hero__photo-wrap {
    min-height: 460px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.university-hero__image {
    width: 100%;
    height: 100%;
    min-height: 424px;
    display: block;
    object-fit: contain;
    border-radius: 20px;
    background: #f7f9fd;
}

.university-hero__info {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.university-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.university-title {
    margin: 0 0 14px;
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.03;
    letter-spacing: -0.04em;
}

.university-full-name {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.university-desc {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 0 20px;
}

.section-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.section-caption {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.teacher-card {
    display: grid;
    grid-template-columns: 124px 1fr;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 12px 30px rgba(20, 32, 55, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.teacher-card:hover {
    transform: translateY(-4px);
    border-color: rgba(29, 78, 216, 0.28);
    box-shadow: 0 18px 42px rgba(20, 32, 55, 0.11);
}

.passport-photo {
    position: relative;
    width: 124px;
    height: 164px;
    overflow: hidden;
    border: 1px solid #d7deea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: inset 0 0 0 8px #ffffff;
}

.passport-photo::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, transparent 0 56%, rgba(240, 244, 250, 0.9) 56% 100%),
        #ffffff;
}

.passport-head {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 52px;
    height: 60px;
    transform: translateX(-50%);
    border-radius: 46% 46% 44% 44%;
    background: linear-gradient(180deg, #f2cdb6, #ddb196);
    z-index: 3;
}

.passport-hair {
    position: absolute;
    left: 50%;
    top: 22px;
    width: 58px;
    height: 34px;
    transform: translateX(-50%);
    border-radius: 50% 50% 36% 36%;
    background: #2f3440;
    z-index: 4;
}

.passport-neck {
    position: absolute;
    left: 50%;
    top: 82px;
    width: 24px;
    height: 26px;
    transform: translateX(-50%);
    background: #ddb196;
    z-index: 2;
}

.passport-shirt {
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: 48px;
    height: 54px;
    transform: translateX(-50%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: #ffffff;
    z-index: 4;
}

.passport-tie {
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: 14px;
    height: 45px;
    transform: translateX(-50%);
    clip-path: polygon(50% 0, 100% 20%, 70% 100%, 30% 100%, 0 20%);
    background: var(--blue);
    z-index: 5;
}

.passport-suit {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 112px;
    height: 78px;
    transform: translateX(-50%);
    border-radius: 34px 34px 0 0;
    background: #182237;
    z-index: 1;
}

.passport-initials {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 6;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.passport-photo[data-color="1"] .passport-tie {
    background: #991b1b;
}

.passport-photo[data-color="2"] .passport-tie {
    background: #166534;
}

.passport-photo[data-color="3"] .passport-tie {
    background: #7c3aed;
}

.passport-photo[data-color="4"] .passport-tie {
    background: #b45309;
}

.passport-photo[data-color="5"] .passport-tie {
    background: #0f766e;
}

.teacher-card__name {
    margin: 0 0 7px;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.teacher-card__position {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.teacher-card__subject {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.teacher-card__email {
    color: #8a94a6;
    font-size: 13px;
    word-break: break-all;
}

.not-found {
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
    .universities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .university-hero {
        grid-template-columns: 1fr;
    }

    .teachers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .demo-page {
        width: min(100% - 22px, 1220px);
        padding-top: 18px;
    }

    .demo-header,
    .university-hero__info {
        padding: 22px;
    }

    .universities-grid,
    .teachers-grid {
        grid-template-columns: 1fr;
    }

    .university-card {
        min-height: auto;
    }

    .university-hero__photo-wrap {
        min-height: 300px;
    }

    .university-hero__image {
        min-height: 264px;
    }

    .section-head {
        display: block;
    }

    .section-caption {
        margin-top: 8px;
    }

    .teacher-card {
        grid-template-columns: 108px 1fr;
    }

    .passport-photo {
        width: 108px;
        height: 144px;
    }
}

@media (max-width: 430px) {
    .teacher-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .passport-photo {
        width: 132px;
        height: 174px;
    }
.teacher-photo-wrap {
    width: 124px;
    height: 164px;
    overflow: hidden;
    border: 1px solid #d7deea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: inset 0 0 0 6px #ffffff;
}

.teacher-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
    background: #ffffff;
}

.teacher-photo-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: #f1f4f8;
    color: #8a94a6;
    font-size: 13px;
    text-align: center;
}
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.teacher-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(20, 32, 55, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.teacher-card:hover {
    transform: translateY(-4px);
    border-color: rgba(29, 78, 216, 0.28);
    box-shadow: 0 18px 42px rgba(20, 32, 55, 0.11);
}

.teacher-photo-wrap {
    width: 100%;
    height: 330px;
    overflow: hidden;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.teacher-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.teacher-photo-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: #f1f4f8;
    color: #8a94a6;
    font-size: 14px;
    text-align: center;
}

.teacher-card__content {
    padding: 18px 20px 20px;
}

.teacher-card__name {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 21px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.teacher-card__position {
    margin: 0 0 9px;
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.teacher-card__subject {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.teacher-card__email {
    color: #8a94a6;
    font-size: 13px;
    word-break: break-all;
}

@media (max-width: 1080px) {
    .teachers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .teachers-grid {
        grid-template-columns: 1fr;
    }

    .teacher-photo-wrap {
        height: 360px;
    }
}
/* ===== Исправление карточек преподавателей ===== */

.teachers-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
    align-items: start !important;
}

.teacher-card {
    display: block !important;
    position: relative !important;
    overflow: hidden !important;

    width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;

    background: #ffffff !important;
    border: 1px solid #dbe3f0 !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 24px rgba(20, 32, 55, 0.06) !important;
}

.teacher-photo-wrap {
    display: block !important;
    position: relative !important;

    width: 100% !important;
    height: 210px !important;

    overflow: hidden !important;
    background: #f3f5f8 !important;
    border-bottom: 1px solid #dbe3f0 !important;
}

.teacher-photo {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    object-fit: cover !important;
    object-position: center top !important;

    position: static !important;
    transform: none !important;
}

.teacher-card__content {
    display: block !important;
    position: static !important;

    padding: 14px 16px 16px !important;
    background: #ffffff !important;
}

.teacher-card__name {
    margin: 0 0 6px !important;
    color: #071b3a !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
}

.teacher-card__position {
    margin: 0 0 7px !important;
    color: #0b63ff !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}

.teacher-card__subject {
    margin: 0 0 9px !important;
    color: #667085 !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}

.teacher-card__email {
    color: #7b8494 !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    word-break: break-all !important;
}

.teacher-photo-empty {
    width: 100% !important;
    height: 100% !important;

    display: grid !important;
    place-items: center !important;

    color: #8a94a6 !important;
    background: #f1f4f8 !important;
    font-size: 14px !important;
}

/* Адаптив */
@media (max-width: 1050px) {
    .teachers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .teachers-grid {
        grid-template-columns: 1fr !important;
    }

    .teacher-photo-wrap {
        height: 240px !important;
    }
}
/* ===== Преподаватели: компактный список по 3 в ряд ===== */

.teachers-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 28px !important;
    align-items: start !important;
}

/* Одна карточка преподавателя */
.teacher-card {
    display: grid !important;
    grid-template-columns: 115px minmax(0, 1fr) !important;
    column-gap: 18px !important;
    align-items: center !important;

    width: 100% !important;
    min-height: 160px !important;
    padding: 18px 0 !important;

    background: transparent !important;
    border: none !important;
    border-top: 1px solid #d8dee8 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    overflow: hidden !important;
    position: relative !important;
}

/* Убираем hover-эффекты старых карточек */
.teacher-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #d8dee8 !important;
}

/* Контейнер фото */
.teacher-photo-wrap {
    display: block !important;
    position: relative !important;

    width: 115px !important;
    height: 115px !important;
    min-width: 115px !important;
    max-width: 115px !important;

    overflow: hidden !important;

    background: #f1f3f6 !important;
    border: none !important;
    border-radius: 3px !important;
    box-shadow: none !important;
}

/* Само фото */
.teacher-photo {
    display: block !important;
    position: static !important;

    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;

    object-fit: cover !important;
    object-position: center top !important;

    transform: none !important;
    inset: auto !important;
}

/* Заглушка, если нет фото */
.teacher-photo-empty {
    width: 100% !important;
    height: 100% !important;

    display: grid !important;
    place-items: center !important;

    background: #f1f3f6 !important;
    color: #8a94a6 !important;
    font-size: 12px !important;
    text-align: center !important;
}

/* Правая часть с текстом */
.teacher-card__content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;

    min-width: 0 !important;
    min-height: 115px !important;
    padding: 0 !important;

    background: transparent !important;
    position: static !important;
}

/* Имя */
.teacher-card__name {
    margin: 0 !important;

    color: #000000 !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;

    letter-spacing: 0 !important;
}

/* Должность */
.teacher-card__position {
    margin: 8px 0 0 !important;

    color: #0b63ff !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
}

/* Предмет */
.teacher-card__subject {
    margin: 6px 0 0 !important;

    color: #555f6d !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
}

/* Почта */
.teacher-card__email {
    margin-top: 8px !important;

    color: #777777 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;

    word-break: break-word !important;
}

/* На средних экранах — 2 в ряд */
@media (max-width: 1200px) {
    .teachers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* На телефоне — 1 в ряд */
@media (max-width: 760px) {
    .teachers-grid {
        grid-template-columns: 1fr !important;
    }

    .teacher-card {
        grid-template-columns: 100px minmax(0, 1fr) !important;
        min-height: 135px !important;
    }

    .teacher-photo-wrap {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
    }

    .teacher-card__content {
        min-height: 100px !important;
    }
}