/**
 * WP Accessibility Module - Accessibility Modes
 * All 14 accessibility features applied via body classes
 */

/* ========================================
   1. DARK MODE
   ======================================== */
body.wp-a11y-dark-mode {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

body.wp-a11y-dark-mode *:not(#wp-a11y-widget):not(#wp-a11y-widget *):not(img):not(svg):not([class*="wp-a11y-"]) {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #444444 !important;
}

body.wp-a11y-dark-mode a:not(#wp-a11y-widget a) {
    color: #66b3ff !important;
}

/* ========================================
   2. LIGHT MODE (High Brightness)
   ======================================== */
body.wp-a11y-light-mode {
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.wp-a11y-light-mode *:not(#wp-a11y-widget):not(#wp-a11y-widget *):not(img):not(svg):not([class*="wp-a11y-"]) {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #e0e0e0 !important;
}

body.wp-a11y-light-mode a:not(#wp-a11y-widget a) {
    color: #0000ff !important;
}

/* ========================================
   3. HIGH CONTRAST
   ======================================== */
body.wp-a11y-high-contrast {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

body.wp-a11y-high-contrast *:not(#wp-a11y-widget):not(#wp-a11y-widget *):not(img):not(svg):not([class*="wp-a11y-"]) {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

body.wp-a11y-high-contrast a:not(#wp-a11y-widget a) {
    color: #00ff00 !important;
    text-decoration: underline !important;
}

body.wp-a11y-high-contrast button:not(#wp-a11y-widget button),
body.wp-a11y-high-contrast input:not(#wp-a11y-widget input),
body.wp-a11y-high-contrast select:not(#wp-a11y-widget select),
body.wp-a11y-high-contrast textarea:not(#wp-a11y-widget textarea) {
    border: 2px solid #ffff00 !important;
}

/* ========================================
   4. INVERT COLORS
   ======================================== */
body.wp-a11y-invert-colors {
    filter: invert(1) hue-rotate(180deg);
}

body.wp-a11y-invert-colors img,
body.wp-a11y-invert-colors video,
body.wp-a11y-invert-colors picture,
body.wp-a11y-invert-colors iframe {
    filter: invert(1) hue-rotate(180deg);
}

/* ========================================
   5. LARGE TEXT (Incremental)
   ======================================== */
body.wp-a11y-large-text {
    font-size: 100% !important;
}

body.wp-a11y-large-text[data-font-size="110"] {
    font-size: 110% !important;
}

body.wp-a11y-large-text[data-font-size="120"] {
    font-size: 120% !important;
}

body.wp-a11y-large-text[data-font-size="130"] {
    font-size: 130% !important;
}

body.wp-a11y-large-text[data-font-size="140"] {
    font-size: 140% !important;
}

body.wp-a11y-large-text[data-font-size="150"] {
    font-size: 150% !important;
}

body.wp-a11y-large-text *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    font-size: inherit !important;
}

/* ========================================
   6. DYSLEXIA FONT (OpenDyslexic via CDN + Atkinson Hyperlegible fallback)
   ======================================== */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body.wp-a11y-dyslexia-font,
body.wp-a11y-dyslexia-font *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    font-family: 'OpenDyslexic', 'Comic Sans MS', Verdana, Tahoma, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.15em !important;
    line-height: 1.6 !important;
}

/* ========================================
   7. HIGHLIGHT LINKS
   ======================================== */
body.wp-a11y-highlight-links a:not(#wp-a11y-widget a) {
    background-color: #ffff00 !important;
    color: #000000 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
}

body.wp-a11y-highlight-links a:hover:not(#wp-a11y-widget a),
body.wp-a11y-highlight-links a:focus:not(#wp-a11y-widget a) {
    background-color: #ffcc00 !important;
    outline: 2px solid #ff6600 !important;
    outline-offset: 2px !important;
}

/* ========================================
   8. LETTER SPACING
   ======================================== */
body.wp-a11y-letter-spacing *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    letter-spacing: 0.15em !important;
    word-spacing: 0.2em !important;
}

/* ========================================
   9. LINE HEIGHT
   ======================================== */
body.wp-a11y-line-height *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    line-height: 2 !important;
}

body.wp-a11y-line-height p:not(#wp-a11y-widget p),
body.wp-a11y-line-height li:not(#wp-a11y-widget li),
body.wp-a11y-line-height div:not(#wp-a11y-widget div) {
    margin-bottom: 1.5em !important;
}

/* ========================================
   10. TEXT ALIGN (cycle: left, center, right, justify)
   ======================================== */
body[data-text-align="left"] *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    text-align: left !important;
}
body[data-text-align="center"] *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    text-align: center !important;
}
body[data-text-align="right"] *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    text-align: right !important;
}
body[data-text-align="justify"] *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    text-align: justify !important;
}

/* ========================================
   11. BIG CURSOR
   ======================================== */
body.wp-a11y-big-cursor,
body.wp-a11y-big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="white" stroke="black" stroke-width="1" d="M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"/></svg>') 0 0, auto !important;
}

body.wp-a11y-big-cursor a:not(#wp-a11y-widget a),
body.wp-a11y-big-cursor button:not(#wp-a11y-widget button) {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="white" stroke="black" stroke-width="1" d="M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"/></svg>') 0 0, pointer !important;
}

/* ========================================
   12. STOP ANIMATIONS
   ======================================== */
body.wp-a11y-stop-animations,
body.wp-a11y-stop-animations *:not(#wp-a11y-widget):not(#wp-a11y-widget *) {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

body.wp-a11y-stop-animations img:not(#wp-a11y-widget img),
body.wp-a11y-stop-animations video:not(#wp-a11y-widget video) {
    animation-play-state: paused !important;
}

/* ========================================
   13. HIDE IMAGES
   ======================================== */
body.wp-a11y-hide-images img:not(#wp-a11y-widget img),
body.wp-a11y-hide-images picture:not(#wp-a11y-widget picture),
body.wp-a11y-hide-images svg:not(#wp-a11y-widget svg):not([role="img"]) {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.wp-a11y-hide-images img:not(#wp-a11y-widget img)[alt]::after {
    content: attr(alt);
    display: block;
    opacity: 1 !important;
    visibility: visible !important;
    background: #f0f0f0;
    padding: 8px;
    font-size: 14px;
    color: #333;
    border: 1px solid #ccc;
}

/* ========================================
   WIDGET EXCLUSIONS
   Always exclude widget from accessibility modes
   ======================================== */
#wp-a11y-widget,
#wp-a11y-widget * {
    animation: initial !important;
    transition: initial !important;
    filter: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Ensure widget remains clickable and visible */
#wp-a11y-widget {
    pointer-events: all !important;
    opacity: 1 !important;
    visibility: visible !important;
}
