/* ========================================
   TKVG — основное оформление Cassiopeia
   ======================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
/* ========================================
   ШАПКА
   ======================================== */

.container-header {
    background: #ffffff;
    background-image: none;
    box-shadow: none;
}

.container-header .navbar-brand {
    width: 100%;
    margin: 0;
    padding: 0.75rem 0 0.6rem;
}

.container-header .navbar-brand img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    border-radius: 10px;
}

.container-header .site-description {
    display: none;
}


/* ========================================
   ГЛАВНОЕ МЕНЮ
   ======================================== */

.container-header .container-nav {
    background: #185d9e;
    margin-top: 0;
    padding: 0.15rem 1rem;
    border-radius: 8px;
}

/* Только верхний уровень главного меню */
.container-header .mod-menu > ul {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.container-header .mod-menu > li {
    flex: 0 0 auto;
}

.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span {
    color: #ffffff;
    padding: 0.45rem 0.55rem;
    white-space: nowrap;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.container-header .mod-menu > li > a:hover,
.container-header .mod-menu > li > span:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.container-header .mod-menu > li.active > a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.container-header .metismenu.mod-menu .mm-toggler {
    color: #ffffff;
}

/* Стрелки выпадающего меню — без белой рамки */
.container-header .metismenu.mod-menu .mm-toggler {
    border: 0 !important;
    outline: 0;
    box-shadow: none !important;
    border-radius: 6px;
}

.container-header .metismenu.mod-menu .mm-toggler:focus,
.container-header .metismenu.mod-menu .mm-toggler:active {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* Более аккуратное выделение при навигации клавиатурой */
.container-header .metismenu.mod-menu .mm-toggler:focus-visible {
    outline: 0 !important;
    background: rgba(255, 255, 255, 0.12);
}


/* ========================================
   ПРАВАЯ КОЛОНКА
   ======================================== */

.container-sidebar-right .card {
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.25rem;
}

.container-sidebar-right .card-header {
    background: #f4f7fb;
    border: 0;
    border-bottom: 1px solid #e6ebf2;
    padding: 0.75rem 1rem;
    color: #18366b;
    font-weight: 600;
}

.container-sidebar-right .card-header h3 {
    color: #18366b;
    font-weight: 600;
}

.container-sidebar-right .card-body {
    padding: 1rem;
}

.container-sidebar-right img {
    max-width: 100%;
    height: auto;
}


/* ========================================
   ОСНОВНОЙ КОНТЕНТ
   ======================================== */

.site-grid {
    margin-top: 1.5rem;
}

main {
    line-height: 1.6;
}

main h1,
main .page-header h1,
main .page-header h2 {
    color: #18366b;
    font-weight: 650;
    line-height: 1.2;
}

.article-info {
    color: #667085;
}

/* Убираем декоративные линии Cassiopeia
   под пунктами и стрелками главного меню */
.container-header .metismenu > li > a:hover::after,
.container-header .metismenu > li > button:hover::before,
.container-header .metismenu > li.active > a::after,
.container-header .metismenu > li.active > button::before {
    display: none !important;
    content: none !important;
}

/* ========================================
   TKVG — логотипы партнёров
   ======================================== */

.container-footer {
    padding: 2rem 0;
}

.container-footer .tkvg-sponsors {
    background: transparent;
}

.container-footer .tkvg-sponsors .sponsor-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: center;
    gap: 1.5rem 2rem;
    padding: 1rem 0;
}

.container-footer .tkvg-sponsors .sponsor-item {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.container-footer .tkvg-sponsors .sponsor-item img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 80px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.container-footer .tkvg-sponsors .sponsor-item:hover img {
    transform: scale(1.04);
}

/* ========================================
   ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА
   ======================================== */

.container-header .container-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

/* Основное меню получает оставшееся место */
.container-header .navbar {
    flex: 1 1 auto;
    min-width: 0;
}

/* Языковой переключатель */
.container-header .tkvg-language {
    flex: 0 0 auto;
    margin: 0 0.6rem 0 0.4rem;
}

/* Кнопка ET / RU */
.container-header .tkvg-language .btn,
.container-header .tkvg-language button {
    padding: 0.4rem 0.65rem;
    min-width: 0;
    white-space: nowrap;
    border-radius: 6px;
}

/* ========================================
   TKVG — компактный аккордеон проектов
   ======================================== */

#projectsAccordion {
    --bs-accordion-border-color: #dfe5ec;
    --bs-accordion-border-radius: 6px;
    --bs-accordion-inner-border-radius: 5px;
}

/* Элементы без промежутков */
#projectsAccordion .accordion-item {
    margin: 0;
    border: 1px solid #dfe5ec;
    border-bottom: 0;
    border-radius: 0;
    overflow: hidden;
}

/* Первый элемент */
#projectsAccordion .accordion-item:first-child {
    border-radius: 6px 6px 0 0;
}

