/* ============================================
   ГРУППА 1: БАЗОВЫЕ НАСТРОЙКИ ШРИФТА
   ============================================ */
body {
    font-size: 18px !important;
    line-height: 1.6 !important;
}

@media (max-width: 992px) {
    body { font-size: 16px !important; }
}

@media (max-width: 768px) {
    body { font-size: 15px !important; }
}


/* ============================================
   ГРУППА 2: ШАПКА И МЕНЮ (ДЕСКТОП)
   ============================================ */
.header.container-header {
    max-width: 1320px;
    width: calc(100% - 30px);
    margin-left: auto;
    margin-right: auto;
    padding: 15px 30px;
    background-image: linear-gradient(135deg, var(--cassiopeia-color-primary) 0%, var(--cassiopeia-color-hover) 100%);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 100;
}

.header-logo img,
.navbar-brand img {
    max-height: 55px;
    width: auto;
}

.mod-menu {
    display: flex !important;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-item a {
    display: block;
    padding: 12px 24px;
    color: #fff !important;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border-radius: 40px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-item.active a,
.nav-item.current a {
    background: linear-gradient(135deg, #f5af19, #f39c12);
    color: #fff !important;
    font-weight: 800;
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4);
    text-shadow: 1px 2px #232323;
}

.jmodedit {
    display: none !important;
}


/* ============================================
   ГРУППА 3: БУРГЕР-МЕНЮ (МОБИЛЬНЫЕ)
   ============================================ */
.navbar-toggler {
    display: none;
}

@media (max-width: 768px) {
    .header-main {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .navbar-toggler {
        display: block !important;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 8px;
        width: 44px;
        height: 44px;
        cursor: pointer;
        position: relative;
    }

    .navbar-toggler span {
        display: block;
        position: absolute;
        width: 24px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        left: 10px;
        transition: all 0.3s ease;
    }

    .navbar-toggler span:first-child   { top: 13px; }
    .navbar-toggler span:nth-child(2) { top: 21px; }
    .navbar-toggler span:last-child    { top: 29px; }

    .navbar-toggler.active span:first-child {
        transform: rotate(45deg);
        top: 21px;
    }

    .navbar-toggler.active span:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggler.active span:last-child {
        transform: rotate(-45deg);
        top: 21px;
    }

    .menu-wrapper {
        position: absolute;
        top: 100%;
        right: 0;
        width: 280px;
        background: linear-gradient(135deg, #1a252f, #2c3e50);
        border-radius: 15px;
        margin-top: 10px;
        padding: 10px;
        display: none;
        z-index: 1000;
    }

    .menu-wrapper.show {
        display: block;
    }

    .mod-menu {
        flex-direction: column !important;
        gap: 5px !important;
    }

    .nav-item a {
        text-align: center;
        padding: 12px 20px;
    }

    .header-logo img {
        max-height: 40px;
    }
}


/* ============================================
   ГРУППА 4: ПЛАНШЕТНАЯ АДАПТАЦИЯ МЕНЮ
   ============================================ */
@media (min-width: 769px) and (max-width: 992px) {
    .mod-menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: right !important;
        gap: 8px !important;
        width: auto !important;
        max-width: 100% !important;
    }

    .mod-menu .nav-item {
        display: inline-block !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .nav-item a {
        display: inline-block !important;
        padding: 8px 10px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
    }
}


/* ============================================
   ГРУППА 5: ИНФОРМАЦИЯ О МАТЕРИАЛЕ
   ============================================ */
.article-info {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin: 15px 0 !important;
    padding: 10px 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.article-info dd {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 14px !important;
    color: #666 !important;
}

.article-info dd span[class*="icon-"] {
    color: #f39c12 !important;
    font-size: 14px !important;
}

.article-info .published,
.article-info .modified {
    background: #f0f0f0;
    padding: 5px 12px !important;
    border-radius: 20px;
}

.article-info .hits {
    background: #f0f0f0;
    padding: 5px 12px !important;
    border-radius: 20px;
}

.article-info-term {
    display: none;
}


/* ============================================
   ГРУППА 6: ЗАГОЛОВКИ
   ============================================ */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75em;
}

h1, .h1 {
    font-size: 2.2rem;
    font-weight: 800;
}

h2, .h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

h3, .h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4, .h4 {
    font-size: 1.3rem;
    font-weight: 600;
}

h5, .h5 {
    font-size: 1.1rem;
    font-weight: 600;
}

h6, .h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

@media (max-width: 768px) {
    h1, .h1 { font-size: 1.6rem; }
    h2, .h2 { font-size: 1.4rem; }
    h3, .h3 { font-size: 1.2rem; }
}


/* ============================================
   ГРУППА 7: КОНТЕЙНЕР КОМПОНЕНТА
   ============================================ */
.container-component {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.container-component:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .container-component {
        padding: 0 5px;
    }
}

.card {
    border: none;
    background: none;
}

.card-body {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header {
    background: #dca63a;
    border-bottom: 2px solid #ad7410;
    border-radius: 25px !important;
    margin-bottom: 10px;
    color: #fff;
}


/* ============================================
   ГРУППА 8: ФУТЕР
   ============================================ */
.footer.container-footer {
    background: linear-gradient(135deg, #1a252f 0%, #0f171e 100%);
    color: #adb5bd;
    margin-top: 50px;
    padding: 40px 0 20px;
    border-top: 3px solid #f39c12;
}

.footer.container-footer .grid-child {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer.container-footer,
.footer.container-footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer.container-footer a:hover {
    color: #f39c12;
}

.footer .mod-menu {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer .mod-menu .nav-item {
    list-style: none;
}

.footer .small,
.footer small {
    font-size: 13px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer.container-footer {
        margin-top: 30px;
        padding: 30px 0 15px;
    }

    .footer.container-footer .grid-child {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer .mod-menu {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}


/* ============================================
   ГРУППА 9: CSS АККОРДЕОН
   ============================================ */
.css-accordion {
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.css-accordion-item {
    border: 1px solid var(--border-color, #dfe3e7);
    border-bottom: none;
}

.css-accordion-item:last-child {
    border-bottom: 1px solid var(--border-color, #dfe3e7);
}

.css-accordion-header {
    margin: 0;
}

.css-accordion-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 500;
    text-align: left;
    background-color: var(--body-bg, #fff);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.css-accordion-button:hover {
    background-color: var(--accordion-active-bg, #e7e9ee);
}

.css-accordion-button:after {
    content: "+";
    font-size: 1.5rem;
    font-weight: normal;
    transition: transform 0.2s ease;
}

.css-accordion-checkbox {
    display: none;
}

.css-accordion-checkbox:checked + .css-accordion-header .css-accordion-button:after {
    content: "−";
}

.css-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--body-bg, #fff);
}

.css-accordion-checkbox:checked + .css-accordion-header + .css-accordion-content {
    max-height: 400px;
    transition: max-height 0.3s ease-in;
}

.css-accordion-body {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, #dfe3e7);
}

@media (max-width: 768px) {
    .css-accordion-button {
        padding: 0.875rem 1rem;
        font-size: 1.1rem;
    }

    .css-accordion-body {
        padding: 0.875rem 1rem;
    }
}


/* ============================================
   ГРУППА 10: СТИЛИ ДЛЯ КНОПОК И ПАГИНАЦИИ
   ============================================ */
.btn {
    border-radius: 30px !important;
    padding: 8px 20px !important;
    transition: all 0.3s ease !important;
}

.pagination .page-link {
    border-radius: 30px !important;
    margin: 0 3px !important;
    color: #2c3e50 !important;
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
}

.pagination .page-link:hover {
    background: #f39c12 !important;
    color: #fff !important;
    border-color: #f39c12 !important;
}

.pagination .active .page-link {
    background: #f39c12 !important;
    color: #fff !important;
    border-color: #f39c12 !important;
}

.btn-primary {
    background: #f39c12 !important;
    border-color: #f39c12 !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: #e67e22 !important;
    border-color: #e67e22 !important;
    transform: translateY(-2px) !important;
}


/* ============================================
   ГРУППА 11: КРАСИВОЕ ОФОРМЛЕНИЕ СТАТЕЙ / БЛОГА
   ============================================ */
.mod-articles-item,
.blog-item {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mod-articles-item:hover,
.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.mod-articles-image,
.blog-item .item-image {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.mod-articles-image img,
.blog-item .item-image img {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

.mod-articles-item:hover .mod-articles-image img,
.blog-item:hover .item-image img {
    transform: scale(1.03);
}

.blog-item .page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    padding: 0;
}

.mod-articles-title a,
.blog-item .page-header h2 a {
    color: #1a252f;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mod-articles-title a:hover,
.blog-item .page-header h2 a:hover {
    color: #f39c12;
}

.mod-articles-item-content,
.blog-item .item-content {
    padding: 15px;
}

.mod-articles-item-content .lead {
    font-size: 1rem;
    line-height: 1.5;
    color: #4a5568;
    margin-bottom: 20px;
}

.mod-articles-readmore,
.blog-item .readmore a {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 24px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #ffffff !important;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.mod-articles-readmore:hover,
.blog-item .readmore a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.mod-articles-info,
.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 13px;
    color: #6c757d;
}

.mod-articles-info span,
.article-info dd {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mod-articles-info i,
.article-info span[class*="icon-"] {
    color: #f39c12;
}

.mod-articles-category,
.blog-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

@media (max-width: 768px) {
    .mod-articles-item-content,
    .blog-item .item-content {
        padding: 20px;
    }

    .mod-articles-title,
    .blog-item .page-header h2 {
        font-size: 1.3rem;
    }

    .mod-articles-category,
    .blog-items {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}


/* ============================================
   ГРУППА 12: ОБЩИЕ СТИЛИ
   ============================================ */
img {
    border-radius: 15px;
}

body {
    background: #f5f5f5;
}
/* ============================================
   УМЕНЬШЕНИЕ ТЕКСТА ОПИСАНИЯ В КАРТОЧКАХ СТАТЕЙ
   ============================================ */

/* Уменьшаем заголовок H2 */
.blog-item .page-header h2 {
    font-size: 1.25rem ;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Уменьшаем информацию о материале */
.blog-item .article-info {
    font-size: 11px;
    margin: 5px 0 10px 0;
}

.blog-item .article-info dd {
    font-size: 11px;
    padding: 2px 8px;
}

/* Уменьшаем текст описания — ТОЧНЫЙ СЕЛЕКТОР */
.blog-item .item-content > p,
.blog-item .item-content p:last-of-type {
    font-size: 15px;
    line-height: 1.45;
    margin: 8px 0 0 0;
    color: #4a5568;
}

/* Если текст обёрнут в div или другой контейнер */
.blog-item .item-content {
    font-size: 15px;
}

/* Дополнительный селектор для текста после article-info */
.blog-item .item-content :not(h2):not(dl):not(.article-info):not(dt):not(dd) {
    font-size: 15px;
}
/* Кнопка "Подробнее" — оранжевая */
.readmore .btn-secondary {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    color: #ffffff ;
    border-radius: 40px;
    padding: 8px 24px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
	text-shadow: 1px 2px #ac730f;
}

.readmore .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.readmore .btn-secondary:active {
    transform: translateY(1px);
}
/* Переключение модуля статей в 2 колонки на планшетах */
@media (min-width: 768px) and (max-width: 991px) {
    .mod-articles-category .mod-articles-category-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}
/* ========================================
   АДАПТИВНАЯ СЕТКА БЛОГА (БЕЗ !important)
   ======================================== */

/* Мобильные телефоны < 576px — 1 колонка */
@media (max-width: 575px) {
    .blog-items.columns-3 {
        display: block;
    }
    
    .blog-items.columns-3 .blog-item {
        width: 100%;
        margin-bottom: 30px;
    }
}

/* Планшеты 576px — 991px — 2 колонки */
@media (min-width: 576px) and (max-width: 991px) {
    .blog-items.columns-3 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .blog-items.columns-3 .blog-item {
        width: auto;
        margin: 0;
    }
}

/* ========================================
   МОДУЛЬ СТАТЕЙ: 2 КОЛОНКИ НА ПЛАНШЕТАХ
   ======================================== */

@media (min-width: 563px) and (max-width: 991px) {
    /* Сам список статей */
    .mod-articles-items.mod-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        list-style: none;
        padding: 0;
    }
    
    /* Каждый элемент списка */
    .mod-articles-items.mod-list > li {
        width: 100%;
        margin: 0;
        padding: 0;
        display: block;
    }
    
    /* Адаптивные изображения */
    .mod-articles-items.mod-list .mod-articles-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }
}
/* ========================================
   СТИЛИЗАЦИЯ КНОПОК СЛАЙДЕРА (CAROUSEL)
   ======================================== */

/* Кнопки "Вперёд" и "Назад" */
.carousel-control-prev,
.carousel-control-next {
    width: 10%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel:hover .carousel-control-prev,
.carousel:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(243, 156, 18, 0.8);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    background-size: 60% 60%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
    background-color: #f39c12;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(243,156,18,0.4);
}

/* Индикаторы (точки/полоски внизу) */
.carousel-indicators {
    bottom: 15px;
    margin-bottom: 0;
}

.carousel-indicators [data-bs-target] {
    width: 40px;
    height: 4px;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.carousel-indicators [data-bs-target]:hover {
    background-color: rgba(243, 156, 18, 0.8);
    transform: scaleY(1.2);
}

.carousel-indicators .active {
    background-color: #f39c12;
    width: 50px;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 35px;
        height: 35px;
    }
    
    .carousel-indicators [data-bs-target] {
        width: 25px;
        height: 3px;
    }
    
    .carousel-indicators .active {
        width: 35px;
    }
}
