/*
Theme Name: NEWS-TM THEME
Theme URI: https://news-tm.ru
Author: Brisper
Author URI: https://news-tm.ru
Description: Чёрно-белая минималистичная тема для новостного сайта
Version: 1.0.2
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ntm
*/

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== ШАПКА ========== */
.site-header {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Логотип */
.site-logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: #000;
}

/* Меню */
.nav-list {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-list a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-list a:hover {
    color: #000;
}

/* Бургер-меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: #000;
    transition: 0.3s;
}

/* Ссылка на поиск */
.search-link {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.search-link:hover {
    color: #000;
}

/* ========== ПОДВАЛ ========== */
.site-footer {
    padding: 40px 0;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    margin-top: 60px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.footer-nav {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #000;
}

/* ========== КАРТОЧКИ ПОСТОВ ========== */
.posts-grid {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.posts-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.posts-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.posts-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
    .posts-grid.cols-3,
    .posts-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* Карточка */
.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Изображение */
.post-card-image {
    display: block;
    overflow: hidden;
    background: #f0f0f0;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Контент */
.post-card-content {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Рубрика */
.post-card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    background: #f0f0f0;
    padding: 2px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    align-self: flex-start;
}

.post-card-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px 0;
    color: #000;
}

.post-card-content h3:hover {
    color: #333;
}

.post-card-meta {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ===== Карточка без картинки ===== */
.post-card.no-image .post-card-content {
    padding: 24px 20px 20px;
    background: #f8f9fa;
    flex: 1;
    min-height: 200px;
    justify-content: center;
}

.post-card.no-image .post-card-content h3 {
    font-size: 1.4rem;
}

.post-card.no-image .post-card-meta {
    border-top: 1px solid #e0e0e0;
    margin-top: 12px;
}

.post-card.no-image .post-card-category {
    background: #e0e0e0;
}

/* Адаптив */
@media (max-width: 768px) {
    .post-card.no-image .post-card-content {
        padding: 18px 16px 16px;
        min-height: 150px;
    }
    .post-card.no-image .post-card-content h3 {
        font-size: 1.2rem;
    }
    .post-card-content h3 {
        font-size: 1.1rem;
    }
    .post-card-content {
        padding: 14px 16px 16px;
    }
}

/* ========== КНОПКА "ЗАГРУЗИТЬ ЕЩЁ" ========== */
.load-more-wrap {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 12px 40px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: #333;
}

/* ========== АДАПТИВ ========== */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    .main-nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ========== СТРАНИЦА СТАТЬИ ========== */
.single-container {
    max-width: 820px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Хлебные крошки */
.breadcrumbs {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 24px;
}
.breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs a:hover {
    color: #000;
}
.breadcrumbs .sep {
    margin: 0 8px;
    color: #ccc;
}

/* Заголовок */
.single-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    color: #000;
}

/* Мета-информация */
.single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 32px;
}

.meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar img {
    border-radius: 50%;
}

.author-name {
    font-weight: 600;
    color: #000;
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 0.9rem;
}

/* Изображение */
.single-image {
    margin: 32px 0;
    border-radius: 16px;
    overflow: hidden;
}
.single-image img {
    width: 100%;
    height: auto;
    display: block;
}
.single-image figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-top: 8px;
}

/* Контент */
.single-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #1a1a1a;
}

.single-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 48px 0 16px;
    line-height: 1.3;
}

.single-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 32px 0 12px;
}

.single-content p {
    margin-bottom: 24px;
}

.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
}

.single-content blockquote {
    border-left: 4px solid #000;
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: #555;
}

.single-content ul,
.single-content ol {
    margin: 16px 0 24px 24px;
}

.single-content li {
    margin-bottom: 8px;
}

/* Теги */
.single-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

.tags-label {
    font-weight: 600;
    color: #333;
    margin-right: 4px;
}

.single-tags a {
    background: #f5f5f5;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}
.single-tags a:hover {
    background: #000;
    color: #fff;
}

/* Навигация между постами */
.single-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 40px 0;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

.single-nav .nav-item {
    flex: 1;
}

.single-nav .next {
    text-align: right;
}

.single-nav a {
    display: inline-block;
    padding: 8px 0;
    color: #000;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
    font-size: 1rem;
}
.single-nav a:hover {
    opacity: 0.6;
}

/* Комментарии */
.single-comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

/* Адаптив */
@media (max-width: 768px) {
    .single-title {
        font-size: 2rem;
    }
    .single-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .single-content {
        font-size: 1rem;
    }
    .single-nav {
        flex-direction: column;
        text-align: center;
    }
    .single-nav .next {
        text-align: center;
    }
}

/* ========== СТРАНИЦЫ (PAGE) ========== */
.page-container {
    max-width: 820px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-title-single {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: #000;
}

.page-image {
    margin: 24px 0 32px;
    border-radius: 16px;
    overflow: hidden;
}
.page-image img {
    width: 100%;
    height: auto;
    display: block;
}

.page-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #1a1a1a;
}

.page-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 40px 0 16px;
}
.page-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 32px 0 12px;
}
.page-content p {
    margin-bottom: 20px;
}
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}
.page-content ul,
.page-content ol {
    margin: 16px 0 24px 24px;
}
.page-content li {
    margin-bottom: 8px;
}

