:root {
    --font-main: "Roboto", Arial, Helvetica, sans-serif;

    --font-light: 300;
    --font-regular: 400;
    --font-medium: 500;
    --font-bold: 700;
    --font-extra-bold: 800;
    --font-black: 900;

    --color-dark: #1B1F26;
    --color-gray-light: #E1E1E2;
    --color-gray: #81818B;
    --color-white: #FFFFFF;
    --color-orange: #FF7641;
    --color-blue: #002FE7;
    --color-yellow: #FFF854;
    --color-violet: #968AE1;

    /* Цвет гуманитарного факультета */
    --color-humanitarian: #AA0041;

    --color-text: #1B1F26;
    --color-bg: #FFFFFF;
    --color-section: #F5F5F6;
    --color-card: #FFFFFF;
    --shadow-card: 0 8px 24px rgba(27, 31, 38, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background: var(--color-bg);
    font-size: 16px;
    font-weight: var(--font-regular);
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* Header */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: var(--color-white);
    border-top: none;
    box-shadow: 0 2px 16px rgba(27, 31, 38, 0.08);
}

.header__inner {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.logo img {
    width: 230px;
    height: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-dark);
}

.nav a {
    position: relative;
    transition: color 0.2s ease;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 3px;
    background: var(--color-humanitarian);
    transition: width 0.2s ease;
}

.nav a:hover {
    color: var(--color-humanitarian);
}

.nav a:hover::after {
    width: 100%;
}

.burger {
    display: none;
    width: 38px;
    height: 30px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.burger span {
    display: block;
    height: 4px;
    background: var(--color-humanitarian);
    margin: 6px 0;
    border-radius: 4px;
}

/* Sections */

.section {
    padding: 50px 0 58px;
}

.section h2 {
    font-weight: var(--font-extra-bold);
}

.section-light {
    background: var(--color-section);
}

.section-blue {
    background: var(--color-humanitarian);
    color: var(--color-white);
}

/* News */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 48px;
}

.card {
    background: var(--color-card);
    color: var(--color-dark);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border-radius: 4px;
}

.card__image {
    height: 105px;
    background: var(--color-white);
}

.card__image img {
    background: var(--color-white);
}

.card__body {
    background: var(--color-gray-light);
    padding: 12px 14px;
    border-top: 4px solid var(--color-humanitarian);
}

.card h3 {
    font-size: 14px;
    margin-bottom: 13px;
    font-weight: 800;
}

.card p {
    font-size: 13px;
    font-weight: 800;
    color: var(--color-dark);
}

.center {
    display: flex;
    justify-content: center;
}

/* Programs */

.programs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    color: var(--color-dark);
    box-shadow: 0 8px 24px rgba(27, 31, 38, 0.18);
}

.program {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 18px;
    border-right: 1px solid var(--color-gray-light);
}

.program:last-child {
    border-right: none;
}

.program__circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--color-gray-light);
    border: 5px solid rgba(170, 0, 65, 0.18);
    flex: 0 0 auto;
}

.program h3 {
    font-size: 14px;
    font-weight: 800;
}

.program-more {
    justify-content: space-between;
}

/* Teachers */

.teachers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 42px;
}

.teacher-card .card__image {
    height: 105px;
}

.teacher-card .card__body {
    padding: 10px;
}

.teacher-card h3 {
    font-size: 13px;
    margin-bottom: 8px;
}

.teacher-card p {
    font-size: 11px;
    color: var(--color-dark);
}

/* Gallery */

.gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    background: var(--color-white);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 35px;
    box-shadow: 0 8px 24px rgba(27, 31, 38, 0.18);
}

.gallery img {
    height: 150px;
    background: var(--color-gray-light);
}


/* Adaptive */

@media (max-width: 1024px) {
    .logo img {
        width: 200px;
    }

    .nav {
        font-weight: var(--font-medium);
    }

    .teachers-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .programs {
        grid-template-columns: repeat(2, 1fr);
    }

    .program:nth-child(2) {
        border-right: none;
    }

    .program:nth-child(1),
    .program:nth-child(2) {
        border-bottom: 1px solid var(--color-gray-light);
    }
}

