/* ==========================================================================
   БЛОКИ КОНТЕНТА 2026 — «Интересная Россия»
   Подключается ПОСЛЕ styles.css и header.css.
   Цвета берутся из палитры в начале styles.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. СТЫК ШАПКИ И КОНТЕНТА
   Страница получает светло-серый фон, контент ложится на неё белой
   карточкой со скруглением — так тёмная навигация больше не упирается
   в белое полотно встык.
   -------------------------------------------------------------------------- */
body { background-color: #eaeef4; }

.cols {
    background-color: #fff;
    margin: 20px 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16,29,56,.05), 0 10px 30px rgba(16,29,56,.07);
}

.footer { border-radius: 14px 14px 0 0; }

/* боковые колонки — чуть теплее белого, как на макете */
.sidebar1, .sidebar { background-color: #f7f9fc; }

/* --------------------------------------------------------------------------
   2. ЗАГОЛОВКИ РАЗДЕЛОВ
   Подчёркивание заменено на вертикальную полосу слева.
   -------------------------------------------------------------------------- */
.sect-title {
    position: relative;
    display: inline-block;
    padding: 0 0 0 15px;
    border-bottom: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.25;
}

.sect-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 3px;
    background: var(--cat-color, var(--c-accent));
}

/* строка «заголовок + ссылка справа» */
.sect-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.sect-head .sect-title { margin-bottom: 0; }

.sect-more {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 500;
    color: var(--cat-color, var(--c-accent));
    white-space: nowrap;
}

.sect-more:hover { color: var(--c-accent-dark); }
.sect-more .fal { margin-left: 6px; }

/* --------------------------------------------------------------------------
   3. СЕТКА «ГЛАВНОЕ СЕГОДНЯ»
   -------------------------------------------------------------------------- */
