/*
Theme Name: SEO Module
Theme URI: https://seo-module.ru
Description: Редакционная тема для блога о SEO и маркетинге. Комиксные иллюстрации в матовых рамках, типографика Plus Jakarta Sans.
Version: 2.0.5
Author: SEO Module
Author URI: https://seo-module.ru
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: seo-module
Requires PHP: 7.4
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    --color-bg: #F6F5F2;
    --color-surface: #FFFFFF;
    --color-surface-illustration: #FAF9F7;
    --color-text: #1A1D26;
    --color-text-muted: #5C6370;
    --color-text-subtle: #8E95A9;
    --color-border: rgba(26, 29, 38, 0.08);
    --color-border-strong: rgba(26, 29, 38, 0.12);
    --color-accent: #6C5CE7;
    --color-accent-hover: #5B4BD6;
    --color-accent-soft: rgba(108, 92, 231, 0.1);
    --color-secondary: #00B894;
    --color-secondary-soft: rgba(0, 184, 148, 0.12);

    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.65;
    --line-height-prose: 1.85;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 3px rgba(26, 29, 38, 0.06);
    --shadow-md: 0 4px 16px rgba(26, 29, 38, 0.08);
    --shadow-card: 0 2px 12px rgba(26, 29, 38, 0.06);

    --space-section: 3rem;
    --max-width-prose: 68ch;

    /* Bootstrap overrides */
    --bs-body-font-family: var(--font-family);
    --bs-body-color: var(--color-text);
    --bs-body-bg: var(--color-bg);
    --bs-primary: var(--color-accent);
    --bs-primary-rgb: 108, 92, 231;
    --bs-link-color: var(--color-accent);
    --bs-link-hover-color: var(--color-accent-hover);
    --bs-border-color: var(--color-border-strong);
}

/* ==========================================================================
   Base
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

/* ==========================================================================
   Media frame — комиксные иллюстрации
   ========================================================================== */
.media-frame {
    background: var(--color-surface-illustration);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.media-frame img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: var(--radius-sm);
    margin: 0 auto;
    box-shadow: none;
}

.post-item .media-frame img,
.post-thumbnail.media-frame img {
    max-height: 420px;
}

.single-post .post-hero__media.media-frame img,
.single-post .post-thumbnail.media-frame img {
    max-height: none;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    margin-bottom: var(--space-section);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

body.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.78);
    border-bottom-color: rgba(26, 29, 38, 0.06);
    box-shadow: var(--shadow-sm);
}

.site-header.is-scrolled .header-main {
    padding-top: 0.75rem;
    padding-bottom: 0.85rem;
}

.site-header--v2 .header-top {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8125rem;
    color: var(--color-text-subtle);
}

.header-top__aside-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem 0.85rem;
}

.header-top__phone {
    white-space: nowrap;
}

.header-top .header-socials.social-links--icons {
    display: inline-flex;
}

.site-header--v2 .header-top a {
    color: var(--color-text-muted);
}

.site-header--v2 .header-top a:hover {
    color: var(--color-accent);
}

.site-header--v2 .header-main {
    padding: 1rem 0 1.25rem;
    transition: padding 0.25s ease;
}

.site-branding {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--color-text) !important;
    padding: 0;
    letter-spacing: -0.03em;
}

.navbar-brand:hover {
    color: var(--color-accent) !important;
}

.site-tagline {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-subtle);
    margin: 0;
    line-height: 1.4;
    max-width: 28rem;
}

.navbar {
    padding: 0;
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text-muted) !important;
    padding: 0.4rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--color-accent) !important;
    background: var(--color-accent-soft);
}

.navbar-nav .current-menu-item > .nav-link,
.navbar-nav .current-menu-ancestor > .nav-link {
    color: var(--color-accent) !important;
    background: var(--color-accent-soft);
}

.header-socials.social-links--icons {
    gap: 0.4rem;
}

.header-socials.social-links--icons .social-links__item {
    width: 2rem;
    height: 2rem;
}

