/* =====================================================================
 * AEGNET Accessibility Stylesheet
 * Implements WCAG 2.1 features required by AMA accessibility directive.
 * Loaded AFTER main.css so it acts as a non-destructive override layer.
 * All selectors are namespaced under body classes (.a11y-*) or .a11y-* widgets
 * so the default site appearance is unchanged unless a user opts in.
 * ===================================================================== */

/* ---------- Skip to content link (WCAG 2.4.1) ---------- */
.a11y-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    background: #000;
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 6px 0;
}
.a11y-skip-link:focus,
.a11y-skip-link:active {
    left: 0;
    color: #fff;
    outline: 3px solid #ffd400;
    outline-offset: 2px;
}

/* ---------- Visible focus indicator (WCAG 2.4.7) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ffd400 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #000 !important;
}

/* ---------- Screen-reader only utility ---------- */
.a11y-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================================
 *  Accessibility Toolbar (widget itself)
 * ===================================================================== */
.a11y-toggle-btn {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 99998;
    background: #c52d2f;
    color: #fff;
    border: 2px solid #fff;
    border-right: none;
    border-radius: 8px 0 0 8px;
    width: 48px;
    height: 48px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.25);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.a11y-toggle-btn:hover,
.a11y-toggle-btn:focus {
    background: #000;
    color: #fff;
}

