/* Custom styles for the blog website */

/* Apply the Inter font to the whole page */
body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* Custom scrollbar for a more subtle, Apple-like feel (WebKit browsers) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* slate-300 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* slate-400 */
}
::-webkit-scrollbar-track {
    background: #f8fafc; /* slate-50 */
}

/* Line clamp utility for truncating text */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Backdrop blur effect for header */
.backdrop-blur-lg {
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

/* Smooth transitions for blog cards */
.blog-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects for navigation links */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #111827;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Mobile menu animations */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

.mobile-menu-exit {
    animation: slideUp 0.3s ease-out;
}

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

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

/* Form focus states */
input:focus, textarea:focus {
    transition: all 0.2s ease;
}

/* Button hover effects */
.btn-hover {
    transition: all 0.2s ease;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #111827;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Success and error message styles */
.success-message {
    background-color: #10b981;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.error-message {
    background-color: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

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

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

/* Category color variations */
.category-tech { color: #059669; }
.category-design { color: #7c3aed; }
.category-productivity { color: #dc2626; }
.category-javascript { color: #d97706; }
.category-backend { color: #7c2d12; }
.category-devops { color: #4338ca; }

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .blog-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid #374151;
    }

    .nav-link {
        font-weight: 600;
    }
}

/* 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;
    }

    body {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional - can be implemented later) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Responsive image container */
.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Text selection styling */
::selection {
    background-color: #3b82f6;
    color: white;
}

::-moz-selection {
    background-color: #3b82f6;
    color: white;
}

/* Focus visible for better accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 6px;
}

/* Loading state for images */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}