/* ============================================================
   Accessibility Menu Widget — Styles
   ============================================================ */

/* ---- Floating Action Button ---- */
#a11y-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid #f0c300;
    background: #171717;
    color: #f0c300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    transition: background 0.2s, transform 0.2s;
}

#a11y-fab:hover,
#a11y-fab:focus-visible {
    background: #262626;
    transform: scale(1.08);
}

#a11y-fab.a11y-fab-active {
    background: #f0c300;
    color: #000;
}

.a11y-fab-icon {
    width: 1.375rem;
    height: 1.375rem;
}

/* ---- Panel ---- */
#a11y-panel {
    position: fixed;
    bottom: 5rem;
    right: 1.25rem;
    z-index: 9999;
    width: 17rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    font-family: 'IBM Plex Mono', monospace;
    color: #e5e5e5;
    transition: opacity 0.15s, transform 0.15s;
}

#a11y-panel.a11y-panel-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.5rem);
}

/* ---- Panel header ---- */
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
}

.a11y-panel-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f0c300;
}

.a11y-panel-header button {
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    padding: 0.125rem;
    line-height: 0;
}

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

/* ---- Panel body ---- */
.a11y-panel-body {
    padding: 0.75rem 1rem;
}

/* ---- Control row ---- */
.a11y-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #262626;
}

.a11y-control:last-of-type {
    border-bottom: none;
}

.a11y-label {
    font-size: 0.75rem;
    color: #d4d4d4;
}

/* ---- Font size buttons ---- */
.a11y-font-btns {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.a11y-btn-sm {
    background: #262626;
    border: 1px solid #404040;
    color: #e5e5e5;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}

.a11y-btn-sm:hover {
    background: #333;
}

.a11y-font-val {
    font-size: 0.6875rem;
    color: #a3a3a3;
    min-width: 2.5rem;
    text-align: center;
}

/* ---- Toggle switch ---- */
.a11y-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
}

.a11y-toggle-track {
    display: block;
    width: 2.25rem;
    height: 1.25rem;
    background: #404040;
    border-radius: 0.625rem;
    position: relative;
    transition: background 0.2s;
    pointer-events: none;
}

.a11y-toggle-on .a11y-toggle-track {
    background: #f0c300;
}

.a11y-toggle-thumb {
    display: block;
    width: 0.9rem;
    height: 0.9rem;
    background: #e5e5e5;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 0.175rem;
    transform: translateY(-50%);
    transition: left 0.2s;
}

.a11y-toggle-on .a11y-toggle-thumb {
    left: calc(100% - 0.175rem - 0.9rem);
    background: #000;
}

/* ---- Reset button ---- */
.a11y-reset-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #262626;
    border: 1px solid #404040;
    border-radius: 0.25rem;
    color: #a3a3a3;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.a11y-reset-btn:hover {
    background: #333;
    color: #e5e5e5;
}

/* ============================================================
   Applied accessibility styles (toggled via classes on <html>)
   ============================================================ */

/* High contrast */
.a11y-high-contrast body {
    background: #000 !important;
    color: #fff !important;
}

.a11y-high-contrast .card,
.a11y-high-contrast .bg-neutral-900,
.a11y-high-contrast [class*="bg-neutral-"] {
    background: #000 !important;
    border-color: #fff !important;
}

.a11y-high-contrast .text-neutral-400,
.a11y-high-contrast .text-neutral-500,
.a11y-high-contrast .text-neutral-600 {
    color: #e5e5e5 !important;
}

.a11y-high-contrast a {
    color: #f0c300 !important;
}

/* Readable font — switch to system sans-serif */
.a11y-readable-font body,
.a11y-readable-font p,
.a11y-readable-font span,
.a11y-readable-font li,
.a11y-readable-font td,
.a11y-readable-font th,
.a11y-readable-font input,
.a11y-readable-font select,
.a11y-readable-font textarea,
.a11y-readable-font .a11y-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Increased line spacing */
.a11y-line-spacing body {
    line-height: 2 !important;
}

.a11y-line-spacing p,
.a11y-line-spacing li,
.a11y-line-spacing td,
.a11y-line-spacing th {
    line-height: 2 !important;
    letter-spacing: 0.02em;
    word-spacing: 0.1em;
}

/* Highlight links */
.a11y-highlight-links a:not(#a11y-panel a):not(#a11y-fab) {
    outline: 2px solid #f0c300 !important;
    outline-offset: 2px;
    text-decoration: underline !important;
}

/* Reduced motion */
.a11y-reduced-motion *,
.a11y-reduced-motion *::before,
.a11y-reduced-motion *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}

/* Keep the widget's own transitions working even in reduced-motion mode */
.a11y-reduced-motion #a11y-panel,
.a11y-reduced-motion #a11y-fab,
.a11y-reduced-motion .a11y-toggle-track,
.a11y-reduced-motion .a11y-toggle-thumb {
    transition-duration: 0.15s !important;
}
