
/* Шапка подстраницы (.page-hero) описана в css/base.css */

.hero-lead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 540px;
    gap: 44px;
    align-items: center;
}
.hero-lead__text { min-width: 0; }
.hero-lead__text .section-desc { max-width: 560px; }

/* Рамка со смещением за фотографией — приём с баннера «Трамплин в науку» */
.hero-lead__media {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 10;
}
.hero-lead__media::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translate(-16px, 16px);
    border: 2px solid rgb(255 255 255 / 90%);
    border-radius: 20px;
    pointer-events: none;
}
.hero-lead__media img {
    position: relative;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 40px 70px -40px rgba(0, 0, 0, 0.8);
}

@media (max-width: 980px) {
    .hero-lead { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .hero-lead__media { max-width: 560px; }
}

.news-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
.news-layout__main { min-width: 0; }

.news-layout__aside { position: sticky; min-width: 0; }

.side-news { display: grid; gap: 10px; }
.side-news__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 4px;
}
.side-news__item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.side-news__item:hover { border-color: rgba(220, 20, 60, 0.4); transform: translateX(3px); }
.side-news__img {
    width: 78px; height: 58px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    background: var(--card-soft);
}
.side-news__text { min-width: 0; display: block; }
.side-news__date { display: block; font-size: 11px; color: var(--text-light); margin-bottom: 3px; }
.side-news__text b { font-size: 13.5px; font-weight: 700; line-height: 1.35; display: block; }
.side-news__item:hover .side-news__text b { color: var(--accent-red); }

.side-news__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--primary-red);
    text-decoration: none;
    transition: gap 0.25s ease;
}
.side-news__all:hover { gap: 13px; }

@media (max-width: 900px) {
    .news-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .news-layout__aside { position: static; }
}

.news-hero-soc {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 34px;
}
.news-hero-soc > span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin-right: 4px;
}
.news-hero-soc .btn { padding: 13px 24px; }

@media (max-width: 560px) {
    .news-hero-soc { margin-top: 26px; gap: 12px; }
    .news-hero-soc .btn { width: 100%; justify-content: center; }
}

.news-toolbar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    margin-bottom: 40px;
}

.news-search {
    position: relative;
    display: flex;
    align-items: center;
}
/*
| Отступы сверху и снизу разные (16 и 10), поэтому строка ввода стоит
| на 3px ниже середины рамки. Значок и крестик сдвинуты на те же 3px,
| иначе они висят выше текста.
*/
/* Только > i: иначе правило цепляет и значок внутри кнопки-крестика,
   и тот уезжает из своего кружка вправо */
.news-search > i {
    position: absolute;
    left: 20px;
    top: calc(50% + 3px);
    transform: translateY(-50%);
    color: var(--accent-red);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}
/* Общая высота поля поиска и выпадающего списка рядом с ним */
.news-toolbar { --field-h: 54px; }

.news-search input {
    width: 100%;
    height: var(--field-h);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.3;
    color: var(--text-dark);
    padding: 16px 52px 10px 52px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--white);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.news-search input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.12);
}

.news-filter select {
    width: 100%;
    height: var(--field-h, 54px);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-dark);
    padding: 0 20px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: var(--white);
    outline: none;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.news-filter select:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.12);
}

/*
| select2 подменяет <select> своей разметкой со своими отступами, поэтому
| высоту задаём и ей: иначе список рядом с полем поиска выше него.
*/
.news-filter .select2-container--default .select2-selection--single {
    height: var(--field-h, 54px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-radius: 14px;
}
.news-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.3;
}
.news-filter .select2-container--default .select2-selection--single .select2-selection__arrow { right: 16px; }

@media (max-width: 700px) {
    .news-toolbar { grid-template-columns: 1fr; }
}

.news-active {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: -14px 0 26px;
    padding: 12px 16px;
    background: var(--card-soft);
    border: 1px solid var(--border-light);
    border-radius: 14px;
}
.news-active__label {
    font-size: 13px;
    color: var(--text-light);
    margin-right: 2px;
}

