/* ============================================================
   Gennex IT Solutions — accessibility.css
   Cookie notice, accessibility menu, and the display options
   the menu switches on (classes on <html>)
   ============================================================ */

/* ─── Screen-reader-only text ─────────────────────────────── */
/* The skip link shares this class but has its own rules in main.css */
.screen-reader-text:not(.skip-link) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


/* ─── Cookie notice ───────────────────────────────────────── */
.cookie-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 1.5rem;
    z-index: 1100;
    width: min(46rem, calc(100% - 12rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.1rem 1.4rem;
    background: var(--color-dark-bg);
    color: var(--color-white);
    border-radius: var(--border-radius-lg);
    border-top: 3px solid var(--color-accent);
    box-shadow: var(--shadow-xl);
    animation: gennex-cookie-in 0.45s ease 0.3s both;
}

.cookie-notice[hidden] { display: none; }

.cookie-notice__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.cookie-notice__text a {
    color: var(--color-white);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.cookie-notice:focus-visible,
.cookie-notice :focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 3px;
}

.cookie-notice__actions {
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
}

.cookie-notice__actions .btn { padding: 0.625rem 1.125rem; }

@keyframes gennex-cookie-in {
    from { opacity: 0; transform: translateY(1rem); }
}

@media (max-width: 768px) {
    .cookie-notice {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        width: auto;
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-notice__actions .btn { flex: 1; }
}


/* ─── Accessibility menu ──────────────────────────────────── */
/* Below the header (z-index 1000), so the open phone menu covers it */
.a11y-menu {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 990;
}

.a11y-menu__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-white);
    box-shadow: var(--shadow-lg);
    transition: background-color var(--transition-fast), transform var(--transition-base);
}

.a11y-menu__toggle:hover,
.a11y-menu__toggle[aria-expanded="true"] {
    background: var(--color-accent-text);
}

.a11y-menu__toggle:hover { transform: scale(1.06); }

.a11y-menu__panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.75rem);
    width: min(20rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    display: grid;
    gap: 0.5rem;
    padding: 1.1rem;
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.a11y-menu__panel[hidden] { display: none; }

.a11y-menu__title {
    margin: 0 0 0.25rem;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
}

.a11y-menu__panel button {
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid #8A8A8A;
    border-radius: var(--border-radius);
    background: var(--color-white);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.a11y-menu__panel button:hover { border-color: var(--color-text); }

.a11y-menu__panel button[aria-pressed="true"] {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.a11y-menu__sizes {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.a11y-menu__sizes span[aria-hidden] {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 600;
}

.a11y-menu__sizes button { min-width: 3rem; }

.a11y-menu__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
}

/* On/off box at the end of each option */
.a11y-menu__option::after {
    content: '';
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.a11y-menu__option[aria-pressed="true"]::after {
    background: var(--color-white);
    box-shadow: inset 0 0 0 3px var(--color-primary);
}

.a11y-menu__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

.a11y-menu__foot button {
    min-height: 2.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.a11y-menu__foot a {
    color: var(--color-accent-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 768px) {
    .a11y-menu {
        left: 0.75rem;
        bottom: 0.75rem;
        /* Moves above the cookie notice while it is showing */
        transform: translateY(calc(var(--cookie-notice-height, 0px) * -1));
    }

    .a11y-menu__toggle {
        width: 2.875rem;
        height: 2.875rem;
    }
}

/* Footer "Cookie settings" button, styled like the text beside it */
.footer-cookie-settings {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-cookie-settings:hover { color: var(--color-white); }

@media print {
    .cookie-notice,
    .a11y-menu { display: none; }
}


/* ─── Options chosen in the menu ──────────────────────────── */

/* Larger text: sizes are in rem, so the whole page scales */
html.a11y-text-1 { font-size: 112.5%; }
html.a11y-text-2 { font-size: 125%; }


/* High contrast: black and white, darker red, stronger borders, underlined links */
html.a11y-contrast {
    --color-accent:         #B00016;
    --color-accent-dark:    #7A000F;
    --color-accent-text:    #9E0014;
    --color-accent-on-dark: #FF8A94;
    --color-text:           #000000;
    --color-text-muted:     #000000;
    --color-text-light:     #000000;
    --color-border:         #000000;
    --color-surface:        #FFFFFF;
    --color-primary:        #000000;
    --color-dark-bg:        #000000;
    --color-dark-surface:   #000000;
    --color-dark-border:    #FFFFFF;
}

html.a11y-contrast .card,
html.a11y-contrast .form-input {
    border: 2px solid var(--color-border);
}

html.a11y-contrast .btn {
    border-width: 2px;
}

html.a11y-contrast .site-footer p,
html.a11y-contrast .site-footer li,
html.a11y-contrast .site-footer a,
html.a11y-contrast .footer-cookie-settings {
    color: #FFFFFF;
}

html.a11y-contrast :focus-visible {
    outline-width: 3px;
}

html.a11y-contrast a:not(.btn),
html.a11y-links a:not(.btn) {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* The logos are links too; an underline under an image only adds a stray line */
html.a11y-contrast .site-logo a,
html.a11y-contrast .footer-logo,
html.a11y-links .site-logo a,
html.a11y-links .footer-logo {
    text-decoration: none !important;
}


/* Easier-to-read text: more space between lines, letters and words, and no all-capitals */
html.a11y-readable body {
    line-height: 1.85;
    letter-spacing: 0.02em;
    word-spacing: 0.08em;
}

html.a11y-readable * {
    text-transform: none !important;
}

html.a11y-readable h1,
html.a11y-readable h2,
html.a11y-readable h3,
html.a11y-readable h4 {
    letter-spacing: 0;
    line-height: 1.35;
}


/* Stop animations */
html.a11y-calm,
html.a11y-calm *,
html.a11y-calm *::before,
html.a11y-calm *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* Content that waits for a scroll animation is simply shown */
html.a11y-calm .js-animate .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
}

/* Sections that receive focus from an in-page link (main.js) are jump targets, not controls */
main [tabindex="-1"]:focus {
    outline: none;
}

/* Larger text on a small laptop: four cards in a row no longer fit their words, so use two */
@media (min-width: 481px) and (max-width: 1200px) {
    html.a11y-text-1 .grid-4,
    html.a11y-text-2 .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Larger text: the four headline figures ("Emergency Support" and so on) need two per row below wide screens */
@media (min-width: 481px) and (max-width: 1440px) {
    html.a11y-text-1 .stats-row,
    html.a11y-text-2 .stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
