/* Navigation and View Transitions Styles */

/* View Transitions API Support */
@supports (view-transition-name: auto) {
    @view-transition {
        navigation: auto;
    }
}

/* Smooth page transitions for modern browsers */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
}

::view-transition-old(root) {
    animation-name: slide-out-to-left;
}

::view-transition-new(root) {
    animation-name: slide-in-from-right;
}

@keyframes slide-out-to-left {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slide-in-from-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

/* Smooth page transitions using standard CSS animations */
.page-transition {
    animation: fade-in 0.3s ease-in-out;
}

/* Smooth navigation link transitions */
.nav-transition {
    transition:
        opacity 0.3s ease-out,
        transform 0.3s ease-in-out;
}

.nav-transition:hover {
    transform: translateY(-2px);
}

/* Enhanced mobile menu animations */
.peer:checked ~ div {
    animation: slide-down 0.3s ease-out;
}

/* Smooth link hover effects */
a {
    transition: color 0.15s ease-in-out;
}

/* Mobile menu toggle accessibility improvements */
.mobile-menu-toggle {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.mobile-menu-toggle:focus + label {
    outline: 2px solid theme("colors.green.500");
    outline-offset: 2px;
}

/* Enhanced focus styles for better keyboard navigation */
.nav-link:focus {
    outline: 2px solid theme("colors.green.500");
    outline-offset: 2px;
    border-radius: 4px;
}

/* Improved touch target sizes for mobile accessibility */
@media (max-width: 768px) {
    .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
    }

    /* Ensure search form elements are touch-friendly */
    input[type="text"],
    input[type="search"],
    button[type="submit"] {
        min-height: 44px;
    }
}

/* Enhanced card hover states for better visual feedback */
.article-card {
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Current page indicator styles */
[aria-current="page"] {
    background-color: theme("colors.green.600");
    color: white;
    font-weight: 600;
}