.header-socials.social-links--icons .social-links__item svg {
    width: 1rem;
    height: 1rem;
}

.navbar-toggler {
    border-color: var(--color-border-strong);
    padding: 0.35rem 0.6rem;
}

/* ==========================================================================
   Blog hero
   ========================================================================== */
.blog-hero {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.blog-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.blog-hero .lead {
    font-size: 1.0625rem;
    color: var(--color-text-muted);
    margin: 0;
    max-width: 36rem;
    line-height: 1.6;
    font-weight: 400;
}

.blog-hero--split {
    margin-bottom: 2.5rem;
    padding: 0;
    border-bottom: none;
}

.blog-hero--split .blog-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas:
        "copy media"
        "actions media";
    gap: 1.25rem 1.65rem;
    align-items: stretch;
    padding: 1.65rem 1.75rem;
    background: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-surface) 55%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.blog-hero--split .blog-hero__copy {
    grid-area: copy;
}

.blog-hero--split .blog-hero__actions {
    grid-area: actions;
    align-self: start;
}

.blog-hero--split .blog-hero__media {
    grid-area: media;
    display: flex;
    align-items: center;
    min-height: 0;
}

.blog-hero--split .blog-hero__inner:not(:has(.blog-hero__media)) {
    grid-template-columns: 1fr;
    grid-template-areas:
        "copy"
        "actions";
}

.blog-hero--split .blog-hero__title {
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    margin: 0 0 0.85rem;
    line-height: 1.2;
}

.blog-hero--split .blog-hero__lead {
    margin: 0;
    max-width: 32rem;
    line-height: 1.65;
}

.blog-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.blog-hero__btn {
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
}

.blog-hero--split .blog-hero__frame.media-frame {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 280px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-hero--split .blog-hero__frame img {
    max-height: none;
    height: auto;
    max-width: 100%;
    width: 100%;
    min-height: 260px;
    max-height: min(440px, 52vh);
    object-fit: contain;
}

@media (max-width: 768px) {
    .blog-hero--split .blog-hero__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "copy"
            "media"
            "actions";
        gap: 1.35rem;
        padding: 1.35rem 1.25rem;
    }

    .blog-hero--split .blog-hero__inner:not(:has(.blog-hero__media)) {
        grid-template-areas:
            "copy"
            "actions";
    }

    .blog-hero--split .blog-hero__frame.media-frame {
        min-height: 200px;
    }

    .blog-hero--split .blog-hero__frame img {
        min-height: 180px;
        max-height: min(320px, 45vh);
    }
}

.archive-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
}

.archive-description {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* ==========================================================================
   Blog layout + author banner
   ========================================================================== */
.blog-layout__main {
    min-width: 0;
}

.blog-layout__sidebar {
    min-width: 0;
}

@media (min-width: 992px) {
    .blog-layout__sidebar {
        flex: 0 0 22%;
        max-width: 22%;
        position: sticky;
        top: 1.25rem;
        align-self: flex-start;
    }

    .blog-layout__main {
        flex: 0 0 78%;
        max-width: 78%;
    }
}

.blog-sidebar {
    margin-bottom: 2rem;
    max-width: 260px;
}

@media (min-width: 992px) {
    .blog-sidebar {
        margin-bottom: 0;
        margin-left: auto;
    }
}

.author-banner {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.author-banner__photo {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1;
    margin: 0 auto 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.author-banner__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--color-accent-soft) 0%, var(--color-secondary-soft) 100%);
    border: 2px dashed var(--color-border-strong);
}

.author-banner__photo-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.author-banner__name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.author-banner__role {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.author-banner__text {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    margin: 0 0 1.25rem;
    text-align: left;
}

.author-banner__contacts {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    text-align: left;
    font-size: 0.9rem;
}

.author-banner__contacts li {
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.author-banner__contacts li::before {
    display: none;
}

.author-banner__contacts a {
    color: var(--color-text-muted);
    word-break: break-word;
}

.author-banner__contacts a:hover {
    color: var(--color-accent);
}

.author-banner__cta {
    display: inline-block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--color-accent);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    text-align: center;
    transition: background 0.2s ease;
}

.author-banner__cta:hover {
    background: var(--color-accent-hover);
    color: #fff !important;
}

.sidebar-links {
    margin-top: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-card);
}

