/* ── Blog listing (home.php + archive.php) ───────────────────────────── */

/* Banner */
.blog-banner {
    background: #F8FAFF;
    border-bottom: 1px solid #E8ECF4;
    padding: 3.5rem 0 3rem;
    text-align: center;
}

.blog-banner-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.blog-banner-desc {
    font-size: 1rem;
    color: #6B7280;
    margin: 0;
}

/* Archive section */
/* ── Featured Posts Section ───────────────────────────────────────────── */
.blog-featured-section {
    padding: 3rem 0 2rem;
    background: #f8fafc;
}

.blog-featured-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 2rem;
}

.blog-hero-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2.5rem;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.blog-hero-thumb {
    display: block;
    overflow: hidden;
    height: 340px;
}

.blog-hero-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.blog-hero-thumb:hover img {
    transform: scale(1.03);
}

.blog-hero-body {
    padding: 2.5rem 2.5rem 2.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.blog-hero-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.blog-hero-title a:hover {
    color: var(--primary-color);
}

.blog-hero-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.blog-hero-more:hover {
    text-decoration: underline;
}

.blog-featured-grid {
    margin-top: 0;
}

/* ─────────────────────────────────────────────────────────────────────── */
.blog-archive-section {
    padding: 3.5rem 0 5rem;
}

/* Category section (home.php grouped layout) */
.blog-cat-section {
    margin-bottom: 4rem;
}

.blog-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.blog-cat-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.blog-cat-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: #185ADB;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.blog-cat-link:hover {
    color: #144CB3;
    text-decoration: underline;
}

/* 3-column grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Post card */
.blog-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E8ECF4;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.blog-card-thumb {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.blog-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-thumb img {
    transform: scale(1.04);
}

.blog-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.blog-card-body .post-category-badges {
    margin-bottom: 0.65rem;
}

.cat-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #185ADB;
    background: #EEF3FF;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.cat-badge:hover {
    background: #185ADB;
    color: #fff;
}

.blog-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    flex: 1;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card-title a:hover {
    color: #185ADB;
}

.blog-card-meta {
    font-size: 0.82rem;
    color: #9CA3AF;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
}

.blog-pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    border: 1px solid #E2E8F0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
    background: #185ADB;
    color: #fff;
    border-color: #185ADB;
}

.blog-no-posts {
    text-align: center;
    color: #6B7280;
    padding: 4rem 0;
    font-size: 1.05rem;
}

/* ── Single post ─────────────────────────────────────────────────────── */
.single-post-page {
    padding: 2.5rem 0 5rem;
}

/* 2-column: content + sticky sidebar */
.single-post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
    margin-bottom: 0;
}

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

.single-post-sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Sidebar widgets */
.sidebar-widget {
    border-radius: 12px;
    border: 1px solid #E8ECF4;
    background: #fff;
    padding: 1.25rem 1.5rem;
}

/* TOC */
.toc-nav {
    display: flex;
    flex-direction: column;
}

.toc-link {
    display: block;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    border-left: 3px solid transparent;
    line-height: 1.5;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    border-radius: 0 6px 6px 0;
}

.toc-link:hover,
.toc-link.is-active {
    color: #185ADB;
    border-left-color: #185ADB;
    background: #F0F4FF;
}

.toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.82rem;
}

/* Signup widget */
.signup-widget {
    background: #F8FAFF;
    border-color: #C7D7FD;
}

.signup-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.2rem;
}

.signup-highlight {
    font-size: 1.1rem;
    font-weight: 700;
    color: #185ADB;
    margin: 0 0 1.1rem;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.signup-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #374151;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    font-family: 'Mulish', sans-serif;
}

.signup-input:focus { border-color: #185ADB; }

.signup-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    background: #185ADB;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Mulish', sans-serif;
    transition: background 0.2s ease;
}

.signup-btn:hover { background: #144CB3; }

/* Breadcrumb */
.single-breadcrumb {
    margin-bottom: 1.25rem;
}

.my-breadcrumbs ol {
    list-style: none !important;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0;
}

.my-breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6B7280;
}

.my-breadcrumbs li::after {
    content: '/';
    margin: 0 0.45rem;
    color: #D1D5DB;
}

.my-breadcrumbs li:last-child::after {
    display: none;
}

.my-breadcrumbs a {
    color: #6B7280;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.my-breadcrumbs a:hover {
    color: #185ADB;
}

.my-breadcrumbs .current {
    color: #374151;
}

/* Post title */
.single-post-title {
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 0 0 1rem;
}

/* Author meta */
.single-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    color: #6B7280;
}

