/**
 * WCAG 2.2 AA fixes (ACCESSIBILITY-PLAN.md).
 *
 * Enqueued at wp_enqueue_scripts priority 1000, after the parent, plugin and Readabler CSS. The Elementor footer CSS
 * prints later still, so rules that have to win use !important or a more specific selector, not source order.
 */

/* -------------------------------------------------------------------------------------------------------------------
 * 1.4.3 Contrast. #919090 (3.18:1) and #848484 (3.74:1) become #666666 (5.74:1 on white, 4.82:1 on #ebebeb).
 * The Redux main colour (--thm-base), Elementor's Accent and the cookie plugin's colour are set in WP admin.
 * ---------------------------------------------------------------------------------------------------------------- */
:root {
    --9f-accent: #666666;
}

p,
.blog-one__content p,
.blog-details__main p,
.last-modified-date p {
    color: #666666;
}

/* The dark footer (#181a1e) needs light links, not the main colour color.php gives them (#666666 is 3.03:1 there) */
.footer-ex-section .footer-widget p a {
    color: #fff !important;
}

footer.site-footer a:hover {
    color: #cccccc !important;
}

.custom-education-label {
    background: #666666;
}

/* The home CTA, the page title banners and the video section put white text on a background image only; a dark colour
   keeps it readable if the image doesn't load, and gives checkers that ignore images (WAVE) a background to measure
   against */
.elementor-widget-container .cta-one.new {
    background-color: #1d1919 !important; /* the child style.css sets the background shorthand with !important */
}

.page-header,
.video-one {
    background-color: #1d1919;
}

.contact-one__form textarea,
.contact-one__form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]) {
    color: #666666;
}

/* Event cards' "Apie renginį": the parent theme makes it a white button with dark text, but the child style.css's
   a.thm-btn{color:#fff!important} made the text white as well. On hover the button fills with --thm-base. */
a.thm-btn.event-three__btn {
    color: var(--thm-black) !important;
}

a.thm-btn.event-three__btn:hover,
a.thm-btn.event-three__btn:focus-visible {
    color: #fff !important;
}

/* Cookie settings dialog: "Įjungta" / "Išjungta" beside each switch. The plugin's green (#2e9935) is 3.25:1 and its
   red 3.54:1 on the dialog's #f1f1f1. The labels are drawn beside the switch but sit inside it in the markup, so
   checkers such as WAVE measure them against the switch's colour; a background of their own fixes that reading. */
#moove_gdpr_cookie_modal .gdpr-sr-enable,
#moove_gdpr_cookie_modal .gdpr-sr-disable {
    background-color: #f1f1f1 !important;
}

#moove_gdpr_cookie_modal .gdpr-sr-enable {
    color: #1d6f2a !important; /* 5.5:1 */
}

#moove_gdpr_cookie_modal .gdpr-sr-disable {
    color: #c00000 !important; /* 5.7:1 */
}

/* The "Navus" link in the copyright: the copyright's colour (#999999, 6.1:1), told apart by its underline (1.4.1) */
.custom-copyrights a,
.footer-ex-section .footer-widget .custom-copyrights p a {
    color: inherit !important;
    text-decoration: underline !important;
}

/* -------------------------------------------------------------------------------------------------------------------
 * 2.4.7 Focus visible. White | dark | white ring that shows on light and dark backgrounds. It has to beat wpsection's
 * *{outline:none} and the parent's button{outline:none!important;box-shadow:none!important}.
 * ---------------------------------------------------------------------------------------------------------------- */
:focus-visible,
.bootstrap-select .dropdown-toggle:focus-visible,
#mdp-readabler-popup #mdp-readabler-popup-close:focus-visible {
    outline: 3px solid #1d1919 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 7px #fff !important;
}

/* Focus moved by script (skip link target) must not ring the whole page */
#main-content:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 2.4.11 Focus not obscured: keep focused elements clear of the sticky header (81 px) and the cookie bar, whose
   height child.js keeps in --a11y-cookie-bar while it's shown */
html {
    scroll-padding-top: 96px;
    scroll-padding-bottom: var(--a11y-cookie-bar, 0px);
}

/* -------------------------------------------------------------------------------------------------------------------
 * 2.4.1 Skip link and <main>
 * ---------------------------------------------------------------------------------------------------------------- */
.skip-link.screen-reader-text:focus {
    z-index: 100001 !important;
    background: #fff;
    color: #1d1919 !important;
}

/* Visually hidden text inherits the colour of what it sits in: white in the buttons over images (video, 360° tour),
   black in the dark "Back to top" button. Checkers like WAVE still measure it, against the nearest background colour
   (images ignored), so it gets a fixed dark-on-white pair of its own. It is never seen. */
.screen-reader-text {
    color: #1d1919;
    background-color: #fff;
}

.page-wrapper > main {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
}

/* -------------------------------------------------------------------------------------------------------------------
 * 1.3.1 Page titles are h1 now (were h2)
 * ---------------------------------------------------------------------------------------------------------------- */
.page-header h1 {
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    margin: 0;
}

@media screen and (max-width: 767px) {
    .page-header .container h1 {
        font-size: 32px !important;
    }
}

/* On archive pages the card titles follow the h1, so they are h2 there (h3 in widgets): the parent's h3 rules */
.blog-one__content h2 {
    margin: 0;
    font-size: 20px;
    line-height: 34px;
    color: var(--thm-black);
    margin-bottom: 15px;
}

.blog-one__content h2 a {
    color: inherit;
    transition: 500ms;
}

.blog-one__content h2 a:hover {
    color: var(--thm-base);
}

