/* =========================
   BASE
========================= */

:root {
    --text: #111;
    --muted: #777;
    --line: #e6e6e6;
    --accent: #b00020;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

/* =========================
   LINKS (FIX underline)
========================= */

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

/* =========================
   LAYOUT
========================= */

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.main-content {
    padding: 30px 0;
}

/* =========================
   HEADER
========================= */

.site-header {
    border-bottom: 1px solid var(--line);
}

.top-line {
    font-size: 10px;
    color: var(--muted);
}

.top-line-inner {
    height: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================
   BRAND
========================= */

.brand {
    display: inline-flex;
    align-items: center;
}

.brand-row {
    display: flex;
    align-items: center;
    padding: 14px 0 12px;
}

.brand-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
}

.nav-brand-mark {
    display: none;
    text-decoration: none;
}

.nav-brand-logo {
    display: block;
    width: auto;
    max-height: 25px;
}

.main-nav.is-sticky .nav-brand-mark {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}
/* =========================
   SEARCH
========================= */

.search-form {
    display: flex;
    border-bottom: 1px solid var(--line);
}

.search-form input {
    border: none;
    padding: 8px;
    outline: none;
    font-size: 14px;
}

.search-form button {
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
}

/* =========================
   NAVIGATION
========================= */

.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 2px solid #c40000;
}

.nav-inner {
    display: flex;
    gap: 24px;
    height: 42px;
    align-items: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
}

/* =========================
   GRID
========================= */

.news-home-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 1fr;
    gap: 28px;
}

/* =========================
   TITLES
========================= */

.section-title {
    font-size: 15px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

/* =========================
   META
========================= */

.news-meta {
    font-size: 12px;
    color: var(--muted);
}

/* =========================
   IMPORTANT (LEFT)
========================= */

.important-item {
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.important-item h3 {
    font-size: 24px;
    margin: 6px 0;
    line-height: 1.2;
}

.important-item p {
    margin: 0;
    color: var(--muted);
}

.news-list-image {
    display: block;
    margin: 10px 0;
}

.news-list-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #f3f3f3;
}

/* =========================
   LATEST (CENTER)
========================= */

.latest-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.latest-item h3 {
    font-size: 17px;
    margin: 4px 0;
    line-height: 1.25;
}

/* =========================
   RIGHT COLUMN
========================= */

.category-block .section-title {
    font-size: 15px;
    font-weight: 700;
}

.category-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.category-item a {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    color: #222;
}

.category-item a:hover {
    color: var(--accent);
}

/* номер/маркер (опционально, как у РБК) */
.category-item::before {
    content: "—";
    margin-right: 6px;
    color: var(--muted);
}

/* =========================
   TAGS
========================= */

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    font-size: 13px;
    color: var(--muted);
}

.tag-cloud a:hover {
    color: var(--accent);
}

.all-tags-link {
    margin: 10px 0 0;
    font-size: 13px;
}

.all-tags-link a {
    color: var(--accent);
}

/* =========================
   THEMES
========================= */

.theme-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.35;
}

.theme-list span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
}

.theme-description {
    margin: -8px 0 18px;
    color: #555;
    font-size: 17px;
    line-height: 1.5;
}

.news-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.news-theme {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: #222;
    font-size: 13px;
    font-weight: 700;
}

.news-theme:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.news-theme-related {
    margin: 28px 0 0;
    border-top: 2px solid var(--accent);
}

.theme-related-block {
    padding: 16px 0 0;
}

