/* ============================================
   BLOG & SINGLE POST - Soft UI Professional
   blog.css - v3.0
   ============================================ */

/* ==================== Blog Archive ==================== */
.blog-archive-page {
    background: var(--bg-light);
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,92,246,0.05));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99,102,241,0.1);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 1rem;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

.blog-posts-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    margin-bottom: 3rem !important;
}

/* Post Card */
.post-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.12);
}

.post-card .post-thumbnail {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.08);
}

.post-card .entry-header {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card .entry-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.post-card .entry-title a {
    color: var(--text);
    transition: color 0.2s;
}

.post-card .entry-title a:hover {
    color: var(--primary);
}

.post-card .entry-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.post-card .entry-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card .entry-meta svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.post-card .entry-meta a {
    color: var(--primary);
}

.post-card .entry-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.9rem;
    flex: 1;
}

.post-card .entry-footer {
    padding: 0 1.5rem 1.5rem;
    margin-top: auto;
}

.post-card .read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.post-card .read-more:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 3rem;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

/* ==================== Single Post ==================== */

/* Hero */
.sf-post-hero {
    position: relative;
    height: 480px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
	border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.sf-post-hero__bg {
    position: absolute;
    inset: 0;
}

.sf-post-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-post-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}

.sf-post-hero__content {
    position: relative;
    z-index: 2;
    padding-bottom: 48px;
    max-width: 800px;
}

.sf-post-hero__cats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.sf-post-hero__cat {
    padding: 5px 14px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    color: white;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
}

.sf-post-hero__cat:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.sf-post-hero__title {
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    line-height: 1.3;
    margin: 0 0 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sf-post-hero__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.sf-post-hero__author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-post-hero__author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.sf-post-hero__author a {
    color: white;
    font-weight: 600;
}

.sf-post-hero__dot {
    color: rgba(255,255,255,0.4);
}

/* Breadcrumb */
.sf-post-breadcrumb {
    padding: 16px 0;
    background: white;
    border-bottom: 1px solid var(--border);
}

.sf-post-breadcrumb__nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.sf-post-breadcrumb__nav a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-md);
    transition: color 0.2s;
}

.sf-post-breadcrumb__nav a:hover {
    color: var(--primary);
}

.sf-post-breadcrumb__sep {
    color: var(--border);
}

.sf-post-breadcrumb__nav span {
    color: var(--text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layout */
.sf-post-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    padding: 40px 0 80px;
}

/* Main Article */
.sf-post-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header (no image fallback) */
.sf-post-header {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
}

.sf-post-header__cats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.sf-post-header__cat {
    padding: 5px 14px;
    background: rgba(99,102,241,0.08);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.sf-post-header__cat:hover {
    background: var(--primary);
    color: white;
}

.sf-post-header__title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 16px;
    line-height: 1.4;
}

.sf-post-header__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.sf-post-header__author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-post-header__author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.sf-post-header__author a {
    color: var(--primary);
    font-weight: 600;
}

/* Share */
.sf-post-share {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.sf-post-share__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-md);
}

.sf-post-share__btns {
    display: flex;
    gap: 8px;
}

.sf-post-share__btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-md);
    cursor: pointer;
    transition: all 0.25s ease;
}

.sf-post-share__btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.sf-post-share__btn--tg:hover { background: #0088cc; color: white; border-color: #0088cc; }
.sf-post-share__btn--tw:hover { background: #1da1f2; color: white; border-color: #1da1f2; }
.sf-post-share__btn--li:hover { background: #0077b5; color: white; border-color: #0077b5; }
.sf-post-share__btn--copy:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Content */
.sf-post-content {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    color: var(--text-md);
    font-size: 1.05rem;
    line-height: 1.9;
}

.sf-post-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin: 2.5rem 0 1rem;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.sf-post-content h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.sf-post-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 2rem 0 0.75rem;
}

.sf-post-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.5rem 0 0.5rem;
}

.sf-post-content p {
    margin-bottom: 1.5rem;
}

.sf-post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sf-post-content a:hover {
    color: var(--secondary);
}

.sf-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.sf-post-content ul, .sf-post-content ol {
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.sf-post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.sf-post-content blockquote {
    margin: 2rem 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04));
    border-right: 4px solid var(--primary);
    border-radius: var(--radius);
    font-style: italic;
    color: var(--text-md);
}

.sf-post-content blockquote p:last-child {
    margin-bottom: 0;
}

.sf-post-content code {
    padding: 2px 8px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.88em;
}

.sf-post-content pre {
    margin: 1.5rem 0;
    padding: 20px;
    background: #1e1e2e;
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.sf-post-content pre code {
    background: none;
    border: none;
    color: #cdd6f4;
    padding: 0;
    font-size: 0.9rem;
}

.sf-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.sf-post-content table th,
.sf-post-content table td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: right;
}

.sf-post-content table th {
    background: var(--bg-light);
    font-weight: 700;
    color: var(--text);
}

