/* Minimal custom CSS - most styling via Tailwind */

/* Font display optimization */
@font-face {
    font-family: 'Poppins';
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    font-display: swap;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for accessibility - enhanced contrast */
*:focus-visible {
    outline: 3px solid #29B9D8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Enhanced focus for interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #29B9D8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Accordion button focus */
[data-accordion-button]:focus-visible {
    outline: 3px solid #29B9D8;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Ensure sufficient color contrast on gradient backgrounds */
.bg-gradient-to-br button,
.bg-gradient-to-br a {
    position: relative;
}

/* High contrast text on light backgrounds */
.text-white {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Improved typography defaults */
body {
    line-height: 1.75;
    font-size: 1rem;
}

@media (min-width: 768px) {
    body {
        font-size: 1.125rem;
    }
}

p {
    line-height: 1.75;
}

/* Max-width on text blocks for optimal readability (~75 characters) */
/* Apply to article bodies and main content paragraphs that don't already have max-width constraints */
article p:not([class*="max-w"]),
.prose p:not([class*="max-w"]),
section p.text-brand-navy:not([class*="max-w"]):not(.text-xl):not(.text-2xl):not(.text-lg) {
    max-width: 65ch;
}

/* Ensure article bodies respect max-width when they don't have explicit width constraints */
article:not([class*="max-w"]),
.prose:not([class*="max-w"]) {
    max-width: 65ch;
}

/* Section dividers */
.section-divider {
    border-top: 1px solid #e5e7eb;
    padding-top: 3rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .section-divider {
        padding-top: 4rem;
        margin-top: 4rem;
    }
}

/* Skip link styles */
.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;
}

.sr-only.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Mobile Menu Animations */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

#mobile-menu:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
}

#mobile-menu.hidden {
    max-height: 0;
    opacity: 0;
}

/* Smooth icon transitions */
#menu-icon,
#close-icon {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#menu-icon.hidden {
    opacity: 0;
    transform: rotate(90deg);
}

#close-icon.hidden {
    opacity: 0;
    transform: rotate(-90deg);
}

#close-icon:not(.hidden) {
    opacity: 1;
    transform: rotate(0deg);
}

/* Enhanced Type Scale - Ensure headers have distinct contrast */
h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

h3 {
    font-weight: 700;
    letter-spacing: -0.005em;
}

/* Ensure Three Pillars h3 headers stand out more from body text */
section h3.font-display {
    font-weight: 700;
}

/* Touch Target Accessibility - Ensure all interactive elements are at least 44x44px on mobile */
@media (max-width: 768px) {
    button,
    a[href],
    input[type="submit"],
    input[type="button"],
    input[type="checkbox"],
    input[type="radio"],
    select,
    [role="button"],
    [role="link"],
    [role="tab"],
    [role="menuitem"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Ensure buttons with padding still meet minimum */
    button:not([class*="min-h"]):not([class*="min-w"]),
    a[href]:not([class*="min-h"]):not([class*="min-w"]) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    /* Small text links that shouldn't be 44px - but ensure they're still tappable */
    a.text-sm:not(button):not([class*="min-h"]),
    a.text-xs:not(button):not([class*="min-h"]) {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
    }
    
    /* Icon buttons and small interactive elements */
    button svg,
    a[href] svg {
        min-width: 24px;
        min-height: 24px;
    }
    
    /* Form inputs should be at least 44px */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="password"],
    textarea {
        min-height: 44px;
    }
    
    /* Carousel navigation buttons */
    [data-carousel-prev],
    [data-carousel-next] {
        min-width: 44px;
        min-height: 44px;
    }
}