.sidebar-links__title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-subtle);
    margin: 0 0 0.85rem;
}

.sidebar-socials {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
}

.sidebar-socials .social-links__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    max-height: 3.1rem;
    border-radius: var(--radius-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.sidebar-socials .social-links__item:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    transform: translateY(-1px);
}

.sidebar-socials .social-links__item svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

@media (max-width: 991px) {
    .sidebar-socials {
        grid-template-columns: repeat(4, minmax(2.75rem, 1fr));
        max-width: 280px;
    }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.content-wrapper {
    min-height: calc(100vh - 220px);
}

/* ==========================================================================
   Post cards
   ========================================================================== */
.post-card-col {
    display: flex;
}

.post-item {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 0;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
    transform: none;
}

.post-item-inner {
    padding: 1.35rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-item.sticky {
    border-color: var(--color-accent);
    background: var(--color-surface);
    position: relative;
}

.post-item.sticky::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-accent);
}

.sticky-badge {
    display: inline-block;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: none;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.post-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: var(--color-accent);
}

.post-meta {
    color: var(--color-text-subtle);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.post-meta .meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    background: var(--color-bg);
    border-radius: 100px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.post-meta .meta-pill a {
    color: var(--color-text-muted);
}

.post-meta .meta-pill a:hover {
    color: var(--color-accent);
}

.post-excerpt {
    color: var(--color-text-muted);
    line-height: 1.7;
    font-size: 0.9375rem;
    margin-bottom: 1.35rem;
    padding-bottom: 0;
    flex: 0 1 auto;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.post-excerpt p {
    margin-bottom: 0.65rem;
}

.post-excerpt p:last-child {
    margin-bottom: 0;
}

.read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: auto;
    padding: 0.6rem 1.2rem;
    background: var(--color-accent);
    color: #fff !important;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.2;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.read-more:hover {
    background: var(--color-accent-hover);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
    transform: translateY(-1px);
}

.read-more::after {
    content: '→';
    font-size: 1.05em;
    line-height: 1;
    transition: transform 0.2s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* Миниатюра в карточке */
.post-thumbnail {
    margin: 0;
    position: relative;
    background: transparent;
    width: 100%;
    padding-bottom: 0;
    border-bottom: none;
}

.post-thumbnail.media-frame {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 12px 14px;
    margin: 0;
}

.post-thumbnail a {
    display: block;
}

.post-thumbnail img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: none;
    transition: none;
}

.post-item:hover .post-thumbnail img {
    transform: none;
}

/* ==========================================================================
   Single post / page
   ========================================================================== */
.single-post {
    background: var(--color-surface);
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
}

.post-hero {
    margin-bottom: 2rem;
}

.post-hero .post-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.post-hero__media {
    margin-top: 1.5rem;
}

.single-post .post-meta {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.single-post .post-content,
.post-content.prose {
    font-size: 1.0625rem;
    line-height: var(--line-height-prose);
    color: var(--color-text);
    max-width: var(--max-width-prose);
}

.blog-layout__main .single-post .post-content.prose {
    max-width: none;
}

.single-post .post-content > *:first-child,
.post-content.prose > *:first-child {
    margin-top: 0;
}

/* Контент: типографика */
.single-post .post-content p,
.post-content.prose p,
.post-content p {
    margin-bottom: 1.5rem;
}

.single-post .post-content h2,
.post-content.prose h2,
.post-content h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 2.25rem 0 1rem;
    color: var(--color-text);
    line-height: 1.3;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4rem;
}

.single-post .post-content h3,
.post-content.prose h3,
.post-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    color: var(--color-text);
}

.single-post .post-content h4,
.post-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--color-text-muted);
}

/* Изображения в контенте */
.single-post .post-content img,
.post-content.prose img,
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1.75rem auto;
    display: block;
    box-shadow: none;
    border: none;
}

