/* Explain: Styles for the floating accessibility options widget. */
/* ===== Accessibility widget: launcher, panel and the display modes it applies ===== */

.a11y-launcher {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    font-size: 1.35rem;
    color: #ffffff;
    background: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    box-shadow: 0 16px 32px -16px rgba(20, 16, 10, 0.85);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.a11y-launcher:hover,
.a11y-launcher:focus-visible {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.a11y-panel {
    position: fixed;
    bottom: 4.75rem;
    left: 1rem;
    z-index: 95;
    display: none;
    width: min(20rem, calc(100vw - 2rem));
    max-height: min(78svh, 35rem);
    padding: 1rem 1.1rem 1.15rem;
    overflow-y: auto;
    color: var(--text-color);
    text-align: start;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 26px 52px -24px rgba(20, 16, 10, 0.7);
}

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

.a11y-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-color);
}

.a11y-panel-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.a11y-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-color);
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.a11y-close:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.a11y-group-title {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.a11y-font-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.a11y-btn,
.a11y-option,
.a11y-reset {
    font-family: inherit;
    color: var(--text-color);
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.a11y-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
}

.a11y-btn:hover:not(:disabled),
.a11y-option:hover,
.a11y-reset:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.a11y-level {
    margin-inline-start: auto;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.a11y-options {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.a11y-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 2.85rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.94rem;
    text-align: start;
}

.a11y-option i {
    width: 1.1rem;
    color: var(--secondary-color);
}

.a11y-option[aria-pressed="true"] {
    color: #ffffff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.a11y-option[aria-pressed="true"] i {
    color: #ffffff;
}

.a11y-panel-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.a11y-reset {
    min-height: 2.5rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.88rem;
}

.a11y-statement-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.a11y-statement-link:hover {
    color: var(--primary-hover);
}

@media (max-width: 639px) {
    footer {
        padding-bottom: 4.5rem;
    }
}

/* ===== Text size ===== */
html.a11y-fs-sm { font-size: 92%; }
html.a11y-fs-1 { font-size: 110%; }
html.a11y-fs-2 { font-size: 120%; }
html.a11y-fs-3 { font-size: 132%; }

/* ===== High contrast ===== */
html.a11y-contrast {
    --background-color: #0c0c0c;
    --surface-color: #141414;
    --surface-alt: #1e1e1e;
    --text-color: #ffffff;
    --text-muted: #eaeaea;
    --border-color: #ffffff;
    --primary-color: #ffd54a;
    --primary-hover: #ffe284;
    --secondary-color: #8fd8ff;
    --accent-color: #ffd54a;
}

html.a11y-contrast .a11y-launcher,
html.a11y-contrast .btn-premium,
html.a11y-contrast .cal-cell.is-blocked-u0,
html.a11y-contrast .cal-cell.is-blocked-u1,
html.a11y-contrast .cal-cell.is-blocked-both,
html.a11y-contrast .a11y-option[aria-pressed="true"] {
    color: #101010;
}

html.a11y-contrast .btn-premium:hover {
    color: #101010;
}

/* ===== Grayscale ===== */
html.a11y-gray main,
html.a11y-gray footer,
html.a11y-gray #siteHeader {
    filter: grayscale(1);
}

/* ===== Highlight links ===== */
html.a11y-links main a:not(.btn),
html.a11y-links footer a:not(.btn),
html.a11y-links #siteHeader a:not(.btn) {
    color: #14110c !important;
    background: #ffe066;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    border-radius: 2px;
}

/* ===== Readable font ===== */
html.a11y-readable {
    --font-heading: 'Heebo', Arial, Helvetica, sans-serif;
    --font-body: 'Heebo', Arial, Helvetica, sans-serif;
}

html.a11y-readable body {
    line-height: 1.9;
    letter-spacing: 0.015em;
}

html.a11y-readable p,
html.a11y-readable li {
    line-height: 1.95;
}

/* ===== Stop animations ===== */
html.a11y-no-anim *,
html.a11y-no-anim *::before,
html.a11y-no-anim *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}

html.a11y-no-anim .hero-media,
html.a11y-no-anim .reveal {
    animation: none !important;
}

/* ===== Big cursor ===== */
html.a11y-big-cursor,
html.a11y-big-cursor * {
    cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l14 9-6 1 3.6 7.2-2.9 1.4L9 13.5 4 18z' fill='%23000000' stroke='%23ffffff' stroke-width='1.3'/%3E%3C/svg%3E") 4 2, auto !important;
}