:root {
    --bg-dark: #0a0e17;
    --panel-bg: rgba(16, 22, 35, 0.9);
    --accent-it: #00d2ff;
    --accent-car: #ff3c00;
    --text-main: #e0e6ed;
    --text-muted: #8899a6;
    --shadow-it: 0 0 20px rgba(0, 210, 255, 0.3);
    --shadow-car: 0 0 20px rgba(255, 60, 0, 0.3);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow-x: hidden;
    background-color: var(--bg-dark);
    background-image:
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZyBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiMwMGQyZmYiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTAgMGg0MHY0MEgwVjB6bTQwIDQwaDQwdjQwSDQwVjQweiIvPjwvZz48L2c+PC9zdmc+'),
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MCIgaGVpZ2h0PSI4MCIgdmlld0JveD0iMCAwIDgwIDgwIj48ZyBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNmZjNjMDAiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTAgMGg0MHY0MEgwVjB6bTQwIDQwaDQwdjQwSDQwVjQweiIvPjwvZz48L2c+PC9zdmc+');
    background-position: left top, right top;
    background-repeat: repeat-y, repeat-y;
    background-size: 50% auto, 50% auto;
}

body::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 2px; height: 100%;
    background: linear-gradient(to bottom, var(--accent-it), var(--accent-car));
    z-index: -1;
    opacity: 0.5;
}

.blog-container {
    width: 100%;
    max-width: 1100px;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.post-title-main {
    font-size: 38px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
    color: var(--text-main);
    text-align: center;
    flex-shrink: 0;
}

/* Хлебные крошки */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--text-muted);
    padding-left: 20px;
}

.breadcrumbs a {
    color: var(--accent-it);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.breadcrumbs .separator {
    color: var(--text-muted);
}

.breadcrumbs .current {
    color: var(--text-main);
    font-weight: 500;
}

/* Статья */
.post-article {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.1);
    margin-bottom: 40px;
    position: relative;
}

.post-hero-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 30px;
}

.post-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-header {
    margin-bottom: 30px;
}

.post-category {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-it);
    color: var(--bg-dark);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.post-category:hover {
    background: #00e5ff;
    box-shadow: var(--shadow-it);
}

.post-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
    color: var(--text-main);
}

.post-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.post-meta i {
    margin-right: 6px;
}

/* Badge styling for post meta */
.post-meta-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: monospace;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.05);
    border-top-left-radius: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.post-meta-badge .post-date,
.post-meta-badge .post-views {
    color: #9ca3af;
    font-size: 0.7rem;
}

.post-meta-badge .post-views i {
    margin-right: 2px;
}

.post-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-main);
}

.post-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 32px 0 16px 0;
    color: var(--accent-it);
}

.post-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: var(--accent-car);
}

.post-content p {
    margin-bottom: 16px;
}

.post-content a {
    color: var(--accent-it);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.post-content a:hover {
    color: #00e5ff;
    border-bottom-color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.post-content ul,
.post-content ol {
    margin: 16px 0;
    padding-left: 24px; /* Увеличили отступ, чтобы моноширинный шрифт не ломал верстку */
    list-style-position: outside;
}

.post-content ul {
    list-style-type: disc; /* Гарантируем отображение стандартных точек для ul */
}

.post-content li {
    margin-bottom: 4px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.post-content blockquote {
    border-left: 4px solid var(--accent-it);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(0, 210, 255, 0.05);
    font-style: italic;
    color: var(--text-muted);
}

.post-content code {
    background: rgba(0, 210, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--accent-it);
}

.post-content pre {
    background: var(--bg-dark);
    color: var(--text-main);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 210, 255, 0.2);
}

.tag {
    padding: 6px 16px;
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-it);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Связанные статьи */
.related-posts {
    margin-bottom: 40px;
}

.related-posts h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-main);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Растягиваем карточки на всю ширину при малом количестве */
.related-posts[data-count="1"] .related-grid {
    grid-template-columns: 1fr;
}

.related-posts[data-count="2"] .related-grid {
    grid-template-columns: repeat(2, 1fr);
}

.related-posts[data-count="3"] .related-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .related-posts[data-count="2"] .related-grid,
    .related-posts[data-count="3"] .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.1);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-it);
    border-color: var(--accent-it);
}

.related-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 16px;
}

.related-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-title a {
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-title a i {
    color: var(--accent-it);
    font-size: 14px;
}

.related-title a:hover {
    color: var(--accent-it);
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.related-excerpt {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.back-link {
    text-align: center;
}

.back-link a {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent-car);
    color: var(--bg-dark);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 0 10px rgba(255, 60, 0, 0.3);
}

.back-link a:hover {
    background: #ff5500;
    transform: translateY(-2px);
    box-shadow: var(--shadow-car);
}

/* Адаптивность */
@media (max-width: 768px) {
    .blog-container {
        padding: 20px 15px;
    }

    .post-article {
        padding: 24px;
    }

    .post-hero-image {
        height: 250px;
    }

    .post-title-main {
        font-size: 22px;
    }

    .post-title {
        font-size: 24px;
    }

    .breadcrumbs {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .post-content {
        font-size: 16px;
    }

    .post-content h2 {
        font-size: 24px;
    }

    .post-content h3 {
        font-size: 20px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .breadcrumbs {
        flex-wrap: wrap;
    }
}

    .post-spoiler {
        background: rgba(0, 210, 255, 0.05);
        border: 1px solid rgba(0, 210, 255, 0.2);
        border-radius: 8px;
        padding: 12px;
        margin: 16px 0;
    }
    .post-spoiler summary {
        font-weight: bold;
        cursor: pointer;
        outline: none;
        color: var(--accent-it);
        font-size: 14px;
    }
    .post-spoiler-content {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px dashed rgba(0, 210, 255, 0.3);
        color: var(--text-main);
        font-size: 14px;
        line-height: 1.6;
    }