/**
 * Frontend CSS for the Open Accessibility plugin
 */

/* Theme variables */
:root {
    --oa-panel-bg: #fff;
    --oa-panel-text: #333;
    --oa-panel-border: #eee;
    --oa-action-button-bg: #f0f0f0;
    --oa-action-button-text: #333;
    --oa-action-button-border: #ddd;
    --oa-action-button-hover-bg: #e0e0e0;
    --oa-link-color: #4054b2;
    --oa-link-hover-color: #2c3e8e;
}

/* Dark mode variables - support both data-theme and data-bs-theme */
[data-theme="dark"],
[data-bs-theme="dark"] {
    --oa-panel-bg: #212529;
    --oa-panel-text: #f8f9fa;
    --oa-panel-border: #495057;
    --oa-action-button-bg: #343a40;
    --oa-action-button-text: #f8f9fa;
    --oa-action-button-border: #495057;
    --oa-action-button-hover-bg: #495057;
    --oa-link-color: #6ea8fe;
    --oa-link-hover-color: #8bb9fe;
}

/* Skip to content link */
.open-accessibility-skip-to-content-link {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    pointer-events: none;
    position: fixed;
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid #2563eb;
    background-color: #fff;
    color: #0c0d0e;
    text-decoration: none;
    word-wrap: normal !important;
    z-index: 100000;
}

.open-accessibility-skip-to-content-link:focus {
    clip: auto !important;
    clip-path: none;
    pointer-events: auto;
    top: 30px;
    left: 30px;
    height: auto;
    width: auto;
    padding: 16px 24px;
}

.open-accessibility-skip-to-content-link:focus + .open-accessibility-skip-to-content-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Accessibility Widget */
.open-accessibility-widget-wrapper {
    position: fixed;
    filter: none !important;
    z-index: 1000000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* Widget positioning */
.open-accessibility-widget-wrapper.position-left {
    left: 20px;
    top: 50vh;
    transform: translateY(-50%);
    position: fixed;
}

.open-accessibility-widget-wrapper.position-right {
    right: 20px;
    top: 50vh;
    transform: translateY(-50%);
    position: fixed;
}

.open-accessibility-widget-wrapper.position-bottom-left {
    left: 20px;
    bottom: 20px;
}

.open-accessibility-widget-wrapper.position-bottom-right {
    right: 20px;
    bottom: 20px;
}

/* Toggle button sizes */
.open-accessibility-widget-wrapper.size-small .open-accessibility-toggle-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.open-accessibility-widget-wrapper.size-medium .open-accessibility-toggle-button {
    width: 50px;
    height: 50px;
    font-size: 22px;
}

.open-accessibility-widget-wrapper.size-large .open-accessibility-toggle-button {
    width: 60px;
    height: 60px;
    font-size: 26px;
}

/* Toggle button */
.open-accessibility-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.open-accessibility-toggle-button:hover,
.open-accessibility-toggle-button:focus {
    transform: scale(1.1);
    outline: none;
}

.open-accessibility-toggle-button:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5), 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Widget panel */
.open-accessibility-widget-panel {
    position: absolute;
    background-color: var(--oa-panel-bg);
    color: var(--oa-panel-text);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 350px;
    max-height: 80vh;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.open-accessibility-widget-panel.oa-panel-is-active {
    visibility: visible;
    opacity: 1;
}

/* Panel positioning */
.open-accessibility-widget-wrapper.position-left .open-accessibility-widget-panel {
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
}

.open-accessibility-widget-wrapper.position-right .open-accessibility-widget-panel {
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
}

.open-accessibility-widget-wrapper.position-bottom-left .open-accessibility-widget-panel {
    left: 0;
    bottom: calc(100% + 15px);
    position: absolute;
}

.open-accessibility-widget-wrapper.position-bottom-right .open-accessibility-widget-panel {
    right: 0;
    bottom: calc(100% + 15px);
    position: absolute;
}

/* Widget header */
.open-accessibility-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    background-color: var(--oa-panel-bg);
    color: var(--oa-panel-text);
    border-bottom: 1px solid var(--oa-panel-border);
}

.open-accessibility-widget-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.open-accessibility-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 30px;
    height: 30px;
}

/* Widget content */
.open-accessibility-widget-content {
    padding: 15px;
}

.open-accessibility-widget-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.open-accessibility-widget-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.open-accessibility-widget-section h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

/* Action buttons */
.open-accessibility-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.open-accessibility-action-button {
    background-color: var(--oa-action-button-bg);
    color: var(--oa-action-button-text);
    border: 1px solid var(--oa-action-button-border);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.open-accessibility-action-button:hover,
.open-accessibility-action-button:focus {
    background-color: var(--oa-action-button-hover-bg);
    outline: none;
}

.open-accessibility-action-button.active {
    background-color: #4054b2;
    color: white;
    border-color: #4054b2;
}

.open-accessibility-action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--oa-action-button-bg);
    color: var(--oa-action-button-text);
    border-color: var(--oa-action-button-border);
}

/* Visual indicators for incremental controls */
.open-accessibility-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    min-height: 20px;
}

