/**
 * RUTS Accessibility Styles
 * รองรับเกณฑ์ ITA และ W3C WCAG 2.1
 */

/* Floating Accessibility Button */
.ruts-a11y-trigger {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #00154b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 21, 75, 0.3);
    z-index: 999998;
    border: 2px solid #fff;
    transition: all 0.3s ease;
    font-size: 22px;
}

.ruts-a11y-trigger:hover {
    transform: scale(1.1);
    background: #003d99;
}

/* Accessibility Toolbar Panel */
.ruts-a11y-panel {
    position: fixed;
    bottom: 145px;
    right: 20px;
    width: 290px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    padding: 20px;
    display: none;
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", sans-serif;
    animation: rutsFadeInUp 0.3s ease forwards;
}

.ruts-a11y-panel.active {
    display: block;
}

@keyframes rutsFadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ruts-a11y-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.ruts-a11y-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #00154b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ruts-a11y-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    line-height: 1;
}

.ruts-a11y-section {
    margin-bottom: 15px;
}

.ruts-a11y-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.ruts-a11y-btn-group {
    display: flex;
    gap: 6px;
}

.ruts-a11y-btn {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #cbd5e0;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: #2d3748;
}

.ruts-a11y-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}

.ruts-a11y-btn.active {
    background: #00154b;
    color: #fff;
    border-color: #00154b;
}

.ruts-a11y-reset {
    width: 100%;
    padding: 10px;
    border: none;
    background: #edf2f7;
    color: #4a5568;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.ruts-a11y-reset:hover {
    background: #e2e8f0;
    color: #1a202c;
}

/* ============================================
   A11Y Modifier Classes on Root (html / body)
   ============================================ */

/* Font Sizing */
html.ruts-font-sm {
    font-size: 90% !important;
}

html.ruts-font-lg {
    font-size: 115% !important;
}

html.ruts-font-xl {
    font-size: 130% !important;
}

/* Grayscale Mode */
html.ruts-grayscale {
    filter: grayscale(100%) !important;
    -webkit-filter: grayscale(100%) !important;
}

/* High Contrast: Black & White */
html.ruts-high-contrast body,
html.ruts-high-contrast #page,
html.ruts-high-contrast .site {
    background: #000000 !important;
    color: #ffffff !important;
}

html.ruts-high-contrast a,
html.ruts-high-contrast h1,
html.ruts-high-contrast h2,
html.ruts-high-contrast h3,
html.ruts-high-contrast h4,
html.ruts-high-contrast h5,
html.ruts-high-contrast h6,
html.ruts-high-contrast p,
html.ruts-high-contrast span,
html.ruts-high-contrast li {
    color: #ffffff !important;
}

html.ruts-high-contrast .card,
html.ruts-high-contrast .custom-card,
html.ruts-high-contrast header,
html.ruts-high-contrast footer,
html.ruts-high-contrast nav {
    background: #111111 !important;
    border-color: #ffffff !important;
}

/* High Contrast: Dark Yellow (Yellow on Black) */
html.ruts-yellow-contrast body,
html.ruts-yellow-contrast #page,
html.ruts-yellow-contrast .site {
    background: #000000 !important;
    color: #ffeb3b !important;
}

html.ruts-yellow-contrast a,
html.ruts-yellow-contrast h1,
html.ruts-yellow-contrast h2,
html.ruts-yellow-contrast h3,
html.ruts-yellow-contrast h4,
html.ruts-yellow-contrast h5,
html.ruts-yellow-contrast h6,
html.ruts-yellow-contrast p,
html.ruts-yellow-contrast span,
html.ruts-yellow-contrast li {
    color: #ffeb3b !important;
}

html.ruts-yellow-contrast .card,
html.ruts-yellow-contrast .custom-card,
html.ruts-yellow-contrast header,
html.ruts-yellow-contrast footer,
html.ruts-yellow-contrast nav {
    background: #111111 !important;
    border: 1px solid #ffeb3b !important;
}