/* Tags */
.sf-post-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.sf-post-tags svg {
    color: var(--primary);
    flex-shrink: 0;
}

.sf-post-tag {
    padding: 6px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-md);
    transition: all 0.2s;
}

.sf-post-tag:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Author Box */
.sf-post-author {
    display: flex;
    gap: 20px;
    padding: 28px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.sf-post-author::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.sf-post-author__avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--bg-light);
    box-shadow: var(--shadow-sm);
}

.sf-post-author__info {
    flex: 1;
}

.sf-post-author__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sf-post-author__name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 4px 0 8px;
}

.sf-post-author__name a {
    color: var(--text);
    transition: color 0.2s;
}

.sf-post-author__name a:hover {
    color: var(--primary);
}

.sf-post-author__bio {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0 0 12px;
}

.sf-post-author__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    transition: gap 0.2s;
}

.sf-post-author__link:hover {
    gap: 10px;
}

/* Navigation */
.sf-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sf-post-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    text-decoration: none;
}

.sf-post-nav__item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.sf-post-nav__item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.sf-post-nav__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sf-post-nav__title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-post-nav__item--next {
    text-align: left;
}

/* Comments */
.sf-post-comments {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
}

/* ==================== Sidebar ==================== */
.sf-post-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sf-sidebar-widget {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sf-sidebar-widget__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.sf-sidebar-widget__title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.sf-sidebar-widget__title svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* Sidebar Post */
.sf-sidebar-post {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-decoration: none;
    margin: -4px -12px;
}

.sf-sidebar-post:hover {
    background: var(--bg-light);
}

.sf-sidebar-post__img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-light);
}

.sf-sidebar-post__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sf-sidebar-post:hover .sf-sidebar-post__img img {
    transform: scale(1.08);
}

.sf-sidebar-post__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.sf-sidebar-post__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-sidebar-post:hover .sf-sidebar-post__title {
    color: var(--primary);
}

.sf-sidebar-post__date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sidebar Product */
.sf-sidebar-product {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-decoration: none;
    margin: -4px -12px;
}

.sf-sidebar-product:hover {
    background: var(--bg-light);
}

.sf-sidebar-product__img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: var(--bg-light);
}

.sf-sidebar-product__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-sidebar-product__sale {
    position: absolute;
    top: 3px;
    right: 3px;
    padding: 1px 6px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
}

.sf-sidebar-product__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.sf-sidebar-product__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}

.sf-sidebar-product:hover .sf-sidebar-product__title {
    color: var(--primary);
}

.sf-sidebar-product__price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.sf-sidebar-product__price del {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.sf-sidebar-product__price ins {
    text-decoration: none;
}

/* TOC */
.sf-toc__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-toc__item {
    display: block;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-md);
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.sf-toc__item:hover {
    background: rgba(99,102,241,0.06);
    color: var(--primary);
}

.sf-toc__item--h3 {
    padding-right: 24px;
    font-size: 0.82rem;
    color: var(--text-light);
}

/* Toast */
.sf-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--text);
    color: white;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .blog-posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .sf-post-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .sf-post-sidebar {
        position: relative;
        top: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sf-sidebar-widget {
        flex: 1;
        min-width: 280px;
    }
}

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

    .sf-post-hero {
        height: 360px;
    }

    .sf-post-hero__title {
        font-size: 1.6rem;
    }

    .sf-post-hero__meta {
        font-size: 0.82rem;
    }

    .sf-post-hero__content {
        padding-bottom: 32px;
    }

    .sf-post-layout {
        padding: 24px 0 60px;
        gap: 24px;
    }

    .sf-post-content {
        padding: 24px;
        font-size: 0.95rem;
    }

    .sf-post-content h2 {
        font-size: 1.3rem;
    }

    .sf-post-content h3 {
        font-size: 1.1rem;
    }

    .sf-post-header {
        padding: 24px;
    }

    .sf-post-header__title {
        font-size: 1.5rem;
    }

    .sf-post-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sf-post-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .sf-post-nav {
        grid-template-columns: 1fr;
    }

    .sf-post-comments {
        padding: 20px;
    }

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

    .sf-sidebar-widget {
        min-width: 100%;
    }

    .post-card .post-thumbnail {
        height: 200px;
    }

    .page-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .sf-post-hero {
        height: 300px;
    }

    .sf-post-hero__title {
        font-size: 1.3rem;
    }

    .sf-post-content {
        padding: 20px;
    }

    .sf-post-tags {
        padding: 16px;
    }

    .sf-post-author {
        padding: 20px;
    }

    .sf-post-nav__item {
        padding: 16px;
    }
}

/* ==================== Print ==================== */
@media print {
    .sf-post-hero,
    .sf-post-breadcrumb,
    .sf-post-share,
    .sf-post-sidebar,
    .sf-post-nav,
    .sf-post-comments {
        display: none !important;
    }

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

    .sf-post-content {
        border: none;
        padding: 0;
    }
}