/**
 * MPFoundation Critical Fixes - Text Visibility & Professional Polish
 * Final layer of CSS to ensure perfect text readability across all pages
 */

/* ===================================================================
   SKIP LINK – Hidden by default, visible only on keyboard focus
   =================================================================== */
.skip-link,
a.skip-link,
.skip-to-content,
a.skip-to-content,
.mpf-skip-link,
a.mpf-skip-link,
.skip-link.screen-reader-text,
a.skip-link.screen-reader-text {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    z-index: 99999 !important;
}

.skip-link:focus,
a.skip-link:focus,
.skip-to-content:focus,
a.skip-to-content:focus,
.mpf-skip-link:focus,
a.mpf-skip-link:focus,
.skip-link.screen-reader-text:focus,
a.skip-link.screen-reader-text:focus {
    top: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    white-space: normal !important;
    padding: 12px 20px !important;
    background: #207dad !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
}

/* ===================================================================
   CRITICAL TEXT VISIBILITY FIXES
   =================================================================== */

/* Force high contrast text throughout the site */
body, 
.site-content, 
.entry-content, 
.wp-site-blocks,
.kadence-blocks-row-layout-wrap,
.kb-row-layout-wrap {
    color: #1f2937 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6 !important;
}

/* Ensure all headings are visible and professional */
h1, h2, h3, h4, h5, h6,
.entry-title,
.wp-block-heading,
.kadence-blocks-heading,
.kb-adv-heading,
.site-title {
    color: #111827 !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
    letter-spacing: -0.025em !important;
    text-rendering: optimizeLegibility !important;
}

/* Fix paragraph text readability */
p,
.wp-block-paragraph,
.kadence-blocks-text,
.entry-content p,
.wp-block-group p {
    color: #374151 !important;
    font-size: 1rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1.5rem !important;
    text-rendering: optimizeLegibility !important;
}

/* Improve link visibility and contrast */
.wp-block-button__link,
.kadence-blocks-btn {
    color: #2563eb !important;
    font-weight: 500 !important;
    transition: all 150ms ease-in-out !important;
}

a:hover,
.wp-block-button__link:hover,
.kadence-blocks-btn:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

/* ===================================================================
   HERO SECTIONS - MAXIMUM TEXT CONTRAST
   =================================================================== */

.mpf-hero-banner,
.mpf-about-hero,
.hero-section,
.wp-block-cover {
    position: relative;
}

.mpf-hero-banner h1,
.mpf-hero-banner h2,
.mpf-hero-banner h3,
.mpf-hero-banner p,
.mpf-about-hero h1,
.mpf-about-hero h2,
.mpf-about-hero h3,
.mpf-about-hero p,
.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section p {
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    font-weight: 700 !important;
    position: relative;
    z-index: 10;
}
.wp-block-cover h1,
.wp-block-cover h2,
.wp-block-cover h3,
.wp-block-cover p {
/*     color: white !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important; */
    font-weight: 700 !important;
    position: relative;
    z-index: 10;
}

/* Add stronger overlay for better text readability */
/* .mpf-hero-banner::after, */
/* .mpf-about-hero::after, */
/* .hero-section::after, */
/* .wp-block-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    
    z-index: 1;
    pointer-events: none;
} */

/* ===================================================================
   CONTENT SECTIONS - PROFESSIONAL SPACING & ALIGNMENT
   =================================================================== */

.mpf-section,
.wp-block-group,
.entry-content > *,
.kadence-blocks-row-layout-wrap {
    margin-bottom: 2rem !important;
}

