
/* Основные стили страницы новостей */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2d3748;
    --accent-color: #3182ce;
    --accent-hover: #2c5282;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --danger-color: #e53e3e;
    --warning-color: #d69e2e;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease-in-out;
    --anim-speed-fast: 0.55s;
    --anim-speed-base: 0.7s;

    /* фирменная кривая — быстрая, но плавная */
    --anim-ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: auto;
    scrollbar-color: #c1c7d0 transparent;
}

/* ====== Chrome / Edge / Safari ====== */
*::-webkit-scrollbar {
    width: 10px; /* толщина */
}

*::-webkit-scrollbar-track {
    background: transparent; /* фон дорожки */
}

*::-webkit-scrollbar-thumb {
    background-color: #c1c7d0;  /* цвет бегунка */
    border-radius: 8px;        /* скругление */
    border: 2px solid transparent; 
    background-clip: content-box;
    transition: background-color 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #9aa3af; /* чуть темнее при наведении */
}


body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.blok-1 {
    height: 90px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumbs-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
    font-size: 14px;
}

.breadcrumbs-item {
    display: flex;
    align-items: center;
}

.breadcrumbs-item:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: var(--text-muted);
}

.breadcrumbs-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs-link:hover {
    color: var(--accent-color);
}

.breadcrumbs-current {
    color: var(--text-primary);
    font-weight: 500;
}

.news-page {
    max-width: 720px;
}

.news-header {
    margin-bottom: 24px;
}

.news-title {
    font-size: 1.8rem;
}

.reaction-item {
    background: #f1f3f5;
    border-radius: 999px;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
}

/* КОНТЕНТ НОВОСТИ */
/* ==================== ОСНОВНОЙ КОНТЕНТ НОВОСТИ ==================== */
.news-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==================== ЗАГОЛОВКИ ВНУТРИ КОНТЕНТА ==================== */
.news-content h2 {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    color: #1a202c;
    margin: 10px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    letter-spacing: -0.01em;
}

.news-content h3 {
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    color: #2d3748;
}

.news-content h4 {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    color: #4a5568;
    margin: 28px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== СПИСКИ ==================== */
.news-content ul,
.news-content ol {
    padding-left: 28px;
}

.news-content li {
    position: relative;
    padding-left: 8px;
}

.news-content ul li::before {
    content: "•";
    color: #4299e1;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    font-size: 1.2em;
}

.news-content ol {
    counter-reset: list-counter;
}

.news-content ol li {
    counter-increment: list-counter;
}

.news-content ol li::before {
    content: counter(list-counter) ".";
    color: #4299e1;
    font-weight: 600;
    position: absolute;
    left: -28px;
    width: 24px;
    text-align: right;
}

/* ==================== ЦИТАТЫ ==================== */
.news-content blockquote {
    font-size: 20px;
    line-height: 1.7;
    font-style: italic;
    color: #4a5568;
    margin: 32px 0;
    padding: 24px 32px;
    background: linear-gradient(90deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 4px solid #38b2ac;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.news-content blockquote::before {
    content: "❝";
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 40px;
    color: #38b2ac;
    opacity: 0.2;
}

.news-content blockquote::after {
    content: "❞";
    position: absolute;
    bottom: -20px;
    right: 20px;
    font-size: 40px;
    color: #38b2ac;
    opacity: 0.2;
}

.news-content blockquote cite {
    display: block;
    font-size: 16px;
    font-style: normal;
    color: #718096;
    margin-top: 12px;
    text-align: right;
    font-weight: 500;
}

.news-content blockquote cite::before {
    content: "— ";
}

/* ==================== ССЫЛКИ ==================== */
.news-content a {
    color: #3182ce;
    text-decoration: none;
    border-bottom: 2px solid rgba(49, 130, 206, 0.2);
    transition: all 0.2s ease;
    padding-bottom: 1px;
    font-weight: 500;
}

.news-content a:hover {
    color: #2c5282;
    border-bottom-color: #3182ce;
    background: rgba(49, 130, 206, 0.05);
}

.news-content a:focus {
    outline: 2px solid rgba(49, 130, 206, 0.3);
    outline-offset: 2px;
    border-radius: 3px;
}






.news-media-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(1, 1fr);
    gap: 6px;

    margin: 16px 0 24px;
    position: relative;

    height: 480px;
}


.media-preview-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    cursor: pointer;

    background: #00000005;
    box-shadow: 0 5px 20px rgb(0 0 0 / 9%);

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        filter .25s ease;
}

