/* ==========================================================================
   ИЗОЛИРОВАННЫЕ СТИЛИ ДЛЯ БЛОКА НОВОСТЕЙ (ВТОРОЙ CONTENT_BOX)
   ========================================================================== */

/* Контейнер новостного блока */
#content_main > .content_box:nth-of-type(2) {
    border: none !important; box-shadow: none !important;
    padding: 0 !important; margin: 0 0 35px 0 !important; width: 100% !important;
    overflow: visible !important; /* Гарантирует, что внешние тени не будут обрезаться по краям */
}

/* Сброс ограничений ТОЛЬКО для контейнеров контента (ajax__tab_body) и его внутренностей */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body,
#content_main > .content_box:nth-of-type(2) .ajax__tab_body [id*="CardView"],
#content_main > .content_box:nth-of-type(2) .ajax__tab_body table,
#content_main > .content_box:nth-of-type(2) .ajax__tab_body tbody,
#content_main > .content_box:nth-of-type(2) .ajax__tab_body tr,
#content_main > .content_box:nth-of-type(2) .ajax__tab_body ul {
    display: block !important; 
    width: 100% !important; 
    border: none !important; 
    padding: 0 0 10px 0 !important; /* Отступ снизу, чтобы нижней тени карточек хватало места */
    margin: 0 !important;
    font-size: 0 !important;
    text-align: left !important;
    overflow: visible !important; /* Разрешаем отображение теней за пределами контейнера */
}

/* Скрываем только пустые технические ячейки разметки платформы */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body td:not(.excerpt):empty {
    display: none !important;
}

/* Стилизация и центрирование системной кнопки "Архив" под сеткой */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body td:not(.excerpt) {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    text-align: center !important;
    margin-top: 20px !important;
}

/* Превращаем стандартную ссылку архива в красивую современную кнопку */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body td:not(.excerpt) a {
    display: inline-block !important;
    padding: 10px 24px !important;
    background: #f0f4f8 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #003366 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
}
#content_main > .content_box:nth-of-type(2) .ajax__tab_body td:not(.excerpt) a:hover {
    background: #003366 !important;
    color: #ffffff !important;
    border-color: #003366 !important;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.15) !important;
}

/* Карточка новости — Инлайн-блочная сетка с выверенными отступами (Компьютеры) */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body .excerpt {
    display: inline-flex !important; 
    flex-direction: column !important;
    vertical-align: top !important;
    width: calc(33.333% - 9.34px) !important; /* Точный расчет под отступ 14px */
    max-width: calc(33.333% - 9.34px) !important; 
    min-width: 240px !important;
    height: 285px !important; 
    background: #ffffff !important; 
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important; 
    overflow: hidden !important; 
    position: relative !important; 
    box-sizing: border-box !important; 
    margin: 24px 14px 0px 0 !important; /* Отступ 14px задан справа и снизу для идеальной симметрии */
    padding: 0 !important;
    font-size: 14px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* Обнуляем правый маржин для каждой третьей карточки в ряду (Компьютеры) */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body .excerpt:nth-of-type(3n) {
    margin-right: 0 !important;
}

/* Эффект приподнимания и тени при наведении на карточку */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body .excerpt:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05) !important;
    border-color: #cbd5e1 !important;
}

/* Превью-зона (Изображение / Календарь) внутри новостей */
#content_main > .content_box:nth-of-type(2) .excerpt_preview_new, 
#content_main > .content_box:nth-of-type(2) .excerpt_preview_new > a {
    width: 100% !important; height: 135px !important; display: block !important; border: none !important; margin: 0 !important; padding: 0 !important;
}
#content_main > .content_box:nth-of-type(2) .excerpt_preview_new img {
    width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important;
}

/* Жестко фиксированный размер превью-календаря для RSS */
#content_main > .content_box:nth-of-type(2) .rss_preview_new {
    background: linear-gradient(135deg, #003366, #3182ce) !important;
    height: 135px !important; width: 100% !important;
    display: block !important;
}
#content_main > .content_box:nth-of-type(2) .rss_preview_new > a {
    display: flex !important; align-items: center !important; justify-content: center !important; 
    height: 100% !important; width: 100% !important; text-decoration: none !important;
}

