/* ══════════════════════════════════════════════════
   SUSHISOM — Accessibility Widget (WCAG 2.1 AA)
   ══════════════════════════════════════════════════ */

/* ── 1. Focus Visible Global (WCAG 2.4.7) ── */
*:focus-visible {
    outline: 3px solid #E31E24 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px rgba(227, 30, 36, 0.25) !important;
}

/* ── 2. Skip-to-Content Link (WCAG 2.4.1) ── */
.a11y-skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 100000;
    padding: 12px 24px;
    background: #E31E24;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s ease;
}

.a11y-skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ── 3. Widget Trigger Button ── */
.a11y-widget-btn {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 99998;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #E31E24;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.a11y-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.a11y-widget-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

/* ── 4. Widget Panel ── */
.a11y-panel {
    position: fixed;
    bottom: 150px;
    right: 20px;
    z-index: 99999;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.a11y-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Panel header */
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.a11y-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
}

.a11y-panel-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.a11y-panel-close:hover {
    color: #fff;
}

/* Panel options */
.a11y-panel-options {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.a11y-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.a11y-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.a11y-option.active {
    background: rgba(227, 30, 36, 0.15);
    border-color: rgba(227, 30, 36, 0.4);
}

.a11y-option-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.a11y-option.active .a11y-option-icon {
    background: #E31E24;
}

.a11y-option-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    line-height: 1.3;
}

.a11y-option-label small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    margin-top: 2px;
}

/* Reset button */
.a11y-reset {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.a11y-reset:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ── 5. Body Modifier Classes ── */

/* Larger text — zoom scales ALL content proportionally */
.a11y-larger-text #wrapper,
.a11y-larger-text #page,
.a11y-larger-text .page-content {
    zoom: 1.25;
}

/* Protect widget from scaling */
.a11y-larger-text .a11y-panel,
.a11y-larger-text .a11y-widget-btn {
    zoom: 0.8;
}


/* High contrast */
.a11y-high-contrast {
    filter: contrast(1.5) !important;
}

.a11y-high-contrast .a11y-panel,
.a11y-high-contrast .a11y-widget-btn {
    filter: contrast(0.67) !important;
    /* Neutralize */
}

/* Grayscale */
.a11y-grayscale {
    filter: grayscale(1) !important;
}

.a11y-grayscale .a11y-panel,
.a11y-grayscale .a11y-widget-btn {
    filter: grayscale(0) !important;
}

/* Combined filters */
.a11y-high-contrast.a11y-grayscale {
    filter: contrast(1.5) grayscale(1) !important;
}

.a11y-high-contrast.a11y-grayscale .a11y-panel,
.a11y-high-contrast.a11y-grayscale .a11y-widget-btn {
    filter: contrast(0.67) grayscale(0) !important;
}

/* Highlight links */
.a11y-highlight-links a {
    outline: 2px solid #E31E24 !important;
    outline-offset: 2px !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

.a11y-highlight-links .a11y-panel a,
.a11y-highlight-links .a11y-widget-btn {
    outline: none !important;
    text-decoration: none !important;
}

/* Readable font */
.a11y-readable-font,
.a11y-readable-font * {
    font-family: Arial, Helvetica, "Segoe UI", sans-serif !important;
    letter-spacing: 0.5px !important;
    word-spacing: 2px !important;
}

.a11y-readable-font .a11y-panel *,
.a11y-readable-font .a11y-widget-btn,
.a11y-readable-font .a11y-option-icon {
    font-family: revert !important;
    letter-spacing: revert !important;
    word-spacing: revert !important;
}

/* Stop animations */
.a11y-stop-animations,
.a11y-stop-animations *,
.a11y-stop-animations *::before,
.a11y-stop-animations *::after {
    animation: none !important;
    transition: none !important;
}

/* Keep widget transitions working */
.a11y-stop-animations .a11y-panel,
.a11y-stop-animations .a11y-panel *,
.a11y-stop-animations .a11y-widget-btn {
    transition: all 0.25s ease !important;
}

/* Large cursor */
.a11y-large-cursor,
.a11y-large-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l28 20H20l8 16-5 2-8-16-7 7z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
}

/* ── 6. Responsive ── */
@media (max-width: 480px) {
    .a11y-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 140px;
    }

    .a11y-widget-btn {
        right: 14px;
        bottom: 80px;
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
}