.news-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(220, 20, 60, 0.3);
    background: var(--red-soft);
    color: var(--accent-red);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease;
}
.news-chip:hover { border-color: var(--accent-red); background: #FCDCE2; }
.news-chip i { font-size: 11px; opacity: 0.75; }
.news-chip:hover i { opacity: 1; }

.news-active__reset {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}
.news-active__reset:hover { color: var(--accent-red); }

.news-active__count {
    margin-left: auto;
    font-size: 13.5px;
    color: var(--text-muted);
}

@media (max-width: 700px) {
    .news-active__count { margin-left: 0; width: 100%; }
}

/* Крестик внутри поля поиска — как в любой поисковой строке */
.news-search__clear {
    position: absolute;
    right: 12px;
    top: calc(50% + 3px);
    transform: translateY(-50%);
    width: 28px; height: 28px;
    border: 0;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--text-light);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.news-search__clear i { position: static; transform: none; color: inherit; font-size: 12px; }
.news-search__clear:hover { background: var(--accent-red); color: var(--white); }

/* ============================================================
   СПИСОК НОВОСТЕЙ (горизонтальные карточки)
   ============================================================ */
.news-list { display: grid; gap: 22px; }

.news-item {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.news-item:hover {
    transform: translateY(-4px);
    border-color: rgba(220, 20, 60, 0.4);
    box-shadow: 0 30px 56px -34px rgba(139, 0, 0, 0.6);
}

.news-item__img {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 220px;
    background: linear-gradient(150deg, #FBE9E9 0%, #F0CFCF 100%);
}
.news-item__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
.news-item:hover .news-item__img img { transform: scale(1.05); }

/* Превью урока — кнопка: открывает проигрыватель, а не отдельную страницу */
.news-item__img--play { border: 0; padding: 0; cursor: pointer; font: inherit; }
.news-item__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 54px; height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: var(--white);
    font-size: 17px;
    z-index: 1;
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.news-item:hover .news-item__play {
    transform: translate(-50%, -50%) scale(1.08);
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* «Смотреть урок» — тоже кнопка, но выглядит ссылкой */
button.news-item__more { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }

.news-item__body { padding: 28px 32px 30px; display: flex; flex-direction: column; }

.news-item__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.news-item__date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
/* В тёмной шапке страницы — белым: приглушённый серый на красном не читался */
.page-hero .news-item__date { color: #ffffff; }
.page-hero .news-item__date i { color: rgba(255, 255, 255, 0.75); }
.news-item__tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--white);
    background: var(--gradient-red-soft);
    padding: 6px 14px;
    border-radius: 20px;
}

.news-item h3 { font-size: 21px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.news-item h3 a { color: inherit; text-decoration: none; transition: color 0.25s ease; }
.news-item h3 a:hover { color: var(--accent-red); }
.news-item p { color: var(--text-muted); font-size: 15px; line-height: 1.75; flex: 1; }

.news-item__more {
    margin-top: 18px;
    align-self: flex-start;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--primary-red);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.25s ease, color 0.25s ease;
}
.news-item__more:hover { gap: 14px; color: var(--accent-red); }

@media (max-width: 850px) {
    .news-item { grid-template-columns: 1fr; }
    .news-item__img { min-height: 210px; }
    .news-item__body { padding: 24px 24px 26px; }
}

/* ============================================================
   ПУСТОЕ СОСТОЯНИЕ И ПАГИНАЦИЯ
   ============================================================ */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
/* width: 100% — иконка растягивается на строку и центрируется вместе с текстом */
.news-empty i {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 42px;
    color: var(--card-border);
    margin-bottom: 16px;
}
.news-empty a { color: var(--accent-red); }

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 44px;
}
.pager a,
.pager span {
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--white);
    color: var(--text-light);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}
.pager a:hover { border-color: rgba(220, 20, 60, 0.45); color: var(--accent-red); }
.pager .is-active {
    background: var(--gradient-red-soft);
    border-color: transparent;
    color: var(--white);
}
.pager .is-off { opacity: 0.45; background: transparent; border-style: dashed; }

.news-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 70px 20px;
    color: var(--text-muted);
    font-size: 15px;
}
.news-loading i { font-size: 26px; color: var(--accent-red); }

@media (max-width: 560px) {
    .pager a, .pager span { min-width: 38px; height: 38px; padding: 0 10px; font-size: 13.5px; }
}
.news-pagination button {
    min-width: 46px;
    height: 46px;
    padding: 0 14px;
    border-radius: 13px;
    border: 1px solid var(--card-border);
    background: var(--white);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
}
.news-pagination button:hover:not(:disabled) { border-color: var(--accent-red); color: var(--accent-red); }
.news-pagination button.is-active {
    background: var(--gradient-red);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 12px 26px -12px rgba(220, 20, 60, 0.65);
}
.news-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   КОЛЛАЖ ФОТОГРАФИЙ В СТАТЬЕ
   ============================================================ */
/*
| Второй способ показать снимки новости — выбирается в админке
| («Как показать фотографии»). Карусель хороша, когда кадров немного
| и каждый хочется разглядеть; репортаж удобнее охватить целиком.
|
| Первый снимок крупный: у репортажа почти всегда есть главный кадр,
| а ровная сетка делает их все одинаково неважными.
*/
.ncollage {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 32px;
}
.ncollage__item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, .06);
    cursor: zoom-in;
}
.ncollage__item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
.ncollage__item:hover img { transform: scale(1.04); }

/* Затемнение по наведению — подсказывает, что снимок откроется */
.ncollage__item::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(transparent 55%, rgba(20, 1, 4, .35));
    opacity: 0;
    transition: opacity .3s ease;
}
.ncollage__item:hover::after { opacity: 1; }

/* Первый кадр крупнее — но только когда снимков хватает на сетку */
.ncollage[data-count="1"] { grid-template-columns: 1fr; }
.ncollage[data-count="1"] .ncollage__item { aspect-ratio: 16 / 9; }

.ncollage[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ncollage:not([data-count="1"]):not([data-count="2"]) .ncollage__item:first-child {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

@media (max-width: 700px) {
    /* На телефоне крупный кадр во всю ширину, остальные по двое:
       в три колонки снимок становится с ноготь */
    .ncollage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ncollage:not([data-count="1"]):not([data-count="2"]) .ncollage__item:first-child {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 16 / 10;
    }
}
