/*
  VR Creators: shared rules for every page of the showcase (home, sectors, guides, accessibility statement).
  Loaded after the kit (assets/system.css), so these values win.

  1. Type a step larger than the kit (user request, 2026-11-11), and scaled by the accessibility widget (--fs).
  2. The accessibility widget's own look and the preferences it sets on <html> (data-a11y-*).
*/

/* ---------------------------------------------------------------- 1. type */
:root {
    --fs: 1;
    --t-label: calc(14px * var(--fs));
    --t-small: calc(15px * var(--fs));
    --t-body: calc(17px * var(--fs));
    --t-lead: calc(19px * var(--fs));
    --t-card: calc(19px * var(--fs));
    --t-h3: calc(25px * var(--fs));
}
@media (min-width: 1024px) {
    :root {
        --t-lead: calc(21px * var(--fs));
        --t-card: calc(21px * var(--fs));
        --t-h3: calc(29px * var(--fs));
    }
}
html[data-a11y-size='1'] {
    --fs: 1.15;
}
html[data-a11y-size='2'] {
    --fs: 1.3;
}
html[data-a11y-size] :is(h1, .t-h1) {
    font-size: calc(var(--t-h1) * (1 + (var(--fs) - 1) / 2));
}
html[data-a11y-size] :is(h2, .t-h2) {
    font-size: calc(var(--t-h2) * (1 + (var(--fs) - 1) / 2));
}
body {
    font-size: var(--t-body);
}
.nav__link,
.nav__actions .btn {
    font-size: calc(16px * var(--fs));
}
p,
li,
dd {
    line-height: 1.6;
}

/* links inside running text are always underlined, not only on hover (WCAG 1.4.1) */
:is(p, li) > a:not(.btn) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* the focus ring: visible on every control, on light and dark grounds (WCAG 2.4.7, 2.4.11) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}
.ground-inverse
    :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline-color: #ffffff;
}

/* ---------------------------------------------------------------- 2. preferences set by the widget */
html[data-a11y-contrast] {
    --p-muted: #1f2433;
    --p-surface: #e6eff6;
    --p-bg: #dbe7f0;
    --p-inv-muted: #e2e8ee;
    --p-inv-ink: #ffffff;
}
html[data-a11y-contrast] :is(.muted, .t-small.muted) {
    color: var(--ink);
}
html[data-a11y-contrast] .btn--secondary {
    box-shadow: inset 0 0 0 2px currentColor;
}
html[data-a11y-contrast] :is(input, select, textarea) {
    border: 2px solid var(--ink) !important;
}

html[data-a11y-links] a:not(.btn):not(.nav__logo):not(.card) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px;
}
html[data-a11y-links] a:not(.nav__logo) {
    outline: 2px dashed color-mix(in oklab, var(--accent) 70%, transparent);
    outline-offset: 2px;
}

/* WCAG 1.4.12 text spacing: line height 1.5, paragraphs 2x, letters 0.12em, words 0.16em */
html[data-a11y-spacing] :is(p, li, dd, h3, label, .btn) {
    line-height: 1.8 !important;
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}
html[data-a11y-spacing] p {
    margin-bottom: 1em;
}

html[data-a11y-font] body,
html[data-a11y-font]
    :is(h1, h2, h3, h4, p, li, a, button, input, select, textarea, label) {
    font-family:
        'Atkinson Hyperlegible', 'Verdana', system-ui, sans-serif !important;
    letter-spacing: 0;
}

html[data-a11y-still] *,
html[data-a11y-still] *::before,
html[data-a11y-still] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* ---------------------------------------------------------------- the widget */
.a11y-btn {
    position: fixed;
    z-index: 60;
    left: 24px;
    bottom: 24px;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0f3d6e;
    color: #ffffff;
    cursor: pointer;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.18),
        0 10px 24px -8px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease;
}
.a11y-btn:hover {
    transform: scale(1.06);
}
.a11y-btn:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
}
.a11y-btn svg {
    width: 28px;
    height: 28px;
}
.a11y-panel {
    position: fixed;
    z-index: 61;
    left: 24px;
    bottom: 88px;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 20px;
    border-radius: 16px;
    background: #ffffff;
    color: #141414;
    font-family: var(--font-text);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.12),
        0 24px 48px -12px rgba(0, 0, 0, 0.35);
}
.a11y-panel[hidden] {
    display: none;
}
.a11y-panel h2#a11y-title {
    font: 600 20px/1.3 var(--font-text);
    letter-spacing: 0;
    margin: 0 0 4px;
    color: #141414;
}
.a11y-panel > p {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #3d4252;
}
.a11y-group {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}
.a11y-group legend {
    padding: 0;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #141414;
}
.a11y-sizes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.a11y-panel button.a11y-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 2px solid #c9d2db;
    border-radius: 10px;
    background: #ffffff;
    color: #141414;
    font: 500 16px/1.3 var(--font-text);
    text-align: left;
    cursor: pointer;
}
.a11y-sizes button.a11y-opt {
    justify-content: center;
    font-weight: 600;
}
.a11y-panel button.a11y-opt:hover {
    border-color: #0f3d6e;
}
.a11y-panel button.a11y-opt[aria-pressed='true'] {
    border-color: #0f3d6e;
    background: #e8f0f8;
}
.a11y-panel button.a11y-opt:focus-visible {
    outline: 3px solid #0f3d6e;
    outline-offset: 2px;
}
.a11y-switch {
    flex: none;
    position: relative;
    width: 40px;
    height: 24px;
    border-radius: 12px;
    background: #b9c3cc;
}
.a11y-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    transition: left 0.15s ease;
}
[aria-pressed='true'] > .a11y-switch {
    background: #0f3d6e;
}
[aria-pressed='true'] > .a11y-switch::after {
    left: 19px;
}
.a11y-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    font-size: 15px;
}
.a11y-foot a {
    color: #0f3d6e;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.a11y-reset {
    min-height: 44px;
    padding: 0 16px;
    border: 2px solid #0f3d6e;
    border-radius: 999px;
    background: #ffffff;
    color: #0f3d6e;
    font: 600 15px/1 var(--font-text);
    cursor: pointer;
}
.a11y-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #3d4252;
    cursor: pointer;
}
.a11y-close:hover {
    background: #eef2f5;
}
.a11y-close svg {
    width: 14px;
    height: 14px;
}
/* phones and tablets: above the action bar */
@media (max-width: 1023px) {
    .a11y-btn {
        left: 12px;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: 48px;
        height: 48px;
    }
    .a11y-panel {
        left: 16px;
        right: 16px;
        width: auto;
        bottom: calc(140px + env(safe-area-inset-bottom));
        max-height: calc(100vh - 200px);
    }
}
@media print {
    .a11y-btn,
    .a11y-panel {
        display: none !important;
    }
}
