/**
 * Content Layouts - Main content area, blog archive, single post layouts
 */

/* Main Content Wrapper */
.hvn-theme-site-main {
    padding: var(--hvn-theme-space-2xl, 2rem) 0;
}

/* Row layout for content and sidebar - IMPORTANT for sticky sidebar */
.hvn-theme-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--hvn-theme-space-md, 1rem);
    align-items: start; /* This is CRITICAL for sticky sidebar */
}
/* Content Area - 8 columns */
.hvn-theme-content-area {
    grid-column: span 8;
}

/* Sidebar Area - 4 columns */
.hvn-theme-sidebar-area {
    grid-column: span 4;
    position: relative;
}

/* Full Width Layout */
.hvn-theme-full-width .hvn-theme-content-area {
    grid-column: span 12;
}

/* No Sidebar Layout */
.hvn-theme-no-sidebar .hvn-theme-content-area {
    grid-column: span 12;
    max-width: 800px;
    margin: 0 auto;
}

/* Left Sidebar Layout */
.hvn-theme-sidebar-left .hvn-theme-content-area {
    grid-column: span 8;
    order: 2;
}

.hvn-theme-sidebar-left .hvn-theme-sidebar-area {
    grid-column: span 4;
    order: 1;
}

/* Posts Grid */
.hvn-theme-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--hvn-theme-space-xl);
    margin-bottom: var(--hvn-theme-space-xl);
}

/* Single Column Posts */
.hvn-theme-posts-list .hvn-theme-post-card {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .hvn-theme-posts-list .hvn-theme-post-card {
        flex-direction: row;
    }
    
    .hvn-theme-posts-list .hvn-theme-post-card-image {
        flex: 0 0 280px;
    }
    
    .hvn-theme-posts-list .hvn-theme-post-card-content {
        flex: 1;
    }
}

/* Page Header */
.hvn-theme-page-header {
    margin-bottom: var(--hvn-theme-space-2xl);
    text-align: center;
}

.hvn-theme-page-title {
    font-size: var(--hvn-theme-font-size-4xl);
    margin-bottom: var(--hvn-theme-space-md);
    position: relative;
    display: inline-block;
}

.hvn-theme-page-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--hvn-theme-brand-primary);
    border-radius: var(--hvn-theme-border-radius-full);
}

/* Archive Description */
.hvn-theme-archive-description {
    color: var(--hvn-theme-text-secondary);
    max-width: 700px;
    margin: var(--hvn-theme-space-md) auto 0;
}

/* Breadcrumbs */
.hvn-theme-breadcrumbs {
    font-size: var(--hvn-theme-font-size-sm);
    margin-bottom: var(--hvn-theme-space-lg);
    padding-bottom: var(--hvn-theme-space-md);
    border-bottom: 1px solid var(--hvn-theme-border-color);
}

.hvn-theme-breadcrumbs a {
    color: var(--hvn-theme-text-muted);
    text-decoration: none;
}

.hvn-theme-breadcrumbs a:hover,
.hvn-theme-breadcrumbs a:focus {
    color: var(--hvn-theme-brand-primary);
}

.hvn-theme-breadcrumbs .separator {
    margin: 0 var(--hvn-theme-space-xs);
    color: var(--hvn-theme-text-muted);
}

.hvn-theme-breadcrumbs .current {
    color: var(--hvn-theme-brand-primary);
    font-weight: var(--hvn-theme-font-weight-medium);
}

/* Single Post Content */
.hvn-theme-single-content {
    background: var(--hvn-theme-color-white);
    border-radius: var(--hvn-theme-border-radius-lg);
    padding: var(--hvn-theme-space-2xl);
    box-shadow: var(--hvn-theme-shadow-card);
}

.hvn-theme-single-content .entry-header {
    margin-bottom: var(--hvn-theme-space-xl);
}

.hvn-theme-single-content .entry-title {
    font-size: var(--hvn-theme-font-size-4xl);
    margin-bottom: var(--hvn-theme-space-md);
}

