/* ══════════════════════════════════════════
   MIRACLES ACCESSIBILITY — v3.0.0
   ══════════════════════════════════════════ */

/* ── Trigger — inline next to Login / Hamburger menu ── */
#ma11y-trigger,
#ma11y-trigger-mobile {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: var(--ma11y-trigger-bg, #2563eb) !important;
    color: var(--ma11y-trigger-color, #ffffff) !important;
    border: none !important;
    cursor: pointer !important;
    margin-left: 8px !important;
    vertical-align: middle !important;
    align-self: center !important;
    transition: background .18s !important;
    outline: none !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    flex-shrink: 0 !important;
    z-index: 9999 !important;
    position: static !important;
    float: none !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    clip-path: none !important;
}
#ma11y-trigger:hover,
#ma11y-trigger-mobile:hover {
    background: #16a1dc !important;
    color: #fff !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    outline: none !important;
}
#ma11y-trigger svg,
#ma11y-trigger svg *,
#ma11y-trigger-mobile svg,
#ma11y-trigger-mobile svg * { pointer-events: none !important; }

/* Desktop trigger visible, mobile trigger hidden by default */
#ma11y-trigger-mobile {
    display: none !important;
}

/* ── Overlay — hidden on desktop ── */
#ma11y-overlay { display: none !important; }

/* ── Panel — slides in from RIGHT (desktop) ── */
#ma11y-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 420px !important;
    max-width: 96vw !important;
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    border-radius: 22px 0 0 22px !important;
    box-shadow: -6px 0 40px rgba(0,0,0,.18) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 2147483646 !important;
    transform: translateX(110%) !important;
    transition: transform .33s cubic-bezier(.4,0,.2,1) !important;
}
#ma11y-panel.ma11y-open { transform: translateX(0) !important; }

#ma11y-panel :not(.ma11y-label):not(.ma11y-icon):not(#ma11y-title):not(#ma11y-reset):not(#ma11y-close) {
    font-size: inherit !important;
}

/* ── Header ── */
#ma11y-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: var(--ma11y-header-bg, #1e2a6e) !important;
    color: var(--ma11y-header-color, #fff) !important;
    padding: 14px 16px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    border-radius: 22px 0 0 0 !important;
    flex-shrink: 0 !important;
}
#ma11y-header-icon {
    width: 32px; height: 32px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,.35);
}
#ma11y-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    flex: 1 !important;
    line-height: 1.25 !important;
    text-transform: capitalize !important;
    letter-spacing: 0.03em !important;
}
#ma11y-close {
    background: rgba(255,255,255,.2) !important;
    border: none !important;
    color: #fff !important;
    font-size: 17px !important;
    cursor: pointer !important;
    width: 26px !important; height: 26px !important;
    border-radius: 50% !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    transition: background .15s !important; flex-shrink: 0 !important;
}
#ma11y-close:hover { background: rgba(255,255,255,.38) !important; }

/* ── Grid ── */
#ma11y-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
    align-content: start !important;
    flex: 1 !important;
    background: #f2f2f2 !important;
}

