/* ==========================================================================
   Accessibility - WCAG 2.1 AA
   Toolbar (same behaviour as agsavvas2) + skip link + focus visibility.
   Icons are FontAwesome 5 class names (the site loads FA 5.15.4, not FA 6).
   ========================================================================== */

/* --- Skip link: WCAG 2.4.1 Bypass Blocks ---------------------------------- */
.skip-link {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 100000;
    padding: 12px 20px;
    border-radius: 0 0 6px 6px;
    background: var(--gym-yellow, #ff6600);
    color: #050708;
    font-weight: 700;
    text-decoration: none;
    transition: top .18s ease;
}
.skip-link:focus { top: 0; color: #050708; text-decoration: none; outline: 3px solid #050708; outline-offset: 2px; }

/* --- Visible keyboard focus: WCAG 2.4.7 ----------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ff6600;
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Toggle button -------------------------------------------------------- */
.accessibility-toggle-btn {
    position: fixed;
    left: 20px;
    bottom: 86px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--gym-yellow, #ff6600);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
    z-index: 99996;
    transition: background .2s ease, transform .2s ease;
}
.accessibility-toggle-btn:hover { background: #050708; transform: translateY(-3px); }

/* --- Panel ---------------------------------------------------------------- */
.accessibility-panel {
    position: fixed;
    left: 20px;
    bottom: 144px;
    width: 280px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .25);
    border: 1px solid #e3e6e8;
    padding: 10px;
    z-index: 99997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.accessibility-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.accessibility-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 12px;
    border-bottom: 1px solid #e3e6e8;
    margin-bottom: 8px;
}
.accessibility-panel-header h2 { margin: 0; font-size: 1rem; color: #111; }

.accessibility-close {
    border: none;
    background: transparent;
    color: #6b7176;
    cursor: pointer;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}
.accessibility-close:hover { background: #f1f3f4; color: #111; }

.accessibility-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: transparent;
    color: #111;
    text-align: left;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.accessibility-option i { width: 18px; text-align: center; color: #ff6600; }
.accessibility-option:hover { background: #f1f3f4; }
.accessibility-option.is-active { background: #ff6600; color: #fff; }
.accessibility-option.is-active i { color: #fff; }
.accessibility-option.accessibility-reset {
    margin-top: 6px;
    border-top: 1px solid #e3e6e8;
    padding-top: 12px;
    color: #c0392b;
}
.accessibility-option.accessibility-reset i { color: #c0392b; }

/* --- Applied modes -------------------------------------------------------- */
html.a11y-contrast { filter: invert(1) hue-rotate(180deg); }
html.a11y-grayscale { filter: grayscale(1); }
html.a11y-contrast.a11y-grayscale { filter: invert(1) hue-rotate(180deg) grayscale(1); }
/* Invert media back so photos stay recognisable. */
html.a11y-contrast img,
html.a11y-contrast video,
html.a11y-contrast picture { filter: invert(1) hue-rotate(180deg); }

html.a11y-underline-links a { text-decoration: underline !important; }

html.a11y-readable-font,
html.a11y-readable-font body {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: .02em;
    line-height: 1.7;
}

/* --- Respect the OS "reduce motion" setting: WCAG 2.3.3 ------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 767px) {
    .accessibility-toggle-btn { left: 12px; bottom: 60px; width: 42px; height: 42px; }
    .accessibility-panel { left: 12px; bottom: 112px; }
}

@media print {
    .accessibility-toggle-btn, .accessibility-panel, .skip-link { display: none !important; }
}

/* Contrast note (WCAG 1.4.3): the brand orange #ff6600 is only 2.94:1 as text
   on white, so wherever it was used that way the per-page stylesheets now use
   #bf4d00 (4.91:1 on white). As a background with dark ink it stays #ff6600
   (7.15:1) and is untouched. */
