/*
 * Accessibility overrides — WCAG 2.1 Level AA remediation.
 * Loaded last on every page so it wins over main.css / responsive.css and the
 * per-page <style> blocks. Each rule notes the success criterion it closes.
 */

/* ---------- Utilities ---------- */

/* Text for assistive technology only (hidden visually, still announced). */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- 2.4.1 Bypass Blocks: skip link ---------- */

.skip-link {
    position: absolute;
    top: 0;
    left: -9999px;
    z-index: 2000;
    padding: 0.75rem 1rem;
    background: #fff;
    color: #0C4EAC;
    font-weight: 600;
    text-decoration: underline;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* Programmatic focus target of the skip link; no ring needed on the region itself. */
main[tabindex="-1"]:focus {
    outline: none;
}

/* ---------- 2.4.7 Focus Visible / 1.4.11 Non-text Contrast ----------
 * main.css sets `outline: 0 none` on every link, button and input.
 * Restore a 3px ring that clears 3:1 on white, the beige form panel and
 * the light-blue popups. */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #0C4EAC !important;
    outline-offset: 2px !important;
}

/* Footer and hero sit on dark blue: use a white ring there. */
.footer-links-wrapper a:focus-visible,
.footer-links-wrapper button:focus-visible {
    outline-color: #fff !important;
}

/* ---------- 1.4.3 Contrast (Minimum) ---------- */

/* Footer copy was #9DB5D9 on #0C4EAC (3.71:1); headings #85A2CF (2.98:1). */
.footer-disclaimer {
    color: #DCE5F3; /* 6.1:1 */
}

.footer-single h2,
.footer-disclaimer h2 {
    color: #fff; /* 7.8:1 */
}

/* Thank-you lead text was #666D78 on #E9ECEF (4.4:1). */
.jumbotron .lead,
.jumbotron .lead strong {
    color: #454B54; /* 7.4:1 */
}

/* ---------- 1.4.1 Use of Color: links in text are underlined ---------- */

main a:not(.tls-popup-link):not(.btn),
.footer-links-wrapper a,
.footer-links-wrapper .disclaimer-content a {
    text-decoration: underline;
}

.footer-links-wrapper .disclaimer-content a {
    color: #fff;
}

/* ---------- Header: native buttons styled like the old links (2.1.1, 4.1.2) ---------- */

.tl-contact,
.tl-contact-mobile {
    padding: 0;
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

.navbar.navbar-gepl .navbar-nav .nav-link.tl-contact-mobile {
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    color: inherit;
}

/* Fixed 92px height clipped the menu under text spacing / zoom (1.4.4, 1.4.12). */
@media (max-width: 767px) {
    .navbar-nav {
        height: auto;
        min-height: 92px;
    }
}

/* Mobile contact dialog (2.1.2, 2.4.3). script.js used jQuery fadeIn; a11y.js toggles .is-open. */
.popup-overlay.is-open,
.tls-popup-mobile.is-open {
    display: block;
}

.tls-popup-mobile {
    max-width: calc(100vw - 2rem);
}

.dialog-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    font-size: 28px;
    line-height: 44px;
    color: #163D7F;
    cursor: pointer;
}

/* ---------- Home hero: real text replaces the text baked into the image (1.1.1, 1.4.5) ----------
 * Desktop: advisory-hero-desktop.jpg is the original 1116×700 photo with its text
 * band painted solid (rows 380–537, x 0–785). The photo layer is always drawn at
 * the banner's full height, so the band's position is a fixed fraction of that
 * height and the real <h1> is laid exactly over it — at native resolution.
 * Phone/tablet: the original "Welcome…" artwork — photo strip (advisory-hero-strip.jpg,
 * cut from landingpage-mobile.jpg), blue band, grey rule, beige panel — with the band
 * rebuilt in HTML/CSS. */

.hero-title {
    margin: 0;
    color: #fff;
    font-weight: 600;
}

.hero-title-mobile {
    display: none;
}

.hero-photo {
    display: contents;
}