/* The no-results heading moved from h1 to h2; keep its size */
.search_tx_box .search_title {
    font-size: 36px;
}

/* Home news block: the heading now holds "Naujienos" and is styled like the subtitle it replaces, in the dark text
   colour of the other block titles (Partneriai) */
.custom-home-news .block-title p:empty {
    display: none;
}

.custom-home-news .block-title h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1em;
    font-weight: bold;
    color: var(--9f-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
}

.custom-home-news .block-title h3:before {
    content: "";
    width: 60px;
    height: 2px;
    background-color: var(--thm-base);
    display: block;
    transform: translateX(-50%);
}

/* -------------------------------------------------------------------------------------------------------------------
 * Header: language links (replace Polylang's <select>)
 * ---------------------------------------------------------------------------------------------------------------- */
.language-switcher {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-switcher li {
    display: flex;
    align-items: center;
}

.language-switcher li + li::before {
    content: "";
    width: 1px;
    height: 14px;
    background: currentColor;
}

.language-switcher a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    padding: 0 4px;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
}

.language-switcher a[aria-current] {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------------------------------------------------
 * Menu. Desktop submenus open on hover (unchanged) or with the disclosure buttons child.js sets up (li.is-open).
 * The :focus-within reveal (style.css) only remains where child.js hasn't set up a disclosure.
 * ---------------------------------------------------------------------------------------------------------------- */
.main-nav__main-navigation > ul .menu-item.is-open > ul {
    transform: perspective(300px) scaleY(1) translateZ(0);
    visibility: visible;
    opacity: 1;
}

html.a11y-js .main-nav__main-navigation > ul .menu-item.a11y-disclosure:not(.is-open):not(:hover) > ul,
.main-nav__main-navigation > ul .menu-item.is-dismissed > ul {
    transform: perspective(300px) scaleY(0) translateZ(30px);
    visibility: hidden;
    opacity: 0;
}

/* -------------------------------------------------------------------------------------------------------------------
 * Dialogs: search, side menu, gesture video. Closed, they were only scaled away and stayed focusable. The visibility
 * switch waits for the closing transition and is immediate on opening, so main.js can focus the search field at once.
 * ---------------------------------------------------------------------------------------------------------------- */
.search-popup {
    visibility: hidden;
    transition: transform 0.7s ease, visibility 0s linear 0.7s;
}

.search-popup.active {
    visibility: visible;
    transition: transform 0.7s ease, visibility 0s linear 0s;
}

.side-menu__block {
    visibility: hidden;
    transition: transform 0.4s ease, visibility 0s linear 0.4s !important;
}

.side-menu__block.active {
    visibility: visible;
    transition: transform 0.4s ease, visibility 0s linear 0s !important;
}

.search-popup__close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 9992;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #1d1919;
    font-size: 22px;
    cursor: pointer;
}

.side-menu__close-btn {
    padding: 0;
    border: 0;
    background: transparent;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* The parent's "all 500ms" also delayed its visibility, so the menu couldn't focus it on opening */
    transition: color 500ms ease;
}

.main-nav-one .side-menu__toggler {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--thm-black);
    font-size: 18px;
    min-width: 32px;
    min-height: 32px;
    cursor: pointer;
}

.gesture-video-modal.open {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.gesture-video-modal .modal-content iframe {
    display: block;
    width: 100%;
    height: 100%;
}

.gesture-video-modal__close {
    position: absolute;
    top: -56px;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #1d1919;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* -------------------------------------------------------------------------------------------------------------------
 * 2.2.2 Home video pause button
 * ---------------------------------------------------------------------------------------------------------------- */
.home-video-section .elementor-widget-html > .elementor-widget-container {
    position: relative;
}

.home-video__toggle {
    position: absolute;
    right: 24px;
    bottom: 24px;
    z-index: 10; /* above the .home-video:after overlay (z-index 9) */
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #fff !important;
    border-radius: 50%;
    background: rgba(29, 25, 25, 0.8);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.home-video__toggle:hover {
    background: #1d1919;
}

/* -------------------------------------------------------------------------------------------------------------------
 * Cards: the image link is hidden from assistive tech, so the labels moved out of it. They let clicks through to it.
 * ---------------------------------------------------------------------------------------------------------------- */
.blog-one__media {
    position: relative;
}

.blog-one__media > a {
    display: block;
}

.blog-one__media > .custom-category-label,
.blog-one__media > .custom-education-label,
.blog-one__media > .blog-one__date {
    z-index: 2;
    pointer-events: none;
}

/* -------------------------------------------------------------------------------------------------------------------
 * Footer social icons, search form, 360° tour, documents accordion
 * ---------------------------------------------------------------------------------------------------------------- */
.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

.sidebar__search button[type=submit] {
    min-width: 44px;
    min-height: 44px;
}

/* Gutenberg file block links were 16 px tall and stacked close together (2.5.8) */
.wp-block-file a {
    display: inline-block;
    min-height: 24px;
    line-height: 24px;
}

/* Contact form labels wrap their fields; Bootstrap's inline-block labels would shrink the fields to fit */
.contact-one__form label {
    display: block;
    margin-bottom: 0;
}

button.tour-overlay-btn {
    padding: 0;
    border: 1px solid #fff !important;
    background: transparent;
}

button.tour-close-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}

.documents-accordion li.with-arrows > span[role="button"] {
    cursor: pointer;
}

/* Working hours toggles: the h4 text is a button now, looking as before */
.custom-toggle__button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
}

/* No-results search "Back to home": the global a{color:#000!important} made it black on black */
.error_btn1.btn-box .btn-one {
    color: #fff !important;
}