/* если одно медиа */
.news-media-preview[data-count="1"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}


.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* primary = крупное */
.media-preview-item.is-primary {
    grid-row: span 2;
}

.media-preview-item.is-secondary {
    border-radius: 12px;
}

/* hover-акцент */
.news-media-preview.is-hovering .media-preview-item {
    filter: brightness(.85);
}

.news-media-preview .media-preview-item.is-hovered {
    filter: brightness(1);
    transform: scale(1.015);
    z-index: 2;
}

.media-primary-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    pointer-events: none;
}

.media-preview-more {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    pointer-events: none;
}




/*Модальное окно*/
.media-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.media-modal.open {
    display: block;
}

/* ===== BACKDROP ===== */

.media-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 36, 0.65);
    backdrop-filter: blur(10px);
}

/* ===== CONTENT ===== */

.media-modal-content {
    position: relative;
    z-index: 2;
    width: min(960px, 92vw);
    height: min(80vh, 680px);
    margin: auto;
    top: 50%;
    transform: translateY(-50%);
    background: #00000078;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== VIEW ===== */

.media-modal-view {
    position: relative;
    flex: 1;
    background: #00000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 100%;
}

.media-modal-view img,
.media-modal-view video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===== CLOSE ===== */

.media-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: none;
    cursor: pointer;
    z-index: 5;
}

.media-modal-close::before,
.media-modal-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: #fff;
}

.media-modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.media-modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.media-modal-close:hover {
    background: rgba(255,255,255,.2);
}

/* ===== NAV ===== */

.media-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    z-index: 5;
}

.media-modal-nav::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 10px;
    height: 10px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

.media-modal-nav.prev {
    left: 14px;
}

.media-modal-nav.prev::before {
    transform: rotate(-135deg);
}

.media-modal-nav.next {
    right: 14px;
}

.media-modal-nav.next::before {
    transform: rotate(45deg);
}

.media-modal-nav:hover {
    background: rgba(255,255,255,.22);
}

/* ===== DOTS ===== */

.media-modal-dots {
    position: absolute;
    bottom: 0px;
    left: 50%;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 12px 0 14px;
    align-items: center;
}

.media-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgb(0 0 0 / 50%);
    cursor: pointer;
}

.media-dot.active {
        background: #ffffff;
    width: 10px;
    height: 10px;
}



/* МЕНЮ РЕАКЦИЙ */
.news-reactions {
    margin: 24px 0 32px;
    display: flex;
    justify-content: space-between;
}

.reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reaction-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;
    border-radius: 20px;

    border: 1px solid #e5e5e5;
    background: #fff;

    cursor: pointer;
    transition: all 0.2s ease;

    font-size: 14px;
}

.reaction-item:hover {
    background: #f5f7fa;
    border-color: #d0d7de;
}

.reaction-item.is-active {
    background: #e7f0ff;
    border-color: #4c82ff;
}

.reaction-item.is-active .reaction-emoji {
    transform: scale(1.15);
}

.reaction-item.has-reactions {
    background: #f0f4ff;
    border-color: #c7d2fe;
}

.reaction-emoji {
    font-size: 18px;
    line-height: 1;
}

.reaction-count {
    font-size: 13px;
    font-weight: 500;
    color: #444;
}


/* ПОПУЛЯРНЫЫЕ НОВОСТИ */

.block-card .currency-all {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
}

/* ===== ПОПУЛЯРНЫЕ НОВОСТИ ===== */

.additional-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 5%;
    margin: 3rem 0;
}

.popular-list {
    list-style: none;
}

.popular-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.popular-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-link {
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    transition: var(--transition);
}

.popular-link:hover {
    color: var(--accent-color);
}

.popular-title {
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.popular-date {
    font-size: 12px;
    color: var(--text-muted);
}

.popular-meta {
    display: flex;
    justify-content: space-between;
}
.vievs-top {
    font-size: 12px;
}

/* ===========================
   Блок категорий
=========================== */

.categories-block .block-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111;
}

/* Сетка категорий */
.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* расстояние между кнопками */
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Каждый элемент категории */
.category-item {
    flex: 1 0 30%; /* максимум 3 в ряд, но адаптивно */
    min-width: 90px;
}

