/* Custom CSS for Portfolio Website */

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

/* Active navigation link styling */
.nav-link.active {
    color: #2563eb;
    font-weight: 600;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 4px;
}

/* Ensure consistent font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

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

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Stagger animation for article cards */
#articles-container > article {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

#articles-container > article:nth-child(1) { animation-delay: 0.1s; }
#articles-container > article:nth-child(2) { animation-delay: 0.2s; }
#articles-container > article:nth-child(3) { animation-delay: 0.3s; }
#articles-container > article:nth-child(4) { animation-delay: 0.4s; }
#articles-container > article:nth-child(5) { animation-delay: 0.5s; }
#articles-container > article:nth-child(6) { animation-delay: 0.6s; }

/* Smooth transitions for interactive elements */
a,
button {
    transition: all 0.3s ease;
}

/* Link styles */
a {
    text-decoration: none;
}

/* Print styles */
@media print {
    nav,
    footer {
        display: none;
    }

    body {
        background: white;
    }

    .shadow-md,
    .shadow-xl {
        box-shadow: none !important;
        border: 1px solid #e5e7eb;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: white;
    }

    .shadow-md,
    .shadow-xl {
        border: 2px solid #000;
    }
}

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

/* Mobile menu transition */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Loading state for images */
img[loading="lazy"] {
    background: #f3f4f6;
}
