/* ============================================
   ACCESSIBILITY STYLE SWITCHER CSS
   Contrast modes, font sizes, simple language
   ============================================ */

/* --- SWITCHER PANEL (fixed bottom-right) --- */
.a11y-panel {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 9000;
    font-family: 'Space Grotesk', sans-serif;
}

.a11y-panel__toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bk-green-dark);
    color: var(--bk-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.a11y-panel__toggle:hover {
    background: var(--bk-green-dark-hover);
    transform: scale(1.05);
}

.a11y-panel__toggle:focus-visible {
    outline: 3px solid var(--bk-green-light);
    outline-offset: 3px;
}

/* Default: options hidden. Only visible when .is-open on parent */
.a11y-panel__options {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: var(--bk-white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    min-width: 240px;
    display: none;
    flex-direction: column;
    gap: 1rem;
}

/* Show options only when panel is toggled open */
.a11y-panel.is-open .a11y-panel__options {
    display: flex;
}

.a11y-panel__group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.a11y-panel__label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bk-brown);
}

.a11y-panel__buttons {
    display: flex;
    gap: 0.375rem;
}

.a11y-panel__buttons button {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1.5px solid rgba(88, 79, 72, 0.55);
    border-radius: 6px;
    background: transparent;
    color: var(--bk-brown);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.a11y-panel__buttons button:hover {
    border-color: var(--bk-green-dark);
    color: var(--bk-green-dark);
}

.a11y-panel__buttons button.is-active {
    background: var(--bk-green-dark);
    color: var(--bk-white);
    border-color: var(--bk-green-dark);
}

.a11y-panel__buttons button:focus-visible {
    outline: 2px solid var(--bk-green-dark);
    outline-offset: 2px;
}

.a11y-panel__lang-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1.5px solid rgba(88, 79, 72, 0.55);
    border-radius: 6px;
    background: transparent;
    color: var(--bk-brown);
    cursor: pointer;
    transition: all 0.15s ease;
}

.a11y-panel__lang-btn:hover {
    border-color: var(--bk-green-dark);
    color: var(--bk-green-dark);
}

.a11y-panel__lang-btn.is-active {
    background: var(--bk-green-dark);
    color: var(--bk-white);
    border-color: var(--bk-green-dark);
}

/* --- HIGH CONTRAST MODE --- */
html.a11y-high-contrast {
    --bk-text: #000000;
    --bk-brown: #1A1A1A;
    --bk-warm-gray: #F0F0F0;
    --bk-cream: #E8E8E8;
}

html.a11y-high-contrast body {
    color: #000000;
}

html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4 {
    color: #000000;
}

html.a11y-high-contrast .btn--primary {
    background: #000000;
    border-color: #000000;
}

html.a11y-high-contrast .site-nav__link {
    color: #000000;
}

html.a11y-high-contrast a {
    text-decoration: underline;
}

html.a11y-high-contrast .hero__content-box {
    background: rgba(0, 0, 0, 0.8);
}

html.a11y-high-contrast .hero__overlay {
    background: rgba(0, 0, 0, 0.65);
}

/* --- DARK MODE --- */
html.a11y-dark {
    --bk-white: #1A1714;
    --bk-warm-gray: #242019;
    --bk-cream: #2A2522;
    --bk-text: #E8E4DE;
    --bk-brown: #D4C9BC;
    --bk-brown-dark: #0F0D0B;
}

html.a11y-dark body {
    background: #1A1714;
    color: #E8E4DE;
}

html.a11y-dark h1,
html.a11y-dark h2,
html.a11y-dark h3,
html.a11y-dark h4 {
    color: #E8E4DE;
}

