@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.sharing {
    position: relative;
}

.sharing__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sharing__track::-webkit-scrollbar {
    display: none;
}

.sharing__track.is-dragging {
    cursor: grabbing;
}

.sharing__item {
    position: relative;
    flex: 0 0 auto;
    width: 70%;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: linear-gradient(90deg, #e8ecf1 25%, #f0f4f8 50%, #e8ecf1 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.sharing__item.is-loaded {
    background: none;
    animation: none;
}

.sharing__item *::selection {
    background: transparent;
}

@media (min-width: 500px) {
    .sharing__item {
        width: calc((100% - 1rem) / 2);
    }
}

@media (min-width: 720px) {
    .sharing__item {
        width: calc((100% - 2 * 1rem) / 3);
    }
}

.sharing__video {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 15;
    object-fit: cover;
    -webkit-user-drag: none;
}

.sharing__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background-color: rgba(0, 0, 0, 0.18);
    color: var(--color-white-text);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sharing__item.is-playing .sharing__play {
    background-color: transparent;
    pointer-events: none;
}

.sharing__item.is-playing .sharing__play-icon {
    pointer-events: auto;
    cursor: pointer;
}

.sharing__play:focus {
    outline: none;
    background-color: transparent;
    border-color: transparent;
}

.sharing__play:hover {
    background-color: rgba(0, 0, 0, 0.18);
    color: var(--color-white-text);
    border-color: transparent;
}

.sharing__play:focus-visible {
    outline: 2px solid var(--color-white-text);
    outline-offset: -4px;
}

.sharing__play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    transition: opacity 0.2s ease;
}

.sharing__icon {
    display: flex;
}

.sharing__icon--pause,
.sharing__item.is-playing .sharing__icon--play {
    display: none;
}

.sharing__item.is-playing .sharing__icon--pause {
    display: flex;
}

.sharing__play-icon .icon {
    width: 40px;
    height: 40px;
}

/* Navigation arrows */
.sharing__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background-color: rgba(26, 26, 26, 0.55);
    color: var(--color-white-text);
    cursor: pointer;
    transition: background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.sharing__arrow:focus {
    outline: none;
    box-shadow: none;
    background-color: rgba(26, 26, 26, 0.55);
    color: var(--color-white-text);
    border-color: transparent;
}

.sharing__arrow:hover {
    background-color: rgba(26, 26, 26, 0.75);
    color: var(--color-white-text);
    border-color: transparent;
}

.sharing__arrow:focus-visible {
    outline: 2px solid var(--color-white-text);
    outline-offset: 2px;
}

.sharing__arrow[hidden] {
    display: none;
}

.sharing__arrow svg {
    width: 20px;
    height: 20px;
}

.sharing__arrow--prev {
    left: 0.75rem;
}

.sharing__arrow--next {
    right: 0.75rem;
}

@media (hover: hover) {
    .sharing__play {
        background-color: transparent;
    }

    .sharing__play-icon {
        opacity: 0;
    }

    .sharing__item:hover .sharing__play,
    .sharing__play:focus-visible {
        background-color: rgba(0, 0, 0, 0.32);
    }

    .sharing__item.is-playing:hover .sharing__play {
        background-color: transparent;
    }

    .sharing__item:hover .sharing__play-icon,
    .sharing__play:focus-visible .sharing__play-icon {
        opacity: 1;
    }
}