.single-post .post-content figure,
.post-content figure {
    margin: 2rem 0;
}

.single-post .post-content figure img,
.post-content figure img {
    margin: 0 auto;
}

.single-post .post-content .wp-block-image,
.post-content .wp-block-image {
    margin: 2rem 0;
}

.single-post .post-content .wp-block-image img,
.post-content .wp-block-image img {
    padding: 14px 16px;
    background: var(--color-surface-illustration);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.single-post .post-content figcaption,
.post-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-subtle);
    font-style: normal;
    margin-top: 0.65rem;
}

/* Списки */
.single-post .post-content ul,
.single-post .post-content ol,
.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.single-post .post-content ul li,
.post-content ul li {
    margin-bottom: 0.65rem;
    line-height: 1.75;
    position: relative;
    padding-left: 1.5rem;
}

.single-post .post-content ul li::before,
.post-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: none;
}

.single-post .post-content ol,
.post-content ol {
    counter-reset: custom-counter;
}

.single-post .post-content ol li,
.post-content ol li {
    margin-bottom: 0.65rem;
    line-height: 1.75;
    position: relative;
    padding-left: 2.25rem;
    counter-increment: custom-counter;
}

.single-post .post-content ol li::before,
.post-content ol li::before {
    content: counter(custom-counter);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: none;
}

/* Цитаты */
.single-post .post-content blockquote,
.post-content blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--color-accent-soft);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-style: italic;
    color: var(--color-text-muted);
    box-shadow: none;
}

.single-post .post-content blockquote::before,
.post-content blockquote::before {
    display: none;
}

/* Таблицы */
.single-post .post-content table,
.post-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    font-size: 0.9375rem;
}

.single-post .post-content table thead,
.post-content table thead {
    background: var(--color-accent);
    color: #fff;
}

.single-post .post-content table thead th,
.post-content table thead th {
    padding: 0.9rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
}

.single-post .post-content table tbody tr,
.post-content table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

.single-post .post-content table tbody tr:nth-child(even),
.post-content table tbody tr:nth-child(even) {
    background-color: var(--color-bg);
}

.single-post .post-content table tbody tr:hover,
.post-content table tbody tr:hover {
    background-color: var(--color-accent-soft);
    transform: none;
    box-shadow: none;
}

.single-post .post-content table td,
.post-content table td {
    padding: 0.85rem 1.25rem;
    border: none;
    color: var(--color-text-muted);
}

/* Код */
.single-post .post-content code,
.post-content code {
    background: var(--color-bg);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    color: var(--color-accent);
    border: 1px solid var(--color-border);
}

.single-post .post-content pre,
.post-content pre {
    background: #252836;
    color: #E8EAED;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

.single-post .post-content pre code,
.post-content pre code {
    background: none;
    border: none;
    color: inherit;
}

.single-post .post-content hr,
.post-content hr {
    margin: 2.5rem 0;
    border: none;
    height: 1px;
    background: var(--color-border-strong);
}

.single-post .post-content a,
.post-content a {
    color: var(--color-accent);
    border-bottom: 1px solid transparent;
}

.single-post .post-content a:hover,
.post-content a:hover {
    border-bottom-color: var(--color-accent);
}

/* Читайте также */
.read-also {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--color-border);
}

.read-also--sidebar {
    margin-top: 1rem;
    padding: 1.15rem 1.25rem;
    border-top: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.read-also__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.read-also--sidebar .read-also__title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-subtle);
    margin: 0 0 0.85rem;
}

.read-also__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.read-also__item {
    margin: 0;
    padding: 0;
}

.read-also__item::before {
    display: none;
}

.read-also__link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.read-also__link:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.read-also__thumb {
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-surface-illustration);
    border: 1px solid var(--color-border);
    display: block;
}

.read-also__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: none;
}

.read-also__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.read-also__item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-also__link:hover .read-also__item-title {
    color: var(--color-accent);
}

.read-also__item-meta {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--color-text-subtle);
}

