/* ---------------------------------------------------------------------------
   The career section: the full vacancy register.

   The hero shows the four soonest to close; this is the whole board, with the
   department each post sits under and the date it shuts. It replaces a <marquee>
   that scrolled the list past the reader at a fixed speed - unreadable, and
   impossible to use on a phone.

   Everything is scoped under .our-feature so nothing leaks into the template.
   --------------------------------------------------------------------------- */

.our-feature {
    --reg-ink: #1b1a19;
    --reg-paper: #f4f2ee;
    --reg-rule: rgba(255, 255, 255, .12);
    --reg-muted: rgba(255, 255, 255, .58);
}

/* The section ground. The template had a pink-to-grey radial gradient that
   belonged to no other part of this site; this is the paper the notices are
   pinned to, with the brand red as a single hairline at the top. */
.our-feature#career {
    background: var(--reg-paper) !important;
    border-top: 3px solid var(--primary-color);
}

/* ---- the register ---- */

.vacancy-register {
    background: var(--reg-ink);
    border-radius: 26px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Fixed, to match the image column beside it. The parts inside flex: the
       head, the pinned shelf and the footer take what they need, and the
       scrolling list takes whatever is left - so the panel is always exactly
       this tall whether there is one post or forty. */
    height: 660px;
}

.register-head {
    background: var(--primary-color);
    color: #fff;
    padding: 20px 26px 18px;
    flex: 0 0 auto;
}

    .register-head h2 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -.02em;
        color: #fff;
        line-height: 1.2;
    }

    .register-head .register-count {
        display: block;
        margin-top: 5px;
        font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
        font-size: 11.5px;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: rgba(255, 255, 255, .82);
    }

/* The list scrolls under its own steam, at the reader's pace. */
.register-list {
    margin: 0;
    padding: 6px 0;
    list-style: none;
    overflow-y: auto;
    flex: 1 1 auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

    .register-list::-webkit-scrollbar {
        width: 6px;
    }

    .register-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .25);
        border-radius: 3px;
    }

.register-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 26px;
    border-bottom: 1px solid var(--reg-rule);
}

    .register-row:last-child {
        border-bottom: 0;
    }

    /* Featured posts carry a red edge. It is the only thing separating them
       from the rest, which is enough - the old page listed them twice. */
    .register-row.is-featured {
        border-left: 3px solid var(--primary-color);
        padding-left: 23px;
        background: rgba(235, 28, 36, .06);
    }

    .register-row.is-closed {
        opacity: .55;
    }

.register-main {
    flex: 1 1 auto;
    min-width: 0;
}

.register-dept {
    display: block;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 10.5px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--reg-muted);
    margin-bottom: 4px;
}

.register-post {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    margin-bottom: 5px;
}

.register-when {
    display: block;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 11px;
    letter-spacing: .5px;
    color: var(--reg-muted);
}

    /* A week or less is the only thing here worth raising your voice about. */
    .register-when.is-urgent {
        color: #ff6b70;
    }

.register-action {
    flex: 0 0 auto;
}

    .register-action .btn-apply,
    .register-action .btn-shut {
        display: inline-block;
        border-radius: 40px;
        padding: 8px 22px;
        font-size: 13.5px;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
    }

    .register-action .btn-apply {
        background: var(--primary-color);
        color: #fff;
        transition: background .18s ease;
    }

        .register-action .btn-apply:hover,
        .register-action .btn-apply:focus-visible {
            background: #fff;
            color: var(--reg-ink);
        }

    .register-action .btn-shut {
        border: 1px solid var(--reg-rule);
        color: var(--reg-muted);
        cursor: not-allowed;
    }

.register-empty {
    padding: 44px 26px;
    text-align: center;
    color: var(--reg-muted);
    font-size: 14.5px;
    line-height: 1.7;
}

.register-foot {
    flex: 0 0 auto;
    border-top: 1px solid var(--reg-rule);
    padding: 16px 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

    .register-foot .foot-note {
        flex: 1 1 auto;
        font-size: 12.5px;
        color: var(--reg-muted);
        margin: 0;
    }

    .register-foot .btn-all {
        display: inline-block;
        border: 1px solid rgba(255, 255, 255, .35);
        border-radius: 40px;
        padding: 8px 22px;
        color: #fff;
        text-decoration: none;
        font-size: 13.5px;
        font-weight: 600;
        transition: background .18s ease;
    }

        .register-foot .btn-all:hover,
        .register-foot .btn-all:focus-visible {
            background: rgba(255, 255, 255, .12);
            color: #fff;
        }

/* ---- the pinned shelf ----
   Featured posts, held still above the scroll so they are readable without
   waiting for them to come round. */

.register-pinned {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--reg-rule);
    background: rgba(235, 28, 36, .05);
}

    .register-pinned .pinned-label {
        display: block;
        padding: 12px 26px 0;
        font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
        font-size: 10px;
        letter-spacing: 1.4px;
        text-transform: uppercase;
        color: var(--primary-color);
    }

    .register-pinned .register-list {
        overflow: visible;
        padding-top: 2px;
    }