.page-comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

/* Адаптив страниц */
@media (max-width: 768px) {
    .page-title-single {
        font-size: 2rem;
    }
    .page-content {
        font-size: 1rem;
    }
}

/* ========== РУБРИКИ (CATEGORY) ========== */
.category-container {
    max-width: 1140px;
    margin: 40px auto;
    padding: 0 20px;
}

.category-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
}

.category-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000;
    margin-bottom: 8px;
}

.category-description {
    color: #666;
    font-size: 1.05rem;
    margin-top: 4px;
}

/* Сообщение, если нет постов */
.no-posts {
    text-align: center;
    color: #999;
    font-size: 1.1rem;
    padding: 40px 0;
}

/* ========== МЕТКИ (TAG) ========== */
.tag-container {
    max-width: 1140px;
    margin: 40px auto;
    padding: 0 20px;
}

.tag-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
}

.tag-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000;
    margin-bottom: 8px;
}

.tag-description {
    color: #666;
    font-size: 1.05rem;
    margin-top: 4px;
}

/* ========== СТРАНИЦА ПОИСКА ========== */
.search-container {
    max-width: 1140px;
    margin: 40px auto;
    padding: 0 20px;
}

.search-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #000;
}

.search-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000;
    margin-bottom: 4px;
}

.search-count {
    color: #666;
    font-size: 0.95rem;
}

/* Форма поиска */
.search-form-wrap {
    margin-bottom: 40px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
}

.search-field {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-field:focus {
    border-color: #000;
}

.search-submit {
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-submit:hover {
    background: #333;
}

/* ========== СТРАНИЦА 404 ========== */
.error-container {
    max-width: 820px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    color: #000;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
}

.error-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 12px;
}

.error-text {
    font-size: 1.1rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto 30px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.error-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #000;
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.error-btn:hover {
    background: #333;
}

.error-btn-outline {
    background: transparent;
    color: #000;
    border: 1px solid #ddd;
}

.error-btn-outline:hover {
    background: #f5f5f5;
}

.error-search p {
    margin-bottom: 12px;
    color: #999;
    font-size: 0.95rem;
}

.error-search .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* Адаптив 404 */
@media (max-width: 768px) {
    .error-code {
        font-size: 5rem;
    }
    .error-title {
        font-size: 1.6rem;
    }
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* ========== ФУТЕР ========== */
.site-footer {
    padding: 50px 0 30px;
    margin-top: 60px;
    background: #f7f7f7;
    border-top: 1px solid #e5e5e5;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

/* Левая колонка */
.footer-brand {
    text-align: left;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: #000;
    letter-spacing: -0.02em;
}

.footer-desc {
    margin: 8px 0 16px;
    font-size: 0.95rem;
    color: #555;
}

.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
    color: #444;
}

.footer-contacts a {
    color: #444;
    text-decoration: none;
}

.footer-contacts a:hover {
    color: #000;
}

/* Правая колонка */
.footer-links-col {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-links a {
    font-size: 0.95rem;
    color: #444;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #000;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    font-size: 0.95rem;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: #000;
}

/* Юридический текст */
.footer-legal {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.7;
    padding: 20px 0 10px;
    border-top: 1px solid #e5e5e5;
}

.footer-legal a {
    color: #666;
    text-decoration: underline;
}

.footer-legal a:hover {
    color: #000;
}

.footer-legal p {
    margin: 0 0 8px 0;
}

.footer-legal p:last-child {
    margin-bottom: 0;
}

/* Копирайт */
.footer-copy {
    font-size: 0.85rem;
    color: #aaa;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    text-align: left;
}

.footer-copy p {
    margin: 0;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-links-col {
        text-align: left;
        align-items: flex-start;
    }

    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    .footer-social {
        margin-top: 6px;
    }

    .footer-copy {
        text-align: center;
    }
}

/* ========== БЛОК "ЧИТАЙТЕ ТАКЖЕ" ========== */
.related-posts {
    margin: 48px 0 32px;
    padding: 28px 30px 24px;
    background: #f7f7f7;
    border-radius: 12px;
    border-left: 4px solid #000;
}

.related-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #000;
    letter-spacing: -0.02em;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.related-item {
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 0;
}

.related-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 16px;
}

.related-headline {
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    transition: color 0.2s;
}

.related-link:hover .related-headline {
    color: #444;
}

.related-date {
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Если нужно 2-3 колонки */
@media (min-width: 600px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 30px;
    }
}

@media (min-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}