/* Custom CSS for Portfolio Blog */

/* Base Styles */
:root {
    --primary-50: #eff6ff;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-900: #1e3a8a;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom focus styles */
*:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Typography enhancements */
.prose {
    color: #374151;
    max-width: none;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #111827;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h1 { font-size: 2.25rem; line-height: 2.5rem; }
.prose h2 { font-size: 1.875rem; line-height: 2.25rem; }
.prose h3 { font-size: 1.5rem; line-height: 2rem; }
.prose h4 { font-size: 1.25rem; line-height: 1.75rem; }

.prose p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.prose a {
    color: var(--primary-600);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: var(--primary-700);
}

.prose ul, .prose ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #dc2626;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

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

.prose img {
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose th,
.prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

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

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

/* Navigation enhancements */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--primary-600);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Button animations */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Loading states */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .prose h1 { font-size: 1.875rem; line-height: 2.25rem; }
    .prose h2 { font-size: 1.5rem; line-height: 2rem; }
    .prose h3 { font-size: 1.25rem; line-height: 1.75rem; }
    
    .prose pre {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        border-radius: 0;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .prose {
        color: #e5e7eb;
    }
    
    .prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
        color: #f9fafb;
    }
    
    .prose blockquote {
        border-left-color: #4b5563;
        background-color: #1f2937;
        color: #d1d5db;
    }
    
    .prose code {
        background-color: #374151;
        color: #f87171;
    }
    
    .prose th {
        background-color: #374151;
    }
    
    .prose th,
    .prose td {
        border-color: #4b5563;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .prose {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .prose h1 { font-size: 18pt; }
    .prose h2 { font-size: 16pt; }
    .prose h3 { font-size: 14pt; }
    
    .prose a {
        color: inherit;
        text-decoration: none;
    }
    
    .prose a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    .prose pre {
        background: #f8f8f8;
        color: #333;
        border: 1px solid #ddd;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-600);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    transition: top 0.3s;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link::after {
        background-color: currentColor;
    }
    
    .prose a {
        text-decoration: underline;
        text-decoration-thickness: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}