/*
 * Accessibility overrides
 *
 * Loaded after the theme and third-party styles so keyboard focus remains
 * visible and the site's recurring foreground/background pairs meet WCAG AA.
 */

:root {
    --a11y-focus: #111;
    --a11y-focus-halo: #fff;
    --a11y-green-dark: #4d7000;
    --a11y-green-light: #b9e879;
    --a11y-text-muted: #626262;
}

/* WCAG 2.4.7: every focusable element receives the same visible indicator. */
:focus {
    outline: 3px solid var(--a11y-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px var(--a11y-focus-halo) !important;
}

/* On dark surfaces use a white indicator with a black outer halo. */
#Top_bar :focus,
#Sliding-top :focus,
#colorbox:focus,
#colorbox :focus,
.dark :focus,
.image_wrapper :focus,
#contactWrapper :focus {
    outline-color: #fff !important;
    box-shadow: 0 0 0 5px #111 !important;
}

/* Form controls retain the dark indicator against their light surface. */
#contactWrapper input:focus,
#contactWrapper select:focus,
#contactWrapper textarea:focus {
    outline-color: #111 !important;
    box-shadow: 0 0 0 5px #fff !important;
}

/* Keep the indicator visible when a control clips its contents. */
#Top_bar a:focus,
#Footer a:focus,
.button:focus,
.slick-arrow:focus,
.paginate_button:focus {
    position: relative;
    z-index: 10;
}

/* WCAG 1.4.3: accessible brand colour on light backgrounds and on buttons. */
a,
.themecolor,
.hr_color,
.hr_zigzag i,
.counter .icon_wrapper i,
.quick_fact .number,
.list_item .list_left,
.icon_box .icon_wrapper,
.icon_box a .icon_wrapper,
.ui-tabs .ui-tabs-nav li.ui-state-active a,
.accordion .question.active .title,
.faq .question.active .title,
#TabellaCer tbody td p strong {
    color: var(--a11y-green-dark);
}

/* Light green remains legible where green is used as foreground on dark UI. */
#Top_bar .menu > li.current-menu-item > a,
#Top_bar .menu > li.current_page_item > a,
#Top_bar .menu > li.current-menu-ancestor > a,
#Top_bar .menu > li.current_page_ancestor > a,
#Top_bar .menu > li.hover > a,
#Header a.responsive-menu-toggle i,
#Sliding-top a {
    color: var(--a11y-green-light) !important;
}

#Sliding-top a:hover {
    color: #eefbd7 !important;
}

#contactWrapper a {
    color: var(--a11y-green-light) !important;
}

input::placeholder,
textarea::placeholder {
    color: #595959;
    opacity: 1;
}

/* Buttons on pale grey and table rows on the brand colour need explicit text. */
a.button:not(.button_theme),
a.tp-button:not(.button_theme) {
    color: #555 !important;
}

a.button.button_blue,
a.tp-button.blue {
    color: #fff !important;
    background-color: #005a9c !important;
}

a.button.button_navy,
a.tp-button.navy {
    color: #fff !important;
    background-color: #3b5982 !important;
}

a.button_theme,
a.tp-button.button_theme,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
    color: #fff !important;
    background-color: var(--a11y-green-dark) !important;
}

table tr:hover td {
    color: #fff;
}

#TabellaCer tr:hover td {
    color: #343434;
}

/* Selected menu items use white text on the darker accessible brand colour. */
.menu-highlight #Top_bar #menu > ul > li.current-menu-item > a,
.menu-highlight #Top_bar #menu > ul > li.current_page_item > a,
.menu-highlight #Top_bar #menu > ul > li.current-menu-ancestor > a,
.menu-highlight #Top_bar #menu > ul > li.current_page_ancestor > a,
.menu-highlight #Top_bar #menu > ul > li.hover > a {
    color: #fff !important;
}

/* Muted copy was too light on white and off-white surfaces. */
.blockquote p.author span,
.counter .desc_wrapper .title,
.article_box .desc_wrapper p,
.team .desc_wrapper p.subtitle,
.post-meta,
.post-meta a,
.post-footer,
.pager .pages a,
.Recent_posts ul li a .desc .date,
.widget_recent_entries ul li .post-date,
.Latest_news ul li .desc_footer,
.portfolio-photo .portfolio-item .portfolio-details .details .categories,
.date_label,
.timeline_items li h3 span,
#Subheader .title,
#Subheader ul.breadcrumbs li,
#Subheader ul.breadcrumbs li a {
    color: var(--a11y-text-muted) !important;
}

#Footer,
#Footer .widget_recent_entries ul li a,
#Footer .Recent_posts ul li a .desc .date,
#Footer .widget_recent_entries ul li .post-date {
    color: #555 !important;
}

#Sliding-top .Recent_posts ul li a .desc .date,
#Sliding-top .widget_recent_entries ul li .post-date,
#Sliding-top .tp_recent_tweets .twitter_time,
#Sliding-top .widget_price_filter .price_label,
#Sliding-top .shop-filters .woocommerce-result-count,
#Sliding-top ul.product_list_widget li .quantity,
#Sliding-top .widget_shopping_cart ul.product_list_widget li dl {
    color: #eee !important;
}

/* Text selection must retain contrast in both directions. */
::-moz-selection {
    color: #fff;
    background: var(--a11y-green-dark);
}

::selection {
    color: #fff;
    background: var(--a11y-green-dark);
}

@media (forced-colors: active) {
    :focus {
        outline-color: Highlight !important;
        box-shadow: none !important;
    }
}
