/* GroundWork - Custom Styles */

/* Base Styles */
html {
    scroll-behavior: smooth;
}

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

/* Skip Link for Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus,
.focus\:not-sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Navigation shadow on scroll - applied via JS */
.navbar-scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* CTA Button Focus States */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #1E3A5F;
    outline-offset: 2px;
}

/* Custom focus states for accessibility */
a:focus-visible {
    outline: 2px solid #1E3A5F;
    outline-offset: 2px;
}

/* Ensure proper line height for readability */
p {
    line-height: 1.6;
}

/* Mobile touch targets - ensure minimum 44px tap target */
@media (max-width: 640px) {
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }

    /* Ensure buttons are easily tappable on mobile */
    a[href^="#"],
    a[href^="mailto"],
    a[href^="https"] {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .reveal.active {
        transform: none;
    }

    /* Disable bounce animation */
    .animate-bounce {
        animation: none;
    }

    /* Disable all transitions for reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Stats counter animation (optional enhancement) */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.6s ease-out forwards;
}

/* Testimonial card hover effects */
.testimonial-card {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

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

/* Smooth section transitions */
section {
    position: relative;
}

/* Hero section gradient overlay for better text readability */
.hero-gradient {
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%);
}

/* Card hover states */
.card-hover {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* CTA button pulse animation (subtle) */
@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(232, 115, 95, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(232, 115, 95, 0);
    }
}

.cta-pulse {
    animation: subtle-pulse 3s infinite;
}

/* Footer link underline animation */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #E8735F;
    transition: width 0.3s ease-out;
}

footer a:hover::after {
    width: 100%;
}

/* Gradient text effect for headings (optional) */
.gradient-text {
    background: linear-gradient(135deg, #1E3A5F 0%, #E8735F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image placeholder styling */
.image-placeholder {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.1) 0%, rgba(30, 58, 95, 0.05) 100%);
    border: 2px dashed rgba(30, 58, 95, 0.3);
}

/* Dark section text improvements */
.bg-navy h2,
.bg-navy h3 {
    color: #ffffff;
}

/* Ensure good contrast on dark backgrounds */
.bg-navy .text-text-light {
    color: #9ca3af;
}

/* Safe area padding for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(3rem, env(safe-area-inset-bottom));
    }
}

/* Print styles */
@media print {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    header,
    footer,
    .cta-pulse {
        display: none;
    }

    section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