.a11y-panel {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    color: #1a1a1a;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    transition: right 250ms ease;
    overflow-y: auto;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.a11y-panel.is-open {
    right: 0;
}
.a11y-panel * {
    box-sizing: border-box;
}
.a11y-panel-header {
    background: #c52d2f;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.a11y-panel-header h2 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    font-weight: 700;
}
.a11y-panel-close {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.a11y-panel-close:hover,
.a11y-panel-close:focus {
    background: #fff;
    color: #c52d2f;
}

.a11y-panel-body {
    padding: 12px 16px 24px;
}

.a11y-section {
    margin: 0 0 18px;
}
.a11y-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

.a11y-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.a11y-btn {
    flex: 1 1 auto;
    min-width: 70px;
    background: #f4f4f4;
    color: #1a1a1a;
    border: 2px solid #bbb;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
}
.a11y-btn:hover {
    background: #e9e9e9;
}
.a11y-btn:focus {
    outline: 3px solid #ffd400;
    outline-offset: 2px;
}
.a11y-btn.is-active {
    background: #c52d2f;
    color: #fff;
    border-color: #c52d2f;
}

.a11y-reset {
    width: 100%;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}
.a11y-reset:hover,
.a11y-reset:focus {
    background: #333;
}

.a11y-help {
    font-size: 12px;
    color: #555;
    margin: 0 0 6px;
}
.a11y-help a {
    color: #c52d2f;
}

/* Hidden until JS boots — prevents flash */
.a11y-panel[hidden] {
    display: none;
}

/* =====================================================================
 *  USER PREFERENCE MODES (activated by body class)
 * ===================================================================== */

/* ---------- Text size scaling ---------- */
body.a11y-text-1 { font-size: 17px !important; }
body.a11y-text-2 { font-size: 19px !important; }
body.a11y-text-3 { font-size: 22px !important; }

body.a11y-text-1 h1, body.a11y-text-2 h1, body.a11y-text-3 h1 { font-size: 1.6em !important; line-height: 1.2 !important; }
body.a11y-text-1 h2, body.a11y-text-2 h2, body.a11y-text-3 h2 { font-size: 1.35em !important; line-height: 1.25 !important; }
body.a11y-text-1 h3, body.a11y-text-2 h3, body.a11y-text-3 h3 { font-size: 1.2em !important; line-height: 1.3 !important; }
body.a11y-text-1 p,
body.a11y-text-2 p,
body.a11y-text-3 p,
body.a11y-text-1 li,
body.a11y-text-2 li,
body.a11y-text-3 li {
    line-height: 1.6 !important;
}

/* ---------- High-contrast mode (black background, yellow text) ---------- */
body.a11y-contrast-high,
body.a11y-contrast-high header,
body.a11y-contrast-high section,
body.a11y-contrast-high footer,
body.a11y-contrast-high nav,
body.a11y-contrast-high div,
body.a11y-contrast-high article,
body.a11y-contrast-high aside,
body.a11y-contrast-high main {
    background: #000 !important;
    background-image: none !important;
    color: #ffeb3b !important;
}
body.a11y-contrast-high h1,
body.a11y-contrast-high h2,
body.a11y-contrast-high h3,
body.a11y-contrast-high h4,
body.a11y-contrast-high h5,
body.a11y-contrast-high h6,
body.a11y-contrast-high p,
body.a11y-contrast-high li,
body.a11y-contrast-high span,
body.a11y-contrast-high address,
body.a11y-contrast-high label {
    color: #ffeb3b !important;
    background: transparent !important;
}
body.a11y-contrast-high a,
body.a11y-contrast-high a:visited {
    color: #00e5ff !important;
    text-decoration: underline !important;
}
body.a11y-contrast-high a:hover,
body.a11y-contrast-high a:focus {
    color: #fff !important;
    background: #c52d2f !important;
}
body.a11y-contrast-high .btn,
body.a11y-contrast-high button,
body.a11y-contrast-high input,
body.a11y-contrast-high select,
body.a11y-contrast-high textarea {
    background: #000 !important;
    color: #ffeb3b !important;
    border: 2px solid #ffeb3b !important;
}
body.a11y-contrast-high img:not(.a11y-keep-image) {
    filter: grayscale(100%) contrast(1.2);
}
body.a11y-contrast-high .a11y-panel,
body.a11y-contrast-high .a11y-panel * {
    background: #000 !important;
    color: #ffeb3b !important;
}
body.a11y-contrast-high .a11y-panel-header {
    background: #c52d2f !important;
    color: #fff !important;
}
body.a11y-contrast-high .a11y-btn.is-active {
    background: #ffeb3b !important;
    color: #000 !important;
    border-color: #ffeb3b !important;
}

/* ---------- Inverted (light-on-dark, photo-friendly) ---------- */
body.a11y-contrast-invert {
    background: #1a1a1a !important;
    color: #f5f5f5 !important;
}
body.a11y-contrast-invert section,
body.a11y-contrast-invert header,
body.a11y-contrast-invert footer {
    background: #1a1a1a !important;
    color: #f5f5f5 !important;
}
body.a11y-contrast-invert h1,
body.a11y-contrast-invert h2,
body.a11y-contrast-invert h3,
body.a11y-contrast-invert h4,
body.a11y-contrast-invert h5,
body.a11y-contrast-invert h6,
body.a11y-contrast-invert p,
body.a11y-contrast-invert li {
    color: #f5f5f5 !important;
}
body.a11y-contrast-invert a {
    color: #ff7a7c !important;
}

/* ---------- Readable / dyslexia-friendly font ---------- */
body.a11y-font-readable,
body.a11y-font-readable h1,
body.a11y-font-readable h2,
body.a11y-font-readable h3,
body.a11y-font-readable h4,
body.a11y-font-readable h5,
body.a11y-font-readable h6,
body.a11y-font-readable p,
body.a11y-font-readable li,
body.a11y-font-readable a,
body.a11y-font-readable button,
body.a11y-font-readable input,
body.a11y-font-readable textarea,
body.a11y-font-readable span {
    font-family: Verdana, Tahoma, Arial, sans-serif !important;
    letter-spacing: 0.03em !important;
    word-spacing: 0.06em !important;
}

/* ---------- Highlight links ---------- */
body.a11y-links-highlight a {
    text-decoration: underline !important;
    background: #fff59d !important;
    color: #000 !important;
    padding: 1px 3px;
    border-radius: 2px;
}

/* ---------- Stop animations (WCAG 2.3.3, 2.2.2) ---------- */
body.a11y-no-motion *,
body.a11y-no-motion *::before,
body.a11y-no-motion *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
}
body.a11y-no-motion .carousel-inner .item {
    transition: none !important;
}

/* ---------- Reading guide (horizontal bar that follows cursor) ---------- */
.a11y-reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 36px;
    background: rgba(255, 235, 59, 0.35);
    border-top: 2px solid #c52d2f;
    border-bottom: 2px solid #c52d2f;
    z-index: 99997;
    pointer-events: none;
    display: none;
}
body.a11y-reading-guide-on .a11y-reading-guide {
    display: block;
}

/* ---------- Honor system-level reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Accessibility statement page ---------- */
.a11y-statement {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px;
}
.a11y-statement h1 {
    color: #c52d2f;
    margin-bottom: 18px;
}
.a11y-statement h2 {
    margin-top: 28px;
    color: #1a1a1a;
}
.a11y-statement p,
.a11y-statement li {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}
.a11y-statement ul {
    padding-left: 22px;
}
.a11y-statement .a11y-contact-box {
    background: #f7f7f7;
    border-left: 4px solid #c52d2f;
    padding: 14px 18px;
    margin: 18px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .a11y-panel {
        width: 100vw;
        max-width: 100vw;
    }
    .a11y-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}
