/* Accessibility widget – brand styled */
.accessibility-widget {
    position: fixed;
    right: 16px;
    top: 2rem;
    z-index: 10001;
    font-family: 'Rubik', sans-serif;
}

.accessibility-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #693F23;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 4px #f4d03f;
    color: #A5D6A7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.accessibility-toggle:hover { color: #f1c40f; }

.accessibility-toggle:focus { outline: 2px solid #693F23; outline-offset: 3px; }

@media (max-width: 640px) {
    .accessibility-widget {
        top: 1.15rem;
        right: 10px;
    }
    .accessibility-toggle {
        width: 48px;
        height: 48px;
    }
    .accessibility-menu {
        right: 0;
        left: auto;
        width: min(290px, calc(100vw - 20px));
        max-width: none;
        padding: 16px;
    }
}

@media (max-width: 400px) {
    .accessibility-widget {
        top: 0.85rem;
        right: 8px;
    }
}

.accessibility-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border-top: 5px solid #693F23;
    box-shadow: 0 6px 24px rgba(105, 63, 35, 0.18);
    width: 290px;
    display: none;
}

.accessibility-menu.show { display: block; }

.accessibility-menu h3 {
    color: #693F23;
    margin: 0 0 15px;
    font-size: 1.2rem;
    font-weight: 500;
}

.accessibility-menu h4 {
    color: #333333;
    margin: 10px 0 6px;
    font-size: 0.98rem;
    font-weight: 500;
}

.option-group {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E3F2FD;
}

.option-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.text-size-btn,
.contrast-btn,
.accessibility-btn {
    background: #E3F2FD;
    border: 1px solid #d9e6f2;
    padding: 8px 12px;
    margin: 3px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Rubik', sans-serif;
    color: #333333;
    transition: all 0.25s ease;
}

.text-size-btn:hover,
.contrast-btn:hover,
.accessibility-btn:hover {
    background: #d3e7fa;
}

.text-size-btn:focus,
.contrast-btn:focus,
.accessibility-btn:focus {
    outline: 2px solid #693F23;
    outline-offset: 1px;
}

.text-size-btn.active,
.contrast-btn.active,
.accessibility-btn.active {
    background: #693F23;
    color: #A5D6A7;
    border-color: #693F23;
}

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

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

body.high-contrast a { color: #ffff00 !important; }

body.high-contrast .accessibility-toggle { box-shadow: 0 0 0 3px #ffff00 !important; }

/* Links Highlight */
body.links-highlighted a {
    text-decoration: underline !important;
    color: #693F23 !important;
    font-weight: bold !important;
}

/* No Animations */
body.no-animations *,
body.no-animations *:before,
body.no-animations *:after {
    animation: none !important;
    transition: none !important;
}

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

@media (max-width: 768px) {
    .accessibility-widget { right: 10px; }
}