/* ── Base button ── */
.ma11y-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    border: 1px solid #e0e3ef !important;
    border-radius: 16px !important;
    padding: 18px 8px 14px !important;
    cursor: pointer !important;
    transition: all .15s !important;
    aspect-ratio: unset !important;
    min-height: 100px !important;
    width: 100% !important;
    text-align: center !important;
    background: #ffffff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
    position: relative !important;
    overflow: hidden !important;
}
.ma11y-btn:hover {
    background: #f2f2f2 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.13) !important;
    border-color: rgba(0,0,0,.15) !important;
}
.ma11y-btn[aria-pressed="true"] {
    border: 2px solid #1e2a6e !important;
    background: #e8eaf6 !important;
    box-shadow: none !important;
}
.ma11y-btn[aria-pressed="true"]::before { content: none !important; }
.ma11y-btn[aria-pressed="true"]::after {
    content: '✓' !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    color: #fff !important;
    background: #1e2a6e !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 18px !important;
    text-align: center !important;
}
.ma11y-btn[aria-pressed="true"] svg { stroke: #1e2a6e !important; }
.ma11y-btn[aria-pressed="true"] svg path[fill]:not([fill="none"]),
.ma11y-btn[aria-pressed="true"] svg rect[fill]:not([fill="none"]) { fill: #1e2a6e !important; }
.ma11y-btn[aria-pressed="true"] .ma11y-icon { color: #1e2a6e !important; }
.ma11y-btn[aria-pressed="true"] .ma11y-label { color: #1e2a6e !important; }

.ma11y-icon {
    font-size: 28px !important; font-weight: 800 !important; line-height: 1 !important;
    display: block !important;
}
.ma11y-label {
    font-size: 11px !important; font-weight: 600 !important;
    line-height: 1.3 !important; color: #444 !important;
}
.ma11y-btn svg {
    width: 30px !important;
    height: 30px !important;
}

/* ── Reset wrapper ── */
#ma11y-reset-wrap {
    background: #ffffff !important;
    padding: 12px 12px 20px !important;
    flex-shrink: 0 !important;
}

/* ── Reset button ── */
#ma11y-reset {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 13px !important;
    border: none !important;
    border-radius: 12px !important;
    background: #2563eb !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all .2s !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 14px rgba(37,99,235,.35) !important;
    letter-spacing: .01em !important;
}
#ma11y-reset:hover {
    background: #16a1dc !important;
    box-shadow: 0 6px 20px rgba(22,161,220,.5) !important;
    transform: translateY(-1px) !important;
}
#ma11y-reset:active {
    transform: translateY(0) !important;
    background: #1189be !important;
}

/* ════════════════════════════════
   Active site-wide CSS classes
   ════════════════════════════════ */
