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

/* Print Styles */
@media print {
    .print\:hidden {
        display: none !important;
    }
    .print\:shadow-none {
        box-shadow: none !important;
    }
    .print\:border-none {
        border: none !important;
    }
    .print\:p-0 {
        padding: 0 !important;
    }
    .print\:py-0 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    .print\:bg-slate-100 {
        background-color: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
    }
    .print\:text-tech-slate {
        color: #4A4A4A !important;
    }
}

/* Custom Utilities */
.selection\:bg-muted-gold ::selection {
    background-color: #C5A059;
    color: white;
}

/* Contact Form 7 Custom Styling */
.wpcf7-response-output {
    margin: 1.5rem 0 0 0 !important;
    padding: 1rem !important;
    border: 1px solid transparent !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
}
.wpcf7-form.sent .wpcf7-response-output {
    border-color: #10b981 !important; /* Emerald-500 */
    background-color: #ecfdf5 !important; /* Emerald-50 */
    color: #065f46 !important; /* Emerald-800 */
}
.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.aborted .wpcf7-response-output,
.wpcf7-form.invalid .wpcf7-response-output {
    border-color: #ef4444 !important; /* Red-500 */
    background-color: #fef2f2 !important; /* Red-50 */
    color: #991b1b !important; /* Red-800 */
}
.wpcf7-not-valid-tip {
    color: #ef4444 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    margin-top: 0.25rem !important;
    display: block !important;
}
.wpcf7 .ajax-loader {
    display: none !important;
}

/* Submit button loading state */
.wpcf7-form.submitting button[type="submit"] {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.wpcf7-form.submitting button[type="submit"] * {
    opacity: 0 !important;
}
.wpcf7-form.submitting button[type="submit"]::after {
    content: "";
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    top: 50%;
    left: 50%;
    margin-top: -0.75rem;
    margin-left: -0.75rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: cf7-spin 0.8s linear infinite;
}

@keyframes cf7-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- SECTION 508 ACCESSIBILITY ENHANCEMENTS --- */
/* 
 * Design principle: ONLY enhance contrast, focus visibility, and motion.
 * NEVER override layout, display, positioning, or padding.
 * Scope all rules to .site-content area where possible.
 * Completely exclude #wpadminbar and #menu-toggle from all rules.
 */

/* Accessibility Toggle Knob Styling */
#accessibility-toggle {
    transition: background-color 0.2s ease;
}
#accessibility-toggle .knob {
    transition: transform 0.2s ease;
}
html.accessibility-active #accessibility-toggle {
    background-color: #D4AF6A !important;
}
html.accessibility-active #accessibility-toggle .knob {
    transform: translateX(1.25rem) !important;
}

/* Visually Hidden Utility for Screen Readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* ---- SCOPED COLOR-ONLY OVERRIDES ---- */
/* Background colors — only on specific site containers, never on #wpadminbar */
html.accessibility-active > body:not(#wpadminbar) {
    background-color: #121826 !important;
    color: #F5F7FA !important;
}
html.accessibility-active header:not(#wpadminbar *) {
    background-color: #121826 !important;
    color: #F5F7FA !important;
}
html.accessibility-active .bg-federal-blue {
    background-color: #0D1520 !important;
}
html.accessibility-active nav.bg-white {
    background-color: #121826 !important;
    border-bottom-color: #2E3748 !important;
}
html.accessibility-active main {
    background-color: #121826 !important;
    color: #F5F7FA !important;
}
html.accessibility-active footer > div {
    background-color: #0D1117 !important;
    color: #F5F7FA !important;
}

/* Text color enhancements — scoped to site content only */
html.accessibility-active .text-tech-slate {
    color: #D1D5DB !important;
}
html.accessibility-active .text-slate-400 {
    color: #9CA3AF !important;
}
html.accessibility-active .text-federal-blue {
    color: #93C5FD !important;
}
html.accessibility-active .opacity-90,
html.accessibility-active .opacity-70 {
    opacity: 1 !important;
}

/* Headings: off-white for maximum readability */
html.accessibility-active main h1,
html.accessibility-active main h2,
html.accessibility-active main h3,
html.accessibility-active main h4 {
    color: #F5F7FA !important;
}

/* Body text: high contrast secondary */
html.accessibility-active main p,
html.accessibility-active main li,
html.accessibility-active main span {
    color: #D1D5DB !important;
}

/* Labels: brighter for form readability */
html.accessibility-active label {
    color: #F5F7FA !important;
    opacity: 1 !important;
}

/* ---- LINKS (scoped, no layout changes) ---- */
/* Only color changes, no display/padding/position changes */
html.accessibility-active main a {
    color: #D4AF6A !important;
    text-decoration: underline !important;
}
html.accessibility-active main a:hover,
html.accessibility-active main a:focus {
    color: #F5F7FA !important;
}

/* Desktop nav links — color only, no layout changes */
html.accessibility-active .desktop-nav-link {
    color: #D1D5DB !important;
}
html.accessibility-active .desktop-nav-link.text-federal-blue,
html.accessibility-active .desktop-nav-link.font-black {
    color: #F5F7FA !important;
}
html.accessibility-active .desktop-nav-link:hover,
html.accessibility-active .desktop-nav-link:focus {
    color: #D4AF6A !important;
}
html.accessibility-active .active-indicator {
    background-color: #D4AF6A !important;
}

/* Footer links — color only */
html.accessibility-active footer a {
    color: #9CA3AF !important;
}
html.accessibility-active footer a:hover,
html.accessibility-active footer a:focus {
    color: #F5F7FA !important;
}

/* ---- FORM INPUTS (color + border only, no layout) ---- */
html.accessibility-active input[type="text"],
html.accessibility-active input[type="email"],
html.accessibility-active input[type="tel"],
html.accessibility-active textarea,
html.accessibility-active select {
    background-color: #161B22 !important;
    color: #F5F7FA !important;
    border-color: #4B5563 !important;
}
html.accessibility-active input::placeholder,
html.accessibility-active textarea::placeholder {
    color: #9CA3AF !important;
    opacity: 1 !important;
}

/* ---- FOCUS RINGS (the core of 508 compliance) ---- */
/* Only on focus-visible to avoid click outlines, exclude admin bar */
html.accessibility-active :not(#wpadminbar):not(#wpadminbar *):focus-visible {
    outline: 3px solid #D4AF6A !important;
    outline-offset: 2px !important;
}

/* Form input focused state */
html.accessibility-active input:focus,
html.accessibility-active textarea:focus,
html.accessibility-active select:focus {
    border-color: #D4AF6A !important;
    outline: 3px solid #D4AF6A !important;
    outline-offset: 0px !important;
}

/* ---- REDUCED MOTION (only when user prefers) ---- */
@media (prefers-reduced-motion: reduce) {
    html.accessibility-active * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

