/* ======= BLOG STYLES ======= */

/* Blog Banner Section */
#blog-banner {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/blogs/blog-banner.jpg');
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    color: var(--text-light);
    text-align: center;
}

.blog-banner-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.blog-banner-content p {
    font-size: 24px;
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Blog Content Layout */
#blog-content {
    padding: 80px 0;
}

.blog-grid-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

/* Blog Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
}

.sidebar-widget h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.sidebar-widget h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Search Widget */
.blog-search-form {
    display: flex;
    position: relative;
}

.blog-search-form input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
}

.blog-search-form button {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.blog-search-form button:hover {
    background-color: #d45f1e;
}

/* Categories Widget */
.categories-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-widget li {
    border-bottom: 1px dashed #eee;
    padding: 10px 0;
}

.categories-widget li:last-child {
    border-bottom: none;
}

.categories-widget a {
    color: var(--text-dark);
    transition: color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categories-widget a span {
    font-size: 14px;
    color: #777;
    background-color: #f5f5f5;
    padding: 2px 8px;
    border-radius: 30px;
    transition: background-color 0.3s, color 0.3s;
}

.categories-widget a:hover span {
    background-color: var(--primary-color);
    color: white;
}

.categories-widget a:hover {
    color: var(--primary-color);
}

.categories-widget a:after {
    display: none;
}

/* Popular Posts Widget */
.popular-posts-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-posts-widget li {
    margin-bottom: 20px;
}

.popular-posts-widget li:last-child {
    margin-bottom: 0;
}

.popular-posts-widget a {
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-image {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.popular-posts-widget a:hover .post-image img {
    transform: scale(1.1);
}

.post-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-dark);
    transition: color 0.3s;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-info span {
    font-size: 14px;
    color: #777;
}

.popular-posts-widget a:hover .post-info h4 {
    color: var(--primary-color);
}

/* Tags Widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #555;
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.3s;
}

.tag-cloud a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Blog Posts Grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* Blog Card */
.blog-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.blog-card-image {
    position: relative;
    overflow: hidden;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    position: absolute;
    top: 0;
    left: 0;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-categories {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.blog-card .blog-category {
    background-color: rgba(237, 111, 38, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-title {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-title a {
    color: var(--text-dark);
    transition: color 0.3s;
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
}

.blog-meta span {
    display: flex;
    align-items: center;
}

.blog-meta i {
    margin-right: 5px;
    color: var(--primary-color);
}

.blog-excerpt {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
    /* Show only 3 lines and add ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s;
}

.read-more i {
    margin-left: 5px;
    transition: transform 0.3s;
}

.read-more:hover {
    color: #d45f1e;
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Blog Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 60px;
    margin-bottom: 40px;
}

.pagination-number, .pagination-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: white;
    color: var(--text-dark);
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pagination-number:hover, .pagination-arrow:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination-number.active {
    background-color: var(--primary-color);
    color: white;
}

/* Newsletter Section */
.blog-newsletter {
    margin-top: 80px;
    background-color: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.newsletter-content {
    padding: 40px;
    text-align: center;
}

.newsletter-content h3 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 15px;
}

.newsletter-content p {
    max-width: 600px;
    margin: 0 auto 25px;
    color: #555;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 30px 0 0 30px;
    font-size: 16px;
}

.newsletter-form .btn {
    border-radius: 0 30px 30px 0;
    margin: 0;
    padding-left: 25px;
    padding-right: 25px;
}

/* BLOG DETAIL STYLES */
#blog-detail {
    padding: 60px 0;
}

.blog-detail-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.blog-detail-header {
    margin-bottom: 30px;
}

.blog-detail-header .blog-categories {
    position: static;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.blog-detail-header .blog-category {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.blog-detail-header .blog-title {
    font-size: 40px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.blog-detail-header .blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
}

.blog-detail-header .author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-detail-header .author-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-detail-header .author-name {
    font-weight: 600;
    color: var(--text-dark);
}

.blog-featured-image {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.blog-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-content {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.blog-content p {
    margin-bottom: 24px;
}

.blog-content h3 {
    font-size: 28px;
    margin: 40px 0 20px;
    color: var(--primary-color);
}

.blog-content h4 {
    font-size: 22px;
    margin: 30px 0 15px;
    color: var(--text-dark);
}

.blog-content ul, .blog-content ol {
    margin-bottom: 24px;
    padding-left: 40px;
}

.blog-content li {
    margin-bottom: 12px;
}

.blog-content strong {
    font-weight: 700;
}

.blog-content em {
    font-style: italic;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.blog-tags {
    margin: 40px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.blog-tags h3 {
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
}

.blog-tags .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-tags .tag {
    display: inline-block;
    padding: 8px 15px;
    background-color: white;
    color: var(--text-dark);
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.blog-tags .tag:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.blog-sharing {
    margin: 40px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.blog-sharing h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.sharing-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: white;
}

.share-button.facebook {
    background-color: #3b5998;
}

.share-button.twitter {
    background-color: #1da1f2;
}

.share-button.linkedin {
    background-color: #0077b5;
}

.share-button.pinterest {
    background-color: #bd081c;
}

.share-button.email {
    background-color: #777;
}

.blog-author-box {
    margin: 40px 0;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.blog-author-box .author-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.blog-author-box .author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-author-box .author-info h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.blog-author-box .author-info p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 0;
}

.related-posts {
    margin: 60px 0;
}

.related-posts h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--primary-color);
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.related-post-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.related-post-image {
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 20px;
}

.related-post-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.related-post-content h3 a {
    color: var(--text-dark);
    transition: color 0.3s;
}

.related-post-content h3 a:hover {
    color: var(--primary-color);
}

.related-post-date {
    font-size: 14px;
    color: #777;
}

.blog-comments {
    margin: 60px 0 40px;
}

.blog-comments h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.comments-list {
    margin-bottom: 40px;
}

.comment {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.comment-header h4 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.comment-date {
    font-size: 14px;
    color: #777;
}

.comment-content p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.reply-button {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.3s;
}

.reply-button:hover {
    opacity: 0.8;
}

.comment-form {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
}

.comment-form h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.comment-form .btn {
    margin-top: 10px;
}

.sidebar-newsletter-form {
    margin-top: 20px;
}

.sidebar-newsletter-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
}

.sidebar-newsletter-form .btn {
    width: 100%;
    margin-top: 0;
}

#blog-newsletter {
    padding: 0 0 80px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .blog-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 992px) {
    .blog-grid-container {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        order: 2;
    }
    
    .blog-posts-grid {
        order: 1;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .sidebar-widget {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .blog-detail-container {
        grid-template-columns: 1fr;
    }
    
    .blog-detail-header .blog-title {
        font-size: 32px;
    }
    
    .blog-author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #blog-banner {
        padding: 70px 0;
    }
    
    .blog-banner-content h1 {
        font-size: 36px;
    }
    
    .blog-banner-content p {
        font-size: 18px;
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .blog-detail-header .blog-title {
        font-size: 28px;
    }
    
    .blog-content {
        font-size: 16px;
    }
    
    .blog-content h3 {
        font-size: 24px;
    }
    
    .blog-content h4 {
        font-size: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .newsletter-form input {
        border-radius: 30px;
    }
    
    .newsletter-form .btn {
        border-radius: 30px;
    }
}

@media (max-width: 576px) {
    #blog-banner {
        padding: 50px 0;
    }
    
    .blog-banner-content h1 {
        font-size: 28px;
    }
    
    .blog-banner-content p {
        font-size: 16px;
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .blog-title {
        font-size: 20px;
    }
    
    .blog-meta {
        font-size: 12px;
    }
    
    .pagination-number, .pagination-arrow {
        width: 35px;
        height: 35px;
    }
    
    #blog-detail {
        padding: 40px 0;
    }
    
    .blog-detail-header .blog-title {
        font-size: 24px;
    }
    
    .blog-detail-header .blog-meta {
        gap: 15px;
    }
    
    .sharing-buttons {
        gap: 10px;
    }
    
    .share-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}