/* Modern EasyHPC homepage and wordmark. Kept separate from accessibility CSS. */

nav.navbar .navbar-brand {
    min-width: 0;
}

.easyhpc-navbar-wordmark {
    display: block;
    width: 160px;
    height: 42px;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

html.easyhpc-homepage-ready body#page-site-index #page-header,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] > .course-content,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] > #frontpage-category-names,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] > #frontpage-available-course-list,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] > .skip-block,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] > .skip-block-to,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] > br {
    display: none !important;
}

html.easyhpc-homepage-ready body#page-site-index #topofscroll.main-inner {
    max-width: 1280px;
}

html.easyhpc-homepage-ready body#page-site-index #region-main,
html.easyhpc-homepage-ready body#page-site-index #region-main > div,
html.easyhpc-homepage-ready body#page-site-index #region-main [role="main"] {
    min-width: 0;
}

.easyhpc-homepage {
    --easyhpc-home-navy: #10264a;
    --easyhpc-home-teal: #0c9eb4;
    --easyhpc-home-blue: #347fe2;
    --easyhpc-home-coral: #e57658;
    --easyhpc-home-surface: #f6fbfd;
    box-sizing: border-box;
    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 0 0 2.75rem;
    color: var(--easyhpc-home-navy);
}

.easyhpc-homepage *,
.easyhpc-homepage *::before,
.easyhpc-homepage *::after {
    box-sizing: border-box;
}

.easyhpc-home-hero {
    position: relative;
    display: block;
    min-height: 390px;
    overflow: hidden;
    margin-bottom: 1.35rem;
    border: 1px solid #d9e8ee;
    border-radius: 1rem;
    background: #f7fbff;
    box-shadow: 0 16px 46px rgba(33, 72, 104, .09);
}

.easyhpc-home-hero-copy {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(54%, 640px);
    min-height: 390px;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4.25rem);
}

.easyhpc-home-hero h1 {
    max-width: 13ch;
    margin: 0 0 .8rem;
    color: var(--easyhpc-home-navy);
    font-size: clamp(2.3rem, 4.2vw, 4rem);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.02;
}

.easyhpc-home-hero p {
    max-width: 31rem;
    margin: 0;
    color: #2c3d58;
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
    line-height: 1.5;
}

.easyhpc-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 1.7rem;
}

.easyhpc-home-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    border: 1px solid transparent;
    border-radius: .55rem;
    padding: .72rem 1.15rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.easyhpc-home-button:hover {
    transform: translateY(-1px);
}

.easyhpc-home-button-primary {
    background: linear-gradient(90deg, var(--easyhpc-home-teal), #18a9bc);
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(12, 158, 180, .2);
}

.easyhpc-home-button-primary:hover {
    background: #087f96;
}

.easyhpc-home-button-secondary {
    border-color: #bfd4de;
    background: rgba(255, 255, 255, .72);
    color: var(--easyhpc-home-navy) !important;
}

.easyhpc-home-button-secondary:hover {
    background: #fff;
}

.easyhpc-home-hero-visual {
    position: absolute;
    z-index: 0;
    inset: 0;
    min-width: 0;
}

.easyhpc-home-hero-visual::before {
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    width: 58%;
    background: linear-gradient(90deg, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .88) 55%, rgba(255, 255, 255, 0) 100%);
    content: "";
}

.easyhpc-home-hero-visual img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 390px;
    object-fit: cover;
    object-position: center;
}

/* Wide second banner, matching the hero width without changing its layout. */
.easyhpc-home-video-banner {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 5.4 / 1;
    min-height: 150px;
    margin-bottom: 1.35rem;
    border: 1px solid #d9e8ee;
    border-radius: .8rem;
    background: #071c29;
    box-shadow: 0 8px 24px rgba(39, 70, 96, .08);
}

.easyhpc-home-video-banner video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.easyhpc-home-video-toggle {
    position: absolute;
    right: .85rem;
    bottom: .85rem;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #071c29;
    color: #fff;
    cursor: pointer;
}

.easyhpc-home-video-toggle[hidden],
.easyhpc-home-video-pause,
.easyhpc-home-video-toggle[data-playing="true"] .easyhpc-home-video-play {
    display: none;
}

.easyhpc-home-video-toggle[data-playing="true"] .easyhpc-home-video-pause {
    display: block;
}

.easyhpc-home-video-toggle svg {
    width: 22px;
    height: 22px;
}

