/* ============================================
   BLOG STYLES - MK Veasey Electrical Services
   ============================================ */

/* Blog Listing Page
   ========================================== */

.blog-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 140px 0 60px;
    text-align: center;
    margin-top: 0;
}

.blog-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white !important;
}

.blog-header p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    color: white !important;
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    .blog-header {
        padding: 60px 20px 40px;
    }
    
    .blog-header h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
    
    .blog-header p {
        font-size: 1rem;
        padding: 0 10px;
    }
}

/* Blog Filters */
.blog-filters {
    background: white;
    padding: 30px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 40px;
}

.filter-tabs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: 10px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    background: white;
    color: var(--grey-700);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

/* Ensure single column on very narrow screens */
@media (max-width: 360px) {
    .blog-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet and foldable devices (unfolded) */
@media (max-width: 1023px) and (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

/* Mobile and foldable devices (folded) */
@media (max-width: 767px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 40px;
    }
}

/* Extra small devices and narrow foldables */
@media (max-width: 375px) {
    .blog-header {
        padding: 50px 15px 35px;
    }
    
    .blog-grid {
        gap: 20px;
    }
    
    .filter-tabs {
        gap: 10px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Gradient Header Box for Blog Cards */
.blog-card-header {
    width: 100%;
    min-height: 180px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.blog-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-header::before {
    transform: translate(-20%, 20%);
}

/* Decorative bolt icon */
.blog-card-header::after {
    content: '⚡';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    opacity: 0.15;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.blog-card:hover .blog-card-header::after {
    opacity: 0.25;
    transform: scale(1.1);
}

.blog-card-header-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    position: relative;
    z-index: 1;
}

.blog-card-category {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    width: fit-content;
}

.blog-card-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-meta-item svg {
    width: 16px;
    height: 16px;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.3;
}

.blog-card-excerpt {
    color: var(--grey-700);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-card-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.blog-card-author-name {
    font-weight: 600;
    color: var(--primary);
}

.blog-card-read-more {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-read-more svg {
    transform: translateX(4px);
}

/* Featured Post */
.featured-post {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 40px;
}

/* Featured Post Gradient Header */
.featured-post-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 400px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.featured-post-header::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
}

.featured-post-header::after {
    content: '⚡';
    position: absolute;
    bottom: 30px;
    right: 30px;
    font-size: 6rem;
    opacity: 0.1;
}

.featured-post-header .featured-badge {
    position: relative;
    z-index: 1;
}

.featured-post-header-title {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 20px 0 0 0;
    position: relative;
    z-index: 1;
}

.featured-post-header-excerpt {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-top: 15px;
    position: relative;
    z-index: 1;
}

.featured-post-content {
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-badge {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.featured-post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.featured-post-excerpt {
    font-size: 1.125rem;
    color: var(--grey-700);
    line-height: 1.6;
    margin-bottom: 30px;
}

.featured-post-meta {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Blog Sidebar */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 60px;
    margin-bottom: 60px;
}

.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.sidebar-widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
}

.sidebar-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categories li {
    margin-bottom: 12px;
}

.sidebar-categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--grey-700);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-categories a:hover {
    background: #f3f4f6;
    color: var(--primary);
    transform: translateX(5px);
}

.sidebar-categories .count {
    background: #e5e7eb;
    color: var(--grey-700);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-post-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.recent-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-post-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-post-image::before {
    content: '⚡';
    font-size: 1.5rem;
    color: var(--secondary);
    opacity: 0.8;
}

.recent-post-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-content {
    flex: 1;
}

.recent-post-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.recent-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-post-title a:hover {
    color: var(--primary);
}

.recent-post-date {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Blog Post Page
   ========================================== */

.post-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 160px 0 60px;
    margin-top: 0;
}

.post-category {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.post-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    color: white !important;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 1rem;
    opacity: 0.95;
    color: white;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-meta-item svg {
    width: 20px;
    height: 20px;
}

.post-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 60px;
    margin: 60px 0;
}

.post-content {
    background: white;
    border-radius: 12px;
    padding: 60px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.post-featured-image {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 40px 0 20px;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 30px 0 15px;
}

.post-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--grey-700);
    margin-bottom: 20px;
}

.post-content ul,
.post-content ol {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--grey-700);
    margin-bottom: 20px;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 20px 30px;
    margin: 30px 0;
    background: #f9fafb;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--grey-700);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
}

.post-content .highlight-box {
    background: #fef3c7;
    border-left: 4px solid var(--secondary);
    padding: 20px 30px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0;
    padding: 30px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.post-tag {
    background: #f3f4f6;
    color: var(--grey-700);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background: var(--primary);
    color: white;
}

.post-author-box {
    background: #f9fafb;
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    display: flex;
    gap: 20px;
}

.post-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.post-author-info h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.post-author-bio {
    color: var(--grey-700);
    line-height: 1.6;
}

.post-share {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    position: sticky;
    top: 100px;
}

.post-share h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.share-button svg {
    width: 20px;
    height: 20px;
}

.share-button.facebook {
    background: #1877f2;
    color: white;
}

.share-button.twitter {
    background: #1da1f2;
    color: white;
}

.share-button.linkedin {
    background: #0a66c2;
    color: white;
}

.share-button.email {
    background: #6b7280;
    color: white;
}

.share-button:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.related-posts {
    margin: 60px 0;
}

.related-posts h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* CTA Section */
.blog-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    border-radius: 12px;
    margin: 60px 0;
}

.blog-cta h3 {
    font-size: 2rem;
    color: white !important;
    font-weight: 700;
    margin-bottom: 15px;
}

.blog-cta p {
    font-size: 1.125rem;
    color: white !important;
    opacity: 0.95;
    margin-bottom: 30px;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 60px 0;
}

.pagination-button {
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--grey-700);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design
   ========================================== */

@media (max-width: 1024px) {
    .blog-layout,
    .post-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar,
    .post-share {
        position: static;
    }
    
    .featured-post {
        grid-template-columns: 1fr;
    }
    
    .featured-post-header {
        min-height: 280px;
        padding: 40px;
    }
    
    .featured-post-header-title {
        font-size: 1.75rem;
    }
    
    .featured-post-content {
        padding: 40px;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .blog-header h1,
    .post-title {
        font-size: 2rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .post-content {
        padding: 30px 20px;
    }
    
    .featured-post-title {
        font-size: 1.75rem;
    }
    
    .featured-post-content {
        padding: 30px 20px;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .post-content p,
    .post-content ul,
    .post-content ol {
        font-size: 1rem;
    }
}
