/*
 * TrainWerk Website System
 * Copyright (C) 2026 Hans-Josef Pesch / TrainWerk
 * License: TrainWerk Open Use License 1.0
 * Nutzung und Weiterentwicklung erlaubt. Backlink oder eine Tasse Kaffee willkommen.
 * Copyright- und Lizenzhinweise bitte beibehalten.
 */

/* Shared trigger: the master geometry, with real SVG and label elements. */
#trainwerk-accessibility-trigger {
    --tw-a11y-trigger-width: 76px;
    --tw-a11y-trigger-expanded-width: 196px;
    --tw-a11y-trigger-height: 154px;
    --tw-a11y-trigger-icon-size: 39px;

    box-sizing: border-box;
    position: fixed;
    left: 0;
    top: 50%;
    right: auto;
    bottom: auto;
    z-index: 9998;
    display: flex;
    width: var(--tw-a11y-trigger-width);
    min-width: var(--tw-a11y-trigger-width);
    height: var(--tw-a11y-trigger-height);
    min-height: var(--tw-a11y-trigger-height);
    max-width: none;
    max-height: none;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;
    margin: 0;
    padding: 12px 16px;
    overflow: hidden;
    transform: translateY(-50%);
    border: 1px solid #2b3852;
    border-left: 4px solid #f97316;
    border-radius: 0 16px 16px 0;
    background: #0f182d;
    color: #ffffff;
    box-shadow:
        0 14px 32px rgba(2, 6, 23, 0.30),
        0 4px 10px rgba(2, 6, 23, 0.22);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition:
        width 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

#trainwerk-accessibility-trigger .tw-a11y-trigger-icon {
    display: block;
    width: var(--tw-a11y-trigger-icon-size);
    height: var(--tw-a11y-trigger-icon-size);
    flex: 0 0 var(--tw-a11y-trigger-icon-size);
    overflow: visible;
}

#trainwerk-accessibility-trigger .tw-a11y-trigger-ring,
#trainwerk-accessibility-trigger .tw-a11y-trigger-person {
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#trainwerk-accessibility-trigger .tw-a11y-trigger-ring {
    stroke-width: 3.6;
}

#trainwerk-accessibility-trigger .tw-a11y-trigger-person {
    stroke-width: 4;
}

#trainwerk-accessibility-trigger .tw-a11y-trigger-head {
    fill: #f97316;
}

#trainwerk-accessibility-trigger .tw-a11y-trigger-label {
    display: block;
    flex: 0 0 auto;
    opacity: 0;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    white-space: nowrap;
    transition: opacity 130ms ease;
}

#trainwerk-accessibility-trigger:hover,
#trainwerk-accessibility-trigger:focus-visible,
#trainwerk-accessibility-trigger[aria-expanded="true"] {
    width: var(--tw-a11y-trigger-expanded-width);
    border-right-color: #f97316;
    background: #17223a;
    box-shadow:
        0 16px 36px rgba(2, 6, 23, 0.36),
        0 5px 12px rgba(2, 6, 23, 0.24);
}

#trainwerk-accessibility-trigger:hover .tw-a11y-trigger-label,
#trainwerk-accessibility-trigger:focus-visible .tw-a11y-trigger-label,
#trainwerk-accessibility-trigger[aria-expanded="true"] .tw-a11y-trigger-label {
    opacity: 1;
}

#trainwerk-accessibility-trigger:focus-visible {
    outline: 3px solid #f97316;
    outline-offset: 4px;
}

#trainwerk-accessibility-panel :focus-visible {
    outline: 3px solid #f97316;
    outline-offset: 3px;
}

#trainwerk-accessibility-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.18);
}

#trainwerk-accessibility-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    width: min(440px, 100vw);
    overflow-y: auto;
    border-left: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.24);
}

#trainwerk-accessibility-panel header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid #334155;
    background: #020617;
    color: #ffffff;
}

#trainwerk-accessibility-panel header h2 {
    margin: 0.2rem 0 0;
    color: inherit;
    font-size: 1.4rem;
}

#trainwerk-accessibility-panel header button {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #64748b;
    background: transparent;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
}

.tw-a11y-kicker {
    margin: 0;
    color: #fb923c;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tw-a11y-content {
    padding: 0 1.25rem 1.25rem;
}

#trainwerk-accessibility-panel section {
    padding: 1.4rem 0;
    border-bottom: 1px solid #e2e8f0;
}

#trainwerk-accessibility-panel section:last-child {
    border-bottom: 0;
}

#trainwerk-accessibility-panel section h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
}

#trainwerk-accessibility-panel section > p {
    margin: 0.35rem 0 0;
    color: #475569;
    font-size: 0.9rem;
}

.tw-a11y-scale {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.tw-a11y-scale button,
.tw-a11y-reset,
.tw-a11y-option {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tw-a11y-scale button {
    padding: 0.8rem 0.5rem;
}

.tw-a11y-scale button[aria-pressed="true"] {
    border-color: #f97316;
    background: #f97316;
    color: #111827;
}

.tw-a11y-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 1rem;
    text-align: left;
}

.tw-a11y-option strong,
.tw-a11y-option small {
    display: block;
}

.tw-a11y-option small {
    margin-top: 0.25rem;
    color: #64748b;
    font-weight: 500;
}

.tw-a11y-switch {
    display: flex;
    width: 48px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    padding: 4px;
    border: 1px solid #94a3b8;
    background: #e2e8f0;
}

.tw-a11y-switch i {
    width: 18px;
    height: 18px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
}

.tw-a11y-option[aria-pressed="true"] {
    border-color: #f97316;
}

.tw-a11y-option[aria-pressed="true"] .tw-a11y-switch {
    justify-content: flex-end;
    border-color: #f97316;
    background: #f97316;
}

.tw-a11y-reset {
    width: 100%;
    padding: 0.9rem 1rem;
    text-align: center;
}

html.tw-a11y-spacing body {
    letter-spacing: 0.08em !important;
    word-spacing: 0.12em !important;
    line-height: 1.8 !important;
}

html.tw-a11y-reading main p,
html.tw-a11y-reading main li,
html.tw-a11y-reading main .tw-prose {
    max-width: 72ch;
    line-height: 1.85 !important;
}

html.tw-a11y-links a:not(.tw-button) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 0.2em !important;
}

