/* --- Blog Archive Styles (Sidebar Left) --- */

.blog-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    margin-top: 50px;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.widget-title {
    font-size: var(--content-size);
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(var(--heading-color-rgb), 0.1);
    color: var(--heading-color);
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list li {
    margin-bottom: 12px;
}

.widget-list li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: var(--secondary-size);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.8;
}

.widget-list li a:hover {
    color: var(--primary-color);
    opacity: 1;
    padding-left: 5px;
}

.widget-list li a .count {
    font-size: var(--small-size);
    background: rgba(var(--heading-color-rgb), 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Tag Cloud Widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    font-size: var(--small-size) !important;
    background: rgba(var(--heading-color-rgb), 0.05);
    border: 1px solid rgba(var(--heading-color-rgb), 0.1);
    padding: 6px 15px;
    border-radius: 50px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--cta-text-color);
    transform: translateY(-2px);
}

/* Search Bar (Top) */
.blog-search-wrap {
    margin-bottom: 40px;
}

.blog-search-form {
    display: flex;
    gap: 0;
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.1);
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-search-form:focus-within {
    border-color: var(--primary-color);
    background: rgba(var(--heading-color-rgb), 0.05);
}

.blog-search-form input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 15px 25px;
    color: var(--heading-color);
    font-size: 15px;
    outline: none;
}

.blog-search-form button {
    background: var(--primary-color);
    color: var(--cta-text-color);
    border: none;
    padding: 0 30px;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.3s;
}

.blog-search-form button:hover {
    opacity: 0.9;
}

/* Blog List (1 Column) */
.blog-posts-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.blog-card-horizontal {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card-horizontal:hover {
    background: rgba(var(--heading-color-rgb), 0.04);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.b-card-img {
    height: 100%;
}

.b-card-img a {
    display: block;
    height: 100%;
}

.b-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-card-horizontal:hover .b-card-img img {
    transform: scale(1.05);
}

.b-card-content {
    padding: 30px 30px 30px 0;
    display: flex;
    flex-direction: column;
}

.b-card-meta {
    font-size: var(--small-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.b-title {
    font-size: var(--h4-size);
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.3;
}

.b-title a {
    color: var(--heading-color);
    text-decoration: none;
    transition: color 0.3s;
}

.b-title a:hover {
    color: var(--primary-color);
}

.b-excerpt {
    font-size: var(--secondary-size);
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.7;
    margin-bottom: 25px;
}

.b-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.b-read-more {
    font-weight: 700;
    font-size: var(--small-size);
    color: var(--primary-color);
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
}

.b-read-more:hover {
    gap: 12px;
}

.b-date {
    font-size: var(--small-size);
    opacity: 0.5;
}

/* Pagination */
.blog-pagination {
    margin-top: 50px;
    display: flex;
    gap: 10px;
}

.blog-pagination .page-numbers {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--heading-color-rgb), 0.05);
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
    background: var(--primary-color);
    color: var(--cta-text-color);
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        order: 2;
        position: static;
    }

    .blog-card-horizontal {
        grid-template-columns: 300px 1fr;
    }
}

/* Search Refinements */
.archive-title span {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.archive-title span::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--primary-color);
    opacity: 0.15;
    z-index: -1;
}

.search-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 6px 15px;
    border-radius: 50px;
    font-size: var(--small-size);
    font-weight: 700;
    margin-top: 15px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.siap-breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    font-size: var(--small-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.siap-breadcrumbs a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.siap-breadcrumbs a:hover {
    color: var(--primary-color);
}

.siap-breadcrumbs .sep {
    opacity: 0.4;
}

.siap-breadcrumbs .current {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .blog-card-horizontal {
        grid-template-columns: 1fr;
    }

    .b-card-img {
        aspect-ratio: 16/9;
    }

    .b-card-content {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .blog-search-form {
        flex-direction: column;
        border-radius: 20px;
    }

    .blog-search-form button {
        padding: 15px;
        width: 100%;
    }
}

/* ============================================= */
/* --- Single Blog Post Styles --- */
/* ============================================= */

/* 1. Hero Section */
.single-blog-hero {
    position: relative;
    padding: 200px 0 80px;
    background-color: var(--bg-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(var(--heading-color-rgb), 0.05);
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
}

.blog-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -2px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-color) 80%);
    z-index: 1;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    background: color-mix(in srgb, var(--bg-color) 70%, transparent);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid color-mix(in srgb, var(--heading-color) 10%, transparent);
    border-radius: 24px;
    padding: 40px 50px;
}

