/* ========================================
   WordPress-Style Blog Layout CSS
   ======================================== */

/* Blog Container */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px;
}

.blog-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e5e5;
}

.blog-header .category-label {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.blog-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Breadcrumbs */
.breadcrumb-nav {
    background: #f8f9fa;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e5e5;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: #0056b3;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 10px;
    color: #999;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Blog Grid Layout */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-bottom: 50px;
}

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

/* Featured Post */
.featured-post {
    position: relative;
    margin-bottom: 50px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.featured-post-image {
    position: relative;
    height: 450px;
    overflow: hidden;
}

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-post:hover .featured-post-image img {
    transform: scale(1.05);
}

.featured-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-post-content {
    padding: 30px;
    background: white;
}

.featured-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

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

.featured-post h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.featured-post h2 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s;
}

.featured-post h2 a:hover {
    color: #007bff;
}

.featured-post-excerpt {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
}

.read-more-btn:hover {
    background: #0056b3;
    color: white;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.blog-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f0f0f0;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.blog-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,123,255,0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.blog-card-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #666;
}

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

.blog-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-card h3 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-card h3 a:hover {
    color: #007bff;
}

.blog-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.blog-card-read-more {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-card-read-more:hover {
    color: #0056b3;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-widget {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.sidebar-widget h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #007bff;
    color: #1a1a1a;
}

.sidebar-search {
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.sidebar-search input:focus {
    outline: none;
    border-color: #007bff;
}

.sidebar-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar-search button:hover {
    background: #0056b3;
}

/* Categories Widget */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.categories-list a:hover,
.categories-list a.active {
    background: #007bff;
    color: white;
}

.categories-list .category-count {
    background: white;
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.categories-list a:hover .category-count,
.categories-list a.active .category-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Popular Posts Widget */
.popular-post {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.popular-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

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

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

.popular-post-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.popular-post-content h4 a {
    color: #1a1a1a;
    text-decoration: none;
}

.popular-post-content h4 a:hover {
    color: #007bff;
}

.popular-post-meta {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Single Post Layout */
.single-post-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 15px;
}

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

.post-categories {
    margin-bottom: 15px;
}

.post-category-badge {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 8px;
    transition: background 0.3s;
}

.post-category-badge:hover {
    background: #0056b3;
    color: white;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 0.95rem;
    color: #666;
    flex-wrap: wrap;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-featured-image {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 40px 0 20px;
    color: #1a1a1a;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #1a1a1a;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

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

.post-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #555;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

/* Social Share Buttons */
.social-share {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.social-share h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.3s;
}

.share-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.share-btn-facebook {
    background: #3b5998;
}

.share-btn-twitter {
    background: #1da1f2;
}

.share-btn-linkedin {
    background: #0077b5;
}

.share-btn-pinterest {
    background: #bd081c;
}

.share-btn-email {
    background: #6c757d;
}

/* Author Box */
.author-box {
    margin: 50px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 25px;
}

.author-avatar {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.author-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Related Posts */
.related-posts {
    margin: 50px 0;
}

.related-posts h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #007bff;
    color: #1a1a1a;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
}

.pagination-btn {
    padding: 10px 18px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tags */
.post-tags {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

.post-tags h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.tag:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2rem;
    }

    .featured-post-image {
        height: 250px;
    }

    .featured-post h2 {
        font-size: 1.5rem;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .author-avatar {
        margin: 0 auto;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* AdSense Ad Containers */
.adsense-container {
    margin: 30px 0;
    padding: 20px 0;
    text-align: center;
    position: relative;
}

.adsense-container::before {
    content: 'Advertisement';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.adsense-container ins {
    display: block;
    margin: 0 auto;
}

/* In-Feed Ad Styling */
.posts-grid .blog-card ins.adsbygoogle {
    min-height: 250px;
}

/* Sidebar Ad Styling */
.blog-sidebar .sidebar-widget ins.adsbygoogle {
    min-height: 250px;
}

/* Print Styles */
@media print {
    .blog-sidebar,
    .social-share,
    .related-posts,
    .breadcrumb-nav,
    .adsense-container {
        display: none;
    }

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