.easyhpc-home-video-toggle:hover {
    background: #17465c;
}

.easyhpc-home-video-toggle:focus-visible {
    outline: 3px solid #ffff66;
    outline-offset: 3px;
}

html.easyhpc-high-contrast .easyhpc-home-video-banner {
    border-color: #fff;
}

html.easyhpc-high-contrast .easyhpc-home-video-toggle {
    border-color: #ffff66 !important;
    background: #000 !important;
    color: #ffff66 !important;
}

@media (max-width: 700px) {
    .easyhpc-home-video-banner {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }
}

.easyhpc-home-quicklinks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2.4rem;
}

.easyhpc-home-quicklink {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 112px;
    border: 1px solid #e0e9ee;
    border-radius: .8rem;
    padding: 1rem 1.15rem;
    background: #fff;
    color: var(--easyhpc-home-navy) !important;
    text-decoration: none !important;
    box-shadow: 0 8px 24px rgba(39, 70, 96, .06);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.easyhpc-home-quicklink:hover {
    transform: translateY(-2px);
    border-color: #9bd9e1;
    box-shadow: 0 12px 28px rgba(39, 70, 96, .1);
}

.easyhpc-home-quicklink-icon,
.easyhpc-home-category-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 999px;
    background: #e8f8fa;
    color: var(--easyhpc-home-teal);
}

.easyhpc-home-quicklink:nth-child(2) .easyhpc-home-quicklink-icon {
    background: #fff0ea;
    color: var(--easyhpc-home-coral);
}

.easyhpc-home-quicklink-icon svg,
.easyhpc-home-category-icon svg {
    width: 30px;
    height: 30px;
}

.easyhpc-home-quicklink-copy {
    min-width: 0;
}

.easyhpc-home-quicklink-copy strong {
    display: block;
    margin-bottom: .25rem;
    color: var(--easyhpc-home-navy);
    font-size: 1rem;
}

.easyhpc-home-quicklink-copy small {
    display: block;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.45;
}

.easyhpc-home-arrow {
    color: #68849c;
    font-size: 1.5rem;
}

.easyhpc-home-section {
    margin-top: 2.5rem;
}

.easyhpc-home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.easyhpc-home-section-heading h2 {
    margin: 0;
    color: var(--easyhpc-home-navy);
    font-size: clamp(1.6rem, 2.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.easyhpc-home-section-heading > a {
    color: #497a9b;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
}

.easyhpc-home-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.easyhpc-home-category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: center;
    min-height: 104px;
    border: 1px solid #e2eaf0;
    border-radius: .75rem;
    padding: 1rem;
    background: #fff;
    color: var(--easyhpc-home-navy) !important;
    text-decoration: none !important;
    box-shadow: 0 6px 20px rgba(38, 70, 96, .05);
    transition: transform .18s ease, border-color .18s ease;
}

.easyhpc-home-category-card:hover {
    transform: translateY(-2px);
    border-color: #acdce3;
}

.easyhpc-home-category-card:nth-child(3n+2) .easyhpc-home-category-icon {
    background: #f5efff;
    color: #8057c7;
}

.easyhpc-home-category-card:nth-child(3n+3) .easyhpc-home-category-icon {
    background: #edf3ff;
    color: #4a78c9;
}

.easyhpc-home-category-card strong {
    min-width: 0;
    font-size: 1rem;
}

.easyhpc-home-category-count {
    display: inline-grid;
    min-width: 30px;
    min-height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #e9f8fa;
    color: var(--easyhpc-home-teal);
    font-size: .85rem;
    font-weight: 800;
}

.easyhpc-home-course-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.easyhpc-home-course-card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #dfe8ed;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(35, 67, 94, .08);
}

.easyhpc-home-course-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 8.7;
    background: #eaf4f8;
}

.easyhpc-home-course-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .28s ease;
}

.easyhpc-home-course-card:hover .easyhpc-home-course-image img {
    transform: scale(1.018);
}

.easyhpc-home-course-body {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 1rem 1.05rem .75rem;
}

.easyhpc-home-course-category {
    align-self: flex-start;
    margin-bottom: .65rem;
    border: 1px solid #8bd2db;
    border-radius: 999px;
    padding: .2rem .55rem;
    color: #177e91;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .025em;
    line-height: 1.3;
    text-transform: uppercase;
}

.easyhpc-home-course-card-two .easyhpc-home-course-category {
    border-color: #94b9ee;
    color: #3c72c3;
}