.top-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.top-side {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    min-width: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* --------------------------------------------------------------------------
   4. КАРТОЧКА НОВОСТИ
   -------------------------------------------------------------------------- */
.ncard {
    position: relative;
    display: block;
    min-width: 0;
    color: inherit;
}

.ncard-img {
    position: relative;
    border-radius: 12px;
    background: #dde3ec;
}

.ncard-img img { transition: transform .5s ease; }
.ncard:hover .ncard-img img { transform: scale(1.05); }

/* --- метка рубрики --- */
.ncat {
    position: absolute;
    z-index: 5;
    left: 12px;
    top: 12px;
    padding: 0 10px;
    height: 22px;
    line-height: 22px;
    border-radius: 6px;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 24px);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* --------------------------------------------------------------------------
   ЦВЕТА РУБРИК — единая карта
   Задаёт переменную --cat-color по названию рубрики. Её используют и метки
   на карточках, и полоса у заголовков блоков рубрик.
   Совпадение по подстроке, поэтому склонения и регистр ловятся сами.
   Рубрики сайта: 1 Главное, 2 Экономика, 3 Политика, 4 Армия,
   5 Происшествия, 6 Спорт, 7 Культура, 8 Шоу-бизнес, 9 СССР,
   10 Общество, 11 Другое, 12 Церковный календарь, 13 Русское лото
   -------------------------------------------------------------------------- */
[data-cat]                       { --cat-color: var(--c-accent); }
[data-cat*="Арми"],
[data-cat*="Военн"],
[data-cat*="СВО"]                { --cat-color: #e02034; }
[data-cat*="Политик"]            { --cat-color: #7a5cf0; }
[data-cat*="Экономик"]           { --cat-color: #f2994a; }
[data-cat*="Обществ"]            { --cat-color: #2f80ed; }
[data-cat*="Происшеств"]         { --cat-color: #eb5757; }
[data-cat*="Спорт"]              { --cat-color: #16a085; }
[data-cat*="Культур"]            { --cat-color: #2d9cdb; }
[data-cat*="Шоу"]                { --cat-color: #e5399b; }
[data-cat*="СССР"]               { --cat-color: #c0392b; }
[data-cat*="Церковн"]            { --cat-color: #b8860b; }
[data-cat*="лото"]               { --cat-color: #8e6bd4; }
[data-cat*="Главн"]              { --cat-color: #16233f; }

.ncat { background: var(--cat-color); }

/* верхний ряд делится со счётчиком просмотров */
.ncard--hero > .ncat,
.ncard--tile > .ncat { max-width: calc(100% - 110px); }

/* --- счётчик просмотров --- */
.nviews {
    position: absolute;
    z-index: 5;
    right: 12px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 22px;
    border-radius: 6px;
    background: rgba(16,29,56,.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}

.nviews .fal { font-size: 11px; }

/* --------------------------------------------------------------------------
   4a. Большая карточка и две боковые: текст поверх изображения
   -------------------------------------------------------------------------- */
.ncard--hero,
.ncard--tile {
    border-radius: 12px;
    overflow: hidden;
}

.ncard--hero .ncard-img,
.ncard--tile .ncard-img {
    position: absolute;
    inset: 0;
    border-radius: 0;
}

.ncard--hero { aspect-ratio: 8 / 7; }
.ncard--tile { height: 100%; min-height: 170px; }

.ncard--hero::after,
.ncard--tile::after {
    content: '';
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56%;
    background: linear-gradient(to top,
        rgba(10,18,36,.90) 0%,
        rgba(10,18,36,.60) 45%,
        rgba(10,18,36,0) 100%);
    transition: height .4s ease;
}

.ncard--hero:hover::after,
.ncard--tile:hover::after { height: 72%; }

.ncard--hero .ncard-body,
.ncard--tile .ncard-body {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    color: #fff;
}

.ncard--hero .ncard-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ncard--tile .ncard-body { padding: 16px; }

.ncard--tile .ncard-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ncard--hero .ncard-meta,
.ncard--tile .ncard-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 9px;
    font-size: 12.5px;
    color: rgba(255,255,255,.75);
}

.ncard--hero .ncard-more {
    color: #fff;
    font-weight: 500;
}

.ncard--hero .ncard-more .fal { margin-left: 6px; transition: transform .3s; }
.ncard--hero:hover .ncard-more .fal { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   4b. Малые карточки: текст под изображением
   -------------------------------------------------------------------------- */
.ncard--sm .ncard-img {
    aspect-ratio: 5 / 4;
    margin-bottom: 11px;
}

/* метка внизу слева, счётчик вверху справа — пересечься не могут */
.ncard--sm .ncat {
    top: auto;
    bottom: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
}

.ncard--sm .nviews { top: 10px; right: 10px; }


.ncard--sm .ncard-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #16233f;
    transition: color .25s;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ncard--sm:hover .ncard-title { color: var(--c-accent); }

.ncard--sm .ncard-date {
    margin-top: 8px;
    font-size: 12px;
    color: var(--c-accent);
}

/* --------------------------------------------------------------------------
   4c. БЛОКИ РУБРИК (Экономика / Политика / Общество)
   Две колонки: в три «Все новости» не помещалось.
   Третий блок занимает вторую строку целиком, список внутри — в две колонки.
   Ссылка «Все новости» вынесена под список, как в макете.
   -------------------------------------------------------------------------- */
.sect-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 30px;
}

.sect-cols .sect {
    width: auto;
    margin: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 18px 18px 14px;
    border-radius: 12px;
    background: #f6f8fc;
    border: 1px solid #e7ecf4;
}

/* третий блок — на всю ширину */
.sect-cols .sect:nth-child(3) { grid-column: 1 / -1; }

.sect-cols .sect:nth-child(3) .sect-cont {
    columns: 2;
    column-gap: 30px;
}

.sect-cols .sect:nth-child(3) .line-item { break-inside: avoid; }

.sect-cols .sect-head { margin-bottom: 15px; }

.sect-cols .sect-title {
    font-size: 15px;
    padding-left: 12px;
    display: flex;
    align-items: center;
}

.sect-cols .sect-title [class*="fa-"] {
    margin-right: 9px;
    font-size: 14px;
    color: var(--cat-color, var(--c-accent));
}

.sect-cols .sect-cont { flex: 1 1 auto; }

.sect-cols .line-item {
    margin-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.45;
}

.sect-cols .line-item:hover { color: var(--cat-color, var(--c-accent)); }

/* ссылка под списком */
.sect-more--bottom {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 4px;
    padding-top: 13px;
    border-top: 1px solid #e2e8f2;
    width: 100%;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   5. АДАПТИВ
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1220px) {
    .card-grid { gap: 12px; }
    .ncard--hero .ncard-title { font-size: 21px; }
    .ncard--tile .ncard-title { -webkit-line-clamp: 2; }
}

@media screen and (max-width: 950px) {
    .cols { margin: 14px 0; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 760px) {
    .top-grid { grid-template-columns: 1fr; }
    .top-side { grid-template-rows: auto auto; }
    .ncard--hero { aspect-ratio: 16 / 11; }
    .ncard--hero .ncard-title { font-size: 20px; }
    .ncard--tile .ncard-title { -webkit-line-clamp: 3; }
    .ncard--tile { min-height: 170px; }
    .sect-title { font-size: 18px; }
    .sect-cols { grid-template-columns: 1fr; }
    .sect-cols .sect:nth-child(3) .sect-cont { columns: 1; }
}

@media screen and (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .ncard--hero { aspect-ratio: 4 / 3; }
    .ncard--hero .ncard-title { font-size: 17px; }
    .ncard--hero .ncard-body,
    .ncard--tile .ncard-body { padding: 14px; }
}
