/* Accessibility panel and the html.a11y-* feature rules, copied from apexweb2's static/css/portal-widgets.css
   (the panel markup and script are in Utils/PageBuilder.py build_widgets). */
.a11y-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 10060;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.a11y-panel-backdrop.open { opacity: 1; visibility: visible; }

.a11y-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-surface, #fff);
    z-index: 10061;
    box-shadow: -4px 0 20px rgba(0,0,0,0.18);
    transition: right .3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.a11y-panel.open { right: 0; }

.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--color-primary, #1e3a5f);
    color: var(--color-text-inverse, #fff);
}
.a11y-panel-close {
    background: none;
    border: none;
    color: var(--color-text-inverse, #fff);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.a11y-panel-close:hover { opacity: 0.8; }

.a11y-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1rem;
}

.a11y-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.6rem;
}

.a11y-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.25rem;
    border: 2px solid var(--color-border, #dee2e6);
    border-radius: var(--radius-md, 8px);
    background: var(--color-surface, #fff);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text, #40474F);
    text-align: center;
    transition: border-color .15s, background .15s, color .15s;
    line-height: 1.2;
    font-family: inherit;
    min-width: 0;
    word-break: break-word;
}
.a11y-btn:hover {
    border-color: var(--color-primary, #1e3a5f);
    color: var(--color-primary, #1e3a5f);
}
.a11y-btn:focus-visible {
    outline: 3px solid var(--color-primary, #1e3a5f);
    outline-offset: 2px;
}
.a11y-btn[aria-pressed="true"] {
    background: var(--color-primary, #1e3a5f);
    border-color: var(--color-primary, #1e3a5f);
    color: var(--color-text-inverse, #fff);
}
.a11y-btn .a11y-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.a11y-panel-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--color-divider, #dee2e6);
    text-align: center;
}
.a11y-reset-btn {
    background: none;
    border: 1px solid var(--color-danger, #dc3545);
    color: var(--color-danger, #dc3545);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1.5rem;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.a11y-reset-btn:hover {
    background: var(--color-danger, #dc3545);
    color: #fff;
}

/* Accessibility Feature Styles */
html.a11y-bigger-text-1 body { font-size: 110% !important; }
html.a11y-bigger-text-2 body { font-size: 125% !important; }

html.a11y-text-spacing body {
    letter-spacing: 0.08em !important;
    word-spacing: 0.16em !important;
}

html.a11y-line-height body { line-height: 2 !important; }
html.a11y-line-height p,
html.a11y-line-height li,
html.a11y-line-height td,
html.a11y-line-height th,
html.a11y-line-height span,
html.a11y-line-height label,
html.a11y-line-height input,
html.a11y-line-height textarea { line-height: 2 !important; }

html.a11y-highlight-links a:not(.sidebar a):not(.nav-link):not(.nav-parent):not([class*="btn"]):not(.fab-sub):not(#fab-main) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    background-color: rgba(255, 255, 0, 0.2) !important;
    padding: 0 2px !important;
    border-radius: 2px !important;
}
html.a11y-highlight-links .sidebar a,
html.a11y-highlight-links a[class*="btn"] {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

html.a11y-pause-anim *,
html.a11y-pause-anim *::before,
html.a11y-pause-anim *::after {
    animation-play-state: paused !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
}

html.a11y-hide-images img:not(.a11y-keep),
html.a11y-hide-images svg:not(.a11y-keep),
html.a11y-hide-images [role="img"]:not(.a11y-keep),
html.a11y-hide-images picture { visibility: hidden !important; }

@font-face {
    font-family: "OpenDyslexic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/opendyslexic-400.woff2") format("woff2");
}
@font-face {
    font-family: "OpenDyslexic";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/opendyslexic-700.woff2") format("woff2");
}
@font-face {
    font-family: "OpenDyslexic";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/opendyslexic-400italic.woff2") format("woff2");
}
@font-face {
    font-family: "OpenDyslexic";
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/opendyslexic-700italic.woff2") format("woff2");
}
html.a11y-dyslexia,
html.a11y-dyslexia *:not(.material-icons):not(.material-icons-outlined):not(.material-symbols-outlined):not([class*="fa-"]):not(i) {
    font-family: "OpenDyslexic", "Lexie Readable", "Comic Sans MS", sans-serif !important;
}

html.a11y-large-cursor,
html.a11y-large-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 2 L5 26 L11 20 L17 28 L21 26 L15 18 L23 18 Z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 5 2, auto !important;
}
html.a11y-large-cursor a,
html.a11y-large-cursor button,
html.a11y-large-cursor [role="button"],
html.a11y-large-cursor input[type="submit"],
html.a11y-large-cursor input[type="button"],
html.a11y-large-cursor select,
html.a11y-large-cursor label {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M14 2 C14 2 14 14 14 14 L10 14 C10 14 10 18 14 18 L14 18 C14 18 14 20 14 20 L9 20 C9 20 9 24 13 24 L14 24 L14 26 L8 26 C8 26 8 30 12 30 L22 30 C26 30 28 28 28 24 L28 16 C28 14 26 12 24 12 L20 12 L20 2 C20 0 14 0 14 2Z' fill='black' stroke='white' stroke-width='1.2'/%3E%3C/svg%3E") 16 2, pointer !important;
}

/* Dotted-underline affordance stays on the element. The tooltip itself is a
   single body-level element (#a11y-js-tooltip) positioned with JS, so it can
   never be clipped by an ancestor's overflow and its text is not truncated.
   [data-a11y-title] is the temporary stash while the native title is
   suppressed during hover/focus, so the underline doesn't flicker. */
html.a11y-tooltips [title]:not([title=""]),
html.a11y-tooltips [data-a11y-title] {
    text-decoration: underline dotted !important;
}
#a11y-js-tooltip {
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    background: #191919;
    color: #fff;
    padding: 0.35rem 0.65rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: min(320px, 90vw);
    z-index: 2147483600;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
