/* Explain: Styles for the floating accessibility widget and its options. */
/* Floating accessibility widget: the launcher button, the settings panel,
   and the page-wide visual modes a visitor can switch on. */

.a11y-launcher {
    position: fixed;
    inset-block-end: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 72;
    display: grid;
    height: 3.25rem;
    width: 3.25rem;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--cream-color);
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(30, 30, 30, 0.28);
    transition: transform 240ms ease, background 240ms ease, color 240ms ease;
}

.a11y-launcher:hover,
.a11y-launcher:focus {
    background: var(--accent-color);
    color: var(--night-color);
    transform: translateY(-3px);
}

.a11y-launcher.is-hidden {
    display: none;
}

.a11y-panel {
    display: none;
    position: fixed;
    inset-block-end: 5.25rem;
    inset-inline-end: 1.25rem;
    z-index: 73;
    width: min(22rem, calc(100vw - 2.5rem));
    max-height: min(30rem, calc(100vh - 7rem));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: var(--shadow-cinematic);
    outline: none;
}

.a11y-panel.is-open {
    display: flex;
}

.a11y-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--primary-color);
    color: var(--cream-color);
}

.a11y-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.a11y-close {
    display: grid;
    height: 2.25rem;
    width: 2.25rem;
    place-items: center;
    border: 1px solid rgba(243, 239, 228, 0.4);
    border-radius: 999px;
    background: transparent;
    color: var(--cream-color);
    cursor: pointer;
    transition: background 200ms ease;
}

.a11y-close:hover,
.a11y-close:focus {
    background: rgba(243, 239, 228, 0.16);
}

.a11y-body {
    overflow-y: auto;
    padding: 1rem;
    background: var(--background-color);
}

.a11y-group-label {
    margin: 0 0 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.a11y-row {
    display: flex;
    gap: 0.5rem;
}

.a11y-row-wrap {
    flex-wrap: wrap;
    margin-top: 1rem;
}

.a11y-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    background: var(--surface-color);
    color: var(--text-color);
    padding: 0.45rem 0.9rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.a11y-row:not(.a11y-row-wrap) .a11y-btn {
    flex: 1;
}

.a11y-btn:hover,
.a11y-btn:focus {
    border-color: var(--accent-color);
    color: var(--accent-ink);
}

.a11y-btn[aria-pressed="true"] {
    border-color: var(--accent-color);
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.a11y-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.a11y-btn-toggle {
    flex: 1 1 45%;
    font-size: 0.85rem;
}

.a11y-reset {
    margin-top: 1rem;
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
}

.a11y-reset:hover,
.a11y-reset:focus {
    background: var(--primary-color);
    color: var(--cream-color);
}

/* High contrast: darker text and stronger borders on light surfaces, while
   the dark navy bands keep their light text. */
html.a11y-contrast {
    --text-color: #000000;
    --text-muted: #000000;
    --border-color: rgba(255, 90, 31, 0.9);
    --mist-color: #FFE3D3;
}

/* Increased spacing between lines of running text. */
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing blockquote,
html.a11y-spacing summary,
html.a11y-spacing .chat-msg {
    line-height: 1.9 !important;
    word-spacing: 0.1em;
}

/* Highlight every link. */
html.a11y-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    outline: 2px solid currentColor !important;
    outline-offset: 2px;
}

/* Grayscale the visible page blocks — never a wrapper of fixed elements. */
html.a11y-grayscale .site-header,
html.a11y-grayscale main,
html.a11y-grayscale footer,
html.a11y-grayscale #closedBanner,
html.a11y-grayscale .chat-launcher,
html.a11y-grayscale .chat-panel {
    filter: grayscale(1);
}

/* Larger, high-visibility cursor. */
html.a11y-big-cursor,
html.a11y-big-cursor a,
html.a11y-big-cursor button,
html.a11y-big-cursor input,
html.a11y-big-cursor textarea,
html.a11y-big-cursor select,
html.a11y-big-cursor summary,
html.a11y-big-cursor [role="button"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath d='M5 2v18l4.6-4.6 3 6.4 2.6-1.2-3-6.3H19z' fill='%23000' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E") 4 2, auto;
}

/* Stop animations, transitions, and smooth scrolling. */
html.a11y-no-motion,
html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}