html.a11y-dark .site-header {
    background: rgba(26, 23, 20, 0.97);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

html.a11y-dark .site-nav__link {
    color: #E8E4DE;
}

html.a11y-dark .site-header__logo img {
    filter: brightness(1.3);
}

html.a11y-dark .contact-form,
html.a11y-dark .param-card {
    background: #242019;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

html.a11y-dark .form-field input,
html.a11y-dark .form-field textarea {
    background: #2A2522;
    color: #E8E4DE;
    border-color: rgba(255, 255, 255, 0.1);
}

html.a11y-dark .form-field input:focus,
html.a11y-dark .form-field textarea:focus {
    background: #1A1714;
    border-color: #3A8037;
}

html.a11y-dark .products__card,
html.a11y-dark .app-detail-card,
html.a11y-dark .partner-detail-card {
    background: #242019;
}

html.a11y-dark .a11y-panel__options {
    background: #2A2522;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html.a11y-dark .a11y-panel__buttons button {
    color: #E8E4DE;
    border-color: rgba(255, 255, 255, 0.15);
}

html.a11y-dark .a11y-panel__lang-btn {
    color: #E8E4DE;
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- FONT SIZE MODES --- */
html.a11y-font-small {
    font-size: 14px;
}

html.a11y-font-large {
    font-size: 20px;
}

/* --- SIMPLE LANGUAGE --- */
html.a11y-simple-lang [data-simple] {
    /* Visual indicator that simple language is active */
}

/* --- DARK MODE: Process + Footer keep their original light text --- */
html.a11y-dark .process__header h2,
html.a11y-dark .process__header p,
html.a11y-dark .process__stat-value,
html.a11y-dark .process__stat-label,
html.a11y-dark .process__photo-caption,
html.a11y-dark .data-card__value,
html.a11y-dark .data-card__label,
html.a11y-dark .data-card__desc {
    color: inherit;
}

html.a11y-dark .process {
    background-color: #1A1714;
}

html.a11y-dark .process__header h2 {
    color: #E8E4DE;
}

html.a11y-dark .process__header p {
    color: rgba(232, 228, 222, 0.75);
}

/* Stats-V2 (green bg) stays green in dark mode — text stays white */
html.a11y-dark .stats-v2__value,
html.a11y-dark .stats-v2__label,
html.a11y-dark .stats-v2__sub {
    color: inherit;
}

/* --- DARK MODE: additional contrast fixes (WCAG AA) --- */

/* Dark mode: muted text needs sufficient contrast on dark backgrounds */
html.a11y-dark .hero__sub,
html.a11y-dark .products__card-sub,
html.a11y-dark .products__card-spec,
html.a11y-dark .applications__card-body p,
html.a11y-dark .param-card p,
html.a11y-dark .form-field__hint,
html.a11y-dark .form-consent,
html.a11y-dark .legal-notice,
html.a11y-dark .contact-info__hint {
    color: rgba(232, 228, 222, 0.75);
}

/* Dark mode: eyebrow labels */
html.a11y-dark .eyebrow {
    color: #8BC34A;
}

/* Dark mode: links in text */
html.a11y-dark a:not(.btn):not(.site-nav__link):not(.nav-overlay__link):not(.site-footer__nav a) {
    color: #8BC34A;
}

/* Dark mode: form field borders visible (includes select) */
html.a11y-dark .form-field input,
html.a11y-dark .form-field textarea,
html.a11y-dark .form-field select {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Dark mode: hero content box */
html.a11y-dark .hero__content-box {
    background: rgba(26, 23, 20, 0.92);
    color: #E8E4DE;
}

html.a11y-dark .hero__headline {
    color: #E8E4DE;
}

/* Dark mode: cards need visible borders */
html.a11y-dark .products__card,
html.a11y-dark .app-detail-card,
html.a11y-dark .partner-detail-card,
html.a11y-dark .param-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Dark mode: CTA statement */
html.a11y-dark .cta-statement {
    background-color: #1A3D1A;
}

/* Dark mode: back-to-top button */
html.a11y-dark .back-to-top {
    background: #3A8037;
    color: #FFFFFF;
}

/* Dark mode: placeholder text */
html.a11y-dark .form-field input::placeholder,
html.a11y-dark .form-field textarea::placeholder {
    color: rgba(232, 228, 222, 0.45);
}

/* Dark mode: a11y panel label */
html.a11y-dark .a11y-panel__label {
    color: rgba(232, 228, 222, 0.75);
}

/* Dark mode: stats on green bg stay readable */
html.a11y-dark .stats {
    background-color: #1A3D1A;
}

/* Dark mode: photo band */
html.a11y-dark .photo-band {
    background-color: #0F0D0B;
}

/* Dark mode: section-contact */
html.a11y-dark .section-contact {
    background-color: #242019;
}

/* Dark mode: footer already dark, ensure contrast */
html.a11y-dark .site-footer {
    background: #0F0D0B;
}

/* Dark mode: nav overlay */
html.a11y-dark .nav-overlay {
    background: rgba(26, 23, 20, 0.98);
}

/* Dark mode: select elements */
html.a11y-dark .form-field select {
    background: #2A2522;
    color: #E8E4DE;
}

/* --- LAYOUT: Full-width mode --- */
html.a11y-layout-full .site-header__inner,
html.a11y-layout-full .site-footer__inner,
html.a11y-layout-full .container {
    max-width: 100%;
    padding-inline: clamp(1.5rem, 3vw, 3rem);
}

/* --- DRAFT LINKS --- */
.a11y-panel__links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.a11y-panel__draft-link {
    display: block;
    padding: 0.4rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bk-green-dark);
    border: 1.5px solid rgba(58, 128, 55, 0.35);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.a11y-panel__draft-link:hover {
    border-color: var(--bk-green-dark);
    background: rgba(58, 128, 55, 0.06);
}

.a11y-panel__draft-link:focus-visible {
    outline: 2px solid var(--bk-green-dark);
    outline-offset: 2px;
}

html.a11y-dark .a11y-panel__draft-link {
    color: #8BC34A;
    border-color: rgba(139, 195, 74, 0.3);
}

html.a11y-dark .a11y-panel__draft-link:hover {
    border-color: #8BC34A;
    background: rgba(139, 195, 74, 0.08);
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .a11y-panel__toggle {
        transition: none;
    }
}
