/* ==========================================================================
   Ecordia Home dashboard & View Portfolio – WCAG 2.2 AA stylesheet overrides
   Load AFTER all existing stylesheets. !important is only used where the
   original colour is set by an inline style attribute or a high-specificity
   jQuery UI rule.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Visible focus  (2.4.7 Focus Visible, 2.4.11 Focus Not Obscured)
   Existing rules set outline:none on nav links, search input/button,
   jsTree anchors and context-menu links. A two-tone ring (dark outline +
   white halo) stays visible on both light and purple backgrounds.
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid #1a1a1a !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #ffffff !important;
    border-radius: 4px !important;
}

/* On the purple navbar a white ring reads better than a dark one */
.navbar a:focus-visible,
.navbar button:focus-visible,
.navbar input:focus-visible,
.navbar [tabindex]:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #1a1a1a !important;
}

button.fixed_base:focus-visible,
.navbar input[type="text"]:focus-visible,
.jstree-anchor:focus-visible,
.vakata-context li > a:focus-visible {
    outline: 3px solid #1a1a1a !important;
    outline-offset: 2px !important;
}

/* Keep focused items clear of any sticky header when scrolled into view */
html {
    scroll-padding-top: 80px;
}

/* --------------------------------------------------------------------------
   2. Text contrast  (1.4.3 Contrast Minimum – 4.5:1, or 3:1 for large text)
   -------------------------------------------------------------------------- */

/* Page heading "Ecordia Administrator [no-reply]" and "Welcome to Ecordia!"
   was #929292 on white (3.11:1) -> #595959 (7.0:1) */
.content-heading,
.content-heading small,
.menuUsersName {
    color: #595959 !important;
}

/* Dashboard tiles – colours are set inline, so !important is required.
   White text on:
     #5d9cec (2.83:1) -> #2366c4 (5.6:1)
     #37bc9b (2.38:1) -> #1d7a63 (5.4:1)
     #7266ba (passes, 5.3:1) left as is */
.ecordia-icon-widget[style*="5d9cec"] {
    background-color: #2366c4 !important;
}
.ecordia-icon-widget[style*="37bc9b"] {
    background-color: #1d7a63 !important;
}

/* User-initials avatar ("E A [") – white on #c5c8cd (1.68:1)
   -> white on #5a6270 (6.1:1) */
.menuButtonWithInitials {
    background-color: #5a6270 !important;
    color: #ffffff !important;
}

/* Footer bar "Logged in as: …" – white on #c5c8cd (1.68:1)
   -> white on #4a5160 (8.0:1); size raised from 10.67px for legibility */
#Main_Layout_Bottom_Bar {
    background-color: #4a5160 !important;
    color: #ffffff !important;
}
#Main_Layout_Bottom_Bar span,
#Main_Layout_Bottom_Bar a {
    color: #ffffff !important;
    font-size: 12px !important;
}

/* Notification badges on the navbar – white on #0b7dda (4.23:1) at ~9px
   -> white on #0a5fa8 (6.6:1) and a readable minimum size */
.navbar [class^="extrainfo_"],
.navbar [class*=" extrainfo_"] {
    background-color: #0a5fa8 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    min-width: 1.4em;
    line-height: 1.4em;
    text-align: center;
}

/* Portfolio: course link text – teal #21a6a6 on white (2.97:1)
   -> #0e7470 (5.6:1) */
.dataCell a,
.dataCell a .dataText {
    color: #0e7470 !important;
}

/* Portfolio: blue action buttons ("Individual Learning Plan" etc.) –
   white on #0b7dda (4.23:1) -> white on #0a5fa8 (6.6:1).
   White buttons ("Show Standards", "Show Users" …) are black on white and
   already pass, so they keep their look. */
.ecordiaButton:not(.whiteButton) {
    background-color: #0a5fa8 !important;
    color: #ffffff !important;
}
.dropbtn:not(.whiteButton) {
    background-color: #0a5fa8 !important;
    color: #ffffff !important;
}

/* Portfolio side menu: "EPA Evidence" label – #808080 on #e4edf2 (3.33:1)
   -> #4d4d4d (7.6:1) */
#peTextPlaceHolder {
    color: #4d4d4d !important;
}

