/* Custom styles that complement Tailwind */

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

/* Image loading optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Focus styles for accessibility */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 2px solid #6fa470;
    outline-offset: 2px;
}

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

/* Print styles */
@media print {
    nav, #mobile-menu, button {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .fade-in-up {
        opacity: 1 !important;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .bg-forest-700,
    .bg-forest-600 {
        background-color: ButtonText !important;
    }
}

/* Ensure text is readable on all backgrounds */
.text-cream-50 {
    color: #fdfcf8;
}

.text-cream-100 {
    color: #faf8f0;
}

/* Gradient backgrounds for visual interest */
.gradient-subtle {
    background: linear-gradient(135deg, #f2f7f4 0%, #faf8f0 100%);
}

/* Shadow utilities */
.shadow-soft {
    box-shadow: 0 4px 20px rgba(45, 68, 44, 0.08);
}

.shadow-medium {
    box-shadow: 0 8px 30px rgba(45, 68, 44, 0.12);
}

/* Custom hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(45, 68, 44, 0.15);
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid #3d6741;
    outline-offset: 2px;
}

/* Ensure proper spacing in asymmetric grid */
.asymmetric-grid > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

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

/* Form validation styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #3d6741;
}

/* Loading state for buttons */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Ensure proper contrast for all text */
.text-forest-600 {
    color: #3d6741;
}

.text-forest-700 {
    color: #325335;
}

.text-forest-800 {
    color: #29442c;
}

.text-forest-900 {
    color: #223825;
}

/* Background colors */
.bg-forest-50 {
    background-color: #f2f7f4;
}

.bg-forest-100 {
    background-color: #e3efe7;
}

.bg-forest-600 {
    background-color: #3d6741;
}

.bg-forest-700 {
    background-color: #325335;
}

.bg-forest-950 {
    background-color: #111c12;
}

/* Border colors */
.border-forest-200\/30 {
    border-color: rgba(197, 223, 201, 0.3);
}

.border-forest-200 {
    border-color: #c5dfc9;
}

.border-forest-500 {
    border-color: #4f8351;
}

/* Text shadows for better readability on images */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure proper line heights for serif fonts */
.font-serif {
    line-height: 1.2;
}

/* Responsive typography adjustments */
@media (max-width: 640px) {
    .font-serif {
        line-height: 1.3;
    }
}

/* Accessibility: skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3d6741;
    color: #fdfcf8;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Ensure proper image aspect ratios */
img {
    object-fit: cover;
}

/* Smooth scroll offset for fixed navigation */
section[id] {
    scroll-margin-top: 80px;
}
