/* EasyHPC Phase 6 branding and accessibility polish. */
.easyhpc-skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10000;
    padding: .65rem 1rem;
    border-radius: .5rem;
    background: #000;
    color: #fff !important;
    font-weight: 700;
    transition: top .15s ease-in-out;
}
.easyhpc-skip-link:focus {
    top: 1rem;
    outline: 4px solid var(--easyhpc-accent, #f59e0b);
}

/* Moodle Boost renders standard_top_of_body_html before its fixed navbar.
   When that navbar is present, JS adds this class and sets the measured offset
   so the EasyHPC banner is visible below the header instead of being covered. */
html.easyhpc-has-fixed-header .easyhpc-top-banner {
    margin-top: var(--easyhpc-fixed-header-offset, 56px);
}
@supports selector(#page-wrapper:has(> nav.navbar.fixed-top)) {
    #page-wrapper:has(> nav.navbar.fixed-top) > .easyhpc-top-banner {
        margin-top: var(--easyhpc-fixed-header-offset, 56px);
    }
}

.easyhpc-top-banner {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: .85rem clamp(1rem, 3vw, 2rem);
    background: linear-gradient(90deg, var(--easyhpc-primary, #1f4f8c), #2f6fb6);
    color: #fff;
    box-shadow: 0 3px 16px rgba(0, 0, 0, .18);
}
.easyhpc-brand-main {
    display: flex;
    gap: .8rem;
    align-items: center;
    min-width: 0;
}
.easyhpc-brand-logo {
    box-sizing: border-box;
    width: auto;
    height: 48px;
    max-width: 122px;
    object-fit: contain;
    background: #fff;
    border-radius: .35rem;
    padding: .18rem .25rem;
    flex: 0 0 auto;
}
.easyhpc-brand-monogram {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: var(--easyhpc-accent, #f59e0b);
    color: #111827;
    font-weight: 800;
    letter-spacing: .04em;
    flex: 0 0 auto;
}
.easyhpc-brand-title {
    display: block;
    font-size: 1.05rem;
    line-height: 1.2;
}
.easyhpc-brand-subtitle {
    font-size: .92rem;
    line-height: 1.25;
    opacity: .95;
}
.easyhpc-accessibility-toolbar {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.easyhpc-a11y-button {
    border: 1px solid rgba(255, 255, 255, .7);
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .85rem;
    line-height: 1.2;
    cursor: pointer;
}
.easyhpc-a11y-button:hover,
.easyhpc-a11y-button:focus,
.easyhpc-a11y-button[aria-pressed="true"] {
    background: #fff;
    color: var(--easyhpc-primary, #1f4f8c);
    outline: 3px solid var(--easyhpc-accent, #f59e0b);
    outline-offset: 2px;
}
.easyhpc-footer-branding {
    margin: 1.5rem auto 0;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    border-top: 4px solid var(--easyhpc-accent, #f59e0b);
    background: #f5f8fc;
    color: #1f2937;
}
.easyhpc-cofunding {
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto .9rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid #cbd5e1;
}
.easyhpc-cofunding-logo {
    width: 210px;
    max-width: 36vw;
    height: auto;
    max-height: 92px;
    object-fit: contain;
    background: #fff;
    border-radius: .35rem;
    flex: 0 0 auto;
}
.easyhpc-cofunding-text {
    max-width: 720px;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.45;
}
.easyhpc-footer-text {
    max-width: 1100px;
    margin: 0 auto .4rem;
    font-size: .95rem;
}
.easyhpc-footer-links {
    max-width: 1100px;
    margin: 0 auto;
    font-weight: 600;
}
.easyhpc-branded a:focus,
.easyhpc-branded button:focus,
.easyhpc-branded input:focus,
.easyhpc-branded select:focus,
.easyhpc-branded textarea:focus {
    outline: 3px solid var(--easyhpc-accent, #f59e0b) !important;
    outline-offset: 2px;
}
html.easyhpc-large-text body {
    font-size: 1.14rem;
}
html.easyhpc-large-text .easyhpc-brand-title {
    font-size: 1.25rem;
}
html.easyhpc-high-contrast body,
html.easyhpc-high-contrast #page,
html.easyhpc-high-contrast #topofscroll.main-inner,
html.easyhpc-high-contrast #region-main,
html.easyhpc-high-contrast .easyhpc-footer-branding,
html.easyhpc-high-contrast .card,
html.easyhpc-high-contrast .modal-content,
html.easyhpc-high-contrast .dropdown-menu,
html.easyhpc-high-contrast .list-group-item,
html.easyhpc-high-contrast nav.navbar,
html.easyhpc-high-contrast nav.navbar.bg-white {
    background: #000 !important;
    color: #fff !important;
}
html.easyhpc-high-contrast a {
    color: #ffff66 !important;
}
html.easyhpc-high-contrast h1,
html.easyhpc-high-contrast h2,
html.easyhpc-high-contrast h3,
html.easyhpc-high-contrast h4,
html.easyhpc-high-contrast h5,
html.easyhpc-high-contrast h6,
html.easyhpc-high-contrast .page-header-headings,
html.easyhpc-high-contrast .page-context-header {
    color: #fff !important;
}
html.easyhpc-high-contrast .easyhpc-top-banner {
    background: #000 !important;
    border-bottom: 4px solid #ffff66;
}
html.easyhpc-high-contrast .easyhpc-cofunding {
    border-bottom-color: #fff !important;
}
html.easyhpc-high-contrast .generaltable {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}
html.easyhpc-high-contrast nav.navbar,
html.easyhpc-high-contrast nav.navbar.bg-white,
html.easyhpc-high-contrast nav.navbar .dropdown-menu {
    border-color: #fff !important;
}
html.easyhpc-high-contrast nav.navbar .nav-link,
html.easyhpc-high-contrast nav.navbar .navbar-brand,
html.easyhpc-high-contrast nav.navbar .btn,
html.easyhpc-high-contrast nav.navbar .dropdown-item {
    color: #ffff66 !important;
}
html.easyhpc-high-contrast nav.navbar .nav-link.active {
    border-bottom-color: #ffff66 !important;
}
html.easyhpc-high-contrast nav.navbar .dropdown-item:hover,
html.easyhpc-high-contrast nav.navbar .dropdown-item:focus,
html.easyhpc-high-contrast nav.navbar .dropdown-item.active,
html.easyhpc-high-contrast nav.navbar .dropdown-item[aria-current="true"] {
    background: #ffff66 !important;
    color: #000 !important;
}
html.easyhpc-high-contrast nav.navbar .navbar-toggler-icon {
    filter: invert(1);
}
html.easyhpc-high-contrast .easyhpc-a11y-button {
    background: #000 !important;
    border-color: #fff !important;
    color: #fff !important;
}
html.easyhpc-high-contrast .easyhpc-a11y-button:hover,
html.easyhpc-high-contrast .easyhpc-a11y-button:focus,
html.easyhpc-high-contrast .easyhpc-a11y-button[aria-pressed="true"] {
    background: #ffff66 !important;
    color: #000 !important;
    outline-color: #fff !important;
}
html.easyhpc-high-contrast input,
html.easyhpc-high-contrast select,
html.easyhpc-high-contrast textarea,
html.easyhpc-high-contrast .form-control {
    background: #000 !important;
    border-color: #fff !important;
    color: #fff !important;
}
html.easyhpc-high-contrast .form-control::placeholder {
    color: #d6d6d6 !important;
    opacity: 1;
}
html.easyhpc-high-contrast th,
html.easyhpc-high-contrast td {
    border-color: #fff !important;
}
html.easyhpc-reduced-motion *,
html.easyhpc-reduced-motion *::before,
html.easyhpc-reduced-motion *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
}
@media (max-width: 760px) {
    .easyhpc-top-banner {
        align-items: stretch;
        flex-direction: column;
    }
    .easyhpc-accessibility-toolbar {
        justify-content: flex-start;
    }
    .easyhpc-brand-subtitle {
        font-size: .88rem;
    }
    .easyhpc-cofunding {
        align-items: flex-start;
        flex-direction: column;
    }
    .easyhpc-cofunding-logo {
        width: 190px;
        max-width: 70vw;
    }
}
@media (prefers-reduced-motion: reduce) {
    .easyhpc-skip-link,
    .easyhpc-a11y-button {
        transition: none;
    }
}
