/* ==========================================================================
   Aftab & Associates - Blog Styling (Premium Design System)
   ========================================================================== */

:root {
    --blog-primary: #1e5f74;
    --blog-primary-light: #2d829e;
    --blog-secondary: #2e7d32;
    --blog-secondary-light: #3d9e41;
    --blog-accent: #ff9800;
    --blog-dark: #1b262c;
    --blog-text: #2c3e50;
    --blog-light-text: #6c7a89;
    --blog-bg: #f8fafc;
    --blog-card-bg: #ffffff;
    --blog-border: #e2e8f0;
    --blog-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --blog-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --blog-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --blog-radius: 12px;
    --blog-font: 'Poppins', sans-serif;
}

/* Base Blog Hub Styles */
.blog-body {
    background-color: var(--blog-bg);
    color: var(--blog-text);
    font-family: var(--blog-font);
}

/* Blog Header Section */
.blog-hero {
    background: linear-gradient(135deg, var(--blog-primary) 0%, #103742 100%);
    color: white;
    padding: 180px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(46, 125, 50, 0.25) 0%, transparent 50%);
    z-index: 1;
}

.blog-hero .container {
    position: relative;
    z-index: 2;
}

.blog-hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.blog-hero p {
    font-size: 18px;
    max-width: 650px;
    margin: 0 auto 30px;
    opacity: 0.9;
    line-height: 1.6;
}

/* Search and Filters Hub */
.blog-controls {
    margin-top: -40px;
    position: relative;
    z-index: 10;
    margin-bottom: 50px;
}

.controls-wrapper {
    background: white;
    padding: 25px;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    position: relative;
    flex: 1 1 300px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 1px solid var(--blog-border);
    border-radius: 8px;
    font-family: var(--blog-font);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.search-box input:focus {
    border-color: var(--blog-primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(30, 95, 116, 0.15);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blog-light-text);
    pointer-events: none;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background-color: #f1f5f9;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-family: var(--blog-font);
    font-weight: 500;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: #e2e8f0;
    color: var(--blog-primary);
}

.filter-btn.active {
    background-color: var(--blog-primary);
    color: white;
}

/* Blog Cards Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.blog-card {
    background-color: var(--blog-card-bg);
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--blog-shadow-lg);
    border-color: var(--blog-primary-light);
}

.blog-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #e2e8f0;
}

.blog-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--blog-secondary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.blog-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--blog-light-text);
    margin-bottom: 12px;
    align-items: center;
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--blog-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-title {
    color: var(--blog-primary);
}

.blog-excerpt {
    font-size: 14.5px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--blog-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.blog-read-more:hover {
    color: var(--blog-secondary);
    gap: 12px;
}

/* ==========================================================================
   Single Blog Post Page Styles
   ========================================================================== */

.post-wrapper {
    background-color: white;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow-md);
    padding: 40px;
    margin-top: -60px;
    position: relative;
    z-index: 10;
    margin-bottom: 60px;
}

.post-header {
    text-align: center;
    margin-bottom: 35px;
}

.post-category {
    display: inline-block;
    background-color: rgba(30, 95, 116, 0.1);
    color: var(--blog-primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.post-header h1 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--blog-dark);
    margin-bottom: 20px;
}

.post-meta-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    color: var(--blog-light-text);
    font-size: 14px;
    border-bottom: 1px solid var(--blog-border);
    padding-bottom: 25px;
}

.post-meta-details span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--blog-radius);
    object-fit: cover;
    margin-bottom: 40px;
    box-shadow: var(--blog-shadow-md);
}

/* Article Content Typography & Layout */
.post-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
}

@media (max-width: 992px) {
    .post-layout {
        grid-template-columns: 1fr;
    }
}

.post-body {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
}

.post-body h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--blog-primary);
    margin: 40px 0 20px;
    border-left: 4px solid var(--blog-secondary);
    padding-left: 15px;
}

.post-body h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--blog-dark);
    margin: 30px 0 15px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body ul, .post-body ol {
    margin-bottom: 25px;
    padding-left: 25px;
}

.post-body li {
    margin-bottom: 10px;
}

.post-body strong {
    color: var(--blog-dark);
}

.post-body blockquote {
    background: #f8fafc;
    border-left: 4px solid var(--blog-primary);
    padding: 20px 30px;
    margin: 30px 0;
    font-style: italic;
    border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 14.5px;
}

.post-body th, .post-body td {
    padding: 12px 15px;
    border: 1px solid var(--blog-border);
    text-align: left;
}

.post-body th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: var(--blog-dark);
}

.post-body tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Sidebar Elements */
.post-sidebar {
    position: sticky;
    top: 110px;
    align-self: start;
}

.sidebar-widget {
    background-color: #f8fafc;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 25px;
    margin-bottom: 30px;
}

.sidebar-widget h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--blog-primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--blog-primary);
    padding-bottom: 10px;
}

.toc-list {
    list-style: none;
    padding: 0 !important;
}

.toc-list li {
    margin-bottom: 12px;
}

.toc-list a {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-block;
}

.toc-list a:hover {
    color: var(--blog-secondary);
    padding-left: 5px;
}

.contact-widget {
    background: linear-gradient(135deg, var(--blog-primary) 0%, #154b5c 100%);
    color: white;
    border: none;
    text-align: center;
}

.contact-widget h3 {
    color: white;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.contact-widget p {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.contact-widget .btn {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.related-posts-widget ul {
    list-style: none;
    padding: 0 !important;
}

.related-posts-widget li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.related-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.related-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--blog-dark);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.3s ease;
}

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

/* Breadcrumb Styling */
.blog-breadcrumbs {
    display: flex;
    gap: 10px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.8);
    justify-content: center;
    margin-top: 15px;
}

.blog-breadcrumbs a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

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

/* Author Profile Section */
.author-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f8fafc;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 25px;
    margin: 40px 0;
}

@media (max-width: 576px) {
    .author-profile {
        flex-direction: column;
        text-align: center;
    }
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--blog-shadow-sm);
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--blog-dark);
    margin-bottom: 6px;
}

.author-info p {
    font-size: 13.5px;
    color: var(--blog-light-text);
    margin: 0;
    line-height: 1.5;
}

/* Keyword Highlights (Visual Tagging) */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid var(--blog-border);
}

.post-tag {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

/* Mobile Responsiveness for Post Page */
@media (max-width: 768px) {
    .blog-hero {
        padding: 130px 0 80px;
    }
    
    .blog-hero h1 {
        font-size: 32px;
    }
    
    .post-wrapper {
        padding: 20px;
        margin-top: -40px;
    }
    
    .post-header h1 {
        font-size: 26px;
    }
    
    .post-body h2 {
        font-size: 20px;
        margin: 30px 0 15px;
    }
}
