/* VIDEO SHELF — the video series from Yesper's channels as a row of 9:16
   cards (build.js buildVideoShelf, video-shelf.js). On the home page and the
   company page. */

.video-section {
    padding: 0 0 96px;
}

.video-section .offset-header {
    margin-bottom: 40px;
}

.vshelf {
    position: relative;
}

.vshelf-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(184px, 15vw, 232px);
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.vshelf-track::-webkit-scrollbar {
    display: none;
}

.vcard {
    min-width: 0;
    scroll-snap-align: start;
}

.vcard-media {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--sand);
    isolation: isolate;
}

.vcard-media img,
.vcard-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vcard-media img {
    transition: transform 0.6s ease;
}

/* Contain, not cover: the card is already 9:16, and in fullscreen cover
   would crop a vertical video to the middle of a wide screen. */
.vcard-video {
    object-fit: contain;
    background-color: rgb(10, 10, 10);
}

a.vcard-media::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.5), rgba(10, 10, 10, 0));
    pointer-events: none;
}

.vcard-play {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(254, 254, 252, 0.94);
    color: rgb(10, 10, 10);
    transition: transform 0.25s ease;
}

.vcard-play svg {
    width: 14px;
    height: 14px;
    margin-left: 2px;
}

.vcard-time {
    position: absolute;
    right: 12px;
    bottom: 21px;
    z-index: 1;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: rgb(254, 254, 252);
    font-variant-numeric: tabular-nums;
}

a.vcard-media:hover img {
    transform: scale(1.03);
}

a.vcard-media:hover .vcard-play {
    transform: scale(1.08);
}

a.vcard-media:focus-visible {
    outline: 2px solid rgb(10, 10, 10);
    outline-offset: 3px;
}

.vcard-series {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(10, 10, 10, 0.4);
}

.vcard-title {
    margin-top: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 21px;
    color: rgb(10, 10, 10);
}

/* The card that ends the row: black like the challenge card on /try, with
   the channels to follow. */
.vcard-follow {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 16px;
    background-color: rgb(10, 10, 10);
    color: rgb(254, 254, 252);
}

/* With the photo of the two bunnies: the title and the buttons sit on
   shades at the top and the bottom. */
.vcard-follow--photo > img {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.vcard-follow--photo::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to bottom, rgba(10, 10, 10, 0.6), rgba(10, 10, 10, 0) 34%),
        linear-gradient(to top, rgba(10, 10, 10, 0.65), rgba(10, 10, 10, 0) 38%);
    pointer-events: none;
}

.vcard-follow-title {
    font-size: 20px;
    font-weight: 500;
    line-height: 26px;
    letter-spacing: -0.2px;
}

.vcard-follow-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vcard-follow-links a {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(254, 254, 252, 0.18);
    color: rgb(254, 254, 252);
    transition: background-color 0.25s, color 0.25s;
}

.vcard-follow-links a:hover {
    background-color: rgb(254, 254, 252);
    color: rgb(10, 10, 10);
}

.vcard-follow-links a:focus-visible {
    outline: 2px solid rgb(254, 254, 252);
    outline-offset: 3px;
}

.vcard-follow-links svg {
    width: 15px;
    height: 15px;
}

.vshelf-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.vshelf-follow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    font-size: 14px;
    color: rgba(10, 10, 10, 0.6);
}

.vshelf-follow a {
    display: inline-flex;
    color: rgb(10, 10, 10);
    transition: opacity 0.3s;
}

.vshelf-follow a:hover {
    opacity: 0.6;
}

.vshelf-follow svg {
    width: 18px;
    height: 18px;
}

.vshelf-nav {
    display: flex;
    gap: 8px;
}

.vshelf-arrow {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(10, 10, 10, 0.15);
    border-radius: 50%;
    background: transparent;
    color: rgb(10, 10, 10);
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.vshelf-arrow svg {
    width: 14px;
    height: 14px;
}

.vshelf-arrow--prev svg {
    transform: scaleX(-1);
}

.vshelf-arrow:hover:not(:disabled) {
    background-color: rgba(10, 10, 10, 0.05);
}

.vshelf-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.vshelf.is-static .vshelf-nav {
    display: none;
}

/* The company page: heading and text above the shelf, as in its other
   sections. */
.company-videos .vshelf {
    margin-top: 32px;
}

@media (max-width: 768px) {
    .video-section {
        padding-bottom: 72px;
    }

    /* Full bleed on a phone: the row runs to the screen's edges and swipes.
       16px is the container's padding at this width (styles.css). */
    .vshelf-track {
        grid-auto-columns: min(50vw, 240px);
        margin: 0 -16px;
        padding: 0 16px 4px;
        scroll-padding: 0 16px;
    }

    .vshelf-nav {
        display: none;
    }
}