/* Жестко фиксированный блок календаря внутри RSS */
#content_main > .content_box:nth-of-type(2) .rss_calendar_box { 
    display: flex !important; flex-direction: column !important; color: #ffffff !important; 
    text-align: center !important; line-height: 1.1 !important; 
    width: 100% !important; max-width: 100% !important; min-width: 100% !important;
    height: auto !important; box-sizing: border-box !important;
}
#content_main > .content_box:nth-of-type(2) .cal_day { font-size: 26px !important; font-weight: 800 !important; display: block !important; }
#content_main > .content_box:nth-of-type(2) .cal_month { font-size: 11px !important; font-weight: 700 !important; letter-spacing: 1px !important; display: block !important; margin: 3px 0 !important; }
#content_main > .content_box:nth-of-type(2) .cal_year { font-size: 11px !important; font-weight: 500 !important; opacity: 0.7; display: block !important; }

/* Текстовый блок внутри карточки новостей */
#content_main > .content_box:nth-of-type(2) .excerpt_content_new {
    display: flex !important; flex-direction: column !important;
    padding: 14px !important; box-sizing: border-box !important;
    width: 100% !important; height: calc(100% - 135px) !important;
}

/* Дата публикации (только на 1-й вкладке) */
#content_main > .content_box:nth-of-type(2) .excerpt_content_new .date {
    font-size: 11px !important; font-weight: 700 !important; color: #2563eb !important; 
    text-transform: uppercase !important; margin-bottom: 6px !important; display: inline-block !important;
}

/* Заголовок новости */
#content_main > .content_box:nth-of-type(2) .excerpt_content_new h2 {
    margin: 0 0 auto 0 !important; padding: 0 !important; display: block !important;
}
#content_main > .content_box:nth-of-type(2) .excerpt_content_new h2 a {
    display: -webkit-box !important; -webkit-line-clamp: 3 !important; -webkit-box-orient: vertical !important;
    overflow: hidden !important; text-overflow: ellipsis !important;
    font-size: 13px !important; font-weight: 600 !important; line-height: 1.4 !important;
    color: #1e293b !important; text-decoration: none !important;
}
#content_main > .content_box:nth-of-type(2) .excerpt_content_new h2 a:hover { color: #003366 !important; }

/* Превращаем ссылку "Читать далее" в синюю плашку со скошенным краем в углу */
#content_main > .content_box:nth-of-type(2) .read_more_new {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    
    /* Размеры плашки и внутренние отступы для текста */
    padding: 12px 14px 6px 45px !important; /* Большой отступ слева, чтобы текст не заезжал на скос */
    background: #003366 !important; /* Темно-синий цвет, сочетающийся с дизайном */
    
    /* Стилизация текста */
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-decoration: none !important;
    
    /* Срезаем левый верхний угол по диагонали (создаем скос через clip-path) */
    clip-path: polygon(35px 0, 100% 0, 100% 100%, 0 100%) !important;
    
    /* Изначально скрываем плашку и смещаем для красивой анимации выплывания */
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(5px) !important; 
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease !important;
    z-index: 10 !important;
}

/* При наведении на саму карточку новости (.excerpt) — плавно проявляем и приподнимаем плашку */
#content_main > .content_box:nth-of-type(2) .ajax__tab_body .excerpt:hover .read_more_new {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Эффект при наведении курсора непосредственно на саму синюю плашку */
#content_main > .content_box:nth-of-type(2) .read_more_new:hover {
    background: #2563eb !important; /* При наведении подсвечиваем ярко-синим */
    color: #ffffff !important;
}

/* ==========================================================================
   АДАПТИВНОСТЬ: МОБИЛЬНЫЕ ТЕЛЕФОНЫ И ПЛАНШЕТЫ (МЕНЕЕ 768px)
   ========================================================================== */
@media screen and (max-width: 767px) {
    /* Перестраиваем карточки новостей в одну колонку на мобильных экранах */
    #content_main > .content_box:nth-of-type(2) .ajax__tab_body .excerpt {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 16px 0 0 0 !important; /* Отступы только вертикальные, боковые обнуляем */
    }
}
