/* ============================================================
   Движок новостей — Modern Minimalist / Swiss Clean
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Outfit:wght@300;400;500;600&display=swap');

/* ---------- Reset & Variables ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #fafaf9;
    --bg2:         #ffffff;
    --bg3:         #f4f3f1;
    --border:      #e8e6e2;
    --border-dark: #d0cdc8;
    --accent:      #1a1a1a;
    --accent-line: #c0392b;
    --text:        #2d2d2d;
    --text-muted:  #8a8480;
    --text-light:  #b0ada8;
    --text-head:   #111110;
    --radius:      6px;
    --font-body:   'Outfit', system-ui, sans-serif;
    --font-head:   'DM Serif Display', Georgia, serif;
    --max-w:       1140px;
    --side-w:      280px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}

.header-inner {
    display: flex; align-items: center;
    justify-content: space-between;
    height: 58px; gap: 32px;
}

.site-logo {
    font-family: var(--font-head);
    font-size: 1.35rem;
    color: var(--text-head);
    letter-spacing: -0.01em;
    white-space: nowrap;
    display: flex; align-items: center; gap: 10px;
}
.site-logo::before {
    content: '';
    display: block;
    width: 3px; height: 20px;
    background: var(--accent-line);
    border-radius: 2px;
    flex-shrink: 0;
}

.header-search {
    flex: 1; max-width: 320px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1.5px solid var(--border-dark);
    padding: 4px 0;
    transition: border-color .2s;
}
.header-search:focus-within { border-color: var(--accent); }
.header-search input {
    background: none; border: none; outline: none;
    color: var(--text); font-family: var(--font-body);
    font-size: .88rem; flex: 1; min-width: 0;
}
.header-search input::placeholder { color: var(--text-light); }
.header-search button {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: .9rem;
    padding: 0; transition: color .2s;
}
.header-search button:hover { color: var(--accent); }

/* ---------- Category Nav ---------- */
.cat-nav {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.cat-nav-inner {
    display: flex;
    overflow-x: auto; scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-link {
    padding: 10px 20px;
    font-size: .78rem; font-weight: 600;
    letter-spacing: .06em;
    white-space: nowrap;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    text-transform: uppercase;
    margin-bottom: -1px;
}
.cat-link:hover { color: var(--text); border-color: var(--border-dark); }
.cat-link.active { color: var(--text-head); border-color: var(--accent-line); }

/* ---------- Main Wrap ---------- */
.main-wrap {
    display: grid;
    grid-template-columns: 1fr var(--side-w);
    gap: 56px;
    padding: 48px 0 72px;
    align-items: start;
}
@media (max-width: 900px) {
    .main-wrap { grid-template-columns: 1fr; gap: 40px; }
    .sidebar { display: none; }
}

/* ---------- Section Header ---------- */
.section-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.section-title {
    font-family: var(--font-head);
    font-size: 1.75rem;
    color: var(--text-head);
    letter-spacing: -0.02em;
    font-weight: 400;
}
.section-meta { font-size: .78rem; color: var(--text-light); font-weight: 300; }

/* ---------- News Grid ---------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 680px) { .news-grid { grid-template-columns: 1fr; } }
@media (min-width: 681px) and (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }

/* Card */
.news-card {
    display: flex; flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    transition: background .2s;
    position: relative;
    background: transparent;
}
.news-card:hover { background: var(--bg2); }

/* Left red line accent on hover */
.news-card::before {
    content: '';
    position: absolute; top: 24px; left: 0;
    width: 2px; height: 0;
    background: var(--accent-line);
    transition: height .3s ease;
    border-radius: 0 2px 2px 0;
}
.news-card:hover::before { height: calc(100% - 48px); }

/* Remove extra right borders */
.news-grid .news-card:nth-child(3n) { border-right: none; }
@media (max-width: 900px) and (min-width: 681px) {
    .news-grid .news-card:nth-child(3n) { border-right: 1px solid var(--border); }
    .news-grid .news-card:nth-child(2n) { border-right: none; }
}
@media (max-width: 680px) {
    .news-grid .news-card { border-right: none; }
}

.card-img {
    aspect-ratio: 3/2;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--bg3);
    border-radius: 4px;
}
.card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s ease, filter .3s;
    filter: saturate(.9);
}
.news-card:hover .card-img img { transform: scale(1.04); filter: saturate(1); }
.card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--border-dark); font-size: 1.6rem;
    background: var(--bg3);
}