/* ---- the scrolling list ----

   A CSS animation on a duplicated track rather than <marquee>: the old element
   is deprecated, ignores a reduced-motion preference, and cannot be paused
   from the keyboard. This pauses on hover and on focus, so somebody tabbing
   through the Apply links is not chasing a moving target. */

.register-ticker {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

    /* Feathered top and bottom, so rows arrive and leave rather than being
       sliced off by the edge of the panel. */
    .register-ticker.is-scrolling::before,
    .register-ticker.is-scrolling::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        height: 34px;
        z-index: 2;
        pointer-events: none;
    }

    .register-ticker.is-scrolling::before {
        top: 0;
        background: linear-gradient(to bottom, var(--reg-ink), rgba(27, 26, 25, 0));
    }

    .register-ticker.is-scrolling::after {
        bottom: 0;
        background: linear-gradient(to top, var(--reg-ink), rgba(27, 26, 25, 0));
    }

    /* Not scrolling: an ordinary list the reader scrolls themselves. */
    .register-ticker:not(.is-scrolling) {
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .25) transparent;
    }

        .register-ticker:not(.is-scrolling)::-webkit-scrollbar {
            width: 6px;
        }

        .register-ticker:not(.is-scrolling)::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, .25);
            border-radius: 3px;
        }

.register-ticker.is-scrolling .register-track {
    /* The track holds the list twice, so translating by exactly half returns
       it to where it started and the loop has no seam. */
    animation: registerScroll var(--scroll-seconds, 30s) linear infinite;
}

    .register-ticker.is-scrolling:hover .register-track,
    .register-ticker.is-scrolling:focus-within .register-track {
        animation-play-state: paused;
    }

@keyframes registerScroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(0, -50%, 0); }
}

.register-ticker .register-list {
    overflow: visible;
    padding: 0;
}

/* The repeats are cloned in the browser once it knows how tall a row is, so
   there is nothing here to hide - a track that is not scrolling holds exactly
   one list. */

/* ---- motion ----
   Asked not to move things, so nothing moves: the list becomes an ordinary
   scrollable one and the second copy goes away. */

@media (prefers-reduced-motion: reduce) {
    .register-ticker.is-scrolling .register-track {
        animation: none;
    }

    .register-ticker.is-scrolling {
        overflow-y: auto;
    }

        .register-ticker.is-scrolling::before,
        .register-ticker.is-scrolling::after {
            display: none;
        }



    .register-action .btn-apply,
    .register-foot .btn-all {
        transition: none;
    }
}

/* ---- keyboard ---- */

.our-feature a:focus-visible,
.our-feature button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.vacancy-register a:focus-visible {
    outline-color: #fff;
}

/* ---- narrow screens ---- */

@media (max-width: 991px) {
    /* Side by side is gone, so nothing is left to match a height to. Let the
       panel be as tall as its content and stop the scroll - a list that moves
       under your thumb while you are trying to tap Apply is a fight. */
    .vacancy-register {
        height: auto;
        margin-top: 34px;
    }

    .register-list {
        overflow-y: visible;
    }

    .register-ticker,
    .register-ticker.is-scrolling {
        overflow: visible;
    }

        .register-ticker.is-scrolling .register-track {
            animation: none;
        }

        /* The duplicate exists only to hide the loop seam. With no loop, it
           would just be every post listed twice. */


        .register-ticker.is-scrolling::before,
        .register-ticker.is-scrolling::after {
            display: none;
        }
}

@media (max-width: 575px) {
    .register-row {
        flex-wrap: wrap;
        gap: 12px;
        padding: 15px 20px;
    }

        .register-row.is-featured {
            padding-left: 17px;
        }

    .register-action {
        width: 100%;
    }

        .register-action .btn-apply,
        .register-action .btn-shut {
            display: block;
            text-align: center;
        }

    .register-head {
        padding: 18px 20px 16px;
    }

    .register-foot {
        padding: 16px 20px;
    }
}