@media (min-width: 992px) {
    .banner {
        min-height: 356px;
        overflow: hidden;
        background: #F0F0E9;
    }

    .banner .hero-photo {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        display: block;
        height: 100%;
        max-width: 62%; /* never reaches the form column */
        aspect-ratio: 1116 / 700;
        overflow: hidden;
        background: url(../images/advisory-hero-desktop.jpg) no-repeat left top / auto 100%;
        border-right: 10px solid #96A0B3; /* divider from the original artwork */
    }

    .banner > .container {
        position: relative;
        z-index: 1;
    }

    .banner .hero-title {
        position: absolute;
        top: 54.2857%;       /* 380 / 700 */
        left: 0;
        display: flex;
        align-items: center;
        height: 22.5714%;    /* 158 / 700 */
        min-height: -moz-fit-content;
        min-height: fit-content; /* grows over the photo instead of clipping at 200% text */
        max-width: 100%;
        aspect-ratio: 786 / 158;
        padding: 0 1.5rem 0 2.5rem;
        font-size: clamp(1rem, 1.45vw, 1.5rem);
        line-height: 1.35;
        background: #2E5089; /* same as the painted band; white text 8.2:1 */
    }
}

@media (max-width: 991.98px) {
    .banner.p-5 {
        padding: 10.47% 0 2rem !important; /* photo strip: 47 / 449 */
        background: #EEEFE9 url(../images/advisory-hero-strip.jpg) no-repeat center top / 100% auto;
    }

    .banner .hero-title {
        padding: 1.25rem 1rem;
        font-size: 1rem;
        line-height: 1.4;
        letter-spacing: 0.02em;
        text-align: center;
        text-transform: uppercase;
        background: #4A6696; /* white text: 5.8:1 */
        border-bottom: 9px solid #969EB0;
    }

    .hero-title-desktop {
        display: none;
    }

    .hero-title-mobile {
        display: inline;
    }

    .banner .slider-info {
        display: none;
    }

    .banner .banner-form {
        margin: 2.5rem auto 1rem !important;
    }
}

/* ---------- Home contact form (1.3.1, 3.3.1, 3.3.2, 1.4.11) ---------- */

.banner-form label {
    display: block;
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: #222831;
}

.banner-form .field-hint {
    margin: 0 0 0.4em;
    font-size: 0.875rem;
    color: #3F4652;
}

/* Field boundary was #CED4DA on the beige panel (1.4:1). */
.banner-form input[type="text"],
.banner-form input[type="email"],
.banner-form input[type="tel"] {
    width: 100%;
    margin-bottom: 0.8em;
    padding: 0.8em 1em;
    font-size: 16px;
    letter-spacing: 1px;
    background: #fff;
    border: 1px solid #6B6B6B; /* 4.6:1 against the panel */
    border-radius: 0;
    -webkit-appearance: none;
}

/* Error text: red alone is not enough, and #DC3545 was under 4.5:1 on beige. */
.banner-form .field-error {
    margin: -0.4em 0 0.8em;
    font-size: 0.875rem;
    font-weight: 600;
    color: #A4001C; /* 7.0:1 on the panel */
}

.banner-form .field-error::before {
    content: "\26A0\FE0E  ";
    content: "\26A0\FE0E  " / "";
}

.banner-form .form-message:empty {
    display: none;
}

.banner-form .form-message {
    margin: 0.8em 0 0;
    font-weight: 600;
    color: #222831;
}

.banner-form .form-message.is-error {
    color: #A4001C;
}

/* ---------- FAQ accordion: <button> triggers (2.1.1, 4.1.2) ---------- */

.faq-item-heading {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.faq-list .question {
    width: 100%;
    margin: 0;
    color: inherit;
    font-family: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-align: left;
    background: none;
    border: 0;
}

/* The "+" icon is decoration; give it empty alt text where supported. */
.faq-list .question::after {
    content: "\002B" / "";
}

/* ---------- Footer headings (h4 → h2) and mobile toggles ---------- */

.footer-heading {
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.footer-toggle {
    display: block;
    width: 100%;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
}

.footer-toggle[aria-expanded="true"] .footer-link-arrow {
    transform: rotate(180deg);
}

@media (max-width: 767px) {
    .footer-heading {
        position: relative;
        margin: 0;
    }

    .footer-disclaimer .footer-heading {
        margin: 0 0 20px 0;
    }

    .footer-links-list.is-open,
    .disclaimer-content.is-open {
        display: block;
    }
}

.footer-middle-links {
    gap: 0 40px;
}

/* ---------- Tables ---------- */

/* 1.4.10 Reflow: wide tables scroll inside a keyboard-focusable region. */
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.investor-charter-content table.medium-editor-table th {
    padding: 16px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    text-align: left;
    vertical-align: bottom;
    background: #C7D3E9;
    border: 4px solid #fff;
}

/* Complaint-process flowchart, rebuilt in HTML (was an image of text: 1.1.1, 1.4.5).
 * Arrows are decorative pseudo-elements; the sequence is carried by the <ol>. */
.complaint-flow {
    --cf-blue: #1E3F86;
    --cf-arrow: #D32F2F; /* 4.98:1 on white (1.4.11) */
    --cf-gap: 2.5rem;
    margin: 1.5rem 0 2rem;
    color: #163D7F;
}

.investor-charter-content .complaint-flow ul,
.investor-charter-content .complaint-flow ol {
    margin: 0;
}

.cf-terminal {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    background: #DCE6F5;
    border: 3px solid var(--cf-blue);
}

.cf-start {
    margin-bottom: var(--cf-gap);
}

.cf-end {
    margin: var(--cf-gap) 0 0 auto;
}

.cf-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--cf-gap);
    padding: 0 !important;
    list-style: none;
}

