/* ============================================================
   СТИЛИ ДЛЯ НОВОСТЕЙ (рубрика + главная страница)
   ============================================================ */

/* --- Сетка новостей (страница рубрики) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px 25px;
    margin: 30px 0;
}

.news-card {
    position: relative;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 400px;
    overflow: visible;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.news-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.news-card-bg {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    border-radius: 16px;
    overflow: hidden;
}

.news-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.05) 100%);
    z-index: 1;
}

.news-card-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.news-card-date {
    position: absolute;
    top: -15px;
    left: -15px;
    z-index: 3;
    background: #ff6b00;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 8px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255,107,0,0.4);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.news-card-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    word-break: break-word;
}

/* Анимация для рубрики */
.news-card-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.news-card-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Сетка на главной (шорткод) --- */
.news-grid-home {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 30px 0;
}

.news-card-home {
    position: relative;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.news-card-home:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.news-card-home-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card-home-bg {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 */
    background-size: cover;
    background-position: center;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.news-card-home-date {
    position: absolute;
    top: -15px;
    left: -15px;
    z-index: 3;
    background: #ff6b00;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 5px 16px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255,107,0,0.4);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.news-card-home-title {
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a365d;
    margin: 0;
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* Анимация для главной */
.news-card-home-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.news-card-home-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптивность */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 30px 20px;
    }
    .news-card {
        height: 350px;
    }
    .news-card-title {
        font-size: 20px;
    }
    .news-card-date {
        font-size: 14px;
        padding: 6px 16px;
        top: -10px;
        left: -10px;
    }
    .news-grid-home {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .news-card-home-date {
        font-size: 12px;
        padding: 4px 12px;
        top: -10px;
        left: -10px;
    }
}

@media (max-width: 480px) {
    .news-card {
        height: 300px;
    }
    .news-card-title {
        font-size: 18px;
    }
    .news-grid-home {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .news-card-home-title {
        font-size: 16px;
    }
}

/* ============================================================
   ЦВЕТОВЫЕ СХЕМЫ ДЛЯ РАЗНЫХ РУБРИК
   ============================================================ */

/* --- Мероприятия: тёплый оранжево-розовый градиент --- */
.events-grid .news-card-home-bg {
    position: relative;
}
.events-grid .news-card-home-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,107,0,0.4) 0%, rgba(233,30,99,0.35) 100%);
    z-index: 1;
    border-radius: 16px 16px 0 0;
}
.events-grid .news-card-home-date {
    background: #ff6b00; /* оранжевый */
}

/* --- Опорный центр: спокойный сине-голубой градиент --- */
.center-news-grid .news-card-home-bg {
    position: relative;
}
.center-news-grid .news-card-home-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,146,204,0.4) 0%, rgba(0,200,255,0.3) 100%);
    z-index: 1;
    border-radius: 16px 16px 0 0;
}
.center-news-grid .news-card-home-date {
    background: #0092cc; /* синий */
}

.news-grid-home {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 20px;
}
.events-grid {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}
.center-news-grid {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* ============================================================
   ГОРИЗОНТАЛЬНАЯ ПРОКРУТКА ДЛЯ МЕРОПРИЯТИЙ И ОПОРНОГО ЦЕНТРА
   ============================================================ */

.horizontal-scroll-wrapper {
    position: relative;
    margin: 30px 0;
    padding: 0 45px; /* место для стрелок */
}

.horizontal-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.horizontal-track::-webkit-scrollbar {
    height: 6px;
}
.horizontal-track::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Карточка внутри горизонтальной дорожки */
.horizontal-track .news-card-home {
    min-width: 300px;
    max-width: 320px;
    flex-shrink: 0;
}

/* Кнопки-стрелки */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background 0.3s, box-shadow 0.3s;
    color: #333;
    font-size: 18px;
}
.scroll-btn:hover {
    background: #0092cc;
    color: #fff;
    border-color: #0092cc;
    box-shadow: 0 4px 15px rgba(0,146,204,0.3);
}
.scroll-left {
    left: 0;
}
.scroll-right {
    right: 0;
}

/* На устройствах без точного указателя (тачскрины) стрелки скрываем */
@media (hover: none) and (pointer: coarse) {
    .scroll-btn {
        display: none;
    }
    .horizontal-scroll-wrapper {
        padding: 0;
    }
}

/* Цветовые подложки */
.events-scroll {
    background: #eceef1;
    border-radius: 20px;
    padding: 25px 45px;
}
.center-news-scroll {
    background: #edeff2;
    border-radius: 20px;
    padding: 25px 45px;
}

@media (hover: none) and (pointer: coarse) {
    .events-scroll,
    .center-news-scroll {
        padding: 25px 15px;
    }
}

/* Общие стили горизонтальной прокрутки */
.horizontal-scroll-wrapper {
    position: relative;
    margin: 30px 0;
    padding: 0 45px;
}

.horizontal-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.horizontal-track::-webkit-scrollbar {
    height: 6px;
}
.horizontal-track::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Кнопки-стрелки */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background 0.3s, box-shadow 0.3s;
    color: #333;
    font-size: 18px;
}
.scroll-btn:hover {
    background: #0092cc;
    color: #fff;
    border-color: #0092cc;
    box-shadow: 0 4px 15px rgba(0,146,204,0.3);
}
.scroll-left {
    left: 0;
}
.scroll-right {
    right: 0;
}

/* На тач-устройствах стрелки скрываем */
@media (hover: none) and (pointer: coarse) {
    .scroll-btn {
        display: none;
    }
    .horizontal-scroll-wrapper {
        padding: 0;
    }
}

/* Специфические стили для области баннеров */
.banners-scroll {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 20px 45px;
}

.banner-item {
    flex-shrink: 0;
    width: 200px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.banner-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,146,204,0.15);
}

.banner-item img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-title {
    display: none; /* можно показывать, если нужно */
}

@media (hover: none) and (pointer: coarse) {
    .banners-scroll {
        padding: 20px 15px;
    }
}