/* ==========================================================================
   Edy London: front page "Discover The Edy London Experience" videos
   Rebuilt from the original Elementor section (containers 114faaa9 and
   6d75ae41). Markup: template-parts/home/videos.php
   Script: assets/js/videos.js
   Breakpoints follow the original Elementor setup: tablet 1024px, mobile 767px.
   ========================================================================== */

/* ---------- Section */
.el-videos {
    background: #fff;
    padding-block: 130px;
}

.el-videos__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1375px;
    margin-inline: auto;
    padding-inline: var(--el-gutter);
}

/* ---------- Heading */
/* Font, size and colour come from .el-h2 (edy.css), like the other section
   headings; this only sets the width, spacing and centring. */
.el-videos__title {
    width: 654px;
    max-width: 100%;
    margin: 0 0 55px;
    text-align: center;
}

/* Same type as "Discover The" (inherits the heading's font and size). */
.el-videos__script {
    display: block;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    color: var(--el-tex);
}

/* ---------- Video grid */
.el-videos__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 286px));
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.el-video {
    position: relative;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #000;
}

.el-video__facade {
    position: absolute;
    inset: 0;
    display: block;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.el-video__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Title bar, like the YouTube Shorts embed. */
.el-video__caption {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    padding: 14px 16px 28px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 100%);
    font-family: var(--el-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.el-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 68px;
    height: 48px;
    transform: translate(-50%, -50%);
}

.el-video__play svg {
    display: block;
    width: 100%;
    height: 100%;
}

.el-video__play-bg {
    fill: #FF0033;
    fill-opacity: .9;
    transition: fill-opacity .2s;
}

.el-video__facade:hover .el-video__play-bg,
.el-video__facade:focus-visible .el-video__play-bg {
    fill-opacity: 1;
}

.el-video__facade:focus-visible {
    outline: 2px solid var(--el-sage);
    outline-offset: -4px;
}

/* The YouTube player, inserted on click. */
.el-video__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Loop clones (added by videos.js) are only used on mobile. */
.el-video[data-el-clone] {
    display: none;
}

/* ---------- Desktop: "Discover The" on the first line, "Edy London
   Experience" on one unbroken second line (the 654px width broke it). */
@media (min-width: 1025px) {
    .el-videos__title {
        width: auto;
    }

    .el-videos__script {
        white-space: nowrap;
    }
}

/* ---------- Tablet */
@media (max-width: 1024px) {
    .el-videos__title {
        margin-bottom: 35px;
    }
}

/* ---------- Mobile: all three videos in a horizontal swipe row */
@media (max-width: 767px) {
    .el-videos__title {
        margin-bottom: 25px;
    }

    /* Full-bleed horizontal scroller, one video per view. */
    .el-videos__grid {
        display: flex;
        align-self: stretch;
        gap: 12px;
        width: auto;
        margin-inline: calc(-1 * var(--el-gutter));
        padding-inline: var(--el-gutter);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--el-gutter);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .el-videos__grid::-webkit-scrollbar {
        display: none;
    }

    /* Same size as the single mobile video before: full width, max 360px. */
    .el-video {
        flex: 0 0 100%;
        max-width: 360px;
        scroll-snap-align: center;
    }

    /* Infinite loop: offsets are measured against the scroller. */
    .el-videos__grid {
        position: relative;
    }

    .el-video[data-el-clone] {
        display: block;
    }
}
