/* Accessibility helpers: skip link, the slim Accessibility button, and the high-contrast mode */
.a11y-skip {
    position: absolute;
    left: 8px;
    top: -120px;
    z-index: 4000;
    padding: 10px 16px;
    border-radius: 8px;
    background: #2dd4bf;
    color: #04210d;
    font-weight: 700;
    text-decoration: none;
}
.a11y-skip:focus {
    top: 8px;
}

/* At the bottom of the page, in the footer: not fixed, so it scrolls with the page */
.a11y-widget {
    position: relative;
    margin: 24px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: Arial, sans-serif;
}

/* Desktop: the controls sit in the social-icon row, to the left of the three circular links.
   The row keeps a fixed height, so the footer does not grow when the controls open. */
.a11y-social-row {
    min-height: 44px;
    align-items: center;
}
.a11y-panel.a11y-panel--social {
    position: static;
    transform: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.a11y-panel.a11y-panel--social .a11y-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.a11y-panel.a11y-panel--social .a11y-row {
    width: auto;
    gap: 6px;
}
.a11y-panel.a11y-panel--social .a11y-row > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.a11y-panel.a11y-panel--social .a11y-wide {
    width: auto;
    padding: 0 14px;
}

/* Desktop: beside the copyright line in the footer */
.a11y-widget--inline {
    margin: 0 16px 0 0;
    align-self: center;
}

.a11y-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #2dd4bf;
    border-radius: 999px;
    background: #0f172a;
    color: #e2e8f0;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.a11y-toggle[aria-expanded="true"] {
    background: #2dd4bf;
    color: #04210d;
}

.a11y-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 220px;
    padding: 14px;
    border: 1px solid #1e2a44;
    border-radius: 14px;
    background: #111a2e;
    color: #e2e8f0;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.a11y-panel[hidden] {
    display: none;
}
.a11y-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}
.a11y-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 14px;
}
.a11y-panel button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid #64748b;
    border-radius: 8px;
    background: #1e293b;
    color: #e2e8f0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.a11y-panel button:disabled {
    opacity: 0.45;
    cursor: default;
}
.a11y-panel .a11y-wide {
    width: 100%;
}
.a11y-panel button[aria-pressed="true"] {
    background: #2dd4bf;
    color: #04210d;
    border-color: #2dd4bf;
}
.a11y-toggle:focus-visible,
.a11y-panel button:focus-visible,
.a11y-skip:focus-visible {
    outline: 3px solid #facc15;
    outline-offset: 2px;
}

/* High contrast: black and white, with yellow links and visible borders */
html.a11y-contrast,
html.a11y-contrast body {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-contrast a {
    color: #facc15 !important;
    text-decoration: underline !important;
}
html.a11y-contrast * {
    border-color: #fff !important;
    box-shadow: none !important;
}
