/**
 * Single blog post layout: centered header, sticky left rail, scrollable article.
 * Scoped to .single-blog-layout so other templates are unaffected.
 */

.single-blog-layout {
    max-width: 1280px;
}

.single-blog-layout .single-post {
    background: #fff;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.single-blog-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.single-blog-header-cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.single-blog-layout .single-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.75rem, 3.2vw, 2.25rem);
    line-height: 1.25;
    color: #111827;
    margin: 0 0 0.75rem;
}

.single-blog-byline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #6b7280;
    font-weight: 400;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.single-blog-byline .author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.single-blog-cta {
    margin-top: 1.25rem;
    border-radius: 999px;
    padding: 12px 28px;
    font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Two-column grid                                                            */
/* -------------------------------------------------------------------------- */

.single-blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

.single-blog-main {
    min-width: 0;
}

.single-blog-layout .single-sidebar {
    order: 2;
}

.single-blog-main {
    order: 1;
}

@media (min-width: 992px) {
    .single-blog-grid {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 2.5rem 3rem;
    }

    .single-blog-layout .single-sidebar {
        order: 0;
    }

    .single-blog-main {
        order: 0;
    }

    .single-blog-layout .sticky-sidebar {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow: auto;
        scrollbar-width: none;
    }

    .single-blog-layout .sticky-sidebar::-webkit-scrollbar {
        display: none;
    }
}

/* -------------------------------------------------------------------------- */
/* Left rail                                                                  */
/* -------------------------------------------------------------------------- */

.single-blog-featured {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.single-blog-featured img {
    display: block;
    width: 100%;
    height: auto;
}

.single-blog-layout .toc-card {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.75rem;
    box-shadow: none;
}

.single-blog-layout .toc-header {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #111827;
    margin-bottom: 0.75rem;
}

.single-blog-layout .toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.single-blog-layout .toc-link {
    display: block;
    color: #111827;
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.4;
    font-weight: 400;
}

.single-blog-layout .toc-link:hover,
.single-blog-layout .toc-link:focus {
    color: var(--color-primary, #22C55E);
    text-decoration: none;
}

.single-blog-layout .toc-list .toc-level-3 .toc-link {
    padding-left: 0.75rem;
    font-weight: 400;
}

.single-blog-layout .toc-list .toc-level-2 .toc-link {
    font-weight: 400;
}

.single-blog-rail-block {
    margin-bottom: 1.5rem;
}

.single-blog-rail-heading {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #111827;
    margin-bottom: 0.65rem;
}

.single-blog-rail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.single-blog-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-decoration: none;
}

.single-blog-tag:hover {
    color: var(--color-primary, #22C55E);
    text-decoration: none;
}

.single-blog-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.single-blog-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
}

.single-blog-social a:hover {
    background: var(--color-primary, #22C55E);
    color: #fff;
}

/* -------------------------------------------------------------------------- */
/* Article content                                                            */
/* -------------------------------------------------------------------------- */

.single-blog-layout .single-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #000;
}

.single-blog-layout .single-content h2 {
    font-weight: 700;
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.single-blog-layout .single-content h3 {
    font-weight: 600;
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.single-blog-layout .single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0 1.75rem;
    font-size: 0.975rem;
}

.single-blog-layout .single-content table th,
.single-blog-layout .single-content table td {
    border: 1px solid #e5e7eb;
    padding: 0.7rem 0.9rem;
    text-align: left;
    vertical-align: top;
}

.single-blog-layout .single-content table thead th,
.single-blog-layout .single-content table:not(:has(thead)) tr:first-child th,
.single-blog-layout .single-content table:not(:has(thead)) tr:first-child td {
    background: #dcfce7;
    font-weight: 600;
    color: #111827;
}

.single-blog-layout .single-content .wp-element-button,
.single-blog-layout .single-content .wp-block-button__link,
.single-blog-layout .single-content a.btn,
.single-blog-layout .single-content .btn-primary {
    border-radius: 999px;
}

/* -------------------------------------------------------------------------- */
/* Prev / next                                                                */
/* -------------------------------------------------------------------------- */

.single-blog-post-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 0.5rem;
}

.single-blog-nav-link {
    color: var(--color-primary, #22C55E);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
}

.single-blog-nav-link:hover {
    color: var(--color-primary-hover, #16a34a);
    text-decoration: underline;
}

/* -------------------------------------------------------------------------- */
/* Related posts                                                              */
/* -------------------------------------------------------------------------- */

.single-blog-related {
    margin-top: 2.75rem;
}

.single-blog-related-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
}

.single-blog-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

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

.single-blog-related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.single-blog-related-image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.single-blog-related-image img,
.single-blog-related-image .img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.single-blog-related-body {
    padding: 1rem 1.1rem 1.2rem;
}

.single-blog-related-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.single-blog-related-cats span {
    color: #2563eb;
    font-size: 0.8125rem;
    font-weight: 500;
}

.single-blog-related-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.5rem;
}

.single-blog-related-title a {
    color: #111827;
    text-decoration: none;
}

.single-blog-related-title a:hover {
    color: var(--color-primary, #22C55E);
}

.single-blog-related-meta {
    font-size: 0.8125rem;
    color: #6b7280;
}
