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

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

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

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

/* Blog Detail Page Styles */
.blog-content {
    line-height: 1.8;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.blog-content h1 {
    font-size: 2.25rem;
    margin-top: 3rem;
}

.blog-content h2 {
    font-size: 1.875rem;
    margin-top: 2.5rem;
}

.blog-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
}

.blog-content p {
    margin-bottom: 1.5rem;
    color: #374151;
}

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

.blog-content li {
    margin-bottom: 0.75rem;
    color: #374151;
}

.blog-content blockquote {
    border-left: 4px solid #3b82f6;
    background-color: #f8fafc;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: #475569;
}

.blog-content pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 2rem;
    border-radius: 0.75rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.blog-content code {
    background-color: #f1f5f9;
    color: #e11d48;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

.blog-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.blog-content img {
    margin: 2rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

/* Enhanced prose styling */
.prose-lg {
    font-size: 1.125rem;
    line-height: 1.8;
}

.prose-lg p {
    margin-bottom: 1.75rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .blog-content {
        padding: 1rem 0.5rem;
    }
    
    .blog-content h1 {
        font-size: 1.875rem;
    }
    
    .blog-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-content pre {
        padding: 1rem;
        font-size: 0.8125rem;
    }
}

/* Blog Editor Enhanced Styles */
.editor-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Form Input Enhancements */
.editor-container input[type="text"],
.editor-container input[type="url"],
.editor-container textarea {
    transition: all 0.2s ease-in-out;
    font-size: 1.1rem;
    line-height: 1.6;
}

.editor-container input[type="text"]:focus,
.editor-container input[type="url"]:focus,
.editor-container textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.15), 0 4px 6px -2px rgba(59, 130, 246, 0.05);
}

/* Content textarea specific styling */
#content {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 1rem;
    line-height: 1.7;
    tab-size: 4;
    background-color: #fafafa;
    border: 2px solid #e5e7eb;
}

#content:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
}

/* Preview enhancements */
.prose code {
    background-color: #f1f5f9;
    color: #e11d48;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    border-radius: 0.75rem;
    padding: 2rem;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.prose pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Code block quick insert buttons */
.code-insert-grid button {
    transition: all 0.15s ease-in-out;
}

.code-insert-grid button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Success/Error message animations */
.message-container {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .editor-container {
        padding: 1rem;
    }
    
    .editor-container input[type="text"],
    .editor-container input[type="url"] {
        font-size: 1rem;
        padding: 1rem;
    }
    
    #content {
        font-size: 0.9rem;
        min-height: 400px;
    }
    
    .code-insert-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Loading states */
.loading-overlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
}

/* Image preview styling */
.image-preview {
    border: 2px dashed #d1d5db;
    transition: border-color 0.2s ease-in-out;
}

.image-preview:hover {
    border-color: #3b82f6;
}

/* Tag preview styling */
.tag-preview {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}