.rounded {
    border-radius: 0 !important;
}

/* Подключение шрифта Lora */
@font-face {
    font-family: 'Lora';
    src: url('../fonts/lora/Lora-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lora';
    src: url('../fonts/lora/Lora-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Lora';
    src: url('../fonts/lora/Lora-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lora';
    src: url('../fonts/lora/Lora-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}


/* Graphik Regular */
@font-face {
    font-family: 'Graphik';
    src: url('../fonts/Graphik/Graphik-Regular-Web.eot');
    /* IE9 */
    src: url('../fonts/Graphik/Graphik-Regular-Web.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Graphik/Graphik-Regular-Web.woff2') format('woff2'),
        url('../fonts/Graphik/Graphik-Regular-Web.woff') format('woff'),
        url('../fonts/Graphik/Graphik-Regular-Web.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Graphik Medium */
@font-face {
    font-family: 'Graphik';
    src: url('../fonts/Graphik/Graphik-Medium-Web.eot');
    src: url('../fonts/Graphik/Graphik-Medium-Web.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Graphik/Graphik-Medium-Web.woff2') format('woff2'),
        url('../fonts/Graphik/Graphik-Medium-Web.woff') format('woff'),
        url('../fonts/Graphik/Graphik-Medium-Web.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Graphik Bold */
@font-face {
    font-family: 'Graphik';
    src: url('../fonts/Graphik/Graphik-Bold-Web.eot');
    src: url('../fonts/Graphik/Graphik-Bold-Web.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Graphik/Graphik-Bold-Web.woff2') format('woff2'),
        url('../fonts/Graphik/Graphik-Bold-Web.woff') format('woff'),
        url('../fonts/Graphik/Graphik-Bold-Web.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --body-font-family: 'Lora', serif;
    --body-font-size: 20px;
}

body {
    font-family: 'Lora', serif;
    font-size: 20px;
}

.article-body {
    font-family: 'Lora', serif;
    font-size: 20px;
}

h1,
h2,
h3 {
    font-family: 'Graphik', sans-serif;
    font-weight: 700;
    /* автоматически возьмёт Graphik Bold */
}

a {
    color: #b20917;
}

a:hover {
    color: #ce0101;
}

/* Убираем лишние отступы у обертки */
.moduletable.top-header-module {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    background: transparent !important;
    border: none !important;
}

/* Принудительно наследуем высоту */
.moduletable.top-header-module>div {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Цвет по умолчанию (для всех страниц, кроме главной) */
.top-header-row .header-buttons button svg path,
.top-header-row .header-buttons button svg circle,
.top-header-row .header-buttons button svg rect {
    stroke: #000 !important;
    fill: #000 !important;
}

/* Цвет только на главной */
.top-header-row.is-home .header-buttons button svg path,
.top-header-row.is-home .header-buttons button svg circle,
.top-header-row.is-home .header-buttons button svg rect {
    stroke: #fff !important;
    fill: #fff !important;
}

.top-header-row .svg-logo svg path {
    stroke: none !important;
    fill: #000 !important;
}

.top-header-row.is-home .svg-logo svg path {
    stroke: none !important;
    fill: #fff !important;
}

.container-topbar {
    position: relative;
    top: -20px;
}

.custom-header {
    width: 100%;
    background: url('/images/banners/main-bg.jpg') center center / cover no-repeat !important;
    color: white;
    /* Если текст должен быть белым */
    min-height: 600px;
    background-size: cover;
    margin: 0 !important;
    padding: 0 !important;
    height: 66.666666666vh !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: hidden;
}

.custom-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.custom-header-main {
    width: 100%;
    background: white !important;
    padding: 0 0;
    color: white;
    /* Если текст должен быть белым */
    background-size: cover;
}

.header-container {
    max-width: 1320px;
    /* ширина контента Joomla (может отличаться) */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
    position: relative;
    height: 100%;
}

.top-header-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

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

/* Левый блок с логотипом и надписью */
.logo-block {
    display: flex;
    align-items: flex-end;
    position: relative;
}

.logo-rectangle {
    width: 120px;
    height: 90px;
    background: #b20917 center center / cover no-repeat;
}

.logo-text {
    position: absolute;
    right: 5px;
    bottom: 5px;
    color: white;
    font-size: 30px;
    font-family: 'Lora', serif;
}

/* SVG-логотип (ссылка на seance.ru) */
.svg-logo {
    margin-left: 20px;
    display: flex;
    align-items: center;
}

.svg-logo svg {
    width: 130px;
    height: 32px;
    fill: white;
    /* или другой цвет */
}

/* Правые кнопки */
.header-buttons {
    display: flex;
    gap: 15px;
}

.header-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.header-buttons svg {
    width: 24px;
    height: 24px;
}

.timeline-button svg {
    width: 30px;
    height: 22px;
}

@media (max-width: 768px) {
    .custom-header {
        min-height: 400px;
        height: 50vh;
    }

    .logo-text {
        font-size: 18px;
    }
}

.header-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: fadeInCenter 1s ease-out forwards;
}

@keyframes fadeInCenter {
    to {
        opacity: 1;
    }
}

.main-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Lora', serif;
    text-align: center;
    width: max-content;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
        padding: 0 15px;
    }

    .sub-title {
        font-size: 1.5rem;
        padding: 0 15px;
    }
}

/* Основные стили меню */
.main-nav {
    position: absolute;
    bottom: 40px;
    /* Увеличил отступ снизу */
    left: 0;
    right: 0;
    z-index: 3;
}

.main-nav .nav-list {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav .nav-link {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

/* Эффекты при наведении */
.main-nav .nav-link:hover {
    color: #f0f0f0;
    transform: translateY(-2px);
    /* Добавил легкий подъем */
}

.main-nav .nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #b20917;
    transition: width 0.4s ease;
}

.main-nav .nav-link:hover:after {
    width: 100%;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .main-nav .nav-list {
        gap: 20px;
        flex-wrap: wrap;
    }

    .main-nav .nav-link {
        font-size: 18px;
        /* Чуть меньше на мобильных */
        padding: 5px 0;
        /* Добавил отступы для тапов */
    }

    .main-nav {
        bottom: 20px;
        /* Меньше отступ на маленьких экранах */
    }
}

/* Фикс для мобильных */
@media (max-width: 768px) {
    .top-header-row {
        flex-wrap: wrap;
    }

    .logo-group {
        order: 1;
        margin-bottom: 15px;
    }

    .header-buttons {
        order: 2;
        margin-left: auto;
    }

    .main-nav {
        order: 3;
    }
}

.custom-footer {
    background-color: #262626;
    color: white;
    font-family: 'Lora', serif;
}

.custom-footer a {
    color: white !important;
    text-decoration: none;
}

.custom-footer a:hover {
    color: #ce0101 !important;
}

.footer-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0px;
}

.footer-row {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-block {
    flex: 1 1 auto;
    min-width: 150px;
    max-width: 100%;
}

.footer-block h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: white;
}

.footer-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-block ul li {
    margin-bottom: 8px;
}

.footer-block ul li a {
    color: white;
    font-weight: normal;
}

.footer-block ul li a:hover {
    color: #ce0101;
}

.footer-block.footer-social ul {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.footer-block.footer-social ul li {
    margin: 0;
}

.footer-block.footer-social ul li a {
    font-weight: bold;
    font-size: 16px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    font-size: 14px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Компактное горизонтальное меню */
.footer-menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
    margin: 0;
    padding: 0;
}

.footer-menu ul li {
    margin: 0;
    white-space: nowrap;
}

.footer-menu ul li a {
    font-size: 14px;
    color: white;
    transition: color 0.3s ease;
}

.footer-menu ul li a:hover {
    color: #ce0101;
}

.footer-about ul {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px;
    margin: 0;
    padding: 0;
}

.footer-social svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    transition: fill 0.3s ease;
}

.footer-social svg:hover {
    fill: #ce0101;
}

/* Десктоп: выравниваем блоки в ряд */
@media (max-width: 1240px) {
    .footer-row {
        margin: 0 20px;
    }
}


/* Десктоп: выравниваем блоки в ряд */
@media (min-width: 992px) {
    .footer-row {
        flex-wrap: nowrap;
    }

    .footer-block {
        min-width: auto;
        flex: 1 0 auto;
        width: auto;
    }
}

/* Планшет: чуть больше компактности */
@media (max-width: 991px) and (min-width: 768px) {
    .footer-row {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Десктоп: выравниваем блоки в ряд */
@media (max-width: 1240px) {
    .footer-bottom {
        margin: 0 20px;
    }
}

/* Мобильные: вертикальный список */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column;
    }

    .footer-block.footer-social ul {
        margin-top: 0;
    }
}

/* Стили для страницы материала в категории "Глоссарий" */
.com-content-article.item-page.articles,
.com-content-article.item-page.news {
    max-width: 800px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
}

/* Стили для текста статьи */
.com-content-article.item-page.articles .com-content-article__body,
.com-content-article.item-page.news .com-content-article__body {
    font-family: 'Lora', serif;
    font-size: 20px;
}

/* Линия под заголовком */
.com-content-article.item-page.articles .article-header::after,
.com-content-article.item-page.news .article-header::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: #000;
    margin-top: 10px;
}

.fullsize-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.fullsize-search .overlay-content {
    padding: 2rem;
    border-radius: 8px;
    max-width: 1200px;
    width: 100%;
    position: relative;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.fullsize-search .close-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 3rem;
    background: none;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 1060;
}

/* Анимация появления */
.fullsize-search.active {
    display: flex;
    animation: fadeInUp 0.3s forwards;
}

.fullsize-search.active .overlay-content {
    opacity: 1;
    transform: scale(1);
}

.overlay-content .awesomplete {
    width: 100%;
}

.overlay-content .awesomplete>input {
    max-width: 100% !important;
}

.btn-primary {
    background: #b20917;
    --btn-active-bg: #b20917;
    border: 0;
}

.btn-primary:hover {
    background: #ce0101 center center / cover no-repeat;
}

.back-to-top-link,
.back-to-top-link:focus {
    color: #000;
    border: 1px solid #000;
    background-color: #fff;
}

.back-to-top-link:hover {
    color: #fff;
    background-color: #b20917;
}


@keyframes fadeInUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.contact-category {
    text-align: center;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 0;
    background-color: transparent;
}

.contact-card {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background-color: #262626;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-height: 250px;
}

.contact-card-bg:after {
    background: rgba(0, 0, 0, 0.5);
}

.contact-card-content {
    padding: 1rem;
    text-align: center;
    width: 100%;
}

.contact-card h3 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: bold;
    color: #fff;
    transition: color 0.3s ease;
}

.contact-profession {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: #ccc;
    font-style: italic;
    font-weight: 300;
    transition: color 0.3s ease;
}

/* Стили при наведении */
.contact-card:hover h3 {
    color: #ce0101;
    /* Красный цвет из твоего дизайна */
}

.contact-card:hover .contact-profession {
    color: #cd9e9e;
}

.code-404 .error-code {
    color: #d9534f;
}

.code-500 .error-code {
    color: #b83e3b;
}

.code-403 .error-code {
    color: #ff9900;
}

.code-401 .error-code {
    color: #007bff;
}

.code-400 .error-code {
    color: #6c757d;
}

.glossary-flex-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .glossary-flex-container {
        flex-direction: row;
        align-items: stretch;
    }
}

/* Стили для блока с полями */
.glossary-meta-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: fit-content;
}

.glossary-meta-container .glossary-field {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.glossary-meta-container .glossary-field strong {
    color: #b20917;
    font-weight: bold;
}

/* Настройки для десктопа: поля слева, контент справа */
@media (min-width: 768px) {
    .glossary-meta-container {
        width: auto;
        min-width: 250px;
        max-width: 300px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .glossary-meta-container .glossary-field {
        margin-bottom: 0;
    }

    .glossary-meta-container .glossary-field {
        margin-bottom: 1rem;
    }

    .glossary-meta-container .glossary-field:last-child {
        margin-top: auto;
    }
}

/* Конкретное поле внутри блока */
.glossary-field {
    display: block;
    background-color: #1a1a1ac4 !important;
    /* Тёмный фон */
    border-left: 4px solid #b20917;
    /* Акцент слева */
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.glossary-field:hover {
    transform: translateX(2px);
}

/* Заголовок поля */
.glossary-field strong {
    font-weight: bold;
    color: #fff;
    /* Белый текст для заголовка */
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Текст внутри поля */
.glossary-field p,
.glossary-field span {
    color: #fff;
    /* Белый цвет текста */
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.person-link {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.person-link:hover {
    color: #ce0101;
}

/* Стили для социальных кнопок */
.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.3s ease-in-out;
}

.btn-social svg {
    fill: currentColor;
    vertical-align: middle;
    margin-right: 0.3rem;
}

.btn-social:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Facebook */
.btn-facebook {
    background-color: #1877f2;
    border-color: #1877f2;
}

.btn-facebook:hover {
    background-color: #166fe5;
}

/* ВКонтакте */
.btn-vk {
    background-color: #4c75a3;
    border-color: #4c75a3;
}

.btn-vk:hover {
    background-color: #45668e;
}

/* Twitter */
.btn-twitter {
    background-color: #1da1f2;
    border-color: #1da1f2;
}

.btn-twitter:hover {
    background-color: #1991db;
}

/* === МОБИЛЬНАЯ ВЕРСИЯ ШАПКИ (ТОЛЬКО ДЛЯ ГЛАВНОЙ) === */
@media (max-width: 768px) {

    /* Фон на весь экран */
    .custom-header {
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: none !important;
        overflow: visible !important;
        /* ← это важно! */
        padding: 0 !important;
    }

    /* Контейнер — гибкий */
    .header-container {
        height: 100%;
        padding: 0 15px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }

    /* Верхняя панель */
    .top-header-row {
        margin-top: env(safe-area-inset-top);
        width: 100%;
    }

    /* Центр */
    .header-center-text {
        position: static;
        transform: none;
        top: auto;
        left: auto;
        width: 100%;
        text-align: center;
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 10px;
    }

    .header-center-text {
        opacity: 0;
        animation: fadeInCenter 1s ease-out forwards;
    }

    @keyframes fadeInCenter {
        to {
            opacity: 1;
        }
    }

    /* Меню — без ограничений */
    .main-nav {
        position: static;
        width: 100%;
        padding: 20px 0 env(safe-area-inset-bottom);
        margin: 0;
    }

    .main-nav .nav-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        list-style: none;
        padding: 0;
        margin: 0;
        max-height: none;
        /* ← убираем ограничение */
        overflow-y: visible;
        /* ← отключаем скролл */
    }

    .main-nav .nav-link {
        font-size: 1.35rem;
        color: white;
        text-decoration: none;
        text-align: center;
        width: 100%;
        max-width: 280px;
        padding: 8px 0;
        text-transform: uppercase;
        font-weight: 500;
    }

    .main-nav .nav-link:hover {
        color: #ce0101;
    }

    .main-nav .nav-link::after {
        display: none;
    }
}

/* Средние экраны: планшеты и узкие десктопы */
@media (min-width: 769px) and (max-width: 1199px) {

    /* Отступы слева и справа для меню */
    .main-nav {
        left: 15px;
        right: 15px;
        width: auto;
        align-items: center;
    }

    .nav-item {
        align-content: center;
    }

    /* Центрируем список и добавляем отступы */
    .main-nav .nav-list {
        justify-content: center;
        gap: 24px;
        /* чуть больше расстояние между пунктами */
        padding: 0;
        line-height: 1.3;
    }

    /* Ограничиваем ширину контейнера меню, если нужно */
    .header-container {
        padding-left: 15px;
        padding-right: 15px;
    }
}