html.tw-a11y-motion *,
html.tw-a11y-motion *::before,
html.tw-a11y-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

html.tw-a11y-contrast-high body {
    background: #ffffff !important;
    color: #000000 !important;
}

html.tw-a11y-contrast-high body .tw-topbar,
html.tw-a11y-contrast-high body .tw-header,
html.tw-a11y-contrast-high body .tw-hero,
html.tw-a11y-contrast-high body .tw-dark-panel,
html.tw-a11y-contrast-high body .tw-contact-dark,
html.tw-a11y-contrast-high body .tw-notice-cta,
html.tw-a11y-contrast-high body .tw-editorial-copy,
html.tw-a11y-contrast-high body .tw-network,
html.tw-a11y-contrast-high body .tw-mega aside,
html.tw-a11y-contrast-high body .tw-qualification header,
html.tw-a11y-contrast-high body .tw-slider,
html.tw-a11y-contrast-high body .tw-footer,
html.tw-a11y-contrast-high body [class*="tw-blue-glass"] {
    background: #e5e7eb !important;
    background-image: none !important;
    color: #000000 !important;
    border-color: #6b7280 !important;
    box-shadow: none !important;
}

html.tw-a11y-contrast-high body .tw-hero-bg,
html.tw-a11y-contrast-high body .tw-hero-overlay,
html.tw-a11y-contrast-high body .tw-home-video,
html.tw-a11y-contrast-high body .tw-footer-bg,
html.tw-a11y-contrast-high body [class*="tw-blue-glass"]::before,
html.tw-a11y-contrast-high body [class*="tw-blue-glass"]::after {
    display: none !important;
}

html.tw-a11y-contrast-high body .tw-topbar *,
html.tw-a11y-contrast-high body .tw-header *,
html.tw-a11y-contrast-high body .tw-hero *,
html.tw-a11y-contrast-high body .tw-dark-panel *,
html.tw-a11y-contrast-high body .tw-contact-dark *,
html.tw-a11y-contrast-high body .tw-notice-cta *,
html.tw-a11y-contrast-high body .tw-editorial-copy *,
html.tw-a11y-contrast-high body .tw-network *,
html.tw-a11y-contrast-high body .tw-mega aside *,
html.tw-a11y-contrast-high body .tw-qualification header *,
html.tw-a11y-contrast-high body .tw-slider *,
html.tw-a11y-contrast-high body .tw-footer * {
    color: #000000 !important;
}

html.tw-a11y-contrast-high body .tw-button,
html.tw-a11y-contrast-high body .tw-a11y-scale button[aria-pressed="true"] {
    background: #f97316 !important;
    border-color: #9a3412 !important;
    color: #000000 !important;
}

html.tw-a11y-contrast-high body .tw-button-outline {
    background: #ffffff !important;
    border-color: #111827 !important;
    color: #000000 !important;
}

html.tw-a11y-contrast-high body .tw-eyebrow,
html.tw-a11y-contrast-high body .tw-a11y-kicker {
    color: #9a3412 !important;
}

html.tw-a11y-contrast-high body a:not(.tw-button) {
    color: #000000 !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

html.tw-a11y-contrast-high body input,
html.tw-a11y-contrast-high body textarea,
html.tw-a11y-contrast-high body select {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #111827 !important;
}

html.tw-a11y-contrast-high #trainwerk-accessibility-panel,
html.tw-a11y-contrast-high #trainwerk-accessibility-panel header,
html.tw-a11y-contrast-high #trainwerk-accessibility-panel section {
    background: #f3f4f6 !important;
    color: #000000 !important;
    border-color: #6b7280 !important;
}

html.tw-a11y-contrast-high #trainwerk-accessibility-panel * {
    color: #000000;
}

html.tw-a11y-contrast-high #trainwerk-accessibility-trigger {
    background: #e5e7eb !important;
    border-color: #111827 !important;
    color: #000000 !important;
}

@media (max-width: 640px) {
    #trainwerk-accessibility-trigger {
        --tw-a11y-trigger-width: 56px;
        --tw-a11y-trigger-expanded-width: 56px;
        --tw-a11y-trigger-height: 56px;
        --tw-a11y-trigger-icon-size: 32px;

        top: auto;
        left: 14px;
        bottom: 18px;
        justify-content: center;
        padding: 9px;
        transform: none;
        border: 2px solid #ffffff;
        border-left: 4px solid #f97316;
        border-radius: 9999px;
    }

    #trainwerk-accessibility-trigger .tw-a11y-trigger-label {
        display: none;
    }

    #trainwerk-accessibility-panel {
        width: 100vw;
    }
}

html.tw-a11y-motion #trainwerk-accessibility-trigger,
html.tw-a11y-motion #trainwerk-accessibility-trigger .tw-a11y-trigger-label {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    #trainwerk-accessibility-trigger,
    #trainwerk-accessibility-trigger .tw-a11y-trigger-label {
        transition: none;
    }
}