.open-accessibility-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--oa-action-button-border, #ccc);
    background-color: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.open-accessibility-indicator-dot.active {
    background-color: var(--oa-action-button-border, #4054b2);
    border-color: var(--oa-action-button-border, #4054b2);
}

/* Widget footer */
.open-accessibility-widget-footer {
    padding: 15px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    background-color: var(--oa-panel-bg);
    color: var(--oa-panel-text);
    border-top: 1px solid var(--oa-panel-border);
    border-color: #4054b2 !important;
}

.open-accessibility-hide-widget {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.open-accessibility-hide-widget:hover,
.open-accessibility-hide-widget:focus {
    opacity: 1;
    outline: none;
}

/* Links section */
.open-accessibility-links-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.open-accessibility-link {
    display: block;
    text-decoration: none;
    color: var(--oa-link-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

.open-accessibility-link:hover,
.open-accessibility-link:focus {
    color: var(--oa-link-hover-color);
    text-decoration: underline;
    outline: none;
}

/* Icons */
.open-accessibility-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.open-accessibility-icon svg {
    width: 75%;
    height: 75%;
    display: block;
}

.open-accessibility-icon svg g {
    transform: none;
}

/* Reset button */
.open-accessibility-reset-button {
    background-color: #f44336;
    color: white;
    border: none;
}

.open-accessibility-reset-button:hover,
.open-accessibility-reset-button:focus {
    background-color: #d32f2f;
}

/* Body classes for accessibility features */
body.open-accessibility-high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.open-accessibility-high-contrast a,
body.open-accessibility-high-contrast button:not(.open-accessibility-toggle-button):not(.open-accessibility-action-button),
body.open-accessibility-high-contrast input,
body.open-accessibility-high-contrast select,
body.open-accessibility-high-contrast textarea,
body.open-accessibility-high-contrast h1,
body.open-accessibility-high-contrast h2, 
body.open-accessibility-high-contrast h3,
body.open-accessibility-high-contrast h4,
body.open-accessibility-high-contrast h5,
body.open-accessibility-high-contrast h6,
body.open-accessibility-high-contrast p,
body.open-accessibility-high-contrast .wp-block-columns,
body.open-accessibility-high-contrast .wp-block-column,
body.open-accessibility-high-contrast .wp-block-group,
body.open-accessibility-high-contrast .wp-block-paragraph,
body.open-accessibility-high-contrast .wp-block-heading,
body.open-accessibility-high-contrast .wp-block-text,
body.open-accessibility-high-contrast .wp-block-list,
body.open-accessibility-high-contrast .wp-block-quote,
body.open-accessibility-high-contrast .wp-block-pullquote,
body.open-accessibility-high-contrast .wp-block-media-text,
body.open-accessibility-high-contrast .wp-block-cover,
body.open-accessibility-high-contrast .wp-block-buttons,
body.open-accessibility-high-contrast .wp-block-button,
body.open-accessibility-high-contrast .wp-block-navigation,
body.open-accessibility-high-contrast .wp-block-site-title,
body.open-accessibility-high-contrast .wp-block-site-tagline,
body.open-accessibility-high-contrast .wp-block-post-title,
body.open-accessibility-high-contrast .wp-block-post-excerpt,
body.open-accessibility-high-contrast .wp-block-post-content,
body.open-accessibility-high-contrast .wp-block-post-date,
body.open-accessibility-high-contrast .wp-block-post-author,
body.open-accessibility-high-contrast .wp-block-post-terms,
body.open-accessibility-high-contrast .wp-block-query,
body.open-accessibility-high-contrast .wp-block-query-loop,
body.open-accessibility-high-contrast .wp-block-template-part,
body.open-accessibility-high-contrast .wp-block-html,
body.open-accessibility-high-contrast .wp-block-separator,
body.open-accessibility-high-contrast .wp-block-spacer,
body.open-accessibility-high-contrast .wp-block-image,
body.open-accessibility-high-contrast .wp-block-gallery,
body.open-accessibility-high-contrast .wp-block-video,
body.open-accessibility-high-contrast .wp-block-audio,
body.open-accessibility-high-contrast .wp-block-file,
body.open-accessibility-high-contrast .wp-block-embed,
body.open-accessibility-high-contrast .wp-block-calendar,
body.open-accessibility-high-contrast .wp-block-rss,
body.open-accessibility-high-contrast .wp-block-search,
body.open-accessibility-high-contrast .wp-block-social-links,
body.open-accessibility-high-contrast .wp-block-navigation-submenu,
body.open-accessibility-high-contrast .wp-block-page-list,
body.open-accessibility-high-contrast .wp-block-archives,
body.open-accessibility-high-contrast .wp-block-categories,
body.open-accessibility-high-contrast .wp-block-latest-posts,
body.open-accessibility-high-contrast .wp-block-latest-comments,
body.open-accessibility-high-contrast .wp-block-tag-cloud,
body.open-accessibility-high-contrast .wp-block-shortcode,
body.open-accessibility-high-contrast .wp-block-code,
body.open-accessibility-high-contrast .wp-block-preformatted,
body.open-accessibility-high-contrast .wp-block-table,
body.open-accessibility-high-contrast .wp-block-verse,
body.open-accessibility-high-contrast .wp-block-more,
body.open-accessibility-high-contrast .wp-block-nextpage,
body.open-accessibility-high-contrast .wp-block-comments,
body.open-accessibility-high-contrast .wp-block-comment-template,
body.open-accessibility-high-contrast .wp-block-comment-author-name,
body.open-accessibility-high-contrast .wp-block-comment-date,
body.open-accessibility-high-contrast .wp-block-comment-content,
body.open-accessibility-high-contrast .wp-block-comment-reply-link,
body.open-accessibility-high-contrast .wp-block-post-comments,
body.open-accessibility-high-contrast .wp-block-loginout,
body.open-accessibility-high-contrast .wp-block-avatar,
body.open-accessibility-high-contrast .wp-block-post-author-biography,
body.open-accessibility-high-contrast .wp-block-post-navigation-link,
body.open-accessibility-high-contrast .wp-block-query-pagination,
body.open-accessibility-high-contrast .wp-block-query-pagination-numbers,
body.open-accessibility-high-contrast .wp-block-query-pagination-previous,
body.open-accessibility-high-contrast .wp-block-query-pagination-next,
body.open-accessibility-high-contrast .wp-block-query-title,
body.open-accessibility-high-contrast .wp-block-query-no-results,
body.open-accessibility-high-contrast .wp-block-read-more,
body.open-accessibility-high-contrast .wp-block-home-link,
body.open-accessibility-high-contrast .wp-block-site-logo,
body.open-accessibility-high-contrast .wp-block-navigation-link,
body.open-accessibility-high-contrast .wp-block-navigation-link-content,
body.open-accessibility-high-contrast .wp-block-navigation-submenu-icon,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon,
body.open-accessibility-high-contrast .wp-block-button__link,
body.open-accessibility-high-contrast .wp-block-social-link,
body.open-accessibility-high-contrast .wp-block-social-link-anchor,
body.open-accessibility-high-contrast .wp-block-social-link-icon,
body.open-accessibility-high-contrast .wp-block-social-link-label,
body.open-accessibility-high-contrast .wp-block-search__input,
body.open-accessibility-high-contrast .wp-block-search__button,
body.open-accessibility-high-contrast .wp-block-search__inside-wrapper,
body.open-accessibility-high-contrast .wp-block-search__label,
body.open-accessibility-high-contrast .wp-block-file__button,
body.open-accessibility-high-contrast .wp-block-file__content-wrapper,
body.open-accessibility-high-contrast .wp-block-file__textlink,
body.open-accessibility-high-contrast .wp-block-file__embed,
body.open-accessibility-high-contrast .wp-block-embed__wrapper,
body.open-accessibility-high-contrast .wp-block-embed figcaption,
body.open-accessibility-high-contrast .wp-block-gallery .blocks-gallery-item,
body.open-accessibility-high-contrast .wp-block-gallery .blocks-gallery-image,
body.open-accessibility-high-contrast .wp-block-gallery .blocks-gallery-caption,
body.open-accessibility-high-contrast .wp-block-gallery figcaption,
body.open-accessibility-high-contrast .wp-block-image figcaption,
body.open-accessibility-high-contrast .wp-block-video figcaption,
body.open-accessibility-high-contrast .wp-block-audio figcaption,
body.open-accessibility-high-contrast .wp-block-cover__inner-container,
body.open-accessibility-high-contrast .wp-block-cover__background,
body.open-accessibility-high-contrast .wp-block-cover__gradient-background,
body.open-accessibility-high-contrast .wp-block-cover__image-background,
body.open-accessibility-high-contrast .wp-block-cover__video-background,
body.open-accessibility-high-contrast .wp-block-cover-text,
body.open-accessibility-high-contrast .wp-block-cover-image-text,
body.open-accessibility-high-contrast .wp-block-cover-image-text2,
body.open-accessibility-high-contrast .wp-block-media-text__content,
body.open-accessibility-high-contrast .wp-block-media-text__media,
body.open-accessibility-high-contrast .wp-block-media-text__image,
body.open-accessibility-high-contrast .wp-block-media-text__video,
body.open-accessibility-high-contrast .wp-block-pullquote__citation,
body.open-accessibility-high-contrast .wp-block-pullquote cite,
body.open-accessibility-high-contrast .wp-block-quote cite,
body.open-accessibility-high-contrast .wp-block-quote__citation,
body.open-accessibility-high-contrast .wp-block-table table,
body.open-accessibility-high-contrast .wp-block-table thead,
body.open-accessibility-high-contrast .wp-block-table tbody,
body.open-accessibility-high-contrast .wp-block-table tfoot,
body.open-accessibility-high-contrast .wp-block-table tr,
body.open-accessibility-high-contrast .wp-block-table th,
body.open-accessibility-high-contrast .wp-block-table td,
body.open-accessibility-high-contrast .wp-block-code code,
body.open-accessibility-high-contrast .wp-block-verse pre,
body.open-accessibility-high-contrast .wp-block-preformatted pre,
body.open-accessibility-high-contrast .wp-block-latest-posts__list,
body.open-accessibility-high-contrast .wp-block-latest-posts__list-item,
body.open-accessibility-high-contrast .wp-block-latest-posts__post-date,
body.open-accessibility-high-contrast .wp-block-latest-posts__post-author,
body.open-accessibility-high-contrast .wp-block-latest-posts__post-excerpt,
body.open-accessibility-high-contrast .wp-block-latest-comments__list,
body.open-accessibility-high-contrast .wp-block-latest-comments__list-item,
body.open-accessibility-high-contrast .wp-block-latest-comments__comment-date,
body.open-accessibility-high-contrast .wp-block-latest-comments__comment-excerpt,
body.open-accessibility-high-contrast .wp-block-latest-comments__comment-author,
body.open-accessibility-high-contrast .wp-block-latest-comments__comment-link,
body.open-accessibility-high-contrast .wp-block-archives__list,
body.open-accessibility-high-contrast .wp-block-archives__list-item,
body.open-accessibility-high-contrast .wp-block-categories__list,
body.open-accessibility-high-contrast .wp-block-categories__list-item,
body.open-accessibility-high-contrast .wp-block-calendar table,
body.open-accessibility-high-contrast .wp-block-calendar th,
body.open-accessibility-high-contrast .wp-block-calendar td,
body.open-accessibility-high-contrast .wp-block-calendar caption,
body.open-accessibility-high-contrast .wp-block-calendar tbody,
body.open-accessibility-high-contrast .wp-block-calendar thead,
body.open-accessibility-high-contrast .wp-block-rss__list,
body.open-accessibility-high-contrast .wp-block-rss__list-item,
body.open-accessibility-high-contrast .wp-block-rss__item-title,
body.open-accessibility-high-contrast .wp-block-rss__item-publish-date,
body.open-accessibility-high-contrast .wp-block-rss__item-author,
body.open-accessibility-high-contrast .wp-block-rss__item-excerpt,
body.open-accessibility-high-contrast .wp-block-tag-cloud__list,
body.open-accessibility-high-contrast .wp-block-tag-cloud__list-item,
body.open-accessibility-high-contrast .wp-block-tag-cloud__tag,
body.open-accessibility-high-contrast .wp-block-page-list__list,
body.open-accessibility-high-contrast .wp-block-page-list__list-item,
body.open-accessibility-high-contrast .wp-block-page-list__page,
body.open-accessibility-high-contrast .wp-block-navigation-link__label,
body.open-accessibility-high-contrast .wp-block-navigation-link__description,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon svg,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon path,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon rect,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon circle,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon polygon,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon line,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon polyline,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon ellipse,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon text,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon g,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon *,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:hover,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:focus,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:active,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:visited,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:link,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:before,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon:after,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon::before,
body.open-accessibility-high-contrast .wp-block-navigation-link__submenu-icon::after {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* Bootstrap 5 Background Classes - High Contrast Mode */
body.open-accessibility-high-contrast .bg-primary,
body.open-accessibility-high-contrast .bg-secondary,
body.open-accessibility-high-contrast .bg-success,
body.open-accessibility-high-contrast .bg-danger,
body.open-accessibility-high-contrast .bg-warning,
body.open-accessibility-high-contrast .bg-info,
body.open-accessibility-high-contrast .bg-light,
body.open-accessibility-high-contrast .bg-dark,
body.open-accessibility-high-contrast .bg-body,
body.open-accessibility-high-contrast .bg-body-secondary,
body.open-accessibility-high-contrast .bg-body-tertiary,
body.open-accessibility-high-contrast .bg-transparent,
body.open-accessibility-high-contrast .bg-white,
body.open-accessibility-high-contrast .bg-black,
body.open-accessibility-high-contrast .bg-opacity-10,
body.open-accessibility-high-contrast .bg-opacity-25,
body.open-accessibility-high-contrast .bg-opacity-50,
body.open-accessibility-high-contrast .bg-opacity-75,
body.open-accessibility-high-contrast .bg-opacity-100,
body.open-accessibility-high-contrast .bg-gradient,
body.open-accessibility-high-contrast .bg-primary-subtle,
body.open-accessibility-high-contrast .bg-secondary-subtle,
body.open-accessibility-high-contrast .bg-success-subtle,
body.open-accessibility-high-contrast .bg-danger-subtle,
body.open-accessibility-high-contrast .bg-warning-subtle,
body.open-accessibility-high-contrast .bg-info-subtle,
body.open-accessibility-high-contrast .bg-light-subtle,
body.open-accessibility-high-contrast .bg-dark-subtle {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* Bootstrap 5 Text Color Classes - High Contrast Mode */
body.open-accessibility-high-contrast .text-primary,
body.open-accessibility-high-contrast .text-secondary,
body.open-accessibility-high-contrast .text-success,
body.open-accessibility-high-contrast .text-danger,
body.open-accessibility-high-contrast .text-warning,
body.open-accessibility-high-contrast .text-info,
body.open-accessibility-high-contrast .text-light,
body.open-accessibility-high-contrast .text-dark,
body.open-accessibility-high-contrast .text-body,
body.open-accessibility-high-contrast .text-body-emphasis,
body.open-accessibility-high-contrast .text-body-secondary,
body.open-accessibility-high-contrast .text-body-tertiary,
body.open-accessibility-high-contrast .text-black,
body.open-accessibility-high-contrast .text-white,
body.open-accessibility-high-contrast .text-opacity-25,
body.open-accessibility-high-contrast .text-opacity-50,
body.open-accessibility-high-contrast .text-opacity-75,
body.open-accessibility-high-contrast .text-opacity-100 {
    color: #ffff00 !important;
}

/* Bootstrap 5 Border Classes - High Contrast Mode */
body.open-accessibility-high-contrast .border,
body.open-accessibility-high-contrast .border-primary,
body.open-accessibility-high-contrast .border-secondary,
body.open-accessibility-high-contrast .border-success,
body.open-accessibility-high-contrast .border-danger,
body.open-accessibility-high-contrast .border-warning,
body.open-accessibility-high-contrast .border-info,
body.open-accessibility-high-contrast .border-light,
body.open-accessibility-high-contrast .border-dark,
body.open-accessibility-high-contrast .border-white,
body.open-accessibility-high-contrast .border-black,
body.open-accessibility-high-contrast .border-opacity-10,
body.open-accessibility-high-contrast .border-opacity-25,
body.open-accessibility-high-contrast .border-opacity-50,
body.open-accessibility-high-contrast .border-opacity-75,
body.open-accessibility-high-contrast .border-opacity-100 {
    border-color: #ffff00 !important;
}

body.open-accessibility-negative-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.open-accessibility-negative-contrast a,
body.open-accessibility-negative-contrast button:not(.open-accessibility-toggle-button):not(.open-accessibility-action-button),
body.open-accessibility-negative-contrast input,
body.open-accessibility-negative-contrast select,
body.open-accessibility-negative-contrast textarea,
body.open-accessibility-negative-contrast h1,
body.open-accessibility-negative-contrast h2, 
body.open-accessibility-negative-contrast h3,
body.open-accessibility-negative-contrast h4,
body.open-accessibility-negative-contrast h5,
body.open-accessibility-negative-contrast h6,
body.open-accessibility-negative-contrast p,
body.open-accessibility-negative-contrast .wp-block-columns,
body.open-accessibility-negative-contrast .wp-block-column,
body.open-accessibility-negative-contrast .wp-block-group,
body.open-accessibility-negative-contrast .wp-block-paragraph,
body.open-accessibility-negative-contrast .wp-block-heading,
body.open-accessibility-negative-contrast .wp-block-text,
body.open-accessibility-negative-contrast .wp-block-list,
body.open-accessibility-negative-contrast .wp-block-quote,
body.open-accessibility-negative-contrast .wp-block-pullquote,
body.open-accessibility-negative-contrast .wp-block-media-text,
body.open-accessibility-negative-contrast .wp-block-cover,
body.open-accessibility-negative-contrast .wp-block-buttons,
body.open-accessibility-negative-contrast .wp-block-button,
body.open-accessibility-negative-contrast .wp-block-navigation,
body.open-accessibility-negative-contrast .wp-block-site-title,
body.open-accessibility-negative-contrast .wp-block-site-tagline,
body.open-accessibility-negative-contrast .wp-block-post-title,
body.open-accessibility-negative-contrast .wp-block-post-excerpt,
body.open-accessibility-negative-contrast .wp-block-post-content,
body.open-accessibility-negative-contrast .wp-block-post-date,
body.open-accessibility-negative-contrast .wp-block-post-author,
body.open-accessibility-negative-contrast .wp-block-post-terms,
body.open-accessibility-negative-contrast .wp-block-query,
body.open-accessibility-negative-contrast .wp-block-query-loop,
body.open-accessibility-negative-contrast .wp-block-template-part,
body.open-accessibility-negative-contrast .wp-block-html,
body.open-accessibility-negative-contrast .wp-block-separator,
body.open-accessibility-negative-contrast .wp-block-spacer,
body.open-accessibility-negative-contrast .wp-block-image,
body.open-accessibility-negative-contrast .wp-block-gallery,
body.open-accessibility-negative-contrast .wp-block-video,
body.open-accessibility-negative-contrast .wp-block-audio,
body.open-accessibility-negative-contrast .wp-block-file,
body.open-accessibility-negative-contrast .wp-block-embed,
body.open-accessibility-negative-contrast .wp-block-calendar,
body.open-accessibility-negative-contrast .wp-block-rss,
body.open-accessibility-negative-contrast .wp-block-search,
body.open-accessibility-negative-contrast .wp-block-social-links,
body.open-accessibility-negative-contrast .wp-block-navigation-submenu,
body.open-accessibility-negative-contrast .wp-block-page-list,
body.open-accessibility-negative-contrast .wp-block-archives,
body.open-accessibility-negative-contrast .wp-block-categories,
body.open-accessibility-negative-contrast .wp-block-latest-posts,
body.open-accessibility-negative-contrast .wp-block-latest-comments,
body.open-accessibility-negative-contrast .wp-block-tag-cloud,
body.open-accessibility-negative-contrast .wp-block-shortcode,
body.open-accessibility-negative-contrast .wp-block-code,
body.open-accessibility-negative-contrast .wp-block-preformatted,
body.open-accessibility-negative-contrast .wp-block-table,
body.open-accessibility-negative-contrast .wp-block-verse,
body.open-accessibility-negative-contrast .wp-block-more,
body.open-accessibility-negative-contrast .wp-block-nextpage,
body.open-accessibility-negative-contrast .wp-block-comments,
body.open-accessibility-negative-contrast .wp-block-comment-template,
body.open-accessibility-negative-contrast .wp-block-comment-author-name,
body.open-accessibility-negative-contrast .wp-block-comment-date,
body.open-accessibility-negative-contrast .wp-block-comment-content,
body.open-accessibility-negative-contrast .wp-block-comment-reply-link,
body.open-accessibility-negative-contrast .wp-block-post-comments,
body.open-accessibility-negative-contrast .wp-block-loginout,
body.open-accessibility-negative-contrast .wp-block-avatar,
body.open-accessibility-negative-contrast .wp-block-post-author-biography,
body.open-accessibility-negative-contrast .wp-block-post-navigation-link,
body.open-accessibility-negative-contrast .wp-block-query-pagination,
body.open-accessibility-negative-contrast .wp-block-query-pagination-numbers,
body.open-accessibility-negative-contrast .wp-block-query-pagination-previous,
body.open-accessibility-negative-contrast .wp-block-query-pagination-next,
body.open-accessibility-negative-contrast .wp-block-query-title,
body.open-accessibility-negative-contrast .wp-block-query-no-results,
body.open-accessibility-negative-contrast .wp-block-read-more,
body.open-accessibility-negative-contrast .wp-block-home-link,
body.open-accessibility-negative-contrast .wp-block-site-logo,
body.open-accessibility-negative-contrast .wp-block-navigation-link,
body.open-accessibility-negative-contrast .wp-block-navigation-link-content,
body.open-accessibility-negative-contrast .wp-block-navigation-submenu-icon,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon,
body.open-accessibility-negative-contrast .wp-block-button__link,
body.open-accessibility-negative-contrast .wp-block-social-link,
body.open-accessibility-negative-contrast .wp-block-social-link-anchor,
body.open-accessibility-negative-contrast .wp-block-social-link-icon,
body.open-accessibility-negative-contrast .wp-block-social-link-label,
body.open-accessibility-negative-contrast .wp-block-search__input,
body.open-accessibility-negative-contrast .wp-block-search__button,
body.open-accessibility-negative-contrast .wp-block-search__inside-wrapper,
body.open-accessibility-negative-contrast .wp-block-search__label,
body.open-accessibility-negative-contrast .wp-block-file__button,
body.open-accessibility-negative-contrast .wp-block-file__content-wrapper,
body.open-accessibility-negative-contrast .wp-block-file__textlink,
body.open-accessibility-negative-contrast .wp-block-file__embed,
body.open-accessibility-negative-contrast .wp-block-embed__wrapper,
body.open-accessibility-negative-contrast .wp-block-embed figcaption,
body.open-accessibility-negative-contrast .wp-block-gallery .blocks-gallery-item,
body.open-accessibility-negative-contrast .wp-block-gallery .blocks-gallery-image,
body.open-accessibility-negative-contrast .wp-block-gallery .blocks-gallery-caption,
body.open-accessibility-negative-contrast .wp-block-gallery figcaption,
body.open-accessibility-negative-contrast .wp-block-image figcaption,
body.open-accessibility-negative-contrast .wp-block-video figcaption,
body.open-accessibility-negative-contrast .wp-block-audio figcaption,
body.open-accessibility-negative-contrast .wp-block-cover__inner-container,
body.open-accessibility-negative-contrast .wp-block-cover__background,
body.open-accessibility-negative-contrast .wp-block-cover__gradient-background,
body.open-accessibility-negative-contrast .wp-block-cover__image-background,
body.open-accessibility-negative-contrast .wp-block-cover__video-background,
body.open-accessibility-negative-contrast .wp-block-cover-text,
body.open-accessibility-negative-contrast .wp-block-cover-image-text,
body.open-accessibility-negative-contrast .wp-block-cover-image-text2,
body.open-accessibility-negative-contrast .wp-block-media-text__content,
body.open-accessibility-negative-contrast .wp-block-media-text__media,
body.open-accessibility-negative-contrast .wp-block-media-text__image,
body.open-accessibility-negative-contrast .wp-block-media-text__video,
body.open-accessibility-negative-contrast .wp-block-pullquote__citation,
body.open-accessibility-negative-contrast .wp-block-pullquote cite,
body.open-accessibility-negative-contrast .wp-block-quote cite,
body.open-accessibility-negative-contrast .wp-block-quote__citation,
body.open-accessibility-negative-contrast .wp-block-table table,
body.open-accessibility-negative-contrast .wp-block-table thead,
body.open-accessibility-negative-contrast .wp-block-table tbody,
body.open-accessibility-negative-contrast .wp-block-table tfoot,
body.open-accessibility-negative-contrast .wp-block-table tr,
body.open-accessibility-negative-contrast .wp-block-table th,
body.open-accessibility-negative-contrast .wp-block-table td,
body.open-accessibility-negative-contrast .wp-block-code code,
body.open-accessibility-negative-contrast .wp-block-verse pre,
body.open-accessibility-negative-contrast .wp-block-preformatted pre,
body.open-accessibility-negative-contrast .wp-block-latest-posts__list,
body.open-accessibility-negative-contrast .wp-block-latest-posts__list-item,
body.open-accessibility-negative-contrast .wp-block-latest-posts__post-date,
body.open-accessibility-negative-contrast .wp-block-latest-posts__post-author,
body.open-accessibility-negative-contrast .wp-block-latest-posts__post-excerpt,
body.open-accessibility-negative-contrast .wp-block-latest-comments__list,
body.open-accessibility-negative-contrast .wp-block-latest-comments__list-item,
body.open-accessibility-negative-contrast .wp-block-latest-comments__comment-date,
body.open-accessibility-negative-contrast .wp-block-latest-comments__comment-excerpt,
body.open-accessibility-negative-contrast .wp-block-latest-comments__comment-author,
body.open-accessibility-negative-contrast .wp-block-latest-comments__comment-link,
body.open-accessibility-negative-contrast .wp-block-archives__list,
body.open-accessibility-negative-contrast .wp-block-archives__list-item,
body.open-accessibility-negative-contrast .wp-block-categories__list,
body.open-accessibility-negative-contrast .wp-block-categories__list-item,
body.open-accessibility-negative-contrast .wp-block-calendar table,
body.open-accessibility-negative-contrast .wp-block-calendar th,
body.open-accessibility-negative-contrast .wp-block-calendar td,
body.open-accessibility-negative-contrast .wp-block-calendar caption,
body.open-accessibility-negative-contrast .wp-block-calendar tbody,
body.open-accessibility-negative-contrast .wp-block-calendar thead,
body.open-accessibility-negative-contrast .wp-block-rss__list,
body.open-accessibility-negative-contrast .wp-block-rss__list-item,
body.open-accessibility-negative-contrast .wp-block-rss__item-title,
body.open-accessibility-negative-contrast .wp-block-rss__item-publish-date,
body.open-accessibility-negative-contrast .wp-block-rss__item-author,
body.open-accessibility-negative-contrast .wp-block-rss__item-excerpt,
body.open-accessibility-negative-contrast .wp-block-tag-cloud__list,
body.open-accessibility-negative-contrast .wp-block-tag-cloud__list-item,
body.open-accessibility-negative-contrast .wp-block-tag-cloud__tag,
body.open-accessibility-negative-contrast .wp-block-page-list__list,
body.open-accessibility-negative-contrast .wp-block-page-list__list-item,
body.open-accessibility-negative-contrast .wp-block-page-list__page,
body.open-accessibility-negative-contrast .wp-block-navigation-link__label,
body.open-accessibility-negative-contrast .wp-block-navigation-link__description,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon svg,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon path,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon rect,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon circle,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon polygon,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon line,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon polyline,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon ellipse,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon text,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon g,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon *,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:hover,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:focus,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:active,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:visited,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:link,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:before,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon:after,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon::before,
body.open-accessibility-negative-contrast .wp-block-navigation-link__submenu-icon::after {
    background-color: #000 !important;
    color: #00ffff !important;
    border-color: #00ffff !important;
}

/* Bootstrap 5 Background Classes - Negative Contrast Mode */
body.open-accessibility-negative-contrast .bg-primary,
body.open-accessibility-negative-contrast .bg-secondary,
body.open-accessibility-negative-contrast .bg-success,
body.open-accessibility-negative-contrast .bg-danger,
body.open-accessibility-negative-contrast .bg-warning,
body.open-accessibility-negative-contrast .bg-info,
body.open-accessibility-negative-contrast .bg-light,
body.open-accessibility-negative-contrast .bg-dark,
body.open-accessibility-negative-contrast .bg-body,
body.open-accessibility-negative-contrast .bg-body-secondary,
body.open-accessibility-negative-contrast .bg-body-tertiary,
body.open-accessibility-negative-contrast .bg-transparent,
body.open-accessibility-negative-contrast .bg-white,
body.open-accessibility-negative-contrast .bg-black,
body.open-accessibility-negative-contrast .bg-opacity-10,
body.open-accessibility-negative-contrast .bg-opacity-25,
body.open-accessibility-negative-contrast .bg-opacity-50,
body.open-accessibility-negative-contrast .bg-opacity-75,
body.open-accessibility-negative-contrast .bg-opacity-100,
body.open-accessibility-negative-contrast .bg-gradient,
body.open-accessibility-negative-contrast .bg-primary-subtle,
body.open-accessibility-negative-contrast .bg-secondary-subtle,
body.open-accessibility-negative-contrast .bg-success-subtle,
body.open-accessibility-negative-contrast .bg-danger-subtle,
body.open-accessibility-negative-contrast .bg-warning-subtle,
body.open-accessibility-negative-contrast .bg-info-subtle,
body.open-accessibility-negative-contrast .bg-light-subtle,
body.open-accessibility-negative-contrast .bg-dark-subtle {
    background-color: #000 !important;
    color: #00ffff !important;
    border-color: #00ffff !important;
}

/* Bootstrap 5 Text Color Classes - Negative Contrast Mode */
body.open-accessibility-negative-contrast .text-primary,
body.open-accessibility-negative-contrast .text-secondary,
body.open-accessibility-negative-contrast .text-success,
body.open-accessibility-negative-contrast .text-danger,
body.open-accessibility-negative-contrast .text-warning,
body.open-accessibility-negative-contrast .text-info,
body.open-accessibility-negative-contrast .text-light,
body.open-accessibility-negative-contrast .text-dark,
body.open-accessibility-negative-contrast .text-body,
body.open-accessibility-negative-contrast .text-body-emphasis,
body.open-accessibility-negative-contrast .text-body-secondary,
body.open-accessibility-negative-contrast .text-body-tertiary,
body.open-accessibility-negative-contrast .text-black,
body.open-accessibility-negative-contrast .text-white,
body.open-accessibility-negative-contrast .text-opacity-25,
body.open-accessibility-negative-contrast .text-opacity-50,
body.open-accessibility-negative-contrast .text-opacity-75,
body.open-accessibility-negative-contrast .text-opacity-100 {
    color: #00ffff !important;
}

/* Bootstrap 5 Border Classes - Negative Contrast Mode */
body.open-accessibility-negative-contrast .border,
body.open-accessibility-negative-contrast .border-primary,
body.open-accessibility-negative-contrast .border-secondary,
body.open-accessibility-negative-contrast .border-success,
body.open-accessibility-negative-contrast .border-danger,
body.open-accessibility-negative-contrast .border-warning,
body.open-accessibility-negative-contrast .border-info,
body.open-accessibility-negative-contrast .border-light,
body.open-accessibility-negative-contrast .border-dark,
body.open-accessibility-negative-contrast .border-white,
body.open-accessibility-negative-contrast .border-black,
body.open-accessibility-negative-contrast .border-opacity-10,
body.open-accessibility-negative-contrast .border-opacity-25,
body.open-accessibility-negative-contrast .border-opacity-50,
body.open-accessibility-negative-contrast .border-opacity-75,
body.open-accessibility-negative-contrast .border-opacity-100 {
    border-color: #00ffff !important;
}

body.open-accessibility-light-background {
    background-color: #fff !important;
    color: #000 !important;
}

body.open-accessibility-light-background * {
    background-color: #fff !important;
    color: #000 !important;
}

/* Bootstrap 5 Background Classes - Light Background Mode */
body.open-accessibility-light-background .bg-primary,
body.open-accessibility-light-background .bg-secondary,
body.open-accessibility-light-background .bg-success,
body.open-accessibility-light-background .bg-danger,
body.open-accessibility-light-background .bg-warning,
body.open-accessibility-light-background .bg-info,
body.open-accessibility-light-background .bg-light,
body.open-accessibility-light-background .bg-dark,
body.open-accessibility-light-background .bg-body,
body.open-accessibility-light-background .bg-body-secondary,
body.open-accessibility-light-background .bg-body-tertiary,
body.open-accessibility-light-background .bg-transparent,
body.open-accessibility-light-background .bg-white,
body.open-accessibility-light-background .bg-black,
body.open-accessibility-light-background .bg-opacity-10,
body.open-accessibility-light-background .bg-opacity-25,
body.open-accessibility-light-background .bg-opacity-50,
body.open-accessibility-light-background .bg-opacity-75,
body.open-accessibility-light-background .bg-opacity-100,
body.open-accessibility-light-background .bg-gradient,
body.open-accessibility-light-background .bg-primary-subtle,
body.open-accessibility-light-background .bg-secondary-subtle,
body.open-accessibility-light-background .bg-success-subtle,
body.open-accessibility-light-background .bg-danger-subtle,
body.open-accessibility-light-background .bg-warning-subtle,
body.open-accessibility-light-background .bg-info-subtle,
body.open-accessibility-light-background .bg-light-subtle,
body.open-accessibility-light-background .bg-dark-subtle {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

/* Bootstrap 5 Text Color Classes - Light Background Mode */
body.open-accessibility-light-background .text-primary,
body.open-accessibility-light-background .text-secondary,
body.open-accessibility-light-background .text-success,
body.open-accessibility-light-background .text-danger,
body.open-accessibility-light-background .text-warning,
body.open-accessibility-light-background .text-info,
body.open-accessibility-light-background .text-light,
body.open-accessibility-light-background .text-dark,
body.open-accessibility-light-background .text-body,
body.open-accessibility-light-background .text-body-emphasis,
body.open-accessibility-light-background .text-body-secondary,
body.open-accessibility-light-background .text-body-tertiary,
body.open-accessibility-light-background .text-black,
body.open-accessibility-light-background .text-white,
body.open-accessibility-light-background .text-opacity-25,
body.open-accessibility-light-background .text-opacity-50,
body.open-accessibility-light-background .text-opacity-75,
body.open-accessibility-light-background .text-opacity-100 {
    color: #000 !important;
}

/* Bootstrap 5 Border Classes - Light Background Mode */
body.open-accessibility-light-background .border,
body.open-accessibility-light-background .border-primary,
body.open-accessibility-light-background .border-secondary,
body.open-accessibility-light-background .border-success,
body.open-accessibility-light-background .border-danger,
body.open-accessibility-light-background .border-warning,
body.open-accessibility-light-background .border-info,
body.open-accessibility-light-background .border-light,
body.open-accessibility-light-background .border-dark,
body.open-accessibility-light-background .border-white,
body.open-accessibility-light-background .border-black,
body.open-accessibility-light-background .border-opacity-10,
body.open-accessibility-light-background .border-opacity-25,
body.open-accessibility-light-background .border-opacity-50,
body.open-accessibility-light-background .border-opacity-75,
body.open-accessibility-light-background .border-opacity-100 {
    border-color: #000 !important;
}

/* Make accessibility icon black in light background mode */
body.open-accessibility-light-background .open-accessibility-toggle-button .open-accessibility-icon svg {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-light-background .open-accessibility-toggle-button:hover .open-accessibility-icon svg,
body.open-accessibility-light-background .open-accessibility-toggle-button:focus .open-accessibility-icon svg {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Ensure all SVG elements within light background toggle button are black */
body.open-accessibility-light-background .open-accessibility-toggle-button .open-accessibility-icon svg *,
body.open-accessibility-light-background .open-accessibility-toggle-button .open-accessibility-icon svg g,
body.open-accessibility-light-background .open-accessibility-toggle-button .open-accessibility-icon svg path {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-light-background .open-accessibility-toggle-button:hover .open-accessibility-icon svg *,
body.open-accessibility-light-background .open-accessibility-toggle-button:hover .open-accessibility-icon svg g,
body.open-accessibility-light-background .open-accessibility-toggle-button:hover .open-accessibility-icon svg path,
body.open-accessibility-light-background .open-accessibility-toggle-button:focus .open-accessibility-icon svg *,
body.open-accessibility-light-background .open-accessibility-toggle-button:focus .open-accessibility-icon svg g,
body.open-accessibility-light-background .open-accessibility-toggle-button:focus .open-accessibility-icon svg path {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-dark-background {
    background-color: #000 !important;
    color: #fff !important;
}

body.open-accessibility-dark-background * {
    background-color: #000 !important;
    color: #fff !important;
}

/* Bootstrap 5 Background Classes - Dark Background Mode */
body.open-accessibility-dark-background .bg-primary,
body.open-accessibility-dark-background .bg-secondary,
body.open-accessibility-dark-background .bg-success,
body.open-accessibility-dark-background .bg-danger,
body.open-accessibility-dark-background .bg-warning,
body.open-accessibility-dark-background .bg-info,
body.open-accessibility-dark-background .bg-light,
body.open-accessibility-dark-background .bg-dark,
body.open-accessibility-dark-background .bg-body,
body.open-accessibility-dark-background .bg-body-secondary,
body.open-accessibility-dark-background .bg-body-tertiary,
body.open-accessibility-dark-background .bg-transparent,
body.open-accessibility-dark-background .bg-white,
body.open-accessibility-dark-background .bg-black,
body.open-accessibility-dark-background .bg-opacity-10,
body.open-accessibility-dark-background .bg-opacity-25,
body.open-accessibility-dark-background .bg-opacity-50,
body.open-accessibility-dark-background .bg-opacity-75,
body.open-accessibility-dark-background .bg-opacity-100,
body.open-accessibility-dark-background .bg-gradient,
body.open-accessibility-dark-background .bg-primary-subtle,
body.open-accessibility-dark-background .bg-secondary-subtle,
body.open-accessibility-dark-background .bg-success-subtle,
body.open-accessibility-dark-background .bg-danger-subtle,
body.open-accessibility-dark-background .bg-warning-subtle,
body.open-accessibility-dark-background .bg-info-subtle,
body.open-accessibility-dark-background .bg-light-subtle,
body.open-accessibility-dark-background .bg-dark-subtle {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

/* Bootstrap 5 Text Color Classes - Dark Background Mode */
body.open-accessibility-dark-background .text-primary,
body.open-accessibility-dark-background .text-secondary,
body.open-accessibility-dark-background .text-success,
body.open-accessibility-dark-background .text-danger,
body.open-accessibility-dark-background .text-warning,
body.open-accessibility-dark-background .text-info,
body.open-accessibility-dark-background .text-light,
body.open-accessibility-dark-background .text-dark,
body.open-accessibility-dark-background .text-body,
body.open-accessibility-dark-background .text-body-emphasis,
body.open-accessibility-dark-background .text-body-secondary,
body.open-accessibility-dark-background .text-body-tertiary,
body.open-accessibility-dark-background .text-black,
body.open-accessibility-dark-background .text-white,
body.open-accessibility-dark-background .text-opacity-25,
body.open-accessibility-dark-background .text-opacity-50,
body.open-accessibility-dark-background .text-opacity-75,
body.open-accessibility-dark-background .text-opacity-100 {
    color: #fff !important;
}

/* Bootstrap 5 Border Classes - Dark Background Mode */
body.open-accessibility-dark-background .border,
body.open-accessibility-dark-background .border-primary,
body.open-accessibility-dark-background .border-secondary,
body.open-accessibility-dark-background .border-success,
body.open-accessibility-dark-background .border-danger,
body.open-accessibility-dark-background .border-warning,
body.open-accessibility-dark-background .border-info,
body.open-accessibility-dark-background .border-light,
body.open-accessibility-dark-background .border-dark,
body.open-accessibility-dark-background .border-white,
body.open-accessibility-dark-background .border-black,
body.open-accessibility-dark-background .border-opacity-10,
body.open-accessibility-dark-background .border-opacity-25,
body.open-accessibility-dark-background .border-opacity-50,
body.open-accessibility-dark-background .border-opacity-75,
body.open-accessibility-dark-background .border-opacity-100 {
    border-color: #fff !important;
}

/* Additional Bootstrap 5 Component Classes - High Contrast Mode */
body.open-accessibility-high-contrast .alert,
body.open-accessibility-high-contrast .alert-primary,
body.open-accessibility-high-contrast .alert-secondary,
body.open-accessibility-high-contrast .alert-success,
body.open-accessibility-high-contrast .alert-danger,
body.open-accessibility-high-contrast .alert-warning,
body.open-accessibility-high-contrast .alert-info,
body.open-accessibility-high-contrast .alert-light,
body.open-accessibility-high-contrast .alert-dark,
body.open-accessibility-high-contrast .card,
body.open-accessibility-high-contrast .card-header,
body.open-accessibility-high-contrast .card-body,
body.open-accessibility-high-contrast .card-footer,
body.open-accessibility-high-contrast .modal-content,
body.open-accessibility-high-contrast .modal-header,
body.open-accessibility-high-contrast .modal-body,
body.open-accessibility-high-contrast .modal-footer,
body.open-accessibility-high-contrast .dropdown-menu,
body.open-accessibility-high-contrast .navbar,
body.open-accessibility-high-contrast .navbar-brand,
body.open-accessibility-high-contrast .navbar-nav,
body.open-accessibility-high-contrast .nav-link,
body.open-accessibility-high-contrast .nav-tabs,
body.open-accessibility-high-contrast .nav-pills,
body.open-accessibility-high-contrast .tab-content,
body.open-accessibility-high-contrast .tab-pane,
body.open-accessibility-high-contrast .list-group,
body.open-accessibility-high-contrast .list-group-item,
body.open-accessibility-high-contrast .badge,
body.open-accessibility-high-contrast .btn,
body.open-accessibility-high-contrast .form-control,
body.open-accessibility-high-contrast .input-group,
body.open-accessibility-high-contrast .table,
body.open-accessibility-high-contrast .progress,
body.open-accessibility-high-contrast .jumbotron,
body.open-accessibility-high-contrast .toast,
body.open-accessibility-high-contrast .tooltip,
body.open-accessibility-high-contrast .popover {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* Additional Bootstrap 5 Component Classes - Negative Contrast Mode */
body.open-accessibility-negative-contrast .alert,
body.open-accessibility-negative-contrast .alert-primary,
body.open-accessibility-negative-contrast .alert-secondary,
body.open-accessibility-negative-contrast .alert-success,
body.open-accessibility-negative-contrast .alert-danger,
body.open-accessibility-negative-contrast .alert-warning,
body.open-accessibility-negative-contrast .alert-info,
body.open-accessibility-negative-contrast .alert-light,
body.open-accessibility-negative-contrast .alert-dark,
body.open-accessibility-negative-contrast .card,
body.open-accessibility-negative-contrast .card-header,
body.open-accessibility-negative-contrast .card-body,
body.open-accessibility-negative-contrast .card-footer,
body.open-accessibility-negative-contrast .modal-content,
body.open-accessibility-negative-contrast .modal-header,
body.open-accessibility-negative-contrast .modal-body,
body.open-accessibility-negative-contrast .modal-footer,
body.open-accessibility-negative-contrast .dropdown-menu,
body.open-accessibility-negative-contrast .navbar,
body.open-accessibility-negative-contrast .navbar-brand,
body.open-accessibility-negative-contrast .navbar-nav,
body.open-accessibility-negative-contrast .nav-link,
body.open-accessibility-negative-contrast .nav-tabs,
body.open-accessibility-negative-contrast .nav-pills,
body.open-accessibility-negative-contrast .tab-content,
body.open-accessibility-negative-contrast .tab-pane,
body.open-accessibility-negative-contrast .list-group,
body.open-accessibility-negative-contrast .list-group-item,
body.open-accessibility-negative-contrast .badge,
body.open-accessibility-negative-contrast .btn,
body.open-accessibility-negative-contrast .form-control,
body.open-accessibility-negative-contrast .input-group,
body.open-accessibility-negative-contrast .table,
body.open-accessibility-negative-contrast .progress,
body.open-accessibility-negative-contrast .jumbotron,
body.open-accessibility-negative-contrast .toast,
body.open-accessibility-negative-contrast .tooltip,
body.open-accessibility-negative-contrast .popover {
    background-color: #000 !important;
    color: #00ffff !important;
    border-color: #00ffff !important;
}

/* Additional Bootstrap 5 Component Classes - Light Background Mode */
body.open-accessibility-light-background .alert,
body.open-accessibility-light-background .alert-primary,
body.open-accessibility-light-background .alert-secondary,
body.open-accessibility-light-background .alert-success,
body.open-accessibility-light-background .alert-danger,
body.open-accessibility-light-background .alert-warning,
body.open-accessibility-light-background .alert-info,
body.open-accessibility-light-background .alert-light,
body.open-accessibility-light-background .alert-dark,
body.open-accessibility-light-background .card,
body.open-accessibility-light-background .card-header,
body.open-accessibility-light-background .card-body,
body.open-accessibility-light-background .card-footer,
body.open-accessibility-light-background .modal-content,
body.open-accessibility-light-background .modal-header,
body.open-accessibility-light-background .modal-body,
body.open-accessibility-light-background .modal-footer,
body.open-accessibility-light-background .dropdown-menu,
body.open-accessibility-light-background .navbar,
body.open-accessibility-light-background .navbar-brand,
body.open-accessibility-light-background .navbar-nav,
body.open-accessibility-light-background .nav-link,
body.open-accessibility-light-background .nav-tabs,
body.open-accessibility-light-background .nav-pills,
body.open-accessibility-light-background .tab-content,
body.open-accessibility-light-background .tab-pane,
body.open-accessibility-light-background .list-group,
body.open-accessibility-light-background .list-group-item,
body.open-accessibility-light-background .badge,
body.open-accessibility-light-background .btn,
body.open-accessibility-light-background .form-control,
body.open-accessibility-light-background .input-group,
body.open-accessibility-light-background .table,
body.open-accessibility-light-background .progress,
body.open-accessibility-light-background .jumbotron,
body.open-accessibility-light-background .toast,
body.open-accessibility-light-background .tooltip,
body.open-accessibility-light-background .popover {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
}

/* Additional Bootstrap 5 Component Classes - Dark Background Mode */
body.open-accessibility-dark-background .alert,
body.open-accessibility-dark-background .alert-primary,
body.open-accessibility-dark-background .alert-secondary,
body.open-accessibility-dark-background .alert-success,
body.open-accessibility-dark-background .alert-danger,
body.open-accessibility-dark-background .alert-warning,
body.open-accessibility-dark-background .alert-info,
body.open-accessibility-dark-background .alert-light,
body.open-accessibility-dark-background .alert-dark,
body.open-accessibility-dark-background .card,
body.open-accessibility-dark-background .card-header,
body.open-accessibility-dark-background .card-body,
body.open-accessibility-dark-background .card-footer,
body.open-accessibility-dark-background .modal-content,
body.open-accessibility-dark-background .modal-header,
body.open-accessibility-dark-background .modal-body,
body.open-accessibility-dark-background .modal-footer,
body.open-accessibility-dark-background .dropdown-menu,
body.open-accessibility-dark-background .navbar,
body.open-accessibility-dark-background .navbar-brand,
body.open-accessibility-dark-background .navbar-nav,
body.open-accessibility-dark-background .nav-link,
body.open-accessibility-dark-background .nav-tabs,
body.open-accessibility-dark-background .nav-pills,
body.open-accessibility-dark-background .tab-content,
body.open-accessibility-dark-background .tab-pane,
body.open-accessibility-dark-background .list-group,
body.open-accessibility-dark-background .list-group-item,
body.open-accessibility-dark-background .badge,
body.open-accessibility-dark-background .btn,
body.open-accessibility-dark-background .form-control,
body.open-accessibility-dark-background .input-group,
body.open-accessibility-dark-background .table,
body.open-accessibility-dark-background .progress,
body.open-accessibility-dark-background .jumbotron,
body.open-accessibility-dark-background .toast,
body.open-accessibility-dark-background .tooltip,
body.open-accessibility-dark-background .popover {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.open-accessibility-grayscale {
    filter: grayscale(100%);
}

body.open-accessibility-grayscale *:not(.open-accessibility-widget-wrapper *) {
    background-color: transparent !important;
    color: #333 !important;
    border-color: #666 !important;
    -webkit-filter: grayscale(100%) !important;
    filter: grayscale(100%) !important;
}

/* Grayscale effect for the widget elements */
.open-accessibility-toggle-button.widget-grayscale,
.open-accessibility-widget-panel.widget-grayscale {
    filter: grayscale(100%);
}

/* If the SVG icon within the button also needs an explicit filter 
   (often inherited, but can be explicit if issues persist) */
.open-accessibility-toggle-button.widget-grayscale .open-accessibility-icon svg {
    filter: grayscale(100%); 
}

body.open-accessibility-links-underline a {
    text-decoration: underline !important;
}

body.open-accessibility-hide-images img {
    visibility: hidden !important;
}

body.open-accessibility-focus-outline a:focus,
body.open-accessibility-focus-outline button:focus,
body.open-accessibility-focus-outline input:focus,
body.open-accessibility-focus-outline select:focus,
body.open-accessibility-focus-outline textarea:focus,
body.open-accessibility-focus-outline [tabindex]:focus {
    outline: 3px solid #4054b2 !important;
    outline-offset: 3px !important;
}

/* Line Height Levels */
body.open-accessibility-line-height-1,
body.open-accessibility-line-height-1 p,
body.open-accessibility-line-height-1 div,
body.open-accessibility-line-height-1 span,
body.open-accessibility-line-height-1 li {
    line-height: 1.6 !important;
}

body.open-accessibility-line-height-2,
body.open-accessibility-line-height-2 p,
body.open-accessibility-line-height-2 div,
body.open-accessibility-line-height-2 span,
body.open-accessibility-line-height-2 li {
    line-height: 1.8 !important;
}

body.open-accessibility-line-height-3,
body.open-accessibility-line-height-3 p,
body.open-accessibility-line-height-3 div,
body.open-accessibility-line-height-3 span,
body.open-accessibility-line-height-3 li {
    line-height: 2.0 !important;
}

body.open-accessibility-text-align-left,
body.open-accessibility-text-align-left p,
body.open-accessibility-text-align-left div,
body.open-accessibility-text-align-left h1,
body.open-accessibility-text-align-left h2,
body.open-accessibility-text-align-left h3,
body.open-accessibility-text-align-left h4,
body.open-accessibility-text-align-left h5,
body.open-accessibility-text-align-left h6 {
    text-align: left !important;
}

body.open-accessibility-text-align-center,
body.open-accessibility-text-align-center p,
body.open-accessibility-text-align-center div,
body.open-accessibility-text-align-center h1,
body.open-accessibility-text-align-center h2,
body.open-accessibility-text-align-center h3,
body.open-accessibility-text-align-center h4,
body.open-accessibility-text-align-center h5,
body.open-accessibility-text-align-center h6 {
    text-align: center !important;
}

body.open-accessibility-text-align-right,
body.open-accessibility-text-align-right p,
body.open-accessibility-text-align-right div,
body.open-accessibility-text-align-right h1,
body.open-accessibility-text-align-right h2,
body.open-accessibility-text-align-right h3,
body.open-accessibility-text-align-right h4,
body.open-accessibility-text-align-right h5,
body.open-accessibility-text-align-right h6 {
    text-align: right !important;
}

body.open-accessibility-pause-animations *,
body.open-accessibility-pause-animations *::before,
body.open-accessibility-pause-animations *::after {
    animation-play-state: paused !important;
    transition: none !important;
}

/* Reading guide */
.open-accessibility-reading-guide {
    position: fixed;
    background-color: rgba(255, 255, 0, 0.3); /* Slightly more visible yellow */
    height: 30px; /* Standard height */
    width: 100%;
    left: 0; /* Ensure it spans full width */
    pointer-events: none; /* Allow clicks through the guide */
    z-index: 999999; /* Keep high, but lower than widget */
    display: none; /* Hide by default, JS controls show/hide */
    transition: top 0.05s ease-out; /* Add subtle smoothing */
}

/* ==========================================================================
   Shortcode Embed Overrides
   ========================================================================== */

.open-accessibility-shortcode {
    position: relative;
    display: inline-block;
}

.open-accessibility-shortcode .open-accessibility-widget-wrapper {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    z-index: 100;
    filter: none !important;
}

.open-accessibility-shortcode .open-accessibility-widget-panel {
    position: absolute;
    top: auto;
    left: auto;
    right: auto;
    bottom: calc(100% + 15px);
    transform: none;
}

.open-accessibility-shortcode .open-accessibility-widget-wrapper.position-left .open-accessibility-widget-panel,
.open-accessibility-shortcode .open-accessibility-widget-wrapper.position-right .open-accessibility-widget-panel,
.open-accessibility-shortcode .open-accessibility-widget-wrapper.position-bottom-left .open-accessibility-widget-panel,
.open-accessibility-shortcode .open-accessibility-widget-wrapper.position-bottom-right .open-accessibility-widget-panel {
    left: 0;
    right: auto;
    top: auto;
    bottom: calc(100% + 15px);
    transform: none;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .open-accessibility-widget-panel {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        max-width: 100vw;
    }

    .open-accessibility-widget-wrapper.position-left .open-accessibility-widget-panel {
        left: -20px;
        transform: none;
    }
    .open-accessibility-widget-wrapper.position-right .open-accessibility-widget-panel {
        right: -20px;
        transform: none;
    }

    .open-accessibility-shortcode .open-accessibility-widget-wrapper {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
    }

    .open-accessibility-shortcode .open-accessibility-widget-panel {
        position: absolute;
        width: 300px;
        max-height: 80vh;
        height: auto;
    }
}

/* Text size adjustments */
body.open-accessibility-text-size-1 {
    font-size: 110% !important;
}

body.open-accessibility-text-size-2 {
    font-size: 120% !important;
}

body.open-accessibility-text-size-3 {
    font-size: 130% !important;
}

body.open-accessibility-text-size-4 {
    font-size: 140% !important;
}

body.open-accessibility-text-size-5 {
    font-size: 150% !important;
}

/* Isolate widget from body filter effects */
body.open-accessibility-high-contrast .open-accessibility-widget-wrapper,
body.open-accessibility-negative-contrast .open-accessibility-widget-wrapper {
    /* Create a new stacking context */
    isolation: isolate;
    z-index: 9999;
}

/* Special panel handling for contrast modes */
body.open-accessibility-high-contrast .open-accessibility-widget-panel,
body.open-accessibility-negative-contrast .open-accessibility-widget-panel {
    visibility: hidden;
    opacity: 0;
    z-index: 9999;
    background-color: #fff !important;
    color: #333 !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-panel.oa-panel-is-active,
body.open-accessibility-negative-contrast .open-accessibility-widget-panel.oa-panel-is-active {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Make sure widget and panel use proper styling */
body.open-accessibility-high-contrast .open-accessibility-widget-panel h2,
body.open-accessibility-high-contrast .open-accessibility-widget-panel h3,
body.open-accessibility-negative-contrast .open-accessibility-widget-panel h2,
body.open-accessibility-negative-contrast .open-accessibility-widget-panel h3 {
    color: #333 !important;
    background-color: #fff !important;
}

body.open-accessibility-high-contrast .open-accessibility-action-button,
body.open-accessibility-negative-contrast .open-accessibility-action-button {
    background-color: #f0f0f0 !important;
    color: #333 !important;
    border-color: #ddd !important;
}

body.open-accessibility-high-contrast .open-accessibility-action-button.active,
body.open-accessibility-negative-contrast .open-accessibility-action-button.active {
    background-color: #4054b2 !important;
    color: white !important;
    border-color: #4054b2 !important;
}

/* Enhanced high contrast styles for widget panel */
body.open-accessibility-high-contrast .open-accessibility-widget-panel {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8) !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-header {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-bottom: 3px solid #ffffff !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-header h2 {
    color: #ffffff !important;
    background-color: #000000 !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-close {
    color: #ffffff !important;
    background-color: #000000 !important;
    border: 2px solid #ffffff !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-close:hover,
body.open-accessibility-high-contrast .open-accessibility-close:focus {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-content {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-section {
    border-bottom: 2px solid #ffffff !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-section h3 {
    color: #ffffff !important;
    background-color: #000000 !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-action-button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-action-button:hover,
body.open-accessibility-high-contrast .open-accessibility-action-button:focus {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.open-accessibility-high-contrast .open-accessibility-action-button.active {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 3px solid #000000 !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-widget-footer {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-top: 3px solid #ffffff !important;
}

body.open-accessibility-high-contrast .open-accessibility-hide-widget {
    color: #ffffff !important;
    background-color: #000000 !important;
    border: 2px solid #ffffff !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-hide-widget:hover,
body.open-accessibility-high-contrast .open-accessibility-hide-widget:focus {
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.open-accessibility-high-contrast .open-accessibility-reset-button {
    background-color: #ff0000 !important;
    color: #ffffff !important;
    border: 3px solid #ffffff !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-reset-button:hover,
body.open-accessibility-high-contrast .open-accessibility-reset-button:focus {
    background-color: #ffffff !important;
    color: #ff0000 !important;
    border-color: #ff0000 !important;
}

/* Ensure toggle button is visible in high contrast mode */
body.open-accessibility-high-contrast .open-accessibility-toggle-button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 3px solid #000000 !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8) !important;
    font-weight: bold !important;
}

body.open-accessibility-high-contrast .open-accessibility-toggle-button:hover,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:focus {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #000000 !important;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.9) !important;
}

/* Ensure icon is visible in high contrast toggle button */
body.open-accessibility-high-contrast .open-accessibility-toggle-button .open-accessibility-icon svg {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-high-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Ensure all SVG elements within high contrast toggle button are visible */
body.open-accessibility-high-contrast .open-accessibility-toggle-button .open-accessibility-icon svg *,
body.open-accessibility-high-contrast .open-accessibility-toggle-button .open-accessibility-icon svg g,
body.open-accessibility-high-contrast .open-accessibility-toggle-button .open-accessibility-icon svg path {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-high-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg *,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg g,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg path,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg *,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg g,
body.open-accessibility-high-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg path {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Ensure toggle button is visible in negative contrast mode */
body.open-accessibility-negative-contrast .open-accessibility-toggle-button {
    background-color: #00ffff !important;
    color: #000 !important;
    border: 2px solid #00ffff !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5) !important;
}

body.open-accessibility-negative-contrast .open-accessibility-toggle-button:hover,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:focus {
    background-color: #ffffff !important;
    color: #000 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.7) !important;
}

/* Ensure icon is visible in negative contrast toggle button */
body.open-accessibility-negative-contrast .open-accessibility-toggle-button .open-accessibility-icon svg {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-negative-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Ensure all SVG elements within negative contrast toggle button are visible */
body.open-accessibility-negative-contrast .open-accessibility-toggle-button .open-accessibility-icon svg *,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button .open-accessibility-icon svg g,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button .open-accessibility-icon svg path {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

body.open-accessibility-negative-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg *,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg g,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:hover .open-accessibility-icon svg path,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg *,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg g,
body.open-accessibility-negative-contrast .open-accessibility-toggle-button:focus .open-accessibility-icon svg path {
    fill: #000000 !important;
    stroke: #000000 !important;
    color: #000000 !important;
}

/* Enhanced negative contrast styles for widget panel */
body.open-accessibility-negative-contrast .open-accessibility-widget-panel {
    background-color: #000000 !important;
    color: #00ffff !important;
    border: 3px solid #00ffff !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8) !important;
}

body.open-accessibility-negative-contrast .open-accessibility-widget-header {
    background-color: #000000 !important;
    color: #00ffff !important;
    border-bottom: 3px solid #00ffff !important;
}

body.open-accessibility-negative-contrast .open-accessibility-widget-header h2 {
    color: #00ffff !important;
    background-color: #000000 !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-close {
    color: #00ffff !important;
    background-color: #000000 !important;
    border: 2px solid #00ffff !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-close:hover,
body.open-accessibility-negative-contrast .open-accessibility-close:focus {
    background-color: #00ffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.open-accessibility-negative-contrast .open-accessibility-widget-content {
    background-color: #000000 !important;
    color: #00ffff !important;
}

body.open-accessibility-negative-contrast .open-accessibility-widget-section {
    border-bottom: 2px solid #00ffff !important;
}

body.open-accessibility-negative-contrast .open-accessibility-widget-section h3 {
    color: #00ffff !important;
    background-color: #000000 !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-action-button {
    background-color: #000000 !important;
    color: #00ffff !important;
    border: 2px solid #00ffff !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-action-button:hover,
body.open-accessibility-negative-contrast .open-accessibility-action-button:focus {
    background-color: #00ffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

body.open-accessibility-negative-contrast .open-accessibility-action-button.active {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 3px solid #00ffff !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-widget-footer {
    background-color: #000000 !important;
    color: #00ffff !important;
    border-top: 3px solid #00ffff !important;
}

body.open-accessibility-negative-contrast .open-accessibility-hide-widget {
    color: #00ffff !important;
    background-color: #000000 !important;
    border: 2px solid #00ffff !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-hide-widget:hover,
body.open-accessibility-negative-contrast .open-accessibility-hide-widget:focus {
    background-color: #00ffff !important;
    color: #000000 !important;
}

body.open-accessibility-negative-contrast .open-accessibility-reset-button {
    background-color: #ff0000 !important;
    color: #00ffff !important;
    border: 3px solid #00ffff !important;
    font-weight: bold !important;
}

body.open-accessibility-negative-contrast .open-accessibility-reset-button:hover,
body.open-accessibility-negative-contrast .open-accessibility-reset-button:focus {
    background-color: #00ffff !important;
    color: #ff0000 !important;
    border-color: #ff0000 !important;
}

/* Letter Spacing Levels */
body.open-accessibility-letter-spacing-1 {
    letter-spacing: 0.12em;
}
body.open-accessibility-letter-spacing-2 {
    letter-spacing: 0.18em;
}
body.open-accessibility-letter-spacing-3 {
    letter-spacing: 0.24em;
}

/* Word Spacing Levels */
body.open-accessibility-word-spacing-1 {
    word-spacing: 0.16em;
}
body.open-accessibility-word-spacing-2 {
    word-spacing: 0.24em;
}
body.open-accessibility-word-spacing-3 {
    word-spacing: 0.32em;
}

/* Ensure widget itself is not affected by spacing (redundant selector removed) */
.open-accessibility-widget-wrapper * {
    letter-spacing: initial;
    word-spacing: initial;
    line-height: initial;
    /* Also ensure widget font doesn't change */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* ---- Font Loading (@font-face) ---- */

/* Atkinson Hyperlegible */
@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('../fonts/Atkinson-Hyperlegible-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('../fonts/Atkinson-Hyperlegible-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('../fonts/Atkinson-Hyperlegible-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    src: url('../fonts/Atkinson-Hyperlegible-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* OpenDyslexic */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2');
    font-weight: normal; /* Typically 400 */
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Bold.woff2') format('woff2');
    font-weight: bold; /* Typically 700 */
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Bold-Italic.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* ---- Font Application Classes ---- */

body.open-accessibility-font-atkinson,
body.open-accessibility-font-atkinson * {
    font-family: 'Atkinson Hyperlegible', sans-serif !important;
}

body.open-accessibility-font-opendyslexic,
body.open-accessibility-font-opendyslexic * {
    font-family: 'OpenDyslexic', sans-serif !important;
}