.card-cat {
    font-size: .66rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--accent-line); margin-bottom: 8px;
}

.card-title {
    font-family: var(--font-head);
    font-size: 1.05rem; font-weight: 400;
    color: var(--text-head); line-height: 1.35;
    margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .2s;
}
.news-card:hover .card-title { color: var(--accent-line); }

.card-excerpt {
    font-size: .84rem; color: var(--text-muted); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: auto; font-weight: 300;
}

.card-footer {
    margin-top: 18px; padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-size: .72rem;
}
.card-meta { display: flex; gap: 10px; color: var(--text-light); }
.card-date { color: var(--text-light); font-weight: 300; }
.read-link {
    font-size: .68rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .06em;
    transition: color .2s;
}
.news-card:hover .read-link { color: var(--accent-line); }

/* ---------- Hero Card ---------- */
.news-grid .news-card:first-child {
    grid-column: 1 / -1;
    flex-direction: row; gap: 32px;
    padding: 32px;
    min-height: 280px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0;
}
.news-grid .news-card:first-child::before { top: 32px; height: 0; }
.news-grid .news-card:first-child:hover::before { height: calc(100% - 64px); }
.news-grid .news-card:first-child .card-img {
    flex: 0 0 42%; aspect-ratio: unset; margin-bottom: 0; align-self: stretch;
    border-radius: 4px;
}
.news-grid .news-card:first-child .card-title { font-size: 1.55rem; -webkit-line-clamp: 4; }
.news-grid .news-card:first-child .card-excerpt { -webkit-line-clamp: 5; font-size: .9rem; }
/* Reset borders for first hero card */
.news-grid .news-card:first-child { border-right: 1px solid var(--border) !important; }

@media (max-width: 640px) {
    .news-grid .news-card:first-child { flex-direction: column; }
    .news-grid .news-card:first-child .card-img { flex: none; aspect-ratio: 3/2; }
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center; padding: 100px 20px; color: var(--text-muted);
}
.empty-state .icon { font-size: 2rem; margin-bottom: 14px; opacity: .3; }
.empty-state h3 {
    font-family: var(--font-head); font-size: 1.4rem;
    font-weight: 400; color: var(--text); margin-bottom: 8px;
}
.empty-state p { font-size: .88rem; font-weight: 300; }

/* ---------- Pagination ---------- */
.pagination {
    margin-top: 48px; border-top: 1px solid var(--border); padding-top: 32px;
}
.pagination ul { display: flex; gap: 4px; list-style: none; justify-content: center; }
.pag-num, .pag-arrow {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .82rem; font-weight: 500; color: var(--text-muted);
    transition: all .15s;
}
.pag-num:hover, .pag-arrow:hover { border-color: var(--accent); color: var(--text-head); }
.pag-num.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pag-dots {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; color: var(--text-light);
}

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 40px; }

