/* Custom CSS for KingsWill Website */
/* Cross-browser compatible styles */

/* CSS Variables for theming */
:root {
    --kw-bg: #F1EAD7;
    --kw-text: #464b58;
    --kw-text-muted: rgba(70, 75, 88, 0.7);
    --kw-border: rgba(70, 75, 88, 0.2);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
    -webkit-scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
    background: #464b58;
    border-radius: 5px;
    opacity: 0.5;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3f4a;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #464b58 #F1EAD7;
}

/* Selection color */
::selection {
    background: rgba(70, 75, 88, 0.2);
    color: #464b58;
}

/* Image rendering optimization */
img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    max-width: 100%;
    height: auto;
}

/* Line clamp utility for cross-browser support */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animation classes with fallbacks */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback for browsers without IntersectionObserver */
@supports not (animation-timeline: scroll()) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 400px;
    opacity: 1;
}

/* Button hover effects with fallbacks */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Ensure touch targets are large enough on mobile */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    nav a, nav button {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Reduced motion preferences */
@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;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-400 {
        color: #000000;
    }
    
    .border-white\/10 {
        border-color: rgba(0, 0, 0, 0.5);
    }
}

/* Print styles */
@media print {
    nav, footer, .scroll-indicator {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
}

/* Particle container - hidden in light theme */
#particles-container {
    display: none;
}

/* Ensure proper z-index stacking */
nav {
    z-index: 9999;
}

/* Loading state for images */
img {
    background: linear-gradient(110deg, #F1EAD7 8%, #e8e2d0 18%, #F1EAD7 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

img[src] {
    background: none;
    animation: none;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #464b58;
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}