/* Список новостей (public/news.php): «Журнал» — первая новость крупно, разделы вкладками, сетка */

.nl {
    --nl-card: var(--card-bg, #141419);
    --nl-border: var(--border-color, #22222b);
    --nl-soft: var(--hover-bg-color, #1c1c24);
    --nl-text: var(--text-color, #fff);
    --nl-muted: var(--text-muted, #8b8b98);
    --nl-accent: var(--primary-color, #6a5aff);
    --nl-accent-soft: color-mix(in srgb, var(--nl-accent) 14%, transparent);

    max-width: var(--page-max);
    margin: 0 auto;
    padding: 28px var(--page-pad) 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    color: var(--nl-text);
}

/* Заголовок */
.nl-head { display: flex; align-items: baseline; gap: 14px; }
.nl-head h1 { margin: 0; font-size: 32px; font-weight: normal; }
.nl-count { font-size: 14px; color: var(--nl-muted); }

/* Вкладки разделов, поиск, сортировка */
.nl-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.nl-tabs { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.nl-tab {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--nl-border);
    color: var(--nl-muted);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.nl-tab:hover { color: var(--nl-text); border-color: var(--nl-accent); }
.nl-tab.is-on { background: var(--nl-accent); border-color: var(--nl-accent); color: #fff; }

.nl-filters { margin: 0 0 0 auto; display: flex; gap: 8px; }

.nl-search, .nl-sort {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 10px;
    border: 1px solid var(--nl-border);
    background: var(--nl-card);
    color: var(--nl-muted);
    font-size: 14px;
}
.nl-search:focus-within, .nl-sort:focus-within { border-color: var(--nl-accent); }
.nl-search { gap: 8px; padding: 0 12px; width: 260px; box-sizing: border-box; }
.nl-search i { font-size: 13px; }

.nl-search input, .nl-sort select {
    flex: 1;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--nl-text);
    font: inherit;
}
.nl-search input::placeholder { color: var(--nl-muted); }
.nl-sort select { appearance: none; padding: 9px 32px 9px 12px; cursor: pointer; }
.nl-sort select option { background: var(--nl-card); color: var(--nl-text); }
.nl-sort i { position: absolute; right: 12px; font-size: 11px; pointer-events: none; }

.nl-found { margin: -4px 0 0; font-size: 14px; color: var(--nl-muted); }
.nl-found a { color: var(--nl-accent); }

/* Общие кусочки карточек */
.nl-cat {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--nl-accent-soft);
    color: var(--nl-accent);
    font-size: 12px;
    white-space: nowrap;
}

.nl-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--nl-muted); }
.nl-meta > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nl-push { margin-left: auto; }
.nl-au img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; image-rendering: pixelated; }
.nl-au { color: var(--nl-text); }

/* Главная новость */
.nl-feat {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    height: clamp(320px, 24vw, 420px);
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--nl-border);
    background: var(--nl-card);
    color: inherit;
    text-decoration: none;
}
.nl-feat:hover { border-color: var(--nl-accent); }
.nl-feat-img { width: 100%; height: 100%; min-height: 0; object-fit: cover; display: block; background: var(--nl-soft); }
.nl-feat-body { padding: 28px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: hidden; }
.nl-feat-title { font-size: 28px; line-height: 1.25; overflow-wrap: anywhere; }
.nl-feat:hover .nl-feat-title { color: var(--nl-accent); }
.nl-feat-text { font-size: 15px; line-height: 1.6; color: var(--nl-muted); }
.nl-feat-stats { margin-top: auto; }

/* Сетка */
.nl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.nl-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--nl-border);
    background: var(--nl-card);
    color: inherit;
    text-decoration: none;
}
.nl-card:hover { border-color: var(--nl-accent); }
.nl-card-img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; background: var(--nl-soft); }
.nl-card-body { flex: 1; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.nl-card-title { font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.nl-card:hover .nl-card-title { color: var(--nl-accent); }
.nl-card-text { flex: 1; font-size: 13px; line-height: 1.5; color: var(--nl-muted); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Кнопки и пустое состояние */
.nl-btn {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 12px;
    border: 1px solid var(--nl-border);
    background: var(--nl-soft);
    color: var(--nl-text);
    font-size: 15px;
    text-decoration: none;
}
.nl-btn:hover { border-color: var(--nl-accent); }
.nl-more.is-loading { opacity: 0.6; pointer-events: none; }

.nl-empty {
    padding: 56px 20px;
    border-radius: 18px;
    border: 1px dashed var(--nl-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--nl-muted);
    text-align: center;
}
.nl-empty i { font-size: 34px; opacity: 0.6; }
.nl-empty p { margin: 0; }

.nl a:focus-visible { outline: 2px solid var(--nl-accent); outline-offset: 2px; }

/* Адаптив */
@media (max-width: 1100px) {
    .nl-filters { margin-left: 0; width: 100%; }
    .nl-search { flex: 1; width: auto; min-width: 0; }
    .nl-search input { width: 100%; }

    .nl-feat { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .nl { padding: 18px 14px 32px; gap: 14px; }
    .nl-head h1 { font-size: 26px; }
    .nl-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
    .nl-tabs::-webkit-scrollbar { display: none; }
    .nl-feat { grid-template-columns: 1fr; height: auto; }
    .nl-feat-img { min-height: 0; aspect-ratio: 16 / 9; height: auto; }
    .nl-feat-body { padding: 18px; }
    .nl-feat-title { font-size: 22px; }
    .nl-grid { grid-template-columns: minmax(0, 1fr); }
}
