/* Blog-specific styles that work with site-wide header/footer */

/* Ensure blog content doesn't interfere with header/footer */
.blog-page {
    min-height: calc(100vh - 120px); /* Account for header/footer */
}

/* Blog content styling */
.blog-content h1 { 
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin: 2rem 0 1rem 0;
    line-height: 1.2;
}

.blog-content h2 { 
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem 0;
}

.blog-content h3 { 
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 1.25rem 0 0.5rem 0;
}

.blog-content p { 
    color: #4b5563;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.blog-content ul, .blog-content ol { 
    color: #4b5563;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.blog-content ul { 
    list-style-type: disc;
}

.blog-content ol { 
    list-style-type: decimal;
}

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

.blog-content a { 
    color: #3b82f6;
    text-decoration: underline;
}

.blog-content a:hover { 
    color: #1d4ed8;
}

.blog-content strong { 
    font-weight: 600;
    color: #1f2937;
}

.blog-content em { 
    font-style: italic;
}

.blog-content blockquote { 
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1rem 0;
}

.blog-content code { 
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: monospace;
}

.blog-content pre { 
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
    display: block;
}

/* Table of contents */
.toc-floating {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-link {
    transition: all 0.2s ease;
}

.toc-link:hover {
    color: #3b82f6;
    background-color: #f8fafc;
}

.toc-link.active {
    color: #3b82f6;
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.1);
}

.toc-link.active i {
    color: #3b82f6 !important;
}

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #10b981);
    z-index: 9999;
    transition: width 0.2s ease;
}

/* Sidebar cards */
.sidebar-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ensure consistent container spacing */
.blog-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .blog-container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .blog-container {
        padding: 0 2rem;
    }
}

/* Aspect ratio utilities for images */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-w-16 > img {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    object-fit: cover;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
