/* =========================================================================
   Apexa – Akadálymentesítés (WCAG 2.0 AA) + vakbarát / gyengénlátó mód
   -------------------------------------------------------------------------
   Ez a fájl tartalmazza:
     1. Általános WCAG-segédosztályokat (skip link, sr-only, fókusz)
     2. Az akadálymentes eszköztár (widget) megjelenését
     3. A választható megjelenítési módokat (kontraszt, szürkeárnyalat,
        linkkiemelés, olvasható betűtípus, térköz, animációmentes, nagy
        kurzor, olvasási segéd)
   A módok a <html> elemen lévő osztályokkal kapcsolhatók be.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. ALAP WCAG SEGÉDOSZTÁLYOK
   ------------------------------------------------------------------------- */

/* Csak képernyőolvasónak szánt szöveg (WCAG 1.3.1, 2.4.4) */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Tartalomra ugrás link – WCAG 2.4.1 Bypass Blocks */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 100000;
    padding: 12px 20px;
    background: #0e104b;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    transition: top 0.2s ease-in-out;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #ffeb3b;
    outline-offset: 2px;
}

/* Látható billentyűzet-fókusz minden interaktív elemen – 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,
[role="button"]:focus-visible {
    outline: 3px solid #1056d6 !important;
    outline-offset: 2px !important;
    border-radius: 2px;
}

/* Fallback azoknak a böngészőknek, ahol nincs :focus-visible */
.js-focus-keyboard a:focus,
.js-focus-keyboard button:focus,
.js-focus-keyboard input:focus,
.js-focus-keyboard select:focus,
.js-focus-keyboard textarea:focus,
.js-focus-keyboard [tabindex]:focus {
    outline: 3px solid #1056d6 !important;
    outline-offset: 2px !important;
}

/* A célként megjelölt fő tartalom ne kapjon zavaró keretet kattintáskor */
#main-content:focus {
    outline: none;
}

/* Csökkentett mozgás tisztelete rendszerszinten – WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Korábban <div>-ként megjelenő, most <button>-né alakított vezérlők
   (akadálymentesség miatt) – a böngésző alap gombstílusának eltüntetése,
   hogy a megjelenés változatlan maradjon. */
.mobile-nav-toggler,
.menu-tigger,
.search-open-btn,
.tgmobile__menu .close-btn,
.offCanvas__close-icon button {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* A keresés ikon-gomb mérete: a téma eredetileg a `.header-search a`
   szelektorral stílusozta, ami a <button>-re már nem érvényes – ezért
   itt visszaadjuk az ikon méretét és igazítását. */
.header-search .search-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-secondary, #191d88);
    font-size: 20px;
    line-height: 0;
}

.header-search .search-open-btn svg {
    width: 20px;
    height: auto;
}

.header-search .search-open-btn:hover {
    color: var(--tg-theme-primary, #f7a400);
}

/* -------------------------------------------------------------------------
   2. AKADÁLYMENTES ESZKÖZTÁR (WIDGET)
   ------------------------------------------------------------------------- */

/* Nyitógomb – bal alsó sarok (a "fel" gomb a jobb alsóban van) */
.a11y-toggle {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 99990;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #0e104b;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.a11y-toggle:hover,
.a11y-toggle:focus {
    background: #1056d6;
    transform: scale(1.06);
}

.a11y-toggle svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

/* Panel */
.a11y-panel {
    position: fixed;
    right: 20px;
    top: 160px;
    z-index: 99991;
    width: 320px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #d4d4d4;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.4;
}

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

.a11y-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0e104b;
}

.a11y-panel__title {
    font-size: 17px;
    font-weight: 700;
    color: #0e104b;
    margin: 0;
}

.a11y-panel__close {
    width: 36px;
    height: 36px;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #f3f3f3;
    color: #1a1a1a;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.a11y-panel__close:hover {
    background: #e2e2e2;
}

/* Vezérlőcsoportok */
.a11y-group {
    margin-bottom: 14px;
}

.a11y-group__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
    margin-bottom: 6px;
}

.a11y-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.a11y-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 8px;
    border: 2px solid #d4d4d4;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.a11y-btn:hover {
    border-color: #1056d6;
    background: #eef4ff;
}

.a11y-btn[aria-pressed="true"] {
    border-color: #0e104b;
    background: #0e104b;
    color: #ffffff;
}

.a11y-btn__icon {
    font-size: 20px;
    line-height: 1;
}

