/* =====================================================================
   Новости: страница /news/ (VIEW_MODE = page) и «Другие новости» (related)
   Лента на главной (strip) стилизуется в css/style.css шаблона (.news-strip).
   Переменные --red, --black, --border, --bg, --muted — из css/style.css.
   ===================================================================== */
.nl { padding: 8px 0 24px; }
body:has(.nl-head) .title { display: none; }
.nl-head { margin: 24px 0 28px; padding-bottom: 18px; border-bottom: 2px solid var(--black, #000); }
.nl-title {
    font-family: 'Jost', sans-serif;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    line-height: 1;
    margin: 0;
    color: var(--black, #000);
}
/* Вкладки-разделы под заголовком на /news/ (разметка — в /news/index.php, вид .news-tab — из css/style.css шаблона) */
.nl-head .news-tabs { margin: 22px 0 0; }
.nl-title::after { content: '.'; color: var(--red, #F93F33); }
.nl-empty { color: var(--muted, #888); font-size: 15px; }

.nl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.nl--related .nl-grid { gap: 20px; }

/* ── Карточка ── */
.nl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--white, #fff);
    border: 1px solid var(--border, #DFDFDF);
    transition: box-shadow .2s, transform .2s;
}
.nl-card::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px;
    height: 3px;
    background: var(--red, #F93F33);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s;
    z-index: 2;
}
.nl-card:hover { box-shadow: 0 10px 30px rgba(0,0,0,.08); transform: translateY(-2px); }
.nl-card:hover::before { transform: scaleX(1); }

.nl-card-img {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--bg, #F2F2F2);
}
.nl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}
.nl-card:hover .nl-card-img img { transform: scale(1.04); }

.nl-card-tag {
    position: absolute;
    left: 0; bottom: 0;
    max-width: 90%;
    background: var(--black, #000);
    color: var(--white, #fff);
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nl-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 18px 20px 20px;
}
.nl-card-date {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--red, #F93F33);
    margin-bottom: 8px;
}
.nl-card-title {
    font-family: 'Jost', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--black, #000);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nl-card-title a { color: inherit; text-decoration: none; }
.nl-card-title a:hover { color: var(--red, #F93F33); }
.nl-card-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; } /* вся карточка кликабельна */

.nl-card-text {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nl-card-more {
    margin-top: auto;
    align-self: flex-start;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--black, #000);
    text-decoration: none;
    border-bottom: 2px solid var(--red, #F93F33);
    padding-bottom: 2px;
}
.nl-card:hover .nl-card-more { color: var(--red, #F93F33); }

/* ── Первая новость на 1-й странице — крупно, на всю ширину ── */
.nl-card--lead {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.nl-card--lead .nl-card-img { aspect-ratio: auto; min-height: 380px; }
.nl-card--lead .nl-card-body { padding: 36px 40px; justify-content: center; }
.nl-card--lead .nl-card-title { font-size: 32px; font-weight: 800; line-height: 1.12; letter-spacing: -.5px; -webkit-line-clamp: 5; margin-bottom: 16px; }
.nl-card--lead .nl-card-text { font-size: 15px; -webkit-line-clamp: 5; margin-bottom: 24px; }
.nl-card--lead .nl-card-more { margin-top: 0; }

/* «Другие новости» — компактнее */
.nl--related .nl-card-title { font-size: 16px; }
.nl--related .nl-card-body { padding: 14px 16px 18px; }

/* ── Пагинация (шаблон system.pagenavigation/news_pager) ── */
.nl-pager { margin-top: 40px; }
.nl-pager--top { margin: 0 0 24px; }

/* ── Адаптив ── */
@media (max-width: 991.98px) {
    .nl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .nl--related .nl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nl-card--lead { grid-template-columns: 1fr; }
    .nl-card--lead .nl-card-img { min-height: 0; aspect-ratio: 16 / 9; }
    .nl-card--lead .nl-card-body { padding: 24px; }
    .nl-card--lead .nl-card-title { font-size: 26px; }
}
@media (max-width: 767.98px) {
    .nl--related .nl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .nl-grid { grid-template-columns: 1fr; }
    .nl-card-title { font-size: 17px; }
    .nl-card--lead .nl-card-title { font-size: 22px; }
}
