/* ===================================
   Mercy Family Practice — Custom Styles
   =================================== */

/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background-color: rgba(20, 184, 166, 0.3);
    color: #f1f5f9;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ===================================
   Navbar
   =================================== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(20, 184, 166, 0.1), 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Scroll Reveal Animations
   Progressive enhancement — only apply
   when JS is available and user prefers motion
   =================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Default state is visible — JS adds the revealed class */
    .reveal {
        transform: translateY(24px);
        opacity: 0;
    }
    
    .reveal.revealed {
        transform: translateY(0);
        opacity: 1;
    }
    
    /* Staggered delays for grid items */
    .reveal:nth-child(1) { transition-delay: 0.05s; }
    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.15s; }
    .reveal:nth-child(4) { transition-delay: 0.2s; }
    .reveal:nth-child(5) { transition-delay: 0.25s; }
    .reveal:nth-child(6) { transition-delay: 0.3s; }
}

/* Fallback: content always visible if JS is disabled */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal {
        transform: none;
        opacity: 1;
    }
}

/* ===================================
   Hero
   =================================== */
#hero {
    position: relative;
}

/* ===================================
   Buttons
   =================================== */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* ===================================
   Form inputs
   =================================== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ===================================
   Mobile menu
   =================================== */
.mobile-link {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 1rem;
}

.mobile-link:last-of-type {
    border-bottom: none;
}

/* ===================================
   Utility
   =================================== */
.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;
}