.author-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.meta-dot { color: #D1D5DB; }

/* Featured image */
.single-post-thumb {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.single-post-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content typography */
.single-post-content {
    font-size: 1rem;
    line-height: 1.85;
    color: #374151;
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    color: #111827;
    margin: 2rem 0 0.75rem;
    line-height: 1.35;
}

.single-post-content h2 { font-size: 1.5rem; }
.single-post-content h3 { font-size: 1.25rem; }
.single-post-content h4 { font-size: 1.1rem; }

.single-post-content p { margin-bottom: 1.25rem; }

.single-post-content ul,
.single-post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.single-post-content ul { list-style: disc; }
.single-post-content ol { list-style: decimal; }
.single-post-content li { margin-bottom: 0.4rem; }

.single-post-content a {
    color: #185ADB;
    text-decoration: underline;
}

.single-post-content img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.single-post-content figure,
.single-post-content .wp-block-image,
.single-post-content .wp-caption {
    max-width: 100% !important;
    overflow: hidden;
}

.single-post-content figure img,
.single-post-content .wp-block-image img,
.single-post-content .wp-caption img {
    width: 100%;
    height: auto;
}

.single-post-content .aligncenter,
.single-post-content figure.aligncenter,
.single-post-content .wp-block-image.aligncenter {
    display: table;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.single-post-content .aligncenter img,
.single-post-content figure.aligncenter img,
.single-post-content .wp-block-image.aligncenter img {
    width: auto;
    max-width: 100%;
}

.single-post-content figcaption,
.single-post-content .wp-caption-text,
.single-post-content .wp-element-caption {
    text-align: center;
}

.single-post-content blockquote {
    border-left: 4px solid #185ADB;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: #F0F4FF;
    border-radius: 0 8px 8px 0;
    color: #374151;
    font-style: italic;
}

.single-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.single-post-content table th,
.single-post-content table td {
    padding: 0.65rem 1rem;
    border: 1px solid #E2E8F0;
    text-align: left;
    vertical-align: top;
}

.single-post-content table th {
    background: #F8FAFF;
    font-weight: 600;
    color: #374151;
}

/* Post navigation */
.single-post-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #E8ECF4;
}

.single-post-nav .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.single-post-nav .nav-previous,
.single-post-nav .nav-next { max-width: 48%; }

.single-post-nav a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    color: #374151;
    transition: color 0.2s ease;
}

.single-post-nav a:hover { color: #185ADB; }

.single-post-nav .nav-label {
    font-size: 0.8rem;
    color: #9CA3AF;
    font-weight: 500;
}

.single-post-nav .nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

/* ── Single Post CTA Banner ──────────────────────────────────────────── */
.single-post-cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(100deg, #1d4ed8 0%, #2563eb 50%, #312e81 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem 5rem;
    margin: 2.5rem 0 3rem;
}


.single-post-cta-content {
    flex: 1;
    min-width: 0;
}

.single-post-cta-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: 0.02em;
}

.single-post-cta-title {
    color: #fff !important;
    font-size: 1.35rem;
    font-weight: 700 !important;
    margin: 0 0 0.3rem;
    line-height: 1.35;
}

.single-post-cta-sub {
    color: #fff;
    font-size: 0.88rem;
    margin: 0;
}

.single-post-cta-btn {
    flex-shrink: 0;
    background: #fff;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.single-post-cta-btn:hover {
    opacity: 0.9;
    color: #1d4ed8;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .single-post-layout {
        grid-template-columns: 1fr 260px;
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .single-post-main {
        overflow-x: hidden;
        min-width: 0;
        max-width: 100%;
    }

    .single-post-layout {
        grid-template-columns: 1fr;
    }

    .single-post-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .toc-widget { flex: 1 1 300px; }
    .signup-widget { flex: 1 1 260px; }
}

@media (max-width: 768px) {
    .blog-hero-card {
        grid-template-columns: 1fr;
    }

    .blog-hero-thumb {
        height: 240px;
    }

    .blog-hero-body {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .single-post-cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 3rem;
        gap: 1.25rem;
    }

    .single-post-cta-btn {
        width: 100%;
        text-align: center;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-banner {
        padding: 2.5rem 0 2rem;
    }

    .blog-banner-title {
        font-size: 1.75rem;
    }

    .single-post-sidebar {
        flex-direction: column;
    }

    .single-post-nav .nav-links {
        flex-direction: column;
    }

    .single-post-nav .nav-previous,
    .single-post-nav .nav-next {
        max-width: 100%;
    }
}