.read-also__meta-sep {
    margin: 0 0.35rem;
}

.read-also--sidebar .read-also__list {
    gap: 0.55rem;
}

.read-also--sidebar .read-also__link {
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.65rem;
}

.read-also--sidebar .read-also__thumb {
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
}

.read-also--sidebar .read-also__thumb img {
    object-fit: cover;
    object-position: center;
    background: var(--color-bg);
}

.read-also--sidebar .read-also__item-title {
    font-size: 0.8125rem;
    -webkit-line-clamp: 2;
    line-height: 1.35;
}

.read-also--sidebar .read-also__item-meta {
    font-size: 0.75rem;
}

.read-also--sidebar .read-also__meta-views,
.read-also--sidebar .read-also__meta-sep {
    display: none;
}

/* Post navigation */
.post-navigation {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.post-navigation__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .post-navigation__row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

.post-navigation__empty {
    display: none;
}

@media (min-width: 768px) {
    .post-navigation__empty {
        display: block;
    }
}

.post-nav-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 1.1rem;
    min-height: 5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.post-nav-card:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.post-nav-card--next {
    text-align: right;
}

.post-nav-card__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-subtle);
    line-height: 1.3;
}

.post-nav-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-nav-card:hover .post-nav-card__title {
    color: var(--color-accent);
}

.header-main .navbar {
    flex-wrap: wrap;
}

.post-tags {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.post-tags a {
    color: var(--color-accent);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
    margin: 0 0 1.25rem;
    font-size: 0.8125rem;
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-muted);
}

.breadcrumbs__item:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    color: var(--color-text-subtle);
}

.breadcrumbs__link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumbs__link:hover {
    color: var(--color-accent-hover);
}

.breadcrumbs__current {
    color: var(--color-text);
    font-weight: 600;
}

/* ==========================================================================
   Search form + подсказки
   ========================================================================== */
.search-form--suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-start;
}

.search-form__field {
    position: relative;
    flex: 1 1 16rem;
    min-width: 0;
}

.search-form__input {
    width: 100%;
}

.search-form__submit {
    flex-shrink: 0;
}

.search-suggest__list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    max-height: 16rem;
    overflow-y: auto;
}

.search-suggest__link {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
}

.search-suggest__link:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.search-suggest__status {
    padding: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.sidebar-search {
    margin-bottom: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-card);
}

.sidebar-search__title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-subtle);
    margin: 0 0 0.5rem;
}

.sidebar-search .search-form--sidebar {
    display: block;
    margin: 0;
}

.sidebar-search .search-form__field {
    position: relative;
    flex: none;
    width: 100%;
}

.sidebar-search .search-form__input {
    font-size: 0.875rem;
    padding: 0.45rem 0.7rem;
    width: 100%;
    min-height: 0;
}

.featured-posts-block__title {
    margin: 0 0 1rem;
    font-weight: 700;
}

.seo-picture {
    display: block;
    width: 100%;
}

.seo-picture img {
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Comments — модерация с фронта
   ========================================================================== */
.comments-area--moderator .comment-header {
    position: relative;
}

.comment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.comment-header .comment-author {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.comment-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

.comment-badge--pending {
    color: #9a6700;
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid rgba(241, 196, 15, 0.35);
}

.comment--pending {
    border-color: rgba(241, 196, 15, 0.35) !important;
    background: rgba(241, 196, 15, 0.06) !important;
}

.comments-title__pending {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-text-muted);
}

.comment-mod-actions {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.35rem;
}

.comment-mod-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-subtle);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.comment-mod-btn svg {
    display: block;
}

.comment-mod-btn--approve:hover {
    color: #1e8449;
    border-color: rgba(30, 132, 73, 0.35);
    background: rgba(30, 132, 73, 0.1);
}

.comment-mod-btn--reject:hover,
.comment-mod-btn--delete:hover {
    color: #c0392b;
    border-color: rgba(192, 57, 43, 0.35);
    background: rgba(192, 57, 43, 0.08);
}