.mpf-container,
.container,
.wp-block-group__inner-container {
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

@media (min-width: 640px) {
    .mpf-container,
    .container,
    .wp-block-group__inner-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Center align text sections properly */
.text-center,
.has-text-align-center,
.wp-block-group.has-text-align-center {
    text-align: center !important;
}

/* ===================================================================
   CARDS & CONTENT BOXES - IMPROVED READABILITY
   =================================================================== */

.mpf-card,
.wp-block-group,
.kadence-blocks-row-layout-item,
.appeal-card,
.donation-card {
    background: white !important;
    border: 1px solid rgba(229, 231, 235, 0.8) !important;
    border-radius: 0.75rem !important;
    padding: 2rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    margin-bottom: 2rem !important;
}

.mpf-card h3,
.wp-block-group h3,
.kadence-blocks-row-layout-item h3,
.appeal-card h3,
.donation-card h3 {
    color: #111827 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
}

.mpf-card p,
.wp-block-group p,
.kadence-blocks-row-layout-item p,
.appeal-card p,
.donation-card p {
    color: #4b5563 !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

/* ===================================================================
   BUTTONS - PROFESSIONAL & ACCESSIBLE
   =================================================================== */

.wp-block-button__link,
.kadence-blocks-btn,
.mpf-btn,
.btn,
button[type="submit"],
input[type="submit"],
.donate-btn {
    background: #2563eb !important;
    color: white !important;
    border: 2px solid #2563eb !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    transition: all 150ms ease-in-out !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

.wp-block-button__link:hover,
.kadence-blocks-btn:hover,
.mpf-btn:hover,
.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.donate-btn:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    text-decoration: none !important;
}

/* Secondary buttons */
.wp-block-button.is-style-outline .wp-block-button__link,
.btn-secondary,
.mpf-btn-secondary {
    background: transparent !important;
    color: #fff !important;
    border-color: #fff !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.btn-secondary:hover,
.mpf-btn-secondary:hover {
    background: #2563eb !important;
    color: white !important;
}

/* ===================================================================
   FORMS - BETTER VISIBILITY & USABILITY
   =================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select,
.wp-block-search input {
    background: white !important;
    border: 2px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    color: #374151 !important;
    transition: border-color 150ms ease-in-out !important;
    width: 100% !important;
    font-family: inherit !important;
}

input:focus,
textarea:focus,
select:focus,
.wp-block-search input:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

label,
.wp-block-search label {
    color: #374151 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    font-size: 0.875rem !important;
}

/* ===================================================================
   NAVIGATION - IMPROVED VISIBILITY
   =================================================================== */

.main-navigation,
.site-header,
.navigation-wrapper {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.8) !important;
}

.main-navigation a,
.site-header a,
.navigation-wrapper a {
    color: #374151 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 0.75rem 1rem !important;
    transition: all 150ms ease-in-out !important;
}

.main-navigation a:hover,
.site-header a:hover,
.navigation-wrapper a:hover,
.main-navigation .current-menu-item a {
    color: #2563eb !important;
    background: rgba(37, 99, 235, 0.1) !important;
    border-radius: 0.25rem !important;
}

/* ===================================================================
   FOOTER - HIGH CONTRAST
   =================================================================== */

.site-footer,
footer,
.mpf-footer {
    background: #111827 !important;
    color: #d1d5db !important;
    padding: 3rem 0 1.5rem !important;
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6,
.mpf-footer h1,
.mpf-footer h2,
.mpf-footer h3,
.mpf-footer h4,
.mpf-footer h5,
.mpf-footer h6 {
    color: white !important;
    font-weight: 700 !important;
}

.site-footer p,
.site-footer li,
.mpf-footer p,
.mpf-footer li {
    color: #d1d5db !important;
    line-height: 1.6 !important;
}

.site-footer a,
.mpf-footer a {
    color: #93c5fd !important;
    font-weight: 500 !important;
}

.site-footer a:hover,
.mpf-footer a:hover {
    color: #dbeafe !important;
    text-decoration: underline !important;
}

/* ===================================================================
   WORDPRESS BLOCK EDITOR FIXES
   =================================================================== */

.wp-block-columns {
    margin-bottom: 2rem !important;
}

.wp-block-column {
    padding: 1rem !important;
}

.wp-block-image {
    margin-bottom: 2rem !important;
}

.wp-block-image img {
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.wp-block-quote {
    border-left: 4px solid #2563eb !important;
    padding-left: 1.5rem !important;
    margin: 2rem 0 !important;
    font-style: italic !important;
    color: #4b5563 !important;
}

.wp-block-separator {
    border-color: #e5e7eb !important;
    margin: 3rem 0 !important;
}

/* ===================================================================
   TABLES - PROFESSIONAL STYLING
   =================================================================== */

table,
.wp-block-table table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 2rem 0 !important;
    background: white !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1) !important;
}

th,
td,
.wp-block-table th,
.wp-block-table td {
    padding: 1rem !important;
    text-align: left !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

th,
.wp-block-table th {
    background: #f9fafb !important;
    font-weight: 600 !important;
    color: #374151 !important;
    font-size: 0.875rem !important;
}

/* ===================================================================
   MOBILE RESPONSIVENESS - CRITICAL FIXES
   =================================================================== */

@media (max-width: 767px) {
    /* Fix mobile text sizing */
    h1 { font-size: 1.875rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    /* Mobile container spacing */
    .mpf-container,
    .container,
    .wp-block-group__inner-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Mobile card spacing */
    .mpf-card,
    .wp-block-group {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Mobile button sizing */
    .wp-block-button__link,
    .kadence-blocks-btn,
    .mpf-btn {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Mobile navigation */
    .main-navigation a {
        padding: 1rem !important;
        border-bottom: 1px solid rgba(229, 231, 235, 0.5) !important;
        display: block !important;
    }
}

/* ===================================================================
   ACCESSIBILITY ENHANCEMENTS
   =================================================================== */

/* Focus indicators */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.wp-block-button__link:focus {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px !important;
    border-radius: 0.25rem !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: white !important;
        color: #000000 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
    }
    
    p {
        color: #333333 !important;
    }
    
    .mpf-card,
    .wp-block-group {
        border: 2px solid #000000 !important;
    }
}

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

/* ===================================================================
   PRINT STYLES
   =================================================================== */

@media print {
    body {
        color: #000000 !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
        break-after: avoid !important;
    }
    
    .mpf-hero-banner,
    .site-header,
    .site-footer,
    .navigation-wrapper {
        display: none !important;
    }
    
    .mpf-card {
        border: 1px solid #000000 !important;
        break-inside: avoid !important;
    }
}