/* Text spacing — only on text nodes, not layout containers */
html[class*="ma11y-text-spacing"] p:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] h1:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] h2:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] h3:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] h4:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] h5:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] h6:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] span:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] a:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] li:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] td:not(#ma11y-panel *),
html[class*="ma11y-text-spacing"] label:not(#ma11y-panel *) {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
}

html.ma11y-text-spacing-1 p:not(#ma11y-panel *),
html.ma11y-text-spacing-1 h1:not(#ma11y-panel *),
html.ma11y-text-spacing-1 h2:not(#ma11y-panel *),
html.ma11y-text-spacing-1 h3:not(#ma11y-panel *),
html.ma11y-text-spacing-1 h4:not(#ma11y-panel *),
html.ma11y-text-spacing-1 h5:not(#ma11y-panel *),
html.ma11y-text-spacing-1 h6:not(#ma11y-panel *),
html.ma11y-text-spacing-1 span:not(#ma11y-panel *),
html.ma11y-text-spacing-1 a:not(#ma11y-panel *),
html.ma11y-text-spacing-1 li:not(#ma11y-panel *),
html.ma11y-text-spacing-1 td:not(#ma11y-panel *),
html.ma11y-text-spacing-1 label:not(#ma11y-panel *) { letter-spacing:.06em !important; word-spacing:.08em !important; }

html.ma11y-text-spacing-2 p:not(#ma11y-panel *),
html.ma11y-text-spacing-2 h1:not(#ma11y-panel *),
html.ma11y-text-spacing-2 h2:not(#ma11y-panel *),
html.ma11y-text-spacing-2 h3:not(#ma11y-panel *),
html.ma11y-text-spacing-2 h4:not(#ma11y-panel *),
html.ma11y-text-spacing-2 h5:not(#ma11y-panel *),
html.ma11y-text-spacing-2 h6:not(#ma11y-panel *),
html.ma11y-text-spacing-2 span:not(#ma11y-panel *),
html.ma11y-text-spacing-2 a:not(#ma11y-panel *),
html.ma11y-text-spacing-2 li:not(#ma11y-panel *),
html.ma11y-text-spacing-2 td:not(#ma11y-panel *),
html.ma11y-text-spacing-2 label:not(#ma11y-panel *) { letter-spacing:.12em !important; word-spacing:.14em !important; }

html.ma11y-text-spacing-3 p:not(#ma11y-panel *),
html.ma11y-text-spacing-3 h1:not(#ma11y-panel *),
html.ma11y-text-spacing-3 h2:not(#ma11y-panel *),
html.ma11y-text-spacing-3 h3:not(#ma11y-panel *),
html.ma11y-text-spacing-3 h4:not(#ma11y-panel *),
html.ma11y-text-spacing-3 h5:not(#ma11y-panel *),
html.ma11y-text-spacing-3 h6:not(#ma11y-panel *),
html.ma11y-text-spacing-3 span:not(#ma11y-panel *),
html.ma11y-text-spacing-3 a:not(#ma11y-panel *),
html.ma11y-text-spacing-3 li:not(#ma11y-panel *),
html.ma11y-text-spacing-3 td:not(#ma11y-panel *),
html.ma11y-text-spacing-3 label:not(#ma11y-panel *) { letter-spacing:.20em !important; word-spacing:.22em !important; }

html.ma11y-line-height-1 *:not(#ma11y-panel):not(#ma11y-panel *) { line-height: 1.4 !important; }
html.ma11y-line-height-2 *:not(#ma11y-panel):not(#ma11y-panel *) { line-height: 1.7 !important; }
html.ma11y-line-height-3 *:not(#ma11y-panel):not(#ma11y-panel *) { line-height: 2.0 !important; }

@font-face {
    font-family:"OpenDyslexic";
    src:url("https://fonts.cdnfonts.com/s/14780/OpenDyslexic-Regular.woff") format("woff");
}
html.ma11y-dyslexia *:not(#ma11y-panel):not(#ma11y-panel *) { font-family:"OpenDyslexic","Comic Sans MS",cursive !important; }

#ma11y-adhd-top {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 2147483641 !important;
    background: linear-gradient(
        to bottom,
        rgba(180,180,180,.65) var(--adhd-top, 300px),
        transparent var(--adhd-top, 300px),
        transparent var(--adhd-bot, 500px),
        rgba(180,180,180,.65) var(--adhd-bot, 360px)
    ) !important;
}
html.ma11y-adhd #ma11y-adhd-top { display: block !important; }
#ma11y-adhd-bot { display: none !important; }

html.ma11y-tts *:not(#ma11y-panel):not(#ma11y-panel *):not(#ma11y-trigger):not(#ma11y-overlay) {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z' fill='%231e2a6e'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2' stroke='%231e2a6e' stroke-width='2' fill='none'/%3E%3Cline x1='12' y1='19' x2='12' y2='23' stroke='%231e2a6e' stroke-width='2'/%3E%3Cline x1='8' y1='23' x2='16' y2='23' stroke='%231e2a6e' stroke-width='2'/%3E%3C/svg%3E") 12 0, pointer !important;
}

html.ma11y-saturation  { filter: grayscale(100%) !important; }
html.ma11y-invert      { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.95) !important; }
html.ma11y-invert img,
html.ma11y-invert video,
html.ma11y-invert [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; }
html.ma11y-saturation.ma11y-invert { filter: grayscale(100%) invert(1) !important; }

html.ma11y-highlight-links a:not(#ma11y-panel *) {
    background: #ff0 !important; color: #000 !important;
    text-decoration: underline !important; padding: 0 2px !important; border-radius: 2px !important;
}
html.ma11y-hide-images img,
html.ma11y-hide-images video,
html.ma11y-hide-images figure { visibility: hidden !important; }

html.ma11y-big-cursor,
html.ma11y-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M6 2L34 22l-11 1.5L30 38l-4.6 2.1L18.5 24.5 8 34z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 0 0, auto !important;
}
html.ma11y-pause-animation *,
html.ma11y-pause-animation *::before,
html.ma11y-pause-animation *::after {
    animation-play-state: paused !important;
    -webkit-animation-play-state: paused !important;
    transition: none !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
}
html.ma11y-pause-animation [data-aos]:not(.mf-new-orbit-icon-wrap),
html.ma11y-pause-animation [data-sal]:not(.mf-new-orbit-icon-wrap),
html.ma11y-pause-animation [data-wow-delay]:not(.mf-new-orbit-icon-wrap) {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    visibility: visible !important;
}
html.ma11y-pause-animation .mf-new-orbit-icon-wrap { transition: none !important; }
html.ma11y-pause-animation .elementor-invisible,
html.ma11y-pause-animation .animated,
html.ma11y-pause-animation .wow {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation-play-state: paused !important;
}
html.ma11y-pause-animation .value-card,
html.ma11y-pause-animation .values-stack .value-card {
    position: relative !important;
    top: auto !important;
}
html.ma11y-pause-animation .values-stack { gap: 16px !important; }

html.ma11y-focus-mode *:not(:hover):not(#ma11y-panel):not(#ma11y-panel *):not(#ma11y-trigger):not(#ma11y-trigger-mobile) {
    opacity: .35 !important;
    transition: opacity .2s !important;
}
html.ma11y-focus-mode *:hover { opacity: 1 !important; }

/* ══════════════════════════════════════════
   MOBILE — must be at END of file to override desktop
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
    #ma11y-trigger {
        display: none !important;
    }
    #ma11y-trigger-mobile {
        display: inline-flex !important;
        margin-left: auto !important;
        margin-right: 15px !important;
    }

    /* Dim overlay */
    #ma11y-overlay {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,.45) !important;
        z-index: 2147483640 !important;
    }
    body.ma11y-open-mobile #ma11y-overlay {
        display: block !important;
    }

    /* Floating popup — exact center */
    #ma11y-panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: 90vw !important;
        max-width: 370px !important;
        height: auto !important;
        min-height: unset !important;
        max-height: none !important;
        transform: translate(-50%, -50%) scale(0.88) !important;
        opacity: 0 !important;
        border-radius: 20px !important;
        overflow: hidden !important;
        pointer-events: none !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: 0 8px 40px rgba(0,0,0,.35) !important;
        transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .28s !important;
    }
    #ma11y-panel.ma11y-open {
        transform: translate(-50%, -50%) scale(1) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    #ma11y-header {
        padding: 12px 14px !important;
        border-radius: 20px 20px 0 0 !important;
        flex-shrink: 0 !important;
    }
    #ma11y-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        padding: 10px !important;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        max-height: 433px !important;
        flex: 0 0 auto !important;
        background: #f2f2f2 !important;
        scrollbar-width: thin !important;
        scrollbar-color: #2563eb #f2f2f2 !important;
    }
    .ma11y-btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    #ma11y-grid::-webkit-scrollbar { width: 5px !important; }
    #ma11y-grid::-webkit-scrollbar-track { background: #f2f2f2 !important; border-radius: 10px !important; }
    #ma11y-grid::-webkit-scrollbar-thumb { background: #2563eb !important; border-radius: 10px !important; }
    .ma11y-btn {
        min-height: 72px !important;
        padding: 10px 4px 8px !important;
        border-radius: 12px !important;
        gap: 6px !important;
    }
    .ma11y-btn svg { width: 22px !important; height: 22px !important; }
    .ma11y-icon { font-size: 20px !important; }
    .ma11y-label { font-size: 9px !important; line-height: 1.2 !important; }
    .ma11y-btn[aria-pressed="true"]::after {
        top: 5px !important; right: 5px !important;
        width: 14px !important; height: 14px !important;
        font-size: 9px !important; line-height: 14px !important;
    }
    #ma11y-reset-wrap {
        padding: 8px 10px 14px !important;
        flex-shrink: 0 !important;
    }
    #ma11y-reset {
        padding: 10px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
    }
}