.comment-mod-btn--edit:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.comment-mod-btn:disabled,
.comment-mod-btn--loading {
    opacity: 0.55;
    cursor: wait;
}

.comment-content__edit .comment-edit-textarea {
    width: 100%;
    resize: vertical;
    min-height: 5rem;
}

.comment-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment--removing {
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.comment-reply-link a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
}

.comment-reply-link a:hover {
    color: var(--color-accent-hover);
}

.comment-telegram a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.comment-telegram a:hover {
    color: var(--color-accent-hover);
}

.comment-form .required {
    color: var(--color-accent);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-wrapper {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.pagination-wrapper h2,
.pagination-wrapper .screen-reader-text {
    display: none;
}

.pagination-links {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-links > a,
.pagination-links > span {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.pagination-links > a:hover,
.pagination-links > a:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-surface);
    outline: none;
}

.pagination-links > .current {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    pointer-events: none;
}

.pagination-links > .disabled {
    opacity: 0.35;
    pointer-events: none;
    background: var(--color-bg);
}

.pagination-links > .dots {
    width: auto;
    min-width: 1.5rem;
    padding: 0 0.15rem;
    border: none;
    background: transparent;
    color: var(--color-text-subtle);
}

.pagination-links > .prev,
.pagination-links > .next {
    font-size: 1.05rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--color-surface);
    color: var(--color-text-muted);
    padding: 2.5rem 0 2rem;
    margin-top: var(--space-section);
    border-top: 1px solid var(--color-border);
}

.site-footer h5 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.site-footer a {
    color: var(--color-text-muted);
}

.site-footer a:hover {
    color: var(--color-accent);
}

.social-links--icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.social-links--icons .social-links__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.social-links--icons .social-links__item:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.social-links--icons .social-links__item svg {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}

.site-footer hr {
    border-color: var(--color-border) !important;
}

.site-footer .copyright {
    font-size: 0.8125rem;
    color: var(--color-text-subtle);
}

/* ==========================================================================
   Alerts, search, misc
   ========================================================================== */
.alert-info {
    background: var(--color-accent-soft);
    border-color: transparent;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn-outline-primary {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-outline-primary:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

/* ==========================================================================
   Global table overrides (legacy content)
   ========================================================================== */
html body table,
html body .post-content table,
html body article table {
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid var(--color-border) !important;
}

html body table thead,
html body table > tr:first-child,
html body table > tbody > tr:first-child {
    background: var(--color-accent) !important;
}

html body table thead th,
html body table tr:first-child td,
html body table > tbody > tr:first-child td {
    color: #fff !important;
    font-weight: 600 !important;
    border: 0 !important;
}

html body table tbody tr:nth-child(even),
html body table > tr:nth-child(even) {
    background-color: var(--color-bg) !important;
}

html body table tbody tr:hover,
html body table > tr:not(:first-child):hover {
    background-color: var(--color-accent-soft) !important;
    transform: none !important;
    box-shadow: none !important;
}

html body table td {
    border: 0 !important;
    padding: 0.85rem 1.25rem !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    .blog-sidebar {
        max-width: none;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .site-header--v2 .header-top {
        text-align: center;
    }

    .header-top__contacts,
    .header-top__aside {
        text-align: center;
    }

    .header-top__aside-inner {
        justify-content: center;
    }

    .site-branding {
        align-items: center;
        text-align: center;
    }

    .site-tagline {
        max-width: none;
    }

    .navbar-collapse {
        margin-top: 1rem;
    }

    .post-item-inner {
        padding: 1.15rem 1.25rem 1.35rem;
    }

    .post-title {
        font-size: 1.15rem;
    }

    .single-post {
        padding: 1.35rem;
    }

    .post-hero .post-title {
        font-size: 1.65rem;
    }

    .single-post .post-content,
    .post-content.prose {
        font-size: 1rem;
        max-width: none;
    }

    .post-meta span {
        display: inline;
    }

    .pagination-links > a,
    .pagination-links > span {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.85rem;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1140px;
    }
}