/* Search placeholder text must also meet 4.5:1 */
#txtMenuSearch::placeholder,
input::placeholder,
textarea::placeholder {
    color: #6b6b6b;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   3. Non-text contrast  (1.4.11 – icons and control boundaries 3:1)
   -------------------------------------------------------------------------- */

/* Settings / refresh icons were #929292 on white (3.06:1, borderline)
   -> #595959 (7.0:1) */
.dashboard-icon,
.dashboard-icon i,
.dashboard-icon svg {
    color: #595959 !important;
    fill: #595959;
}

/* jQuery UI accordion headers: #d3d3d3 border on #e6e6e6 is invisible;
   give the header a 3:1 boundary so it reads as a control */
.ui-accordion .ui-accordion-header.ui-state-default {
    border-color: #767676 !important;
    color: #333333 !important;
}

/* Portfolio progress bars: #c4c4c4 outline on white (1.7:1) is invisible
   -> #767676 (4.5:1). Expected-progress fill #ff6961 (2.6:1) -> #c8322a (5.3:1) */
.progress-bar,
.expected-progress-bar {
    border-color: #767676 !important;
}

/* Form fields: ensure inputs have a visible boundary */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    border-color: #767676;
}

/* --------------------------------------------------------------------------
   4. Target size  (2.5.8 Target Size Minimum – 24 × 24 CSS px)
   -------------------------------------------------------------------------- */

/* Task accordion links were 17px tall */
.ui-accordion .ui-accordion-header > a {
    display: inline-block;
    min-height: 24px;
    line-height: 24px;
}

/* Navbar search button, "+" quick-add and dashboard icon buttons */
#btnMenuSearch,
.subMenuAnchor,
.dashboard-icon {
    min-width: 24px;
    min-height: 24px;
}

/* Portfolio: unit-details and progress-details icon links were 19×16 / 15×16 */
#unitDetails,
#progressDetails {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

/* Portfolio unit tree: unit links ("201 - Consultation" …) were 16px tall,
   print-criteria icon 23px */
.unitAndAimProgressBar a {
    display: inline-block;
    min-height: 24px;
    line-height: 24px;
}
/* The print icon's box already spans the panel, so no text-align:center here:
   it moved the icon from the left edge to the middle. */
.printCriteriaUnit {
    display: inline-block;
    min-width: 24px;
    min-height: 24px;
    line-height: 24px;
}

/* --------------------------------------------------------------------------
   5. Text spacing & reflow  (1.4.12 Text Spacing, 1.4.10 Reflow)
   Let containers grow when users apply their own spacing, and stop
   fixed-width content from forcing sideways scroll at 320px / 400% zoom.
   -------------------------------------------------------------------------- */
.ui-accordion .ui-accordion-header,
.ecordia-icon-widget-text,
.panel-body {
    height: auto;
    overflow-wrap: break-word;
}

/* Dashboard tiles keep their 80px height: they are display:table, so that
   height is already a minimum and the tile grows with its text.
   height:auto here shrank them to uneven 44-71px. */
.ecordia-icon-widget {
    overflow-wrap: break-word;
}

img,
iframe,
canvas,
svg {
    max-width: 100%;
}

@media (max-width: 640px) {
    #row-of-three-widgets {
        display: flex;
        flex-wrap: wrap;
    }
    .ecordia-icon-widget {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .navbar {
        display: flex;
        flex-wrap: wrap;
        height: auto !important;
    }
    .navbarRightSection {
        width: 100%;
    }
    #txtMenuSearch {
        width: calc(100% - 48px);
    }
}

/* --------------------------------------------------------------------------
   6. Motion  (2.2.2 Pause, Stop, Hide – best effort)
   -------------------------------------------------------------------------- */
/* Transitions are switched off (0s), not made very short: an element's
   transition-property is "all" unless a page sets it, so a duration of 0.01ms
   gave EVERY element a transition on EVERY property. Moves made by script then
   took effect a frame later, and Telerik read positions too soon - with Windows
   "Animation effects" off, the RadEditor toolbar (ToolbarMode PageTop) was
   pinned above the editor instead of at the top of the window (Peter, 24 Nov
   2026). Animations keep 0.01ms: only elements with an animation have one. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   7. Helpers used by the HTML changes (skip link, screen-reader-only text)
   -------------------------------------------------------------------------- */
.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;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 10000;
    padding: 8px 16px;
    background: #1a1a1a;
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
}
.skip-link:focus {
    top: 8px;
}
