/**
 * Blog Styles - Apple Newsroom Inspired
 * TAB.MD Blog System
 */

/* ========================= */
/* Variables */
/* ========================= */
:root {
    --blog-text-primary: #1d1d1f;
    --blog-text-secondary: #86868b;
    --blog-bg-light: #f5f5f7;
    --blog-transition: 0.3s ease;
    --blog-radius: 18px;
    --blog-radius-sm: 12px;
}

/* ========================= */
/* Blog Page Container */
/* ========================= */
.blog-page {
    background-color: #fff;
}

/* ========================= */
/* Hero Section */
/* ========================= */
.blog-hero {
    height: 75vh;
    min-height: 500px;
    max-height: 800px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.2) 70%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
}

.blog-hero-content {
    max-width: 800px;
}

.blog-hero-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    opacity: 0.9;
    text-decoration: none;
    margin-bottom: 16px;
    transition: opacity var(--blog-transition);
}

.blog-hero-category:hover {
    opacity: 1;
    color: #fff;
}

.blog-hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 20px;
}

.blog-hero-title a {
    color: #fff;
    text-decoration: none;
    transition: opacity var(--blog-transition);
}

.blog-hero-title a:hover {
    opacity: 0.85;
}

.blog-hero-excerpt {
    font-size: 18px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 20px;
    max-width: 600px;
}

.blog-hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.blog-hero-author::before {
    content: '|';
    margin-right: 16px;
}

/* ========================= */
/* Categories Navigation */
/* ========================= */
.blog-categories-section {
    padding: 30px 0;
    background: #fff;
    border-bottom: 1px solid #e8e8ed;
    position: sticky;
    top: 0;
    z-index: 100;
}

.blog-categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.blog-category-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--blog-text-secondary);
    background: var(--blog-bg-light);
    border-radius: 980px;
    text-decoration: none;
    transition: all var(--blog-transition);
}

.blog-category-link:hover {
    background: #e8e8ed;
    color: var(--blog-text-primary);
}

.blog-category-link.active {
    background: var(--blog-text-primary);
    color: #fff;
}

.blog-category-count {
    font-size: 12px;
    opacity: 0.7;
}

.blog-category-link.active .blog-category-count {
    opacity: 0.8;
}

/* ========================= */
/* Blog Grid Section */
/* ========================= */
.blog-grid-section {
    padding: 60px 0 80px;
}

.blog-section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--blog-text-primary);
    margin: 0 0 40px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--blog-text-secondary);
    font-size: 18px;
}

/* ========================= */
/* Blog Cards */
/* ========================= */
.blog-card {
    border-radius: var(--blog-radius);
    overflow: hidden;
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.blog-card-link {
    display: block;
    text-decoration: none;
}

.blog-card-image {
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    position: relative;
}

.blog-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 100%
    );
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.blog-card-category {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.blog-card-title {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* Large Card (first in grid when no featured) */
.blog-card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.blog-card-large .blog-card-image {
    aspect-ratio: auto;
    height: 100%;
    min-height: 400px;
}

.blog-card-large .blog-card-title {
    font-size: 32px;
}

.blog-card-large .blog-card-excerpt {
    font-size: 16px;
    -webkit-line-clamp: 3;
}

/* ========================= */
/* Pagination */
/* ========================= */
.blog-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.blog-pagination .pagination {
    gap: 8px;
}

.blog-pagination .page-link {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--blog-text-primary);
    background: var(--blog-bg-light);
    font-weight: 500;
}

.blog-pagination .page-link:hover {
    background: #e8e8ed;
}

.blog-pagination .page-item.active .page-link {
    background: var(--blog-text-primary);
    color: #fff;
}

.blog-pagination .page-item.disabled .page-link {
    opacity: 0.4;
}

/* ========================= */
/* Article Page */
/* ========================= */
.blog-article-header {
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.blog-article-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    display: flex;
    align-items: flex-end;
    padding-bottom: 50px;
}

/* Breadcrumb */
.blog-breadcrumb {
    margin-bottom: 24px;
}

.blog-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.blog-breadcrumb li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
}

.blog-breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    opacity: 0.5;
}

.blog-breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--blog-transition);
}

.blog-breadcrumb a:hover {
    color: #fff;
}

.blog-breadcrumb li.active {
    color: rgba(255, 255, 255, 0.5);
}

.blog-article-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.blog-article-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    margin: 0 0 24px;
    max-width: 900px;
}

.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.blog-article-author {
    font-weight: 500;
}

/* Article Content */
.blog-article-content {
    padding: 60px 0;
}

