/* Custom styles for S & J Home Inspection Service */

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

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

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

::-webkit-scrollbar-thumb {
    background: #d4b582;
    border-radius: 3px;
}

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

/* Selection color */
::selection {
    background: #fce8df;
    color: #1a1714;
}

/* Base typography refinements */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Font-serif fallback */
font-family: 'Cormorant Garamond', Georgia, serif;

/* Input focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Select arrow customization */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a1714' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 2rem;
}

/* Mobile menu transitions */
#mobile-menu {
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

#mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

/* Navigation transitions */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(26, 23, 20, 0.08);
}

/* Mobile menu button animation */
#menu-btn.active #bar1 {
    transform: rotate(45deg) translate(3px, 3px);
}

#menu-btn.active #bar2 {
    opacity: 0;
}

#menu-btn.active #bar3 {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.25rem;
}

/* Subtle hover line animation for links */
a {
    text-decoration: none;
}

/* Image loading optimization */
img {
    loading: lazy;
}

/* Prevent layout shift on images */
img {
    will-change: transform;
}

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

/* Print styles */
@media print {
    nav,
    #contact-form,
    .hover\\:bg-sand-100:hover {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .bg-terracotta-600 {
        background-color: ButtonText;
    }
    
    .text-terracotta-600 {
        color: ButtonText;
    }
}

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

/* Ensure touch targets are adequate on mobile */
@media (max-width: 768px) {
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Subtle texture overlay for depth */
.bg-sand-50::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a1714' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}
