/**
 * Unblur Skin Studio – Accessibility (ADA / WCAG 2.1 AA)
 * Use with accessibility.js for toolbar toggle.
 */

/* ----- Skip link (WCAG 2.4.1 Bypass Blocks) ----- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 12px 24px;
    background: #BA9B7C;
    color: #2C332F;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 12px;
    outline: 3px solid #fffff9;
    outline-offset: 2px;
}

/* ----- Respect reduced motion (WCAG 2.3.3) ----- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----- Visible focus baseline (WCAG 2.4.7) – applied when a11y mode off ----- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #BA9B7C;
    outline-offset: 2px;
}

/* ----- ACCESSIBILITY MODE (toolbar toggle) ----- */
body[data-a11y="true"] {
    --a11y-text-scale: 1.15;
    --a11y-focus-width: 3px;
    --a11y-focus-color: #ffff00;
    --a11y-link-underline: underline;
}

/* Larger text */
body[data-a11y="true"] {
    font-size: calc(1rem * var(--a11y-text-scale, 1.15));
}
body[data-a11y="true"] h1,
body[data-a11y="true"] h2,
body[data-a11y="true"] h3 {
    font-size: inherit;
    line-height: 1.3;
}

/* High-contrast focus (keyboard only) */
body[data-a11y="true"] a:focus-visible,
body[data-a11y="true"] button:focus-visible,
body[data-a11y="true"] input:focus-visible,
body[data-a11y="true"] select:focus-visible,
body[data-a11y="true"] textarea:focus-visible,
body[data-a11y="true"] [tabindex]:focus-visible {
    outline: var(--a11y-focus-width) solid var(--a11y-focus-color);
    outline-offset: 3px;
}

/* Underline links */
body[data-a11y="true"] a {
    text-decoration: var(--a11y-link-underline);
}

/* Reduce motion when a11y mode is on */
body[data-a11y="true"] *,
body[data-a11y="true"] *::before,
body[data-a11y="true"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.08s !important;
}

/* Spacer pushes the accessibility button to the bottom of the drawer */
.nav-drawer .nav-drawer-spacer {
    flex-grow: 1;
    min-height: 0; /* Allow shrink so button stays in view when drawer scrolls */
}

/* Accessibility toggle – inside nav drawer at bottom */
.nav-drawer .a11y-toggle {
    flex-shrink: 0; /* Never collapse so it stays visible */
    width: 100%;
    min-height: 56px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255,255,249,0.2);
    color: #fffff9;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.5em;
    box-sizing: border-box;
}
.nav-drawer .a11y-toggle:hover {
    background: rgba(255,255,249,0.08);
}
.nav-drawer .a11y-toggle:focus-visible {
    outline: 2px solid #BA9B7C;
    outline-offset: -2px;
}
.nav-drawer .a11y-toggle[aria-pressed="true"] {
    background: rgba(186, 155, 124, 0.25);
    color: #BA9B7C;
}
.nav-drawer .a11y-toggle svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* 404 page: toggle inside .nav-links (different nav structure) */
.nav-links .a11y-toggle,
.a11y-toggle--nav-links {
    width: 100%;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(255,255,249,0.2);
    color: #fffff;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.5em;
}
.nav-links .a11y-toggle:hover,
.a11y-toggle--nav-links:hover {
    background: rgba(255,255,249,0.08);
}
.nav-links .a11y-toggle:focus-visible,
.a11y-toggle--nav-links:focus-visible {
    outline: 2px solid #BA9B7C;
    outline-offset: 2px;
}
.nav-links .a11y-toggle[aria-pressed="true"],
.a11y-toggle--nav-links[aria-pressed="true"] {
    background: rgba(186, 155, 124, 0.25);
    color: #BA9B7C;
}
.nav-links .a11y-toggle svg,
.a11y-toggle--nav-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