.blog-article-body {
    max-width: 760px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.7;
    color: var(--blog-text-primary);
}

.blog-article-body h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 48px 0 20px;
}

.blog-article-body h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 36px 0 16px;
}

.blog-article-body p {
    margin: 0 0 24px;
}

.blog-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius-sm);
    margin: 32px 0;
}

.blog-article-body a {
    color: #0066cc;
    text-decoration: none;
}

.blog-article-body a:hover {
    text-decoration: underline;
}

.blog-article-body ul,
.blog-article-body ol {
    margin: 0 0 24px;
    padding-left: 24px;
}

.blog-article-body li {
    margin-bottom: 8px;
}

.blog-article-body blockquote {
    border-left: 4px solid var(--blog-text-primary);
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--blog-text-secondary);
}

/* Share Buttons */
.blog-article-share {
    max-width: 760px;
    margin: 60px auto 0;
    padding-top: 40px;
    border-top: 1px solid #e8e8ed;
    display: flex;
    align-items: center;
    gap: 16px;
}

.blog-share-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--blog-text-secondary);
}

.blog-share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    transition: transform var(--blog-transition), opacity var(--blog-transition);
}

.blog-share-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

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

.blog-share-twitter {
    background: #000;
}

.blog-share-telegram {
    background: #0088cc;
}

/* Related Posts */
.blog-related {
    padding: 80px 0;
    background: var(--blog-bg-light);
}

.blog-related-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--blog-text-primary);
    margin: 0 0 40px;
    text-align: center;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Back Link */
.blog-back-section {
    padding: 40px 0 80px;
    background: var(--blog-bg-light);
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #0066cc;
    text-decoration: none;
    transition: gap var(--blog-transition);
}

.blog-back-link:hover {
    gap: 12px;
    color: #0055b3;
}

/* ========================= */
/* Responsive */
/* ========================= */
@media (max-width: 991px) {
    .blog-hero {
        height: 60vh;
        min-height: 400px;
    }

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

    .blog-hero-excerpt {
        font-size: 16px;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-card-large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .blog-card-large .blog-card-image {
        min-height: 300px;
    }

    .blog-card-large .blog-card-title {
        font-size: 26px;
    }

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

    .blog-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .blog-hero {
        height: 50vh;
        min-height: 350px;
    }

    .blog-hero-overlay {
        padding-bottom: 40px;
    }

    .blog-hero-title {
        font-size: 28px;
    }

    .blog-hero-excerpt {
        display: none;
    }

    .blog-hero-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .blog-hero-author::before {
        display: none;
    }

    .blog-categories-section {
        padding: 20px 0;
    }

    .blog-categories-nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0 15px;
        margin: 0 -15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .blog-categories-nav::-webkit-scrollbar {
        display: none;
    }

    .blog-category-link {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .blog-grid-section {
        padding: 40px 0 60px;
    }

    .blog-section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

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

    .blog-card-large {
        grid-column: span 1;
    }

    .blog-card-large .blog-card-image {
        min-height: auto;
        aspect-ratio: 16 / 10;
    }

    .blog-card-large .blog-card-title {
        font-size: 21px;
    }

    .blog-card-title {
        font-size: 18px;
    }

    .blog-article-header {
        height: 45vh;
        min-height: 300px;
    }

    .blog-article-header-overlay {
        padding-bottom: 30px;
    }

    .blog-article-title {
        font-size: 26px;
    }

    .blog-article-meta {
        font-size: 13px;
    }

    .blog-article-content {
        padding: 40px 0;
    }

    .blog-article-body {
        font-size: 16px;
    }

    .blog-article-body h2 {
        font-size: 22px;
    }

    .blog-article-body h3 {
        font-size: 18px;
    }

    .blog-article-share {
        margin-top: 40px;
        padding-top: 30px;
    }

    .blog-related {
        padding: 60px 0;
    }

    .blog-related-title {
        font-size: 22px;
        margin-bottom: 24px;
    }

    .blog-related-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .blog-back-section {
        padding: 30px 0 60px;
    }
}

/* ========================= */
/* Print Styles */
/* ========================= */
@media print {
    .blog-categories-section,
    .blog-article-share,
    .blog-related,
    .blog-back-section {
        display: none;
    }

    .blog-article-header {
        height: auto;
        min-height: 0;
    }

    .blog-article-header-overlay {
        position: static;
        background: none;
        padding: 0;
    }

    .blog-article-title,
    .blog-breadcrumb a,
    .blog-article-meta {
        color: #000;
    }
}
