/* ============================================
   TESCA HOSPICE — 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: #B85C38;
    color: #FDF8F0;
}

/* ============================================
   NAVIGATION
   ============================================ */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 248, 240, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(61, 44, 30, 0.08);
}

/* ============================================
   HERO ANIMATIONS (above the fold — visible by default)
   ============================================ */
#heroEyebrow {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

#heroHeadline {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

#heroSub {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

#heroCTAs {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

#heroTrust {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 1s;
    opacity: 0;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator animation */
.scroll-line {
    animation: scrollDown 1.5s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { top: -12px; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 32px; opacity: 0; }
}

/* ============================================
   MOBILE MENU
   ============================================ */
#mobileMenu {
    pointer-events: none;
}

#mobileMenu.open {
    pointer-events: all;
    transform: translateX(0);
}

.mobile-link {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Hamburger animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 1.25rem;
}

/* ============================================
   SCROLL REVEAL (below the fold only)
   ============================================ */
.service-reveal,
.about-reveal,
.care-reveal,
.community-reveal,
.contact-reveal {
    /* Default: visible — progressive enhancement */
    opacity: 1;
    transform: none;
}

/* When JS adds the class, animate into view */
.service-reveal.revealed,
.about-reveal.revealed,
.care-reveal.revealed,
.community-reveal.revealed,
.contact-reveal.revealed {
    animation: revealUp 0.7s ease forwards;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger children */
.service-card.revealed {
    animation: revealUp 0.6s ease forwards;
}

.service-card:nth-child(1).revealed { animation-delay: 0s; }
.service-card:nth-child(2).revealed { animation-delay: 0.08s; }
.service-card:nth-child(3).revealed { animation-delay: 0.16s; }
.service-card:nth-child(4).revealed { animation-delay: 0.24s; }
.service-card:nth-child(5).revealed { animation-delay: 0.32s; }
.service-card:nth-child(6).revealed { animation-delay: 0.4s; }

/* Respect reduced motion */
@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;
    }
    
    .service-reveal,
    .about-reveal,
    .care-reveal,
    .community-reveal,
    .contact-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.service-card {
    will-change: transform;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ============================================
   FORM STYLES
   ============================================ */
input:focus,
textarea:focus {
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: rgba(61, 44, 30, 0.25);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1023px) {
    .font-serif {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }
}

@media (max-width: 639px) {
    .font-serif {
        font-size: clamp(2rem, 8vw, 2.75rem);
    }
}

/* ============================================
   UTILITY — smooth image loading
   ============================================ */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
