/* ========================================
   СТИЛИ ДЛЯ БЛОКА НОВОСТЕЙ
   ======================================== */

/* News Box - Image Frame Style (как у login-box) */
.news-box {
    position: relative;
    
    /* Размеры и отступы */
    width: 320px;
    padding: 20px;
    max-height: 450px;
    overflow-y: auto;
    z-index: 2;
    flex-shrink: 0;

    /* --- НАСТРОЙКА РАМКИ-КАРТИНКИ (как у login-box) --- */
    border: 25px solid transparent;
    border-image-source: url('/templates/kertas/assets/img/login.png');
    border-image-slice: 30% fill;
    border-image-repeat: stretch;
    border-radius: 0;
    
    /* Темный полупрозрачный фон для читаемости текста */
    background-color: rgba(40, 40, 40, 0.9);
    background-clip: padding-box;

    /* Стили скроллбара */
    scrollbar-width: thin;
    scrollbar-color: #B49A88 rgba(0, 0, 0, 0.2);
}

/* Заголовок новостей */
.news-box-title {
    color: #fff;
    font-family: "Tahoma", sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #B49A88;
    text-align: center;
    letter-spacing: 1px;
}

/* Отдельная новость */
.news-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(180, 154, 136, 0.3);
}

.news-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Шапка новости (заголовок + дата) */
.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

/* Заголовок новости */
.news-item-title {
    color: #fff;
    font-family: "Tahoma", sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

/* Дата новости */
.news-item-date {
    color: #B49A88;
    font-family: "Tahoma", sans-serif;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(180, 154, 136, 0.15);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid rgba(180, 154, 136, 0.2);
}

/* Контент новости */
.news-item-content {
    color: #ddd;
    font-family: "Tahoma", sans-serif;
    font-size: 11px;
    line-height: 1.6;
    margin: 0;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Списки в новостях */
.news-item-content ul,
.news-item-content ol {
    margin: 8px 0 8px 20px;
    padding: 0;
}

.news-item-content li {
    margin: 4px 0;
    padding-left: 5px;
    color: #ddd;
    list-style-type: disc;
}

.news-item-content li::marker {
    color: #B49A88;
}

/* Жирный текст в новостях */
.news-item-content strong,
.news-item-content b {
    color: #B49A88;
    font-weight: bold;
}

/* Заголовки внутри контента */
.news-item-content h4 {
    color: #B49A88;
    margin: 8px 0 4px 0;
    font-size: 13px;
    font-weight: 700;
}

/* Разделители в новостях */
.news-item-content hr {
    border: none;
    border-top: 1px solid rgba(180, 154, 136, 0.2);
    margin: 8px 0;
}

/* ========================================
   СТИЛИ ДЛЯ СКРОЛЛА НОВОСТЕЙ
   ======================================== */

/* Кастомный скроллбар для Webkit (Chrome, Safari, Edge) */
.news-box::-webkit-scrollbar {
    width: 6px;
}

.news-box::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.news-box::-webkit-scrollbar-thumb {
    background: #B49A88;
    border-radius: 3px;
}

.news-box::-webkit-scrollbar-thumb:hover {
    background: #a08a7a;
}

/* ========================================
   ОСОБЫЕ СТИЛИ ДЛЯ НОВОСТЕЙ
   ======================================== */

/* Стиль для новостей с пометкой "Важно" */
.news-item:has(.news-item-date:contains("Важно")) {
    border-left: 3px solid #ff6b6b;
    padding-left: 15px;
}

.news-item:has(.news-item-date:contains("Важно")) .news-item-title {
    color: #ff6b6b;
}

.news-item:has(.news-item-date:contains("Важно")) .news-item-date {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
    background: rgba(255, 107, 107, 0.15);
}

/* Первая новость (самая важная) */
.news-item:first-child {
    border-left: 3px solid #B49A88;
    padding-left: 15px;
}

/* ========================================
   АНИМАЦИЯ НОВОСТЕЙ
   ======================================== */

.news-item {
    animation: fadeInNews 0.5s ease-in-out;
}

@keyframes fadeInNews {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   АДАПТИВ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ======================================== */

@media (max-width: 768px) {
    .news-box {
        width: 100% !important;
        max-width: 350px !important;
        max-height: 60vh !important;
        padding: 15px !important;
        border: 20px solid transparent !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .news-item-title {
        font-size: 13px !important;
    }
    
    .news-item-content {
        font-size: 10px !important;
        line-height: 1.5 !important;
    }
    
    .news-item-date {
        font-size: 9px !important;
    }
    
    .news-box-title {
        font-size: 14px !important;
    }
}