/* Modern Blog UI System */
/* Base Grid & Layout */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2.5rem;
    padding-bottom: 2rem;
}

/* Toolbar & Search */
.blog-toolbar {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.25rem 2rem;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .blog-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .blog-search {
        min-width: 300px;
    }
}

.blog-search {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
}

.blog-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

.blog-search i {
    color: var(--text-muted);
    font-size: 1rem;
}

.blog-search input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag-chip {
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.tag-chip.active {
    border-color: transparent;
    color: white;
    background: var(--gradient);
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.3);
    transform: scale(1.05);
}

.blog-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Blog Cards */
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.blog-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.blog-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent 60%);
    opacity: 0.6;
}

.blog-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.blog-card:first-child .blog-image::before {
    content: 'TOP / RECOMMENDED';
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 3;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(255, 107, 74, 0.4);
}

.blog-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

.blog-tag {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-tag::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.blog-card h3 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s;
}

.blog-card:hover h3 {
    color: var(--accent);
}

.blog-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.blog-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.read-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s;
}

.blog-link i {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.blog-link:hover {
    color: var(--accent);
}

.blog-link:hover i {
    transform: translateX(3px) translateY(-3px);
}

/* Featured Layout (Desktop) */
@media (min-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-card:first-child {
        grid-column: 1 / -1;
        flex-direction: row;
        min-height: 420px;
    }

    .blog-card:first-child .blog-image {
        width: 58%;
        height: auto;
        clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
    }

    .blog-card:first-child .blog-image img {
        height: 100%;
        width: 100%;
    }

    .blog-card:first-child .blog-content {
        width: 42%;
        justify-content: center;
        padding: 3rem 2.5rem;
        padding-left: 1rem;
    }

    .blog-card:first-child h3 {
        font-size: 2.25rem;
        margin-bottom: 1.5rem;
    }

    .blog-card:first-child p {
        font-size: 1.05rem;
        -webkit-line-clamp: 4;
        margin-bottom: 2rem;
    }
}

/* Skeleton Loading */
.blog-skeleton {
    min-height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    padding: 0;
}

.skeleton-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-info {
    padding: 1.5rem;
}

.skeleton-title {
    width: 80%;
    height: 24px;
    background: rgba(255, 255, 255, 0.06);
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-text {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

@media (min-width: 992px) {
    .blog-skeleton.featured {
        grid-column: 1 / -1;
        display: flex;
    }
    .blog-skeleton.featured .skeleton-image {
        width: 58%;
        height: 100%;
    }
    .blog-skeleton.featured .skeleton-info {
        width: 42%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Empty State */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
}

/* Reader Progress Bar */
#reader-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--gradient);
    z-index: 2100;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.1s ease;
}

/* Reader Overlay Enhancements */
.blog-reader-overlay {
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(16px);
}

.blog-reader-container {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 850px;
}

.reader-title {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

.reader-content {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
}

.reader-content p {
    margin-bottom: 1.8rem;
}

.reader-content blockquote {
    border-left-width: 3px;
    border-color: var(--accent);
    background: linear-gradient(to right, rgba(255, 107, 74, 0.1), transparent);
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    border-radius: 0 12px 12px 0;
}