.blog-breadcrumbs {
    margin-bottom: 25px;
}

.blog-breadcrumbs a {
    color: var(--heading-color);
    opacity: 0.7;
}

.blog-breadcrumbs a:hover,
.blog-breadcrumbs .current {
    color: var(--heading-color);
    opacity: 1;
    text-shadow: 0 2px 4px color-mix(in srgb, var(--heading-color) 30%, transparent);
}

.blog-breadcrumbs .sep {
    color: var(--heading-color);
    opacity: 0.4;
}

.blog-hero-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.blog-cat-badge {
    display: inline-block;
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    color: var(--primary-color);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: var(--xs-size);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-cat-badge:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--cta-text-color);
}

.blog-hero-title {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 30px;
    letter-spacing: 1px;
    color: var(--heading-color);
}

.blog-hero-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--button-size);
    color: var(--text-color);
    opacity: 0.8;
}

.meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.meta-author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.meta-author a {
    color: var(--heading-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.meta-author a:hover {
    color: var(--primary-color);
}

.meta-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-color);
    opacity: 0.3;
}

/* 2. Single Blog Layout (Content + Sidebar) */
.single-blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    padding: 80px 0 100px;
}

/* Blog Rich Text Content */
.blog-rich-text {
    font-size: var(--content-size);
    line-height: 1.85;
    color: var(--text-color);
}

.blog-rich-text h2 {
    font-size: var(--content-h2-size);
    font-weight: 800;
    margin: 60px 0 25px;
    letter-spacing: -0.5px;
    color: var(--heading-color);
}

.blog-rich-text h3 {
    font-size: var(--h4-size);
    font-weight: 800;
    margin: 45px 0 20px;
    color: var(--heading-color);
}

.blog-rich-text h4 {
    font-size: var(--h5-size);
    font-weight: 700;
    margin: 35px 0 15px;
    color: var(--heading-color);
}

.blog-rich-text p {
    margin-bottom: 25px;
    opacity: 0.85;
    text-align: justify;
}

.blog-rich-text ul,
.blog-rich-text ol {
    margin-bottom: 30px;
    padding-left: 25px;
}

.blog-rich-text li {
    margin-bottom: 10px;
    opacity: 0.85;
}

.blog-rich-text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md, 16px);
    margin: 30px 0;
}

.blog-rich-text blockquote {
    margin: 40px 0;
    padding: 30px 35px;
    border-left: 4px solid var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    font-size: var(--h5-size);
    font-style: italic;
    line-height: 1.7;
    color: var(--heading-color);
}

.blog-rich-text blockquote p {
    margin-bottom: 0;
    opacity: 1;
}

.blog-rich-text pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(var(--heading-color-rgb), 0.1);
    border-radius: var(--radius-sm, 8px);
    padding: 25px;
    overflow-x: auto;
    margin: 30px 0;
    font-size: 14px;
    line-height: 1.6;
}

.blog-rich-text code {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.blog-rich-text pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.blog-rich-text a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.3s ease;
}

.blog-rich-text a:hover {
    opacity: 0.8;
}

.blog-rich-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: var(--secondary-size);
}

.blog-rich-text th,
.blog-rich-text td {
    padding: 12px 16px;
    border: 1px solid rgba(var(--heading-color-rgb), 0.1);
    text-align: left;
}

.blog-rich-text th {
    background: rgba(var(--heading-color-rgb), 0.05);
    font-weight: 700;
    color: var(--heading-color);
}

/* Post Tags */
.blog-post-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 30px 0;
    margin-top: 20px;
    border-top: 1px solid rgba(var(--heading-color-rgb), 0.08);
}

.tags-label {
    font-size: var(--button-size);
    font-weight: 700;
    color: var(--heading-color);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tag {
    font-size: var(--small-size);
    background: rgba(var(--heading-color-rgb), 0.05);
    border: 1px solid rgba(var(--heading-color-rgb), 0.1);
    padding: 6px 15px;
    border-radius: 50px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--cta-text-color);
    transform: translateY(-2px);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 25px;
    padding: 35px;
    margin: 50px 0;
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.08);
    border-radius: var(--radius-md, 16px);
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-label {
    font-size: var(--small-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.author-name {
    font-size: var(--h5-size);
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--heading-color);
}

.author-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-name a:hover {
    color: var(--primary-color);
}

.author-bio {
    font-size: var(--secondary-size);
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.7;
    margin: 0;
}

/* Post Navigation */
.post-nav {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(var(--heading-color-rgb), 0.08);
}

.post-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-nav-item {
    padding: 25px;
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.08);
    border-radius: var(--radius-sm, 8px);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-nav-item:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
    transform: translateY(-3px);
}