/* Последний элемент */
#projectsAccordion .accordion-item:last-child {
    border-bottom: 1px solid #dfe5ec;
    border-radius: 0 0 6px 6px;
}

/* Компактный заголовок */
#projectsAccordion .accordion-button {
    min-height: 0;
    padding: 0.65rem 1rem;
    color: #18366b;
    background: #fff;
    font-weight: 500;
    box-shadow: none;
}

/* Открытый проект */
#projectsAccordion .accordion-button:not(.collapsed) {
    color: #fff;
    background: #185d9e;
    box-shadow: none;
}

/* Без синей рамки при нажатии */
#projectsAccordion .accordion-button:focus {
    box-shadow: none;
}

/* Содержимое раскрытого проекта */
#projectsAccordion .accordion-body {
    padding: 1rem;
    background: #fff;
}

/* Убираем лишние промежутки между проектами */
#projectsAccordion .accordion-item {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#projectsAccordion > p {
    display: none !important;
}

/* ========================================
   TKVG — juhtkond
   ======================================== */

.tkvg-management {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.tkvg-person {
    padding: 1.4rem 1.5rem;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(24, 54, 107, 0.05);
}

.tkvg-person--lead {
    grid-column: 1 / -1;
    border-left: 4px solid #185d9e;
}

.tkvg-person h3 {
    margin: 0 0 .25rem;
    color: #18366b;
    font-size: 1.2rem;
    font-weight: 700;
}

.tkvg-person-role {
    margin-bottom: .8rem;
    color: #185d9e;
    font-weight: 600;
}

.tkvg-person-description {
    margin-bottom: .9rem;
    color: #536274;
    line-height: 1.55;
}

.tkvg-person-contact {
    margin-top: .3rem;
}

.tkvg-person-contact strong {
    color: #243247;
    font-weight: 600;
}

.tkvg-person-contact a,
.tkvg-person-note a {
    color: #185d9e;
    text-decoration: none;
}

.tkvg-person-contact a:hover,
.tkvg-person-note a:hover {
    text-decoration: underline;
}

.tkvg-person-note {
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px solid #edf0f4;
    color: #536274;
}

@media (max-width: 767px) {
    .tkvg-management {
        grid-template-columns: 1fr;
    }

    .tkvg-person--lead {
        grid-column: auto;
    }
}

/* ========================================
   TKVG — õpetajate nimekiri
   ======================================== */

.tkvg-teachers {
    margin: 1.5rem 0 2rem;
}

.tkvg-teachers .accordion-item {
    border: 1px solid #dfe5ec;
    border-bottom: 0;
}

.tkvg-teachers .accordion-item:first-child {
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tkvg-teachers .accordion-item:last-child {
    border-bottom: 1px solid #dfe5ec;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.tkvg-teachers .accordion-button {
    padding: 0.7rem 1rem;
    color: #18366b;
    background: #f7f9fc;
    font-weight: 600;
    box-shadow: none !important;
}

.tkvg-teachers .accordion-button:not(.collapsed) {
    color: #fff;
    background: #185d9e;
}

.tkvg-teachers .accordion-button:focus {
    box-shadow: none !important;
}

.tkvg-teachers .accordion-body {
    padding: 0;
    background: #fff;
}

.tkvg-teachers-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.tkvg-teachers-table th,
.tkvg-teachers-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #edf0f4;
    vertical-align: middle;
    text-align: left;
}

.tkvg-teachers-table th {
    color: #536274;
    background: #f8fafc;
    font-size: 0.86rem;
    font-weight: 600;
}

.tkvg-teachers-table td:first-child {
    width: 22%;
    color: #243247;
}

.tkvg-teachers-table td:nth-child(2) {
    width: 28%;
}

.tkvg-teachers-table td:nth-child(3) {
    width: 34%;
}

.tkvg-teachers-table td:nth-child(4) {
    width: 16%;
    white-space: nowrap;
}

.tkvg-teachers-table tr:last-child td {
    border-bottom: 0;
}

.tkvg-teachers-table a {
    color: #185d9e;
    text-decoration: none;
}

.tkvg-teachers-table a:hover {
    color: #18366b;
    text-decoration: underline;
}

.tkvg-juhataja {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: #e7f0fa;
    color: #185d9e;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: middle;
}

.tkvg-class {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    background: #eef4fb;
    color: #18366b;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 767px) {
    .tkvg-teachers-table th,
    .tkvg-teachers-table td {
        padding: 0.55rem 0.5rem;
        font-size: 0.9rem;
    }

    .tkvg-teachers-table th:nth-child(2),
    .tkvg-teachers-table td:nth-child(2) {
        display: none;
    }

    .tkvg-teachers-table td:first-child {
        width: 34%;
    }

    .tkvg-teachers-table td:nth-child(3) {
        width: 46%;
    }

    .tkvg-teachers-table td:nth-child(4) {
        width: 20%;
    }
}