.easyhpc-home-course-card h3 {
    margin: 0 0 .55rem;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.easyhpc-home-course-card h3 a {
    color: var(--easyhpc-home-navy);
    text-decoration: none;
}

.easyhpc-home-course-card h3 a:hover {
    color: #087f96;
}

.easyhpc-home-course-summary {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #5b687b;
    font-size: .9rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.easyhpc-home-course-teachers {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    margin-top: auto;
    border-top: 1px solid #e7edf1;
    padding-top: .85rem;
    color: #4f6b7e;
    font-size: .82rem;
    line-height: 1.45;
}

.easyhpc-home-course-teachers svg {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    color: var(--easyhpc-home-teal);
}

.easyhpc-home-course-cta {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    margin: .2rem 1rem 1rem;
    border-radius: .45rem;
    background: linear-gradient(90deg, var(--easyhpc-home-teal), #10a8ba);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

.easyhpc-home-course-card-two .easyhpc-home-course-cta {
    background: linear-gradient(90deg, #2f67d7, #3d8be8);
}

.easyhpc-home-empty {
    border: 1px dashed #b8ccd7;
    border-radius: .75rem;
    padding: 1.25rem;
    color: #5b687b;
    text-align: center;
}

/* General site footer. The separate ESPA co-funding footer follows it. */
.easyhpc-site-footer {
    margin-top: 2rem;
    border-top: 1px solid #dde7ec;
    background: #f8fbfc;
    color: #293b53;
}

.easyhpc-site-footer-inner {
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) minmax(150px, .6fr) minmax(180px, .7fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    width: min(100% - 2rem, 1160px);
    margin: 0 auto;
    padding: 2rem 0;
}

.easyhpc-site-footer-logo {
    display: block;
    width: 260px;
    max-width: 100%;
    height: 76px;
    margin-bottom: .8rem;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.easyhpc-site-footer-description {
    max-width: 34rem;
    margin: 0;
    color: #5f6f82;
    font-size: .9rem;
    line-height: 1.55;
}

.easyhpc-site-footer-column h2 {
    margin: .15rem 0 .75rem;
    color: #1a2d4d;
    font-size: .93rem;
    font-weight: 800;
}

.easyhpc-site-footer-column ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.easyhpc-site-footer-column li + li {
    margin-top: .42rem;
}

.easyhpc-site-footer-column a {
    color: #5b6b7d;
    font-size: .88rem;
    text-decoration: none;
}

.easyhpc-site-footer-column a:hover {
    color: #087f96;
    text-decoration: underline;
}

/* Keep the official co-funding acknowledgement as the final footer block. */
.easyhpc-footer-branding {
    margin-top: 0;
    border-top-color: var(--easyhpc-accent, #f59e0b);
}

.easyhpc-footer-branding .easyhpc-cofunding {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

/* Accessibility modes cover every newly introduced surface. */
html.easyhpc-high-contrast .easyhpc-navbar-wordmark,
html.easyhpc-high-contrast .easyhpc-site-footer-logo {
    border-radius: .3rem;
    padding: .12rem .25rem;
    background: #fff;
}

html.easyhpc-high-contrast .easyhpc-homepage,
html.easyhpc-high-contrast .easyhpc-home-hero,
html.easyhpc-high-contrast .easyhpc-home-quicklink,
html.easyhpc-high-contrast .easyhpc-home-category-card,
html.easyhpc-high-contrast .easyhpc-home-course-card,
html.easyhpc-high-contrast .easyhpc-site-footer {
    border-color: #fff !important;
    background: #000 !important;
    color: #fff !important;
}

html.easyhpc-high-contrast .easyhpc-home-hero h1,
html.easyhpc-high-contrast .easyhpc-home-hero p,
html.easyhpc-high-contrast .easyhpc-home-section-heading h2,
html.easyhpc-high-contrast .easyhpc-home-quicklink-copy strong,
html.easyhpc-high-contrast .easyhpc-home-course-card h3 a,
html.easyhpc-high-contrast .easyhpc-site-footer-column h2,
html.easyhpc-high-contrast .easyhpc-site-footer-description {
    color: #fff !important;
}

html.easyhpc-high-contrast .easyhpc-home-hero-visual img {
    filter: contrast(1.2) brightness(.25);
}

html.easyhpc-high-contrast .easyhpc-home-hero-visual::before {
    width: 70%;
    background: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .96) 60%, rgba(0, 0, 0, .25) 100%);
}

html.easyhpc-high-contrast .easyhpc-home-course-summary,
html.easyhpc-high-contrast .easyhpc-home-course-teachers,
html.easyhpc-high-contrast .easyhpc-home-quicklink-copy small {
    color: #fff !important;
}

html.easyhpc-high-contrast .easyhpc-home-button,
html.easyhpc-high-contrast .easyhpc-home-course-cta,
html.easyhpc-high-contrast .easyhpc-home-course-category,
html.easyhpc-high-contrast .easyhpc-home-category-count {
    border-color: #ffff66 !important;
    background: #ffff66 !important;
    color: #000 !important;
}

html.easyhpc-high-contrast .easyhpc-home-quicklink-icon,
html.easyhpc-high-contrast .easyhpc-home-category-icon {
    border: 2px solid #fff;
    background: #000 !important;
    color: #ffff66 !important;
}

html.easyhpc-high-contrast .easyhpc-home-course-teachers {
    border-top-color: #fff;
}

@media (max-width: 900px) {
    .easyhpc-home-hero {
        display: block;
    }

    .easyhpc-home-hero-copy {
        width: 100%;
        min-height: 0;
        padding-bottom: 1.25rem;
    }

    .easyhpc-home-hero-visual {
        position: relative;
        inset: auto;
        min-height: 260px;
    }

    .easyhpc-home-hero-visual::before {
        inset: 0 0 auto;
        width: 100%;
        height: 35%;
        background: linear-gradient(180deg, #f5fbfd 0%, rgba(245, 251, 253, 0) 100%);
    }

    .easyhpc-home-hero-visual img {
        min-height: 260px;
        object-position: 72% center;
    }

    .easyhpc-home-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .easyhpc-site-footer-inner {
        grid-template-columns: minmax(240px, 1.2fr) repeat(2, minmax(140px, .6fr));
    }
}

@media (max-width: 700px) {
    .easyhpc-homepage {
        padding-bottom: 1.5rem;
    }

    .easyhpc-home-hero {
        min-height: 0;
        border-radius: .75rem;
    }

    .easyhpc-home-hero-copy {
        padding: 1.5rem;
    }

    .easyhpc-home-hero h1 {
        font-size: clamp(2rem, 11vw, 3rem);
    }

    .easyhpc-home-hero-visual,
    .easyhpc-home-hero-visual img {
        min-height: 210px;
    }

    .easyhpc-home-quicklinks,
    .easyhpc-home-category-grid,
    .easyhpc-home-course-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .easyhpc-home-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .easyhpc-site-footer-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.35rem;
    }
}

@media (max-width: 420px) {
    .easyhpc-home-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .easyhpc-home-button {
        width: 100%;
    }

    .easyhpc-home-quicklink {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .easyhpc-home-quicklink .easyhpc-home-arrow {
        display: none;
    }

    .easyhpc-home-category-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .easyhpc-home-button,
    .easyhpc-home-quicklink,
    .easyhpc-home-category-card,
    .easyhpc-home-course-image img {
        transition: none;
    }
}

/* Category browser uses the homepage cards; core action bars and pagination remain. */
html.easyhpc-catalogue-ready body#page-course-index-category #topofscroll.main-inner {
    max-width: 1280px;
}

.easyhpc-catalogue {
    padding: 1rem 0 2rem;
}

.easyhpc-catalogue .easyhpc-home-category-grid,
.easyhpc-catalogue .easyhpc-home-course-grid {
    margin-bottom: 2rem;
}

.easyhpc-catalogue .easyhpc-home-category-grid > :not(.easyhpc-home-category-card),
.easyhpc-catalogue .easyhpc-home-course-grid > :not(.easyhpc-home-course-card) {
    grid-column: 1 / -1;
}

.easyhpc-catalogue-extras {
    margin-top: .75rem;
    font-size: .85rem;
    overflow-wrap: anywhere;
}

.easyhpc-hidden-label {
    display: inline-block;
    font-size: .8rem;
    font-weight: 400;
    margin-bottom: .5rem;
}

.easyhpc-card-hidden {
    border-style: dashed;
}

.easyhpc-home-course-card h3,
.easyhpc-home-category-card strong {
    overflow-wrap: anywhere;
}

/* Keep long course titles usable in the administrator's ordered selectors. */
.easyhpc-homepage-picker .form-autocomplete-selection,
.easyhpc-homepage-picker .form-autocomplete-selection > span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
.easyhpc-homepage-picker select { max-width: 100%; }