.cf-step {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(22, 61, 127, 0.15);
}

.cf-actions {
    flex: 1;
    padding: 1rem 1rem 1rem 2rem !important;
    font-size: 0.875rem;
    line-height: 1.45;
    list-style: disc;
    border: 3px solid var(--cf-blue);
    border-radius: 12px;
}

.cf-actions li + li {
    margin-top: 0.6rem;
}

.cf-outcome {
    margin: 0.6rem 0 0;
    padding: 0.6rem 0.75rem;
    font-size: 1.05rem;
    line-height: 1.35;
    background: #D9E2F0;
    border-radius: 8px;
}

/* Arrow shaft (::before) and head (::after), pointing right between columns… */
.cf-step + .cf-step::before,
.cf-step + .cf-step::after,
.cf-start::before,
.cf-start::after,
.cf-end::before,
.cf-end::after {
    content: "";
    position: absolute;
}

.cf-step + .cf-step::before {
    top: 50%;
    left: calc(-1 * var(--cf-gap) + 4px);
    width: calc(var(--cf-gap) - 14px);
    height: 3px;
    background: var(--cf-arrow);
}

.cf-step + .cf-step::after {
    top: calc(50% - 7px);
    left: -12px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 10px solid var(--cf-arrow);
}

/* …and pointing down into the first step and out of the last one. */
.cf-start::before,
.cf-end::before {
    left: 50%;
    width: 3px;
    background: var(--cf-arrow);
}

.cf-start::before {
    top: 100%;
    height: calc(var(--cf-gap) - 10px);
}

.cf-end::before {
    bottom: calc(100% + 13px);
    height: calc(var(--cf-gap) - 14px);
}

.cf-start::after,
.cf-end::after {
    left: calc(50% - 7px);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--cf-arrow);
}

.cf-start::after {
    top: calc(100% + var(--cf-gap) - 13px);
}

.cf-end::after {
    bottom: calc(100% + 3px);
}

@media (min-width: 992px) {
    /* Start box sits over the first column, end box under the last. */
    .cf-terminal {
        width: calc((100% - 3 * var(--cf-gap)) / 4);
    }
}

@media (max-width: 991.98px) {
    .cf-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .cf-step + .cf-step::before {
        top: calc(-1 * var(--cf-gap) + 4px);
        left: 50%;
        width: 3px;
        height: calc(var(--cf-gap) - 14px);
    }

    .cf-step + .cf-step::after {
        top: -12px;
        left: calc(50% - 7px);
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 10px solid var(--cf-arrow);
        border-bottom: 0;
    }

    .cf-terminal,
    .cf-end {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
}

/* ---------- 1.4.10 Reflow ---------- */

img,
video,
table {
    max-width: 100%;
}

.investor-charter-content,
.about-content-wrapper,
.disclaimer-content {
    overflow-wrap: break-word;
}

/* ---------- 2.2.2 Pause, Stop, Hide / motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* "View Complaints Data" was an <h4> inside a <p>; keep its visual weight as a paragraph. */
.complaints-data-link {
    margin: 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Sitemap page (2.4.5 Multiple Ways) */
.sitemap-list {
    margin: 1.5rem 0 3rem;
    padding-left: 1.25rem;
}

.sitemap-list li {
    margin-bottom: 0.75rem;
}

/* "CALL US" label in the contact popup was #3F6DB4 on #C7D3E9 (3.43:1). */
.call-us .txtxs {
    color: #163D7F; /* 7.1:1 */
}