@media (max-width: 768px) {
    .header__inner {
        height: auto;
        min-height: 80px;
        flex-wrap: wrap;
        padding: 16px 0;
    }

    .logo img {
        width: 185px;
    }

    .burger {
        display: block;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 0;
    }

    .nav.active {
        display: flex;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 19px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .teachers-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .gallery img {
        height: 220px;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .logo img {
        width: 165px;
    }

    .hero {
        min-height: 330px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .btn {
        font-weight: var(--font-bold);
    }

    .programs {
        grid-template-columns: 1fr;
    }

    .program {
        border-right: none;
        border-bottom: 1px solid var(--color-gray-light);
    }

    .program:last-child {
        border-bottom: none;
    }

    .teachers-grid {
        grid-template-columns: 1fr;
    }

    .contacts p {
        font-size: 15px;
    }

    .footer {
        font-size: 14px;
    }
}

/* Teachers dynamic block */

.teachers-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.teacher-card {
    display: flex;
    flex-direction: column;
}

.teacher-card__link {
    display: block;
    flex: 1;
}

.teacher-card .card__image {
    height: 260px;
}

.teacher-card .card__image img {
    object-fit: cover;
    object-position: center;
}

.teacher-card .card__body {
    min-height: 150px;
}

.teacher-card h3 {
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.teacher-card p {
    font-size: 14px;
    line-height: 1.45;
}

.teacher-short {
    margin-top: 10px;
    color: var(--color-gray);
    font-weight: var(--font-regular);
}

.teacher-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-light);
}

.teacher-more {
    color: var(--color-humanitarian);
    font-weight: var(--font-bold);
}

.teacher-more:hover {
    text-decoration: underline;
}

.teacher-likes {
    font-weight: var(--font-bold);
    color: var(--color-dark);
}

/* Teachers cards */

.teachers-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.teacher-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
}

.teacher-card .card__image {
    height: 260px;
}

.teacher-card .card__image img {
    object-fit: cover;
    object-position: center;
}

.teacher-card .card__body {
    min-height: 150px;
}

.teacher-card h3 {
    font-size: 18px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.teacher-card p {
    font-size: 14px;
    line-height: 1.45;
}

.teacher-short {
    margin-top: 10px;
    color: var(--color-gray);
    font-weight: var(--font-regular);
}

.teacher-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-light);
}

.teacher-more {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-humanitarian);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: var(--font-bold);
    cursor: pointer;
}

.teacher-more:hover {
    text-decoration: underline;
}

/* VK-like heart button */

.teacher-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 58px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--color-gray-light);
    border-radius: 999px;
    background: var(--color-section);
    color: var(--color-gray);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.teacher-like:hover {
    background: rgba(170, 0, 65, 0.08);
    color: var(--color-humanitarian);
    border-color: rgba(170, 0, 65, 0.3);
}

.teacher-like:disabled {
    cursor: default;
}

.teacher-like.liked,
.teacher-like.already-liked {
    background: rgba(170, 0, 65, 0.1);
    color: var(--color-humanitarian);
    border-color: rgba(170, 0, 65, 0.35);
}

.teacher-like__heart {
    font-size: 22px;
    line-height: 1;
}

.teacher-like__count {
    line-height: 1;
}

/* Teacher popup */

body.modal-open {
    overflow: hidden;
}

.teacher-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.teacher-modal.active {
    display: flex;
}

.teacher-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 31, 38, 0.72);
}

.teacher-modal__content {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(27, 31, 38, 0.35);
    padding: 34px;
}

.teacher-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: none;
    background: var(--color-section);
    color: var(--color-dark);
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.teacher-modal__close:hover {
    background: rgba(170, 0, 65, 0.1);
    color: var(--color-humanitarian);
}

.teacher-modal__grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 34px;
    align-items: start;
}

.teacher-modal__photo {
    height: 380px;
    background: var(--color-gray-light);
    border-radius: 8px;
    overflow: hidden;
}

.teacher-modal__photo img {
    object-fit: cover;
    object-position: center;
}

.teacher-modal__info h2 {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--color-dark);
    padding-right: 42px;
}

.teacher-modal__position {
    font-size: 20px;
    font-weight: var(--font-bold);
    color: var(--color-humanitarian);
    margin-bottom: 22px;
}

.teacher-modal__description {
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-dark);
}

@media (max-width: 900px) {
    .teachers-grid-3 {
        grid-template-columns: 1fr;
    }

    .teacher-modal__grid {
        grid-template-columns: 1fr;
    }

    .teacher-modal__photo {
        height: 360px;
    }
}

@media (max-width: 520px) {
    .teacher-modal {
        padding: 12px;
    }

    .teacher-modal__content {
        padding: 24px 18px;
    }

    .teacher-modal__info h2 {
        font-size: 25px;
    }

    .teacher-modal__description {
        font-size: 15px;
    }

    .teacher-card .card__image {
        height: 230px;
    }
}

.teacher-like.liked {
    background: rgba(170, 0, 65, 0.1);
    color: var(--color-humanitarian);
    border-color: rgba(170, 0, 65, 0.35);
}

.teacher-like.liked .teacher-like__heart {
    color: var(--color-humanitarian);
}

.teacher-modal__link {
    margin-top: 24px;
}

