/* Programs & Pricing page, "Our students studied at" (template-parts/pricing/logos.php): the university logos on
   white tiles, moving in a loop (two copies of the list, the track moves by half its width). Fonts and colours:
   home-hero.css (body .amerlink-genesis-home). */

.prc-logos {
    position: relative;
    padding: clamp(48px, 4.4vw, 84px) 0 clamp(56px, 5vw, 96px);
    background: linear-gradient(180deg, #f2f8fe 0%, #e9f2fc 100%);
    color: #33446a;
}

.prc-logos-inner {
    position: relative;
    width: min(100% - 64px, 1510px);
    margin-inline: auto;
}

.prc-logos-head {
    margin: 0 auto clamp(22px, 2vw, 38px);
    text-align: center;
}

.prc-logos-title {
    margin: 0;
    color: var(--amh-navy);
    font-size: clamp(26px, 2.2vw, 42px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.12;
}

.prc-logos-title-accent {
    color: #0a72f5;
}

/* The short pink line under the heading, as under the small headings of the page. */
.prc-logos-title::after {
    display: block;
    width: 64px;
    height: 4px;
    margin: clamp(12px, 1vw, 18px) auto 0;
    border-radius: 2px;
    background: var(--amh-pink);
    content: '';
}

.prc-logos-description {
    max-width: 760px;
    margin: clamp(12px, 1vw, 18px) auto 0;
    font-size: clamp(15px, 1.1vw, 19px);
    line-height: 1.55;
}

/* The strip fades out at both ends. */
.prc-logos-viewport {
    overflow: hidden;
    padding-block: 14px 22px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.prc-logos-track {
    display: flex;
    width: max-content;
}

.prc-logos-list {
    display: flex;
    gap: clamp(14px, 1.2vw, 22px);
    margin: 0;
    padding: 0 clamp(7px, .6vw, 11px);
    list-style: none;
}

/* A block (not a grid) so the logo's 100 % height is the tile's: every logo fits its tile, whatever its own size. */
.prc-logo {
    display: block;
    width: clamp(150px, 11vw, 210px);
    height: clamp(84px, 6.2vw, 112px);
    flex: 0 0 auto;
    margin: 0;
    padding: clamp(14px, 1.1vw, 20px) clamp(18px, 1.4vw, 26px);
    border: 1px solid #e3ebf6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(1, 33, 106, .07);
}

.prc-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The pause button, bottom right of the strip (shown by assets/js/pricing-logos.js). */
.prc-logos-toggle {
    position: absolute;
    right: 0;
    bottom: -14px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #cfe0f3;
    border-radius: 50%;
    background: #fff;
    color: var(--amh-navy);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

.prc-logos-toggle[hidden] {
    display: none;
}

.prc-logos-toggle:hover,
.prc-logos-toggle:focus-visible {
    border-color: var(--amh-pink);
    color: var(--amh-pink);
}

.prc-logos-toggle:focus-visible {
    outline: 2px solid #0381f8;
    outline-offset: 3px;
}

.prc-logos-toggle svg {
    width: 16px;
    height: 16px;
}

.prc-logos-icon-play,
.prc-logos.is-paused .prc-logos-icon-pause {
    display: none;
}

.prc-logos.is-paused .prc-logos-icon-play {
    display: block;
}

.prc-logos .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* The loop, only when motion is welcome; it stops under the pointer, with keyboard focus inside and when paused. */
@media (prefers-reduced-motion: no-preference) {
    .prc-logos-track {
        animation: prc-logos-loop var(--prc-logos-duration, 40s) linear infinite;
    }

    .prc-logos-viewport:hover .prc-logos-track,
    .prc-logos-viewport:focus-within .prc-logos-track,
    .prc-logos.is-paused .prc-logos-track {
        animation-play-state: paused;
    }

    @keyframes prc-logos-loop {
        to {
            translate: -50% 0;
        }
    }
}

/* Reduced motion: the logos stand still in a centred grid (the copy for the loop is not shown). */
@media (prefers-reduced-motion: reduce) {
    .prc-logos-viewport {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .prc-logos-track {
        width: auto;
    }

    .prc-logos-list {
        flex-wrap: wrap;
        justify-content: center;
    }

    .prc-logos-list[aria-hidden='true'] {
        display: none;
    }
}

@media (max-width: 780px) {
    .prc-logos-inner {
        width: min(100% - 36px, 660px);
    }

    .prc-logo {
        width: 136px;
        height: 78px;
        padding: 12px 16px;
    }
}
