/* ============================================
   Hospice of South Texas — Dornburg Center
   Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 4px 30px rgba(16, 42, 67, 0.08);
    backdrop-filter: blur(10px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f59e0b;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

#navbar.scrolled .nav-link {
    color: #102a43;
}

#navbar.scrolled .nav-link:hover {
    color: #d97706;
}

#navbar:not(.scrolled) .nav-link {
    color: #d9e2ec;
}

#navbar:not(.scrolled) .nav-link:hover {
    color: #fcd34d;
}

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

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

.menu-line {
    transition: all 0.3s ease;
}

#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#mobile-menu-btn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #f59e0b;
    transition: width 0.3s ease;
}

.mobile-link:hover::after {
    width: 100%;
}

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

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fcd34d);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* ============================================
   Testimonial Cards
   ============================================ */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 80px;
    color: #f0f4f8;
    line-height: 1;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   Contact Form
   ============================================ */
#contact-form input,
#contact-form textarea {
    transition: all 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ============================================
   Scroll Animations (progressive enhancement)
   Only applied when JS is enabled and user prefers motion
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }

    #hero h1 {
        font-size: 2.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .testimonial-card::before {
        font-size: 60px;
        top: 12px;
        right: 16px;
    }
}

@media (max-width: 640px) {
    #hero h1 {
        font-size: 2rem;
    }

    #hero p {
        font-size: 1rem;
    }

    .floating-accent {
        display: none;
    }
}

/* ============================================
   Utility & Accessibility
   ============================================ */
::selection {
    background: rgba(245, 158, 11, 0.3);
    color: #102a43;
}

:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #102a43;
    color: #fcd34d;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    font-weight: 600;
    transition: top 0.3s ease;
}

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