.hvn-theme-single-content .entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hvn-theme-space-md);
    color: var(--hvn-theme-text-muted);
    font-size: var(--hvn-theme-font-size-sm);
    margin-bottom: var(--hvn-theme-space-md);
}

.hvn-theme-single-content .entry-meta a {
    color: var(--hvn-theme-text-muted);
    text-decoration: none;
}

.hvn-theme-single-content .entry-meta a:hover,
.hvn-theme-single-content .entry-meta a:focus {
    color: var(--hvn-theme-brand-primary);
}

/* Featured Image in Single */
.hvn-theme-single-featured-image {
    margin-bottom: var(--hvn-theme-space-xl);
    border-radius: var(--hvn-theme-border-radius-lg);
    overflow: hidden;
}

.hvn-theme-single-featured-image img {
    width: 100%;
    height: auto;
}

/* Post Content */
.hvn-theme-post-content {
    line-height: 1.8;
}

.hvn-theme-post-content p {
    margin-bottom: var(--hvn-theme-space-lg);
}

.hvn-theme-post-content h2,
.hvn-theme-post-content h3,
.hvn-theme-post-content h4 {
    margin-top: var(--hvn-theme-space-2xl);
    margin-bottom: var(--hvn-theme-space-md);
}

/* Post Tags */
.hvn-theme-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hvn-theme-space-sm);
    margin-top: var(--hvn-theme-space-xl);
    padding-top: var(--hvn-theme-space-lg);
    border-top: 1px solid var(--hvn-theme-border-color);
}

.hvn-theme-post-tags a {
    display: inline-block;
    background: var(--hvn-theme-color-gray-100);
    color: var(--hvn-theme-text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--hvn-theme-border-radius-full);
    font-size: var(--hvn-theme-font-size-sm);
    text-decoration: none;
    transition: all var(--hvn-theme-transition-fast);
}

.hvn-theme-post-tags a:hover,
.hvn-theme-post-tags a:focus {
    background: var(--hvn-theme-brand-primary);
    color: var(--hvn-theme-color-white);
}

/* Author Box */
.hvn-theme-author-box {
    display: flex;
    gap: var(--hvn-theme-space-lg);
    background: var(--hvn-theme-color-gray-100);
    padding: var(--hvn-theme-space-lg);
    border-radius: var(--hvn-theme-border-radius-lg);
    margin-top: var(--hvn-theme-space-xl);
}

.hvn-theme-author-avatar {
    flex-shrink: 0;
}

.hvn-theme-author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: var(--hvn-theme-border-radius-full);
}

.hvn-theme-author-info h3 {
    margin-bottom: var(--hvn-theme-space-xs);
    font-size: var(--hvn-theme-font-size-lg);
}

.hvn-theme-author-bio {
    color: var(--hvn-theme-text-secondary);
    font-size: var(--hvn-theme-font-size-sm);
    line-height: 1.6;
}

/* Responsive Content */
@media (max-width: 991px) {
    .hvn-theme-content-area,
    .hvn-theme-sidebar-area,
    .hvn-theme-sidebar-left .hvn-theme-content-area,
    .hvn-theme-sidebar-left .hvn-theme-sidebar-area {
        grid-column: span 12;
    }
    
    .hvn-theme-sidebar-left .hvn-theme-content-area {
        order: 1;
    }
    
    .hvn-theme-sidebar-left .hvn-theme-sidebar-area {
        order: 2;
    }
    
    .hvn-theme-sidebar-area {
        margin-top: var(--hvn-theme-space-2xl);
    }
    
    .hvn-theme-single-content {
        padding: var(--hvn-theme-space-lg);
    }
    
    .hvn-theme-single-content .entry-title {
        font-size: var(--hvn-theme-font-size-3xl);
    }
    
    .hvn-theme-author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .hvn-theme-author-avatar img {
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .hvn-theme-posts-grid {
        grid-template-columns: 1fr;
    }
}