/* --- СТИЛИ ДЛЯ ВИДЖЕТА НОВОСТЕЙ (КАРУСЕЛЬ) --- */

/* ИСПРАВЛЕНИЕ 1: Убираем внутренний отступ только у виджета новостей */
#widget-news {
    padding: 0;
}

#widget-news .widget-tile-content {
    padding: 0;
    overflow: hidden;
    pointer-events: auto;
}

#news-carousel {
    width: 100%;
    height: 100%;
    border-radius: 16px; /* Сохраняем скругление для карусели */
}

.swiper-slide a.news-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: white;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

/* ИСПРАВЛЕНИЕ 2: Добавляем стили для состояния "нет картинки" */
.news-item.no-image {
    background-color: #2c3034; /* Темный фон */
    justify-content: center; /* Центрируем иконку-заглушку по вертикали */
    align-items: center; /* Центрируем иконку-заглушку по горизонтали */
}

.fallback-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Под оверлеем с текстом */
}

.fallback-icon i {
    font-size: 5rem; /* Большой размер иконки */
    color: rgba(255, 255, 255, 0.1); /* Полупрозрачный белый цвет */
}

.news-item:hover {
    transform: scale(1.05);
}

.news-item-overlay {
    position: relative;
    width: 100%; /* Убедимся, что оверлей занимает всю ширину */
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0,0,0,0) 100%);
    padding: 20px 20px 40px 20px;
}

/* Когда нет картинки, оверлей тоже должен быть внизу */
.no-image .news-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
}

.news-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item-source {
    font-size: 0.8rem;
    opacity: 0.8;
}

.news-loading, .news-error {
    display: flex;
    flex-direction: column; /* Чтобы иконка и текст были друг под другом */
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    text-align: center;
}

.news-error .error-icon {
    font-size: 2.5rem; /* Большая иконка */
    margin-bottom: 15px;
    color: #ffc107; /* Предупреждающий желтый цвет */
}

body.dark-theme .news-error .error-icon {
     color: #ffca2c; /* Чуть ярче для темной темы */
}

.news-error h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.news-error p {
    font-size: 0.9rem;
    opacity: 0.7;
    max-width: 90%; /* Чтобы текст не прилипал к краям */
    margin: 0;
    line-height: 1.4;
}

/* --- СТИЛИ ДЛЯ ТОЧЕК --- */
#news-carousel .swiper-pagination {
    bottom: 15px !important;
    left: 0;
    width: 100%;
}

.swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    background-color: rgba(255, 255, 255, 0.4) !important; 
    opacity: 1;
    transition: all 0.3s;
    margin: 0 5px !important;
}

.swiper-pagination-bullet-active {
    background-color: #007aff !important;
    transform: scale(1.2);
}


.edit-mode #news-carousel {
    pointer-events: none;
}