/**
 * DigitalDuniya - Blog CSS
 * Styles for blog listing and blog post pages
 */

/* =====================================================
   BLOG PAGE HEADER
   ===================================================== */
.blog-header {
    background: var(--gradient-primary);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 50%);
}

.blog-header-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.blog-header-title {
    font-size: 48px;
    font-weight: 800;
    color: white;
    margin: 24px 0 16px;
    line-height: 1.2;
}

.blog-header-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* =====================================================
   BLOG LAYOUT
   ===================================================== */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 48px;
    align-items: start;
}

.blog-main {
    min-width: 0; /* Prevents grid blowout */
}

/* =====================================================
   BLOG FILTERS
   ===================================================== */
.blog-filters {
    margin-bottom: 32px;
}

.blog-search-form {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.filter-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.filter-tag:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.filter-tag i {
    font-size: 10px;
}

.filter-clear {
    color: var(--primary-600);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
}

.blog-results-info {
    margin-bottom: 24px;
}

.blog-results-info p {
    color: var(--gray-600);
    font-size: 14px;
    margin: 0;
}

/* =====================================================
   BLOG GRID
   ===================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.blog-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-100);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.blog-card-image {
    display: block;
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--gray-200);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
}

.blog-card-placeholder i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.5);
}

.blog-category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    background: rgba(14, 165, 233, 0.9);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.blog-card-content {
    padding: 24px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.blog-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
}

.blog-meta-item i {
    font-size: 12px;
}

.blog-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.blog-card-title a {
    color: var(--gray-900);
    transition: color var(--transition-fast);
}

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

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-600);
    margin-bottom: 20px;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
}

.blog-author-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-600);
    font-weight: 600;
    font-size: 14px;
    transition: gap var(--transition-fast);
}

.blog-read-more:hover {
    gap: 10px;
}

.blog-read-more i {
    font-size: 12px;
}

/* =====================================================
   NO RESULTS
   ===================================================== */
.blog-no-results {
    text-align: center;
    padding: 80px 20px;
}

.blog-no-results i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 24px;
}

.blog-no-results h3 {
    font-size: 24px;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.blog-no-results p {
    color: var(--gray-600);
    margin-bottom: 32px;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
    border: 1px solid var(--gray-100);
}

.widget-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-500);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.category-item:hover {
    background: var(--gray-50);
    color: var(--primary-600);
}

.category-item.active {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
}

.category-count {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.category-item.active .category-count {
    background: var(--primary-200);
    color: var(--primary-700);
}

.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recent-post-item {
    display: flex;
    gap: 12px;
    transition: all var(--transition-fast);
}

.recent-post-item:hover {
    opacity: 0.8;
}

.recent-post-thumb,
.recent-post-thumb-placeholder {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-thumb-placeholder {
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-post-thumb-placeholder i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
}

.recent-post-content h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.recent-post-date {
    font-size: 12px;
    color: var(--gray-500);
}

.recent-post-date i {
    font-size: 11px;
    margin-right: 4px;
}

.widget-newsletter {
    background: var(--gradient-primary);
    color: white;
}

.widget-newsletter .widget-title {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.widget-newsletter p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.widget-newsletter .form-control {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    margin-bottom: 12px;
}

.widget-newsletter .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.widget-newsletter .form-control:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* =====================================================
   BLOG POST PAGE
   ===================================================== */
.blog-post-header {
    padding: 120px 0 60px;
    background: var(--gray-50);
}

.blog-post-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.post-category-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.post-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: 24px;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--gray-700);
}

.post-author-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.blog-post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

.blog-post-main {
    max-width: 800px;
}

.post-featured-image {
    margin-bottom: 48px;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

.post-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--gray-700);
}

.post-content h2 {
    font-size: 32px;
    margin-top: 48px;
    margin-bottom: 20px;
    scroll-margin-top: 100px;
}

.post-content h3 {
    font-size: 24px;
    margin-top: 32px;
    margin-bottom: 16px;
    scroll-margin-top: 100px;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content img {
    border-radius: var(--radius-xl);
    margin: 32px 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 24px;
    padding-left: 32px;
}

.post-content li {
    margin-bottom: 12px;
}

.post-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    background: var(--gray-50);
    border-left: 4px solid var(--primary-500);
    border-radius: var(--radius-lg);
    font-style: italic;
    color: var(--gray-700);
}

.post-content code {
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--primary-600);
}

.post-content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 24px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 32px 0;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.post-tags {
    margin: 48px 0;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-tag {
    padding: 6px 16px;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.post-tag:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.post-share {
    margin: 48px 0;
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
}

.post-share h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-facebook {
    background: #1877f2;
    color: white;
}

.share-twitter {
    background: #1da1f2;
    color: white;
}

.share-linkedin {
    background: #0077b5;
    color: white;
}

.share-copy {
    background: var(--gray-700);
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.author-bio {
    margin: 48px 0;
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    display: flex;
    gap: 20px;
}

.author-bio-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 32px;
    flex-shrink: 0;
}

.author-bio-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.author-bio-content p {
    color: var(--gray-600);
    font-size: 15px;
    margin: 0;
}

.post-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 48px 0;
}

.post-nav-item {
    padding: 24px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-nav-item:hover {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-md);
}

.post-nav-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.post-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.post-nav-next {
    text-align: right;
}

.sticky-widget {
    position: sticky;
    top: 100px;
}

.toc-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item,
.toc-item-sub {
    margin-bottom: 8px;
}

.toc-item-sub {
    padding-left: 20px;
}

.toc-items a {
    display: block;
    padding: 8px 12px;
    color: var(--gray-700);
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.toc-items a:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .blog-layout,
    .blog-post-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar,
    .blog-post-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding: 100px 0 60px;
    }

    .blog-header-title {
        font-size: 36px;
    }

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

    .post-title {
        font-size: 32px;
    }

    .post-meta {
        flex-direction: column;
        gap: 12px;
    }

    .blog-search-form {
        flex-direction: column;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }

    .author-bio {
        flex-direction: column;
        text-align: center;
    }

    .author-bio-avatar {
        margin: 0 auto;
    }

    .post-content {
        font-size: 16px;
    }
}