.post-nav-empty {
    border: none;
    background: none;
}

.nav-direction {
    font-size: var(--small-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-direction .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.post-nav-next .nav-direction {
    justify-content: flex-end;
}

.nav-title {
    font-size: var(--secondary-size);
    font-weight: 600;
    color: var(--heading-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-nav-next {
    text-align: right;
}

/* 3. Related Posts Section */
.related-posts-section {
    padding: 80px 0 120px;
    border-top: 1px solid rgba(var(--heading-color-rgb), 0.05);
}

.related-posts-title {
    font-size: var(--content-h2-size);
    font-weight: 900;
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: -1px;
    color: var(--heading-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.related-post-card {
    background: rgba(var(--heading-color-rgb), 0.02);
    border: 1px solid rgba(var(--heading-color-rgb), 0.05);
    border-radius: var(--radius-md, 16px);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.related-post-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.related-post-img {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.related-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.related-post-card:hover .related-post-img img {
    transform: scale(1.05);
}

.related-post-info {
    padding: 25px;
}

.related-post-cat {
    font-size: var(--xs-size);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

.related-post-info h3 {
    font-size: var(--content-size);
    font-weight: 700;
    color: var(--heading-color);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-date {
    font-size: var(--small-size);
    color: var(--text-color);
    opacity: 0.5;
}

/* ============================================= */
/* --- Default Page Styles --- */
/* ============================================= */

.page-content-wrap {
    padding: 80px 0 120px;
    max-width: 900px;
    margin: 0 auto;
}

.page-featured-img {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg, 24px);
    overflow: hidden;
    margin-bottom: 50px;
    border: 1px solid rgba(var(--heading-color-rgb), 0.05);
}

.page-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-rich-text {
    font-size: var(--content-size);
    line-height: 1.85;
    color: var(--text-color);
}

.page-rich-text h2 {
    font-size: var(--content-h2-size);
    font-weight: 800;
    margin: 60px 0 25px;
    letter-spacing: -0.5px;
    color: var(--heading-color);
}

.page-rich-text h3 {
    font-size: var(--h4-size);
    font-weight: 800;
    margin: 45px 0 20px;
    color: var(--heading-color);
}

.page-rich-text h4 {
    font-size: var(--h5-size);
    font-weight: 700;
    margin: 35px 0 15px;
    color: var(--heading-color);
}

.page-rich-text p {
    margin-bottom: 25px;
    opacity: 0.85;
}

.page-rich-text ul,
.page-rich-text ol {
    margin-bottom: 30px;
    padding-left: 25px;
}

.page-rich-text li {
    margin-bottom: 10px;
    opacity: 0.85;
}

.page-rich-text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md, 16px);
    margin: 30px 0;
}

.page-rich-text blockquote {
    margin: 40px 0;
    padding: 30px 35px;
    border-left: 4px solid var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    font-size: var(--h5-size);
    font-style: italic;
    line-height: 1.7;
    color: var(--heading-color);
}

.page-rich-text blockquote p {
    margin-bottom: 0;
    opacity: 1;
}

.page-rich-text a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.3s ease;
}

.page-rich-text a:hover {
    opacity: 0.8;
}

/* ============================================= */
/* --- Single Blog Responsive --- */
/* ============================================= */

@media (max-width: 1200px) {
    .single-blog-layout {
        grid-template-columns: 1fr;
    }

    .single-blog-layout .blog-sidebar {
        order: 2;
        position: static;
    }
}

@media (max-width: 991px) {
    .single-blog-hero {
        padding: 150px 0 60px;
        min-height: 50vh;
    }

    .blog-hero-content {
        padding: 30px;
    }

    .blog-hero-title {
        font-size: clamp(28px, 5vw, 42px);
    }

    .related-posts-grid {
        grid-template-columns: 1fr 1fr;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .single-blog-hero {
        padding: 120px 0 50px;
        min-height: auto;
    }

    .blog-hero-meta {
        gap: 12px;
    }

    .meta-sep {
        display: none;
    }

    .post-nav-grid {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
    }

    .post-nav-next .nav-direction {
        justify-content: flex-start;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .page-content-wrap {
        padding: 50px 0 80px;
    }

    .page-featured-img {
        border-radius: var(--radius-md, 16px);
    }
}