/* ========================================
   BLOG LAYOUT CSS
======================================== */

/* Blog Homepage */
.blog-homepage {
    padding: 3rem 0;
}

/* Featured Post Section */
.featured-post-section {
    margin-bottom: 4rem;
    padding: 3rem 0;
}

.featured-post-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: var(--color-light-gray);
    padding: 2rem;
    border-radius: 8px;
}

.featured-post-image {
    display: flex;
    align-items: center;
}

.featured-post-image img {
    border-radius: 8px;
    width: 100%;
    height: auto;
}

.featured-badge {
    display: inline-block;
    background: var(--color-orange);
    color: var(--color-white);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.featured-post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-black);
    line-height: 1.3;
}

.featured-post-title a {
    color: var(--color-black);
    text-decoration: none;
    transition: color 0.3s;
}

.featured-post-title a:hover {
    color: var(--color-teal);
}

.featured-post-meta {
    color: var(--color-medium-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.featured-post-excerpt {
    color: var(--color-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* Category Tabs */
.category-tabs-section {
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
}

.category-tabs,
.filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-link,
.filter-tab {
    padding: 0.75rem 1.5rem;
    background: var(--color-light-gray);
    color: var(--color-dark);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tab-link:hover,
.filter-tab:hover {
    background: var(--color-white);
    border-color: var(--color-teal);
}

.tab-link.active,
.filter-tab.active {
    background: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}

/* Blog Grid Section */
.blog-grid-section {
    margin-bottom: 3rem;
}

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

.blog-card {
    background: var(--color-white);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.blog-card-image-wrapper {
    height: 220px;
    overflow: hidden;
}

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

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

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--color-black);
}

.blog-card-title a {
    color: var(--color-black);
    text-decoration: none;
    transition: color 0.3s;
}

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

.blog-card-meta {
    color: var(--color-medium-gray);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.blog-card-excerpt {
    color: var(--color-dark);
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.blog-card-link {
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
    align-self: flex-start;
}

.blog-card-link:hover {
    color: var(--color-orange);
}

/* View All Button */
.view-all-wrapper {
    text-align: center;
}

/* Blog Listing Page */
.blog-listing-page {
    padding: 2rem 0;
}

.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.archive-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-black);
}

.archive-description {
    color: var(--color-medium-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.category-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

/* Single Post Page */
.single-post-page {
    padding: 2rem 0;
    background: var(--color-light-gray);
    min-height: calc(100vh - 400px);
}

.post-wrapper {
    background: var(--color-white);
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

/* Breadcrumb */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--color-medium-gray);
}

.breadcrumb-nav a {
    color: var(--color-teal);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-nav a:hover {
    color: var(--color-orange);
}

.breadcrumb-nav .separator {
    opacity: 0.5;
}

/* Post Layout - Two Column */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    position: relative;
    z-index: 1;
    align-items: start;
    margin-bottom: 100px;
}

.post-main-content {
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* Post Header */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-black);
}

.post-meta {
    color: var(--color-medium-gray);
    font-size: 0.95rem;
}

/* Featured Image */
.post-featured-image {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

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

/* Post Content */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-dark);
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--color-black);
    scroll-margin-top: 100px;
}

.post-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--color-black);
}

.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

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

.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--color-light-gray);
    border-left: 4px solid var(--color-teal);
    font-style: italic;
    color: var(--color-dark);
}

.post-content a {
    color: var(--color-teal);
    text-decoration: none;
    transition: color 0.3s;
}

.post-content a:hover {
    color: var(--color-orange);
    text-decoration: underline;
}

/* Post Tags */
.post-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag-label {
    font-weight: 600;
    color: var(--color-black);
}

.post-tags a {
    background: var(--color-light-gray);
    color: var(--color-dark);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
}

.post-tags a:hover {
    background: var(--color-teal);
    color: var(--color-white);
}

/* Post Navigation */
.post-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e5e5;
    width: 100%;
    clear: both;
    position: relative;
    z-index: 2;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-prev,
.nav-next {
    display: block;
    padding: 1.5rem;
    background: var(--color-light-gray);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-prev:hover,
.nav-next:hover {
    background: #e8e8e8;
}

.nav-label {
    display: block;
    color: var(--color-medium-gray);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.nav-title {
    display: block;
    color: var(--color-black);
    font-weight: 600;
    font-size: 1rem;
}

/* Sidebar */
.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Table of Contents Widget */
.table-of-contents-widget {
    background: var(--color-light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    position: static !important;
    top: auto !important;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-black);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-teal);
}

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

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-link {
    color: var(--color-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    display: block;
    padding: 0.25rem 0;
}

.toc-link:hover {
    color: var(--color-teal);
    padding-left: 0.5rem;
}

/* Related Posts Widget */
.related-posts-widget {
    background: var(--color-light-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-black);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-teal);
}

.related-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-post-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--color-white);
    border-radius: 6px;
    transition: all 0.3s;
}

.related-post-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

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

.related-content h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.related-content h4 a {
    color: var(--color-black);
    text-decoration: none;
    transition: color 0.3s;
}

.related-content h4 a:hover {
    color: var(--color-teal);
}

.related-date {
    display: block;
    font-size: 0.8rem;
    color: var(--color-medium-gray);
}

/* No Posts Found */
.no-posts {
    text-align: center;
    padding: 3rem;
}

.no-posts h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.no-posts p {
    color: var(--color-medium-gray);
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
}

.pagination .page-numbers {
    padding: 0.75rem 1rem;
    background: var(--color-white);
    border: 1px solid #e5e5e5;
    color: var(--color-dark);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}

/* Responsive */
@media (max-width: 1024px) {
    .featured-post-wrapper {
        grid-template-columns: 1fr;
    }
    
    .post-layout {
        grid-template-columns: 1fr;
    }
    
    .table-of-contents-widget {
        position: static;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .featured-post-title {
        font-size: 1.5rem;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
    
    .nav-links {
        grid-template-columns: 1fr;
    }
    
    .post-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .category-tabs,
    .filter-tabs {
        gap: 0.5rem;
    }
    
    .tab-link,
    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   COMMENTS FORM STYLING
======================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e5e5;
    width: 100%;
    clear: both;
    position: relative;
    z-index: 2;
}

.comment-form {
    display: grid;
    gap: 1.5rem;
}

.comment-form-comment {
    grid-column: 1 / -1;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 1rem;
    resize: vertical;
    min-height: 150px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    padding: 0.75rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 1rem;
    width: 100%;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(4, 139, 154, 0.1);
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
    display: flex;
    flex-direction: column;
}

.comment-form label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-black);
}

.comment-form .required {
    color: var(--color-orange);
}

.form-submit {
    display: flex;
    gap: 1rem;
}

.form-submit input {
    background: var(--color-dark);
    color: var(--color-white);
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.form-submit input:hover {
    background: var(--color-black);
}

/* Comments List */
.commentlist {
    list-style: none;
    padding: 0;
    margin-bottom: 3rem;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-light-gray);
    border-radius: 4px;
}

.comment .children {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
    margin-left: 2rem;
}

.comment .children .comment {
    background: var(--color-white);
    border-left: 3px solid var(--color-teal);
}

.comment-author {
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--color-medium-gray);
    margin-bottom: 1rem;
}

.comment-content {
    color: var(--color-dark);
    line-height: 1.6;
}

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

.reply {
    margin-top: 1rem;
}

.reply a {
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.reply a:hover {
    color: var(--color-orange);
}
