/* Accessibility overrides — loaded after theme CSS */

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 0.75rem 1.25rem;
    background: #1a1a1a;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-link:focus,
.skip-link:focus-visible {
    left: 0;
    outline: 3px solid #ffd100;
    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,
[tabindex]:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.navbar-toggler:focus-visible,
area:focus-visible,
.carousel-pause-btn:focus-visible,
.ticker-pause-btn:focus-visible {
    outline: 3px solid #1a3a8f !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #ffffff !important;
}

/* Contrast: brand blue text on light backgrounds needs darker blue */
.marquee-text,
.marquee-text strong,
.accessible-ticker,
.accessible-ticker strong {
    color: #2a3d7a !important;
}

/* Live rates / light text on colored cards — ensure readable white on darker bg */
.live-rates-card,
.rate-box,
.gold-box,
.silver-box {
    color: #ffffff;
}

/* Accessible branch ticker (replaces marquee) */
.accessible-ticker-wrap,
.accessible-home-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    width: 100%;
}

.accessible-ticker {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    color: #2a3d7a;
    font-weight: 500;
}

.accessible-ticker-track {
    display: inline-block;
    padding-left: 100%;
    animation: a11y-ticker-scroll 40s linear infinite;
    animation-play-state: running;
}

/* Button-controlled pause (works for topbar + home ticker) */
.accessible-ticker-wrap.is-paused .accessible-ticker-track,
.accessible-home-ticker.is-paused .accessible-ticker-track {
    animation-play-state: paused !important;
}

/* Pause only while hovering the scrolling text — not the Pause/Play button */
.accessible-ticker-wrap:not(.is-paused) .accessible-ticker:hover .accessible-ticker-track,
.accessible-home-ticker:not(.is-paused) .accessible-ticker:hover .accessible-ticker-track {
    animation-play-state: paused;
}

@keyframes a11y-ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ticker-pause-btn,
.carousel-pause-btn {
    flex-shrink: 0;
    border: 1px solid #2a3d7a;
    background: #ffffff;
    color: #2a3d7a;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.2;
    z-index: 6;
}

.carousel-pause-btn {
    position: absolute;
    z-index: 20;
    top: 0.75rem;
    right: 0.75rem;
}

.carousel-pause-wrap {
    position: relative;
}

/* Visually hidden but available to screen readers */
.sr-only-a11y {
    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;
}

/* City name tip on map pin hover — does not affect map size */
.map-city-tip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: #ebebeb;
    border: 2px solid grey;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
}

.map-city-tip[hidden] {
    display: none !important;
}

/* Color contrast overrides (WCAG 1.4.3) */
body .heading-text h1,
body .heading-text h2,
body .heading-text h3,
body .heading-text h4,
body h2[style*="#3952a3"],
body h2 span[style*="#3952a3"],
body h3[style*="#3952a3"],
body h4[style*="#3952a3"],
body span[style*="#3952a3"],
.border-rounded-side-box .title,
.border-rounded-side-box .content,
a[style*="#3952a3"] {
    color: #2a3d7a !important;
}

/* Muted / gray text often fails contrast */
.text-muted,
footer a,
.footer a,
#footer a {
    color: #595959 !important;
}

body,
p {
    /* ensure default body text is dark enough if theme uses light gray */
}

.marquee-home,
.accessible-home-ticker {
    background-color: #2a3d7a;
    color: #ffffff !important;
    width: 100%;
    margin: 0 auto;
    padding: 10px 1rem;
    font-size: 16px;
    box-sizing: border-box;
}

.accessible-home-ticker .accessible-ticker,
.accessible-home-ticker strong {
    color: #ffffff !important;
}

.accessible-home-ticker .ticker-pause-btn {
    border-color: #ffffff;
    background: #ffffff;
    color: #2a3d7a;
}

.rate-display-box {
    background-color: #2a3d7a !important;
}

.rate-display-box .text-white,
.rate-display-box h5 {
    color: #ffffff !important;
}

/* Slide caption h1 visual size when demoted */
.slide-captions .slide-title {
    font-size: inherit;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.slide-captions .banner-eyebrow {
    font-size: inherit;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

/* Match former slide h1 styling for demoted titles */
.inspiro-slider .slide .slide-captions .slide-title,
.inspiro-slider .slide .slide-captions .h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 0;
    line-height: 1.2;
    color: inherit;
}

@media (max-width: 991.98px) {
    .inspiro-slider .slide .slide-captions .slide-title,
    .inspiro-slider .slide .slide-captions .h1 {
        font-size: 32px;
    }
}
