.blog-page {
    min-height: 100vh;
}

.blog-page .nav-links a[aria-current="page"] {
    color: var(--text-primary);
}

.blog-page .nav-links a[aria-current="page"]::after {
    width: 100%;
}

.logo-section {
    margin-left: 0.55rem;
    padding-left: 0.7rem;
    border-left: 1px solid var(--border-glow);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
}

.blog-main {
    min-height: calc(100vh - 120px);
    padding: 9rem 1.5rem 6rem;
    position: relative;
    z-index: 1;
}

.blog-shell {
    width: min(100%, 860px);
    margin: 0 auto;
}

.blog-heading {
    max-width: 680px;
    margin-bottom: 2.25rem;
}

.blog-kicker {
    color: var(--primary-light);
    font-family: "Orbitron", sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.9rem;
}

.blog-heading > p:last-child {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.blog-page #blog-content {
    padding: 0;
}

.post-list {
    border-top: 1px solid var(--border);
}

.post-card {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--transition-fast);
}

.post-card:hover {
    border-color: var(--border-glow);
}

.post-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding-top: 0.4rem;
}

.post-card time {
    color: var(--text-muted);
    font-family: "Orbitron", sans-serif;
    font-size: 0.75rem;
}

.post-view-count {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.post-card h2 {
    color: var(--text-primary);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 0.65rem;
    transition: color var(--transition-fast);
}

.post-card:hover h2 {
    color: var(--primary-light);
}

.post-card p {
    color: var(--text-secondary);
    line-height: 1.75;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.post-tag {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.post-tag::before {
    content: "#";
    color: var(--primary-light);
}

.blog-state {
    min-height: 240px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.blog-loader {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: blog-spin 0.8s linear infinite;
}

@keyframes blog-spin {
    to { transform: rotate(360deg); }
}

.blog-back {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    text-decoration: none;
}

.blog-back:hover {
    color: var(--primary-light);
}

.article-header {
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.75rem;
}

.article-header h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0.8rem 0 1.25rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    color: var(--text-muted);
    font-family: "Orbitron", sans-serif;
    font-size: 0.78rem;
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-body {
    color: #d6deea;
    font-size: 1.02rem;
    line-height: 1.9;
}

.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
    margin: 2.4em 0 0.8em;
}

.article-body h2 { font-size: 1.7rem; }
.article-body h3 { font-size: 1.35rem; }
.article-body h4 { font-size: 1.15rem; }
.article-body h5,
.article-body h6 { font-size: 1rem; }
.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre {
    margin: 1.25rem 0;
}

.article-body ul,
.article-body ol {
    padding-left: 1.6rem;
}

.article-body li + li {
    margin-top: 0.45rem;
}

.article-body li > ul,
.article-body li > ol {
    margin: 0.45rem 0;
}

.article-body li:has(> input[type="checkbox"]) {
    list-style: none;
}

.article-body input[type="checkbox"] {
    accent-color: var(--primary);
    margin: 0 0.55rem 0 -1.35rem;
}

.article-body a {
    color: var(--primary-light);
    text-underline-offset: 0.2em;
}

.article-body blockquote {
    border-left: 3px solid var(--primary);
    color: var(--text-secondary);
    padding: 0.15rem 0 0.15rem 1.25rem;
}

.article-body del {
    color: var(--text-muted);
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: 1.75rem auto;
}

.article-body code {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 0.35rem;
    color: #bae6fd;
    font-size: 0.9em;
    padding: 0.18em 0.4em;
}

.article-body pre {
    overflow-x: auto;
    background: #080c14;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.article-body pre code {
    background: transparent;
    color: #dbeafe;
    padding: 0;
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.article-body .table-scroll {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    margin: 1.75rem 0;
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: var(--radius-md);
    scrollbar-color: var(--primary-dark) var(--bg-secondary);
    scrollbar-width: thin;
}

.article-body table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.article-body th,
.article-body td {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.article-body th {
    background: rgba(14, 165, 233, 0.12);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.article-body tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.035);
}

.article-body tbody tr:hover {
    background: rgba(14, 165, 233, 0.06);
}

.article-body .table-scroll::-webkit-scrollbar {
    height: 8px;
}

.article-body .table-scroll::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.article-body .table-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 999px;
}

.comments-section {
    margin-top: 5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.comments-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.comments-heading h2 {
    color: var(--text-primary);
    font-size: 1.45rem;
    font-weight: 600;
}

.comments-heading > span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.comment-list {
    border-top: 1px solid var(--border);
}

.comment-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.comment-item header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.comment-item strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.comment-item time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.comment-item > p {
    color: var(--text-secondary);
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.comments-empty {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    line-height: 1.7;
}

.comment-form {
    margin-top: 2.5rem;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(8, 12, 20, 0.38);
}

.comment-form h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.comment-form > p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.comment-field + .comment-field {
    margin-top: 1.1rem;
}

.comment-field label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.86rem;
    margin-bottom: 0.5rem;
}

.comment-field input,
.comment-field textarea {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    background: rgba(5, 9, 16, 0.72);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.6;
    padding: 0.75rem 0.85rem;
    transition: border-color var(--transition-fast);
}

.comment-field textarea {
    min-height: 8rem;
    resize: vertical;
}

.comment-field input:focus,
.comment-field textarea:focus {
    border-color: var(--primary);
    outline: 2px solid rgba(14, 165, 233, 0.16);
    outline-offset: 1px;
}

.comment-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.comment-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.comment-form button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.comment-form-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.comment-form-status.is-success {
    color: #86efac;
}

.comment-form-status.is-error {
    color: #fca5a5;
}

.blog-footer {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .blog-main {
        padding: 7rem 1.25rem 4rem;
    }

    .blog-heading {
        margin-bottom: 2rem;
    }

    .post-card {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .post-card-meta {
        flex-direction: row;
        align-items: center;
    }

    .comments-section {
        margin-top: 3.75rem;
    }

    .comment-form {
        padding: 1.25rem;
    }

    .comment-item header,
    .comment-form-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-loader { animation: none; }
}