/* Ссылка-кнопка категории */
.category-link {
    display: block;
    text-align: center;
    background-color: #f3f4f6;
    color: #111;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover и актив */
.category-link:hover {
    background-color: #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: #000;
}

.category-item.active .category-link {
    background-color: #2563eb;
    color: #fff;
    font-weight: 600;
}


.main-news-list {
    display: flex;
    justify-content: center;
    gap: 2%;
}

/* Популярные новости */

.news-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* ===== Sidebar контейнер ===== */

.news-recommendation {
    width: 300px;
    position: sticky;
    top: 90px;
    background: #ffffff;
    box-shadow: rgb(0 0 0 / 10%) 0px 0px 10px;
    border-radius: 10px;
}

/* ===== Общий список ===== */

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 6px;
    max-height: 95vh;
    padding: 10px;

    /* Firefox */
    scrollbar-width: none;

    /* IE 10+ */
    -ms-overflow-style: none;
}

/* Chrome / Safari / Edge */
.recommendation-list::-webkit-scrollbar {
    display: none;
}

/* ===== Категория ===== */

.recommendation-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-top: 18px;
    margin-bottom: 6px;
    margin-top: 15px;
}

/* Первая категория без отступа сверху */
.recommendation-category:first-child {
    margin-top: 0;
}

/* ===== Элемент новости ===== */

.recommendation-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.recommendation-item:hover {
    background: #f4f4f4;
}

/* Тайтл */

.recommendation-item__title {
    font-size: 13px;
    line-height: 1.3;
    color: #222;
}

/* Просмотры */

.recommendation-item__views {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.recommendation-list-title {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border-bottom: 1px solid #b9b9b9;
}

.recommendation-list-title-h1 {
    font-size: 1.3rem;
    padding: 8px;
}


/* SVG иконка */
.vievs {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; 
}

.views-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #6d6d6d;
}

.views-icon-dop {
    color: #ffffff;
}


/* ===============================
   Навигация слева
================================ */

.navigation {
    display: flex;
    align-items: center;
    margin-top: 16px;
    border-top: 1px solid #b9b9b9;
    padding: 8px;
    justify-content: space-between;

}

.nav-link {
    font-family: "Roboto", "Helvetica", sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    color: #1a1a1a;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

/* Hover эффект: лёгкий underline и фон */
.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #007bff;
}

/* Эффект "underline" снизу при наведении */
.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Активная страница (можно динамически добавлять класс .active через PHP) */
.nav-link.active {
    color: #007bff;
}

.nav-link.active::after {
    width: 100%;
}


@media (max-width: 768px) {

    .container {
        padding: 0 0.6rem;
    }
    .blok-1 {
        height: 0px;
    }
    .breadcrumbs-list {
        flex-wrap: wrap;
    }
    .breadcrumbs {
        padding: 0 0 12px 0;
        margin-top: 1rem;
        margin-bottom: 0px;
    }
    .main-news-list {
        flex-direction: column;
    }
    .news-title {
        font-size: 1.2rem;
    }
    .news-media-preview {
        height: auto;
    }
    .news-date {
        font-size: 0.6rem;
    }
    .news-header {
        margin: 1rem 0;
    }
    .reaction-emoji {
        font-size: 0.8rem;
    }
    .reaction-item {
        padding: 6px 8px;
        gap: 2px;
        border: 1px solid #898989;
    }
    .news-reactions {
        flex-direction: column;
        align-items: flex-end;
        margin: 1rem 0;
    }
    .reactions-container {
        gap: 6px;
    }
    .news-page {
        margin: 2rem 0;
    }
    .media-preview-item img, .media-preview-item video {
        max-height: 300px;
    }


    .news-content h2 {
        font-size: 1.3rem;
        margin: 1rem 0;
    }
    .news-content blockquote {
        font-size: 1rem;
        margin: 1rem 0;
    }
    .news-content h3 {
        font-size: 1.3rem;
    }

    .news-media-preview {
        grid-template-columns: 3fr 1fr;
    }

    .news-sidebar {
        width: 100%;
    }
    .news-recommendation {
        width: 100%;
    }
    .recommendation-list {
        padding: 1rem;
    }
    .additional-blocks {
        margin: 2rem 0;
        gap: 2rem;
    }
    .category-item {
        flex: auto;
        min-width: auto;
    }
    .popular-title {
        font-size: 0.8rem;
    }
    .popular-list {
        padding: 10px;
    }

    .media-modal-content {
        width: auto;
        height: auto;
        border-radius: 0px;
    }

    .media-modal-close {
        width: 20px;
        height: 20px;
    }
    .media-modal-close::before, .media-modal-close::after {
        width: 12px;
    }

    .media-dot.active {
        width: 6px;
        height: 6px;
    }
}