/* ========================================================= */
/* --- ОБЩИЕ СТИЛИ ШАПКИ (ДЛЯ ВСЕХ ЭКРАНОВ) --- */
/* ========================================================= */
.container-header {
    background-color: #3f3e82 !important; 
    background-image: none !important; 
    box-sizing: border-box !important;
}

/* Убиваем стандартные рамки и псевдоэлементы везде */
.container-header .mod-menu > li > a::after,
.container-header .mod-menu > li > a::before,
.container-header .nav-item > a::after,
.container-header .nav-item > a::before,
.container-header .mod-menu > li::after,
.container-header .mod-menu > li::before {
    display: none !important;
    content: none !important;
}

/* Общие шрифты ссылок */
.container-header .mod-menu > li > a,
.container-header .nav-link {
    color: #ffffff !important;
    font-family: 'Comfortaa', sans-serif !important;
    font-weight: 300 !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.container-header .mod-menu > li > a:hover,
.container-header .nav-link:hover,
.container-header .mod-menu > li.active > a,
.container-header .nav-item.active > a {
    color: #dddddd !important;
    text-decoration: underline !important; 
    text-decoration-thickness: 1px !important;
    text-underline-offset: 6px !important;
}

/* ========================================================= */
/* --- МОБИЛЬНАЯ ВЕРСИЯ (до 1150px) --- */
/* ========================================================= */
@media (max-width: 1150px) {
    /* 1. Прячем графику */
    .container-header .search,
    .container-header .container-search,
    .container-header .mod-custom,
    .container-header .grid-child:nth-child(3) {
        display: none !important;
    }

    /* 2. Шапка - гибкая строка */
    .container-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important; 
        justify-content: space-between !important;
        
        align-items: flex-start !important; 
        
        padding: 10px 20px !important;
    }

    /* Контейнер Логотипа */
    .container-header > div:first-child,
    .container-header .navbar-brand {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 70% !important; 
        margin-top: 0 !important; 
    }

  /* Жестко фиксируем размер герба на мобилках и запрещаем его сжимать */
    .container-header .navbar-brand img,
    .container-header > div:first-child img {
        width: 90px !important; /* Меняйте цифру, чтобы сделать идеальный размер для телефона */
        min-width: 90px !important; /* Запрещаем сплющиваться */
        height: auto !important;
        max-height: none !important;
        flex-shrink: 0 !important;
    }

    /* Блок с меню */
    .container-header .container-nav {
        flex: 1 1 auto !important;
        width: auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Каркас меню */
    .container-header .navbar {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
    }

    /* 3. Кнопка-гамбургер */
    .navbar-toggler {
        background-color: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
        margin-left: auto !important;
        margin-top: 25px !important;
        margin-bottom: 0 !important;
        display: inline-flex !important; 
    }
    
    .navbar-toggler-icon {
        filter: invert(1) !important; 
    }

    /* 4. Раскрытое меню (падает под шапку) */
    .container-header .navbar-collapse {
        width: 100% !important;
        flex-basis: 100% !important;
        margin-top: 20px !important; /* Отступ от логотипа и кнопки вниз */
    }

    /* ЖЕСТКО ГАСИМ ДЕСКТОПНЫЙ РЕЖИМ BOOTSTRAP В ПРОМЕЖУТКЕ 992-1150px */
    .container-header .navbar-collapse:not(.show) {
        display: none !important; /* Меню скрыто, пока нет системного класса .show */
    }

    .container-header .navbar-collapse.show {
        display: block !important; /* Показываем только по клику на гамбургер */
    }

    .container-header .mod-menu {
        display: flex !important;
        flex-direction: column !important; 
        align-items: flex-start !important;
        width: 100% !important;
    }

    .container-header .mod-menu > li {
        width: 100% !important;
    }

    /* Дизайн ссылок на телефоне */
    .container-header .mod-menu > li > a,
    .container-header .nav-link {
        padding: 15px 10px !important;
        font-size: 1.2rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Убираем разделители на телефоне */
    .container-header .mod-menu > li + li::before,
    .container-header .nav-item + .nav-item::before {
        display: none !important;
    }
}

/* ========================================================= */
/* --- ДЕСКТОПНАЯ ВЕРСИЯ (от 1151px) --- */
/* ========================================================= */
@media (min-width: 1151px) {
    /* Главная сетка: ровно 2 колонки (Логотип и Контейнер с навигацией) */
    .container-header {
        display: grid !important;
        grid-template-columns: max-content 1fr !important; 
        align-items: center !important;
        gap: 5px !important;
        padding: 10px 20px !important;
        width: 100% !important;
    }

    /* Вторая колонка (внутри неё и меню, и портрет) */
    .container-header .container-nav {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important; /* Меню прижимается влево, к логотипу */
        width: 100% !important;
    }

    .container-header .mod-menu,
    .container-header .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .container-header .mod-menu > li,
    .container-header .nav-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .container-header .mod-menu > li > a,
    .container-header .nav-link {
        font-size: 1.1rem !important;
        padding: 0 !important; 
        margin: 0 !important;
        display: inline-block !important;
    }

    /* Разделители | */
    .container-header .mod-menu > li + li::before,
    .container-header .nav-item + .nav-item::before {
        content: "|" !important;
        color: #ffffff !important;
        font-weight: 300 !important;
        display: inline-block !important;
        margin: 0 15px !important;
        position: static !important;
    }

    /* ВОТ ОНО: Толкаем графику Алферова вправо ВНУТРИ контейнера навигации */
    .container-header .container-nav .mod-custom,
    .container-header .container-nav > div:not(.navbar) {
        margin-left: auto !important; /* Эта пружина выдавит портрет в край экрана */
        display: flex !important;
        align-items: center !important;
    }
}

/* ========================================================= */
/* --- ВНЕШНИЙ ВИД КАРТОЧЕК (БЛОГ КАТЕГОРИИ ВЫСТАВОК) --- */
/* ========================================================= */

/* ========================================================= */
/* --- УМНАЯ 3-КОЛОНОЧНАЯ СЕТКА ЖУРНАЛЬНОГО ТИПА --- */
/* ========================================================= */
@media (min-width: 992px) {
    .blog-items {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 25px !important;
        align-items: start !important;
    }

    /* Первая карточка (САМАЯ БОЛЬШАЯ) */
    .blog-items > .blog-item:nth-child(1) {
        grid-column: span 2 !important;
        grid-row: span 2 !important;
    }

    /* Увеличиваем заголовок только у первой карточки */
    .blog-items > .blog-item:nth-child(1) .page-header h2 a {
        font-size: 1.8rem !important;
    }
}

/* Мобильная версия: всё в один столбик */
@media (max-width: 991px) {
    .blog-items {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
    }
}

/* 1. Настройка фотографий (Квадрат и скругления) */
.blog-item .item-image {
    margin-bottom: 15px; /* Отступ от картинки до текста */
}

.blog-item .item-image img {
    width: 100% !important;
    height: auto !important; /* Позволяет картинке принять свой настоящий размер */
    object-fit: cover !important;
    border-radius: 15px !important; /* Оставляем ваше красивое скругление */
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* Оставляем вашу тень */
    transition: transform 0.3s ease;
}

/* Картинка приподнимается при наведении на ЛЮБУЮ часть карточки */
.blog-item:hover .item-image img {
    transform: translateY(-5px);
}

/* 2. Настройка заголовка (Шрифт, цвет, отсутствие подчеркивания) */
.blog-item .page-header {
    margin: 0 0 5px 0 !important;
    padding: 0 !important;
    border: none !important;
}

.blog-item .page-header h2 {
    font-size: 20px !important;
    margin: 0 !important;
    line-height: 1.2;
}

.blog-item .page-header h2 a {
    color: #2C1F57 !important; /* Темно-фиолетовый/баклажановый цвет из макета */
    font-family: 'Comfortaa', sans-serif !important;
    font-weight: 700 !important; /* Жирный текст */
    text-decoration: none !important; /* Убирает дефолтное синее подчеркивание */
}

.blog-item .page-header h2 a:hover {
    color: #6a4991 !important; 
}

/* 3. Настройка серого текста под заголовком (Информация о статье) */
.blog-item .article-info {
    font-size: 0.85rem;
    color: #888888;
    font-family: 'Comfortaa', sans-serif;
    margin: 0;
    padding: 0;
}



/* Убираем лишние иконки у метаданных Cassiopeia */
.blog-item .article-info span[class^="icon-"] {
    display: none !important;
}

.blog-item .article-info dd {
    display: inline-block;
    margin-right: 5px;
}

/* ========================================================= */
/* --- ЗАГОЛОВОК СТРАНИЦЫ (ВИРТУАЛЬНЫЕ ВЫСТАВКИ) --- */
/* ========================================================= */

/* Обнуляем отступ у самого контейнера, чтобы он не ломал карточки */
.blog .page-header {
    border-bottom: none !important; 
    margin-bottom: 0 !important; 
    padding-bottom: 0 !important;
}

/* Отступ до карточек (30px) задаем ТОЛЬКО главному тексту (H1) */
.blog .page-header h1 {
    font-family: 'Comfortaa', sans-serif !important;
    color: #5b3679 !important; 
    font-weight: 700 !important; 
    text-transform: uppercase !important; 
    font-size: 2.2rem !important; 
    margin-top: 20px !important;
    margin-bottom: 30px !important; /* Вот он, отступ только для H1 */
}

/* Жестко прижимаем название выставки к автору в самих карточках */
.blog-item .page-header h2 {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.blog-item .item-info,
.blog-item dl.article-info {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ========================================================= */
/* --- СТИЛИ ДЛЯ ВНУТРЕННЕЙ СТРАНИЦЫ ВЫСТАВКИ --- */
/* ========================================================= */

/* 1. Главный фиолетовый заголовок (ВИРТУАЛЬНЫЕ ВЫСТАВКИ) внутри статьи */
.item-page .page-header {
    border-bottom: none !important;
}

.item-page .page-header h1 {
    font-family: 'Comfortaa', sans-serif !important;
    color: #5b3679 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 2.2rem !important;
    margin-top: 20px !important;
    margin-bottom: 30px !important;
}

/* 2. Название самой выставки (StarDust) */
.item-page .page-header h2 {
    color: #432a5e !important;
    font-family: 'Comfortaa', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.8rem !important; /* Чуть крупнее, чем на карточках */
    margin-top: 0 !important;
    margin-bottom: 5px !important;
}

/* 3. Блок автора внутри статьи (убираем иконку, настраиваем шрифт) */
.item-page dl.article-info {
    margin-top: 0 !important;
    margin-bottom: 25px !important;
}

.item-page .article-info span[class^="icon-"] {
    display: none !important; /* Прячем системную иконку человечка */
}

.item-page .article-info dd {
    font-size: 0.85rem !important;
    color: #888888 !important;
    font-family: 'Comfortaa', sans-serif !important;
    margin: 0 !important;
}

/* ========================================================= */
/* --- КЛИКАБЕЛЬНОСТЬ ВСЕЙ КАРТОЧКИ --- */
/* ========================================================= */

/* Делаем карточку опорным контейнером для невидимой ссылки */
.blog-item {
    position: relative !important;
}

/* Растягиваем ссылку из заголовка на 100% ширины и высоты карточки */
.blog-item .page-header h2 a::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
}

/* ========================================================= */
/* --- КЛИКАБЕЛЬНЫЙ ГЛАВНЫЙ ЗАГОЛОВОК --- */
/* ========================================================= */

/* Убираем синий цвет и подчеркивание у ссылки */
.page-header h1 a,
.category-name a,
h1.page-title a,
h1[itemprop="name"] a {
    color: #5b3679 !important; /* Наш фирменный фиолетовый цвет */
    font-family: 'Comfortaa', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: opacity 0.2s ease !important; /* Плавная анимация */
}

/* Добавляем легкое потускнение при наведении, чтобы человек понял, что это кнопка */
.page-header h1 a:hover,
.category-name a:hover,
h1.page-title a:hover,
h1[itemprop="name"] a:hover {
    opacity: 0.7 !important;
    text-decoration: none !important;
}

/* ========================================================= */
/* --- НАСТРОЙКА РАЗМЕРА И ПОЗИЦИИ ГЕРБА (ДЛЯ ПК) --- */
/* ========================================================= */

/* 1. Делаем герб больше (снимаем лимиты шаблона Cassiopeia) */
.container-header .navbar-brand img,
.container-header > div:first-child img {
    width: 100px !important; 
    height: auto !important;
    max-height: none !important; 
}

/* 2. Возвращаем элементы к краям экрана */
@media (min-width: 1021px) {
    /* Обнуляем огромный левый отступ, возвращая герб на базу */
    .container-header > div:first-child,
    .container-header .navbar-brand {
        margin-left: 0 !important; 
    }

    /* Возвращаем Алферова к правому краю */
    .container-header > .mod-custom,
    .container-header > div:nth-child(3),
    .container-header > div:last-child {
        margin-right: 0 !important; 
    }
}