/* Betűméret léptető */
.a11y-fontsize {
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-fontsize button {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 2px solid #d4d4d4;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.a11y-fontsize button:hover {
    border-color: #1056d6;
    background: #eef4ff;
}

.a11y-fontsize__value {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 700;
}

.a11y-reset {
    width: 100%;
    margin-top: 4px;
    padding: 10px;
    border: 2px solid #b00020;
    border-radius: 8px;
    background: #fff;
    color: #b00020;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.a11y-reset:hover {
    background: #b00020;
    color: #fff;
}

/* Olvasási segédvonal */
.a11y-guideline {
    position: fixed;
    left: 0;
    right: 0;
    height: 24px;
    background: rgba(255, 235, 59, 0.35);
    border-top: 2px solid #b00020;
    border-bottom: 2px solid #b00020;
    pointer-events: none;
    z-index: 99980;
    display: none;
}

html.a11y-guide .a11y-guideline {
    display: block;
}

/* -------------------------------------------------------------------------
   3. MEGJELENÍTÉSI MÓDOK
   ------------------------------------------------------------------------- */

/* --- 3.1 Magas kontraszt (vakbarát: fekete háttér, sárga szöveg) --------- */
html.a11y-contrast body {
    background: #000 !important;
    color: #ffeb3b !important;
}

html.a11y-contrast body *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-toggle):not(.a11y-toggle *) {
    background-color: transparent !important;
    background-color: #000 !important;
    background-image: none !important;
    color: #ffeb3b !important;
    border-color: #ffeb3b !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

html.a11y-contrast section,
html.a11y-contrast header,
html.a11y-contrast footer,
html.a11y-contrast .tg-header__top,
html.a11y-contrast .tg-header__area,
html.a11y-contrast .offCanvas__info,
html.a11y-contrast .sticky-menu,
html.a11y-contrast .footer-bottom {
    background: #000 !important;
    background-image: none !important;
}

html.a11y-contrast a,
html.a11y-contrast a *,
html.a11y-contrast h1,
html.a11y-contrast h2,
html.a11y-contrast h3,
html.a11y-contrast h4,
html.a11y-contrast h5,
html.a11y-contrast h6,
html.a11y-contrast p,
html.a11y-contrast span,
html.a11y-contrast li,
html.a11y-contrast label,
html.a11y-contrast td,
html.a11y-contrast th {
    color: #ffeb3b !important;
}

html.a11y-contrast a:hover,
html.a11y-contrast a:focus {
    color: #ffffff !important;
    text-decoration: underline !important;
}

html.a11y-contrast button,
html.a11y-contrast .btn,
html.a11y-contrast input,
html.a11y-contrast textarea,
html.a11y-contrast select {
    background: #000 !important;
    color: #ffeb3b !important;
    border: 2px solid #ffeb3b !important;
}

html.a11y-contrast img,
html.a11y-contrast svg,
html.a11y-contrast video {
    filter: grayscale(20%) contrast(1.1);
}

/* --- 3.2 Negatív / invertált kontraszt ---------------------------------- */
html.a11y-invert body {
    filter: invert(1) hue-rotate(180deg);
    background: #fff;
}

/* A widget maradjon normál színű az invertálás visszafordításával */
html.a11y-invert .a11y-panel,
html.a11y-invert .a11y-toggle {
    filter: invert(1) hue-rotate(180deg);
}

/* --- 3.3 Szürkeárnyalat -------------------------------------------------- */
html.a11y-grayscale body {
    filter: grayscale(100%);
}

html.a11y-grayscale .a11y-panel,
html.a11y-grayscale .a11y-toggle {
    filter: grayscale(0%);
}

/* --- 3.4 Linkek kiemelése (WCAG 1.4.1 – ne csak szín jelölje) ----------- */
html.a11y-links a:not(.a11y-toggle):not(.skip-link) {
    text-decoration: underline !important;
    text-underline-offset: 2px;
    font-weight: 700 !important;
    outline: 1px dashed currentColor;
    outline-offset: 2px;
}

/* --- 3.5 Olvasható betűtípus -------------------------------------------- */
html.a11y-readable body *:not(i):not(.fa):not([class^="ti-"]):not([class*=" ti-"]):not([class^="flaticon"]) {
    font-family: Arial, "Segoe UI", Tahoma, sans-serif !important;
    letter-spacing: 0.03em !important;
    word-spacing: 0.08em !important;
}

/* --- 3.6 Nagyobb sor- és térköz (WCAG 1.4.12 Text Spacing) -------------- */
html.a11y-spacing body p,
html.a11y-spacing body li,
html.a11y-spacing body a,
html.a11y-spacing body span,
html.a11y-spacing body div,
html.a11y-spacing body h1,
html.a11y-spacing body h2,
html.a11y-spacing body h3,
html.a11y-spacing body h4,
html.a11y-spacing body h5,
html.a11y-spacing body h6 {
    line-height: 1.8 !important;
    letter-spacing: 0.06em !important;
    word-spacing: 0.12em !important;
}

html.a11y-spacing body p {
    margin-bottom: 1.2em !important;
}

/* --- 3.7 Animációk leállítása ------------------------------------------- */
html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* AOS / WOW által elrejtett elemek kényszerített megjelenítése */
html.a11y-no-motion [data-aos],
html.a11y-no-motion .wow {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* --- 3.8 Nagy kurzor ----------------------------------------------------- */
html.a11y-bigcursor,
html.a11y-bigcursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='2' d='M6 4 L6 40 L16 30 L22 44 L28 41 L22 27 L36 27 Z'/%3E%3C/svg%3E") 4 4, auto !important;
}

/* -------------------------------------------------------------------------
   4. RESPONZÍV
   ------------------------------------------------------------------------- */
@media (max-width: 575px) {
    .a11y-toggle {
        width: 48px;
        height: 48px;
        left: 12px;
        bottom: 12px;
    }

    .a11y-panel {
        left: 12px;
        right: 12px;
        bottom: 70px;
        width: auto;
    }
}

/* Nyomtatáskor a widget ne jelenjen meg */
@media print {
    .a11y-toggle,
    .a11y-panel,
    .a11y-guideline,
    .skip-link {
        display: none !important;
    }
}