.theme-related-block + .theme-related-block {
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.theme-related-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

.theme-related-item {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.theme-related-item a {
    display: inline-block;
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
}

.theme-related-more {
    display: inline-flex;
    margin-top: 12px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    background: #111;
    color: #aaa;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    font-size: 14px;
}

/* =========================
   UTILS
========================= */

.muted {
    color: var(--muted);
}

/* =========================
   ERROR PAGES
========================= */

.error-page {
    max-width: 680px;
    min-height: 52vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px 0 64px;
}

.error-code {
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.error-page h1 {
    margin: 8px 0 12px;
    font-size: 46px;
    line-height: 1.05;
    font-weight: 800;
}

.error-page p {
    max-width: 560px;
    margin: 0;
    color: #555;
    font-size: 18px;
    line-height: 1.55;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.error-primary-link,
.error-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

.error-primary-link {
    background: var(--accent);
    color: #fff;
}

.error-primary-link:hover {
    background: #8f001a;
    color: #fff;
}

.error-secondary-link {
    border: 1px solid var(--line);
    color: #222;
}

.error-secondary-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================
   ABOUT PAGE
========================= */

.about-page {
    max-width: 760px;
    padding: 18px 0 56px;
}

.about-kicker {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.about-text {
    border-top: 2px solid var(--accent);
    padding-top: 22px;
    color: #333;
    font-size: 18px;
    line-height: 1.65;
}

.about-text p {
    margin: 0 0 18px;
}

/* =========================
   RESPONSIVE
========================= */

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

    .right-column {
        grid-column: 1 / -1;
    }
}

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

    .brand-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .search-form {
        width: 100%;
    }

    .nav-inner {
        overflow-x: auto;
        white-space: nowrap;
    }

    .error-page h1 {
        font-size: 34px;
    }

    .error-page p {
        font-size: 16px;
    }
}

/* =========================
   NEWS DETAIL
========================= */

.news-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(260px, 0.9fr);
    gap: 36px;
}

.news-detail-main {
    max-width: 820px;
}

.detail-meta {
    margin-bottom: 10px;
}

.news-detail-title {
    margin: 0 0 16px;
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.news-detail-summary {
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 1.45;
    color: #444;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.article-author-photo {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.article-author-body {
    min-width: 0;
}

.article-author-label {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    text-transform: uppercase;
}

.article-author-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.article-original-author {
    color: var(--muted);
    font-weight: 400;
}

.article-author-body p {
    margin: 4px 0 0;
    color: #555;
    font-size: 13px;
    line-height: 1.45;
}

.news-featured-image {
    margin: 0 0 24px;
}

.news-featured-image-small {
    max-width: 320px;
}

.news-featured-image-medium {
    max-width: 520px;
}

.news-featured-image-large {
    max-width: 680px;
}

.news-featured-image-full {
    max-width: none;
}

.news-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    background: #f3f3f3;
}

.news-featured-image figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.news-featured-image figcaption span::before {
    content: " / ";
}

.news-detail-text {
    font-size: 18px;
    line-height: 1.65;
}

.news-detail-text p {
    margin: 0 0 18px;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.news-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f1f1;
    color: #333;
    font-size: 13px;
    text-decoration: none;
}

.news-tag:hover {
    background: #e0e0e0;
    color: #000;
}

.article-source-link {
    margin: 20px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.article-source-link a {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.article-gallery {
    position: relative;
    margin: 0 0 24px;
    outline: none;
}

.article-gallery-viewport {
    position: relative;
    width: 100%;
    min-height: 260px;
    background: #f3f3f3;
    overflow: hidden;
}

.article-gallery-slide {
    display: none;
    margin: 0;
}

.article-gallery-slide.is-active {
    display: block;
}

.article-gallery-slide img {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    background: #f3f3f3;
}

.article-gallery-slide figcaption {
    padding: 8px 0 0;
    color: var(--muted);
    background: #fff;
    font-size: 12px;
    line-height: 1.4;
}

.article-gallery-slide figcaption span::before {
    content: " / ";
}

.article-gallery-button {
    position: absolute;
    top: min(260px, 45%);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transform: translateY(-50%);
}

.article-gallery-button:hover,
.article-gallery-button:focus-visible {
    background: rgba(0, 0, 0, 0.72);
}

.article-gallery-prev {
    left: 12px;
}

.article-gallery-next {
    right: 12px;
}

.article-gallery-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.article-embeds {
    display: grid;
    gap: 18px;
    margin: 24px 0;
}

.article-embed {
    margin: 0;
}

.article-embed-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
}

.article-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-embed figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.tag-description {
    margin: -8px 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    color: #444;
    font-size: 13px;
    line-height: 1.45;
}

.tag-description p {
    margin: 0 0 8px;
}

.tag-description a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 300;
    overflow-wrap: anywhere;
}

.tag-description a:hover {
    color: #555;
}

.news-detail-sidebar {
    padding-top: 4px;
}

.side-news-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.side-news-item a {
    font-size: 14px;
    line-height: 1.35;
}

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

    .news-detail-title {
        font-size: 32px;
    }

    .news-detail-text {
        font-size: 17px;
    }

    .article-gallery-viewport {
        min-height: 180px;
    }

    .article-gallery-button {
        top: min(180px, 45%);
        width: 34px;
        height: 34px;
        font-size: 24px;
    }
}

/* =========================
   CATEGORY PAGE
========================= */

.category-page {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

/* -------------------------
   LEFT COLUMN (MAIN)
------------------------- */

.category-main {
    min-width: 0;
}

.page-title {
    margin: 0 0 20px;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.category-news-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.category-news-item:last-of-type {
    border-bottom: none;
}

.category-news-item h2 {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.3;
}

.category-news-item h2 a {
    color: var(--text);
}

.category-news-item h2 a:hover {
    color: var(--accent);
}

.category-news-item p {
    margin: 0 0 6px;
    color: #555;
    font-size: 15px;
    line-height: 1.45;
}

.category-archive-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 10px 0 0;
}

.category-archive-heading {
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: #222;
    font-size: 15px;
    font-weight: 700;
}

.category-archive-links a {
    color: #333;
    font-size: 13px;
    line-height: 1.8;
}

.category-archive-links a:hover {
    color: var(--accent);
}

.category-archive-links a:not(:last-child)::after {
    content: "/";
    display: inline-block;
    margin: 0 9px;
    color: var(--muted);
}

/* -------------------------
   RIGHT COLUMN (SIDEBAR)
------------------------- */

.sidebar-category-block {
    margin-bottom: 24px;
}

.sidebar-category-block h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    padding-bottom: 4px;
}

.sidebar-category-block h3 a {
    color: var(--text);
}

.sidebar-category-block h3 a:hover {
    color: var(--accent);
}

.sidebar-news-item {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.sidebar-news-item a {
    font-size: 13px;
    line-height: 1.35;
    color: #222;
}

.sidebar-news-item a:hover {
    color: var(--accent);
}

.sidebar-empty {
    font-size: 12px;
    color: var(--muted);
}

/* -------------------------
   RESPONSIVE
------------------------- */

@media (max-width: 900px) {
    .category-page {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 20px;
    }
}


.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    line-height: 1.8;
    margin: 24px 0;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    color: #222;
    line-height: 1.15;
    text-decoration: none;
}

.tag-cloud-item:hover {
    color: #b00020;
    text-decoration: underline;
}

.tag-cloud .tag-weight-1 {
    font-size: 13px;
}

.tag-cloud .tag-weight-2 {
    font-size: 16px;
}

.tag-cloud .tag-weight-3 {
    font-size: 20px;
}

.tag-cloud .tag-weight-4 {
    font-size: 32px;
}

.tag-cloud .tag-weight-5 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.15;
}
