/* Blog Page Specific Styles */

/* Blog Header */
.blog-header {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    margin-top: 70px;
}

.blog-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.blog-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Blog Section */
.blog-section {
    padding: 5rem 0;
    background: var(--bg-light);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 580px;
}

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

.blog-card.expanded {
    height: auto;
    max-height: none;
}

/* Card Image */
.card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Card Content */
.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.blog-card.expanded .card-content {
    overflow: visible;
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.card-excerpt {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
    flex: 1;
}

.card-excerpt p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card.expanded .card-excerpt p {
    display: block;
    -webkit-line-clamp: unset;
}

/* Full Content */
.card-full-content {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.card-full-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.card-full-content p {
    margin-bottom: 1rem;
}

/* Read More Button */
.btn-read-more {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-start;
    margin-top: auto;
}

.btn-read-more:hover {
    background: var(--primary-color);
    color: white;
}

.blog-card.expanded .btn-read-more {
    background: var(--primary-color);
    color: white;
}

/* Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

/* Category List */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.75rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.category-list a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

.category-list span {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    transition: var(--transition);
}

.popular-post:hover {
    transform: translateX(5px);
}

.popular-post-image {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex: 1;
}

.popular-post-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.popular-post-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.875rem;
    transition: var(--transition);
}

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

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}

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

.cta-widget p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.cta-widget .btn {
    background: white;
    color: var(--primary-color);
}

.cta-widget .btn:hover {
    background: var(--bg-light);
}

/* Active Nav Link */
.nav-link.active {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        order: -1;
    }

    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding: 6rem 0 3rem;
    }

    .blog-title {
        font-size: 2rem;
    }

    .blog-subtitle {
        font-size: 1.125rem;
    }

    .blog-section {
        padding: 3rem 0;
    }

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

    .blog-card {
        height: 550px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .sidebar-widget {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .blog-title {
        font-size: 1.75rem;
    }

    .blog-card {
        height: 520px;
    }

    .card-image {
        height: 180px;
    }

    .card-content {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .card-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeIn 0.5s ease-out;
}

.blog-card:nth-child(1) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.2s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.3s;
}

.blog-card:nth-child(4) {
    animation-delay: 0.4s;
}
