/**
 * TYGRYS.NET Accessibility Widget
 */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Main toolbar container - FIXED position on RIGHT, 20% from bottom */
#tygrys-acc-toolbar {
    position: fixed;
    right: 0;
    bottom: 20%;
    z-index: 999999;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Toggle button */
#tygrys-acc-toolbar .tygrys-acc-toggle {
    position: absolute;
    right: 0;
    top: 0;
}

#tygrys-acc-toolbar .tygrys-acc-toggle-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #4054b2;
    color: #fff;
    border-radius: 5px 0 0 5px;
    text-decoration: none;
    transition: background 0.3s;
    box-shadow: -2px 0 10px rgba(0,0,0,0.15);
}

#tygrys-acc-toolbar .tygrys-acc-toggle-link:hover {
    background: #2d3a87;
}

#tygrys-acc-toolbar .tygrys-acc-toggle-link svg {
    width: 28px;
    height: 28px;
}

/* Panel overlay - hidden by default */
#tygrys-acc-toolbar .tygrys-acc-overlay {
    position: absolute;
    right: 50px;
    bottom: 0;
    width: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 5px 0 0 5px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: width 0.3s ease;
}

/* Open state */
#tygrys-acc-toolbar.tygrys-acc-open .tygrys-acc-overlay {
    width: 260px;
}

/* Inner content */
#tygrys-acc-toolbar .tygrys-acc-inner {
    width: 260px;
    padding: 15px;
}

/* Title */
#tygrys-acc-toolbar .tygrys-acc-title {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #4054b2;
}

/* Items list */
#tygrys-acc-toolbar .tygrys-acc-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

#tygrys-acc-toolbar .tygrys-acc-item {
    margin-bottom: 5px;
}

/* Tool links */
#tygrys-acc-toolbar .tygrys-acc-items .tygrys-acc-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

#tygrys-acc-toolbar .tygrys-acc-items .tygrys-acc-link:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

#tygrys-acc-toolbar .tygrys-acc-items .tygrys-acc-link.active {
    background: #4054b2;
    color: #fff;
    border-color: #4054b2;
}

/* Icon */
#tygrys-acc-toolbar .tygrys-acc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#tygrys-acc-toolbar .tygrys-acc-icon svg {
    width: 20px;
    height: 20px;
}

/* Text */
#tygrys-acc-toolbar .tygrys-acc-text {
    font-size: 13px;
}

/* Reset button special style */
#tygrys-acc-toolbar .tygrys-acc-btn-reset {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* ========================================
   Accessibility Body Classes
   ======================================== */

/* Font Resize - body scales, all children forced to inherit */
body.tygrys-resize-font-120 { font-size: 120% !important; }
body.tygrys-resize-font-140 { font-size: 140% !important; }
body.tygrys-resize-font-160 { font-size: 160% !important; }
body.tygrys-resize-font-180 { font-size: 180% !important; }
body.tygrys-resize-font-200 { font-size: 200% !important; }

/* Force all elements to inherit scaled font size - exclude toolbar */
body[class*="tygrys-resize-font"] *:not(#tygrys-acc-toolbar):not(#tygrys-acc-toolbar *) {
    font-size: inherit !important;
}

/* Grayscale */
body.tygrys-grayscale {
    filter: grayscale(100%);
}

/* High contrast - black background, white text */
body.tygrys-high-contrast,
body.tygrys-high-contrast *:not(#tygrys-acc-toolbar):not(#tygrys-acc-toolbar *) {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.tygrys-high-contrast a:not(#tygrys-acc-toolbar a) {
    color: #0080ff !important;
}

body.tygrys-high-contrast a:visited:not(#tygrys-acc-toolbar a) {
    color: #00ffff !important;
}

body.tygrys-high-contrast h1:not(#tygrys-acc-toolbar h1),
body.tygrys-high-contrast h2:not(#tygrys-acc-toolbar h2),
body.tygrys-high-contrast h3:not(#tygrys-acc-toolbar h3),
body.tygrys-high-contrast h4:not(#tygrys-acc-toolbar h4),
body.tygrys-high-contrast h5:not(#tygrys-acc-toolbar h5),
body.tygrys-high-contrast h6:not(#tygrys-acc-toolbar h6) {
    color: #40c090 !important;
}

body.tygrys-high-contrast strong:not(#tygrys-acc-toolbar strong),
body.tygrys-high-contrast b:not(#tygrys-acc-toolbar b) {
    color: #ff0 !important;
}

body.tygrys-high-contrast em:not(#tygrys-acc-toolbar em),
body.tygrys-high-contrast i:not(#tygrys-acc-toolbar i) {
    color: #ffff80 !important;
}

body.tygrys-high-contrast img {
    background: #808080 !important;
}

body.tygrys-high-contrast button:not(#tygrys-acc-toolbar button),
body.tygrys-high-contrast input[type="submit"]:not(#tygrys-acc-toolbar input),
body.tygrys-high-contrast input[type="button"]:not(#tygrys-acc-toolbar input) {
    background: #600040 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}

/* Negative contrast - invert colors like photo negative */
body.tygrys-negative-contrast {
    filter: invert(1) !important;
}

/* Keep images normal (double invert = original) */
body.tygrys-negative-contrast img {
    filter: invert(1) !important;
}

/* Underline links */
body.tygrys-underline-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* Readable font */
body.tygrys-readable-font,
body.tygrys-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.03em;
    word-spacing: 0.1em;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 768px) {
    #tygrys-acc-toolbar {
        top: auto;
        bottom: 80px;
        transform: none;
    }

    #tygrys-acc-toolbar .tygrys-acc-toggle {
        top: auto;
        transform: none;
    }

    #tygrys-acc-toolbar .tygrys-acc-toggle-link {
        width: 44px;
        height: 44px;
    }

    #tygrys-acc-toolbar .tygrys-acc-toggle-link svg {
        width: 24px;
        height: 24px;
    }

    #tygrys-acc-toolbar .tygrys-acc-overlay {
        right: 44px;
        top: auto;
        bottom: 0;
        transform: none;
        max-height: 70vh;
        overflow-y: auto;
    }

    #tygrys-acc-toolbar.tygrys-acc-open .tygrys-acc-overlay {
        width: 240px;
    }

    #tygrys-acc-toolbar .tygrys-acc-inner {
        width: 240px;
    }
}

/* Exclude toolbar from body filters */
#tygrys-acc-toolbar {
    filter: none !important;
}

body.tygrys-grayscale #tygrys-acc-toolbar,
body.tygrys-negative-contrast #tygrys-acc-toolbar,
body.tygrys-high-contrast #tygrys-acc-toolbar {
    filter: none !important;
}

body.tygrys-negative-contrast #tygrys-acc-toolbar * {
    filter: none !important;
}

/* Keep toolbar font size normal when resizing */
#tygrys-acc-toolbar,
#tygrys-acc-toolbar * {
    font-size: 14px !important;
}
#tygrys-acc-toolbar .tygrys-acc-title {
    font-size: 16px !important;
}
#tygrys-acc-toolbar .tygrys-acc-text {
    font-size: 13px !important;
}