.widget-title {
    font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Popular */
.popular-list { list-style: none; display: flex; flex-direction: column; }
.popular-item {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
.popular-item:first-child { padding-top: 0; }
.popular-item:last-child { border-bottom: none; padding-bottom: 0; }
.popular-num {
    font-family: var(--font-head); font-size: 1.25rem; font-weight: 400;
    color: var(--border-dark); line-height: 1; flex-shrink: 0; width: 22px;
}
.popular-title {
    font-size: .84rem; line-height: 1.4; color: var(--text); font-weight: 400;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .15s;
}
.popular-title:hover { color: var(--accent-line); }
.popular-date { font-size: .7rem; color: var(--text-light); margin-top: 4px; font-weight: 300; }

/* Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
    padding: 4px 10px; font-size: .72rem; font-weight: 500;
    border: 1px solid var(--border); border-radius: 3px;
    color: var(--text-muted); transition: all .15s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--text-head); background: var(--bg3); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex; gap: 8px; align-items: center;
    font-size: .76rem; color: var(--text-light); font-weight: 400;
    padding: 16px 0 28px;
}
.breadcrumb a { color: var(--text-muted); transition: color .15s; }
.breadcrumb a:hover { color: var(--text-head); }
.breadcrumb .sep { color: var(--border-dark); }

/* ---------- Single Article ---------- */
.news-single-wrap {
    display: grid;
    grid-template-columns: 1fr var(--side-w);
    gap: 56px; padding: 0 0 72px;
    align-items: start;
}
@media (max-width: 900px) { .news-single-wrap { grid-template-columns: 1fr; } }

.article {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.article-hero { width: 100%; aspect-ratio: 21/9; object-fit: cover; filter: saturate(.9); }

.article-content { padding: 40px 44px 48px; }
@media (max-width: 640px) { .article-content { padding: 24px 20px; } }

.article-cats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.article-cat {
    font-size: .66rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--accent-line);
    border-bottom: 1.5px solid var(--accent-line);
    padding-bottom: 1px;
}

.article-title {
    font-family: var(--font-head);
    font-size: clamp(1.7rem, 3.5vw, 2.5rem);
    font-weight: 400; line-height: 1.18;
    color: var(--text-head);
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.article-meta {
    display: flex; gap: 24px; flex-wrap: wrap;
    font-size: .78rem; color: var(--text-muted); font-weight: 300;
    margin-bottom: 36px; padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.article-meta strong { color: var(--text); font-weight: 500; }

.article-body {
    font-size: .97rem; line-height: 1.82; color: var(--text); font-weight: 300;
}
.article-body h2 {
    font-family: var(--font-head); font-size: 1.35rem; font-weight: 400;
    color: var(--text-head); margin: 2.2rem 0 .9rem; line-height: 1.25;
}
.article-body h3 {
    font-family: var(--font-head); font-size: 1.1rem; font-weight: 400;
    color: var(--text-head); margin: 1.8rem 0 .6rem;
}
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin: 1rem 0 1.4rem 1.2rem; }
.article-body li { margin-bottom: .45rem; }
.article-body a {
    color: var(--accent-line);
    text-decoration: underline; text-underline-offset: 3px;
}
.article-body a:hover { opacity: .75; }
.article-body img {
    border-radius: 4px; margin: 2rem auto;
    border: 1px solid var(--border);
}
.article-body blockquote {
    border-left: 2px solid var(--accent-line);
    margin: 1.8rem 0; padding: .5rem 0 .5rem 1.4rem;
    color: var(--text-muted); font-style: italic;
}

.article-tags { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.article-tags-label {
    font-size: .66rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--text-light); margin-bottom: 12px;
}

/* Related */
.related { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.related-title {
    font-size: .66rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--text-muted); margin-bottom: 0;
}
.related-list { list-style: none; }
.related-item { border-bottom: 1px solid var(--border); }
.related-item:last-child { border-bottom: none; }
.related-item a {
    display: flex; gap: 10px; padding: 14px 0;
    font-size: .88rem; color: var(--text); line-height: 1.4; transition: color .15s;
}
.related-item a::before {
    content: '—'; color: var(--border-dark); font-size: .85rem; flex-shrink: 0; line-height: 1.5;
}
.related-item a:hover { color: var(--accent-line); }
.related-item-date { font-size: .7rem; color: var(--text-light); margin-top: 3px; font-weight: 300; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
    font-size: .76rem;
    color: var(--text-light); font-weight: 300;
    background: var(--bg2);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.news-card { animation: fadeIn .3s ease both; }
.news-grid .news-card:nth-child(1) { animation-delay: .02s; }
.news-grid .news-card:nth-child(2) { animation-delay: .07s; }
.news-grid .news-card:nth-child(3) { animation-delay: .12s; }
.news-grid .news-card:nth-child(4) { animation-delay: .17s; }
.news-grid .news-card:nth-child(5) { animation-delay: .22s; }
.news-grid .news-card:nth-child(6) { animation-delay: .27s; }
.news-grid .news-card:nth-child(n+7) { animation-delay: .30s; }
