/* В самый верх файла */
:root {
    background-color: #f4f7f6; /* Светлый фон по умолчанию */
}

:root.dark-mode {
    background-color: #0d1117; /* Темный фон мгновенно */
}

html {
    background-color: var(--bg-main);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    /* Убедитесь, что transition не слишком медленный для фона */
    transition: background-color 0.2s ease, color 0.2s ease; 
}

:root {
    --bg-main: #f4f7f6;
    --bg-header: #ffffff;
    --text-primary: #1a1a1a;
    --accent: #003399;
    --accent-hover: #002266;
    --border: #e0e0e0;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

body.dark-mode {
    --bg-main: #0d1117;
    --bg-header: #161b22;
    --text-primary: #c9d1d9;
    --accent: #2188ff;
    --border: #30363d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease;
    overflow-x: hidden;
}

/* Шапка сайта */
.main-header {
    width: 100%;
    background: var(--bg-header);
    border-bottom: 3px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 120px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 20px;
}

.logo-circle {
    width: 85px;
    height: 85px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
    overflow: hidden;
    flex-shrink: 0;
}

.logo-circle img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.college-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.city-name {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent);
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, auto);
    gap: 10px 25px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 5px;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-theme {
    background: var(--bg-main);
    border: 1px solid var(--border);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-btn {
    display: none;
    background: var(--accent);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
}

.staff-section {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 40px;
    text-transform: uppercase;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.staff-card {
    background: var(--bg-header);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.staff-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
}

.member-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 4px solid var(--accent);
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.staff-card p {
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
}

.rounded-line-with-text {
    width: 100%;
    height: 250px;
    background-color: var(--bg-header);
    border: 1px solid var(--border);
    border-radius: 25px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 900;
    color: var(--accent);
    text-transform: uppercase;
}

.subtitle {
    text-align: center;
    color: var(--text-primary);
    opacity: 0.8;
    margin-bottom: 30px;
}

.wrap {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px 40px;
    display: flex;
    gap: 40px;
}

form { flex: 1; }
table { width: 100%; border-spacing: 15px; }
th { text-align: left; font-weight: 700; color: var(--text-primary); width: 200px; }
input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-header);
    color: var(--text-primary);
}

button[type="submit"] {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 30px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
}

.map { flex: 1; min-height: 400px; border-radius: 15px; overflow: hidden; border: 1px solid var(--border); }

@media (max-width: 1000px) {
    .main-header { 
        height: 100px; 
    }
    
    .mobile-btn { 
        display: block; /* Показываем кнопку-бургер */
    }

    .main-nav {
        display: none; /* Скрыто по умолчанию */
        position: absolute;
        top: 100px; /* Сразу под хедером */
        left: 0;
        width: 100%;
        background: var(--bg-header);
        padding: 20px;
        border-bottom: 2px solid var(--accent);
        z-index: 999;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

    /* Когда JS добавляет этот класс, меню появляется */
    .main-nav.active { 
        display: block !important; 
    }

    .nav-grid { 
        display: flex;
        flex-direction: column; /* Ссылки в столбик */
        grid-template-columns: 1fr; 
        gap: 15px;
    }

    .nav-item {
        font-size: 14px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-item.active::after {
        bottom: 0; /* Корректируем подчеркивание для мобилок */
    }

    .wrap { 
        flex-direction: column; 
    }
}
/* Контейнер сетки */
.video-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Ровно 3 колонки */
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Карточка */
.life-video-card {
    background: var(--bg-header);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.life-video-card:hover {
    transform: translateY(-10px);
}

/* Обертка видео для сохранения пропорций 16:9 */
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Видео заполняет блок без искажения */
}

/* Стили текста внутри карточки */
.card-content {
    padding: 20px;
    flex-grow: 1;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--accent);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .video-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 в ряд на планшетах */
    }
}

@media (max-width: 768px) {
    .video-grid-container {
        grid-template-columns: 1fr; /* 1 в ряд на телефонах */
    }
}
/* Убираем стандартное оформление ссылки для карточки */
.card-link {
    text-decoration: none;
    color: inherit; /* Цвет текста будет браться из настроек карточки */
    display: block; /* Чтобы ссылка занимала всю ширину карточки */
}

/* Адаптация сетки специальностей */
@media (max-width: 1200px) {
    .staff-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 колонки на средних экранах */
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .staff-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на планшетах */
    }
    
    .section-title {
        font-size: 28px; /* Уменьшаем заголовок */
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    .staff-grid {
        grid-template-columns: 1fr; /* 1 колонка на мобильных телефонах */
        gap: 15px;
    }

    .card-img-wrap {
        height: 180px; /* Немного уменьшаем высоту фото для мобильных */
    }

    .card-title {
        font-size: 18px;
    }

    .card-subtitle {
        font-size: 13px;
    }
}
/* Обновляем сетку для хедера, чтобы вместить новый элемент */
@media (min-width: 1001px) {
    .nav-grid {
        grid-template-columns: repeat(6, auto); /* Увеличиваем кол-во колонок для десктопа */
    }
}
/* Уменьшение надписи СЕМЕЙ на телефонах */
@media (max-width: 800px) {
    .city-name {
        font-size: 1.2em; /* Делает текст на 20% меньше основного */
        display: inline-block; /* Позволяет корректно применять размеры */
        letter-spacing: 1px;  /* Можно чуть сузить межбуквенный интервал */
    }
    
    /* Если вы хотите уменьшить весь заголовок в хедере на мобилках */
    .hero-title {
        font-size: 24px !important; 
    }
}