/* assets/css/youtube.css — YouTube clubs: player facade, lightbox, picker.
   Loaded on every page (templates/header.php), next to youtube-player.js. */

:root {
    --yt-red: #ff0033;
}

/* ── Facade: thumbnail + play button, swapped for the iframe on press ───── */
.yt-facade {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    cursor: pointer;
}
    .yt-facade img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* hqdefault is 4:3 with letterbox bars */
        display: block;
        transition: transform .25s ease, filter .25s ease;
    }
    .yt-facade:hover img { transform: scale(1.02); filter: brightness(.9); }
    .yt-facade:focus-visible { outline: 3px solid #2B988F; outline-offset: 2px; }

    .yt-facade-play {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 68px;
        height: 48px;
        transform: translate(-50%, -50%);
        border-radius: 14px;
        background: rgba(20, 20, 20, .78);
        transition: background-color .15s ease;
    }
    .yt-facade-play::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-35%, -50%);
        border-style: solid;
        border-width: 11px 0 11px 18px;
        border-color: transparent transparent transparent #fff;
    }
    .yt-facade:hover .yt-facade-play { background: var(--yt-red); }

    .yt-facade.is-playing { cursor: default; }

.yt-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* "Watch on YouTube" pill in the facade's bottom-right corner. Gone once
   the video plays — the player has its own YouTube button. */
.yt-player { position: relative; }
.yt-watch-link {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px 0 9px;
    border-radius: 999px;
    background: rgba(15, 15, 15, .6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    transition: background-color .15s ease, transform .15s ease;
}
    .yt-watch-link .fa-youtube { color: var(--yt-red); font-size: 1.05rem; transition: color .15s ease; }
    .yt-watch-link:hover,
    .yt-watch-link:focus-visible { background: #2B988F; color: #fff; transform: translateY(-1px); }
    .yt-watch-link:hover .fa-youtube,
    .yt-watch-link:focus-visible .fa-youtube { color: #fff; }
    .yt-watch-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .yt-facade.is-playing ~ .yt-watch-link { display: none; }

/* ── Lightbox (window.openYoutubePlayer) ───────────────────────────────── */
.yt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2100; /* above Bootstrap modals (1055) and the mobile tab bar */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, .82);
    animation: ytFade .15s ease-out;
}
@keyframes ytFade { from { opacity: 0; } to { opacity: 1; } }

.yt-lightbox-inner {
    width: min(1100px, 100%, calc((100vh - 120px) * 16 / 9));
}
.yt-lightbox-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #fff;
}
    .yt-lightbox-title {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 600;
    }
    .yt-lightbox-out {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 6px 10px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .12);
        color: #fff;
        font-size: .8rem;
        text-decoration: none;
    }
    .yt-lightbox-out:hover { background: rgba(255, 255, 255, .2); color: #fff; }
    .yt-lightbox-out .material-icons { font-size: 15px; }
    .yt-lightbox-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, .12);
        color: #fff;
    }
    .yt-lightbox-close:hover { background: rgba(255, 255, 255, .22); }
/* Footer under the video (openYoutubePlayer opts): channel · views · age on
   the left, the caller's action (the picker's Add to queue) on the right. */
.yt-lightbox.has-foot .yt-lightbox-inner {
    width: min(1100px, 100%, calc((100vh - 190px) * 16 / 9));
}
.yt-lightbox-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    color: #fff;
}
.yt-lightbox-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, .72);
    font-size: .85rem;
}
    .yt-lightbox-meta > :first-child { color: #fff; font-weight: 600; }
    .yt-lightbox-meta > * + span::before { content: "·"; margin: 0 6px; color: rgba(255, 255, 255, .5); }
    /* The channel, when it opens the picker's channel view. */
    .yt-lightbox-channel {
        padding: 0;
        border: 0;
        background: none;
        font: inherit;
        cursor: pointer;
        transition: color .15s ease;
    }
    .yt-lightbox-channel:hover { color: #6fd3c9 !important; text-decoration: underline; text-underline-offset: 3px; }
    .yt-lightbox-channel:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 3px; }
.yt-lightbox-action { flex: 0 0 auto; display: flex; gap: 8px; }
.yt-lightbox-action:empty { display: none; }

.yt-frame {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

/* ── Picker (partials/youtube-picker.php, embedded-pick-youtube.js) ────── */
.yt-picker { width: 100%; }

/* Search bar: the shared .custom-album-picker__search-bar / __input look
   (embedded-pick-album.css) with the film picker's Browse dropdown
   (.fp-type-dd, embedded-pick-film.css) on the end. */
.yt-picker .custom-album-picker__search-bar { margin-top: 0; margin-bottom: 12px; }
.yt-picker .fp-type-dd[data-browse-dd] .fp-type-dd__menu { min-width: 260px; }

/* Success variant of the film picker's .fp-toast (embedded-pick-youtube.js
   toast()): "Added … to your queue" etc. The base toast is the amber warning. */
.fp-toast.fp-toast--ok {
    background: #e9f6f4;
    border-color: #9fd3cc;
    color: #1d5f59;
}
.fp-toast.fp-toast--ok .fp-toast__icon { color: #2B988F; }

/* Type-ahead: the film picker's .fp-ac rows. Suggestion rows are a search
   icon + text; video rows swap the portrait poster for a 16:9 thumbnail. */
.yt-ac .yt-ac__q { padding-top: 8px; padding-bottom: 8px; }
.yt-ac .yt-ac__icon { flex: 0 0 auto; width: 24px; color: #8a929c; font-size: 20px; text-align: center; }
.yt-ac .yt-ac__video img { width: 64px; height: 36px; border-radius: 4px; }
.yt-ac__label {
    padding: 10px 14px 4px;
    border-top: 1px solid #e2e5ee;
    color: #686b87;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* Under 992px embedded-pick-album.css reflows every picker bar into a
   button row + a search row (a full-width ::after at order 4, the input at
   order 5, dropdowns at 6). This bar has no button row, so drop the break —
   input and Browse share one line. */
@media (max-width: 991.98px) {
    .yt-picker .custom-album-picker__search-bar::after { display: none; }
}
@media (max-width: 575.98px) {
    .yt-picker .fp-type-dd[data-browse-dd] .fp-type-dd__toggle { padding: 0 6px 0 10px; gap: 4px; }
    .yt-picker .fp-type-dd[data-browse-dd] .fp-type-dd__label {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Browse chips — popular videos by category, shown while the box is empty.
   Desktop: a slider with arrows either side. Touch: swiped, no arrows. */
.yt-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
    .yt-chips[hidden] { display: none; }
.yt-picker-chips {
    position: relative; /* offsetLeft of the chips is measured from here */
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}
    .yt-picker-chips::-webkit-scrollbar { display: none; }
    .yt-chip {
        flex: 0 0 auto;
        height: 32px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 0 14px 0 11px;
        border: 1px solid #dbe7e6;
        border-radius: 999px;
        background: #fff;
        color: #374151;
        font-size: .82rem;
        font-weight: 600;
        white-space: nowrap;
        transition: background .15s ease, border-color .15s ease, color .15s ease;
    }
    .yt-chip .material-icons { font-size: 16px; color: #2B988F; transition: color .15s ease; }
    .yt-chip.is-active .material-icons { color: #fff; }
    .yt-chip:hover { border-color: #2B988F; color: #2B988F; }
    .yt-chip.is-active { background: #2B988F; border-color: #2B988F; color: #fff; }

.yt-chips-nav {
    flex: 0 0 auto;
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #dbe7e6;
    border-radius: 50%;
    background: #fff;
    color: #2B988F;
    transition: background .15s ease, opacity .15s ease;
}
    .yt-chips-nav .material-icons { font-size: 20px; }
    .yt-chips-nav:hover { background: #DEF1EF; }
@media (hover: hover) and (pointer: fine) {
    .yt-chips.is-overflowing .yt-chips-nav { display: inline-flex; }
    .yt-chips.at-start .yt-chips-nav--prev,
    .yt-chips.at-end   .yt-chips-nav--next { opacity: .35; pointer-events: none; }
}

.yt-picker-note {
    min-height: 1.2em;
    margin: 8px 4px 4px;
    color: #6b7380;
    font-size: .85rem;
}
    .yt-picker-note:empty { margin: 4px; }
    .yt-picker-note.is-error { color: #b42318; }
    .yt-picker-note.is-ok    { color: #2B988F; }
    .yt-picker-note.is-info  { color: #8a5a00; }

/* Queue tab: the same 22px under "Add a … to Your Queue" as the film / TV
   pickers there (their root 12px + search bar 10px). Not in the modals,
   where the bar sits at the top of the sheet. */
#queueAddSection > .yt-picker,
#queueAddSection > .pod-picker { margin-top: 22px; }

/* ── "For you" home rows (embedded-pick-youtube.js showRows) ───────────── */
/* A column gap, not sibling margins, so hidden rows leave no extra space. */
.yt-home { display: flex; flex-direction: column; gap: 22px; margin-top: 6px; }
    .yt-home[hidden] { display: none; }
/* Hide restricted can empty a row — then the row goes too, heading and all. */
.yt-hide-restricted .yt-row:not(:has(.yt-card:not(.is-too-long))) { display: none; }
.yt-row-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 2px 10px;
}
    .yt-row-icon { font-size: 20px; color: #2B988F; }
    .yt-row-title {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
        overflow: hidden;
        color: #1a1d2e;
        font-size: 1rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .yt-row-more {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        padding: 0;
        border: 0;
        background: none;
        color: #2B988F;
        font-size: .82rem;
        font-weight: 600;
    }
        .yt-row-more .material-icons { font-size: 18px; }
        .yt-row-more:hover { color: #237d76; }
.yt-row-wrap { position: relative; }
.yt-row-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 2px;
}
    .yt-row-track::-webkit-scrollbar { display: none; }
    .yt-row-track > .yt-card { flex: 0 0 220px; min-width: 0; scroll-snap-align: start; }
/* Desktop: arrows over the ends of the row (touch just swipes). */
.yt-row-nav {
    position: absolute;
    top: calc(220px * 9 / 16 / 2);
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #dbe7e6;
    border-radius: 50%;
    background: #fff;
    color: #2B988F;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .15);
    transform: translateY(-50%);
    transition: opacity .15s ease, background .15s ease;
}
    .yt-row-nav .material-icons { font-size: 22px; }
    .yt-row-nav:hover { background: #DEF1EF; }
    .yt-row-nav--prev { left: -10px; }
    .yt-row-nav--next { right: -10px; }
@media (hover: hover) and (pointer: fine) {
    .yt-row-wrap.is-overflowing .yt-row-nav { display: inline-flex; }
    .yt-row-wrap.at-start .yt-row-nav--prev,
    .yt-row-wrap.at-end   .yt-row-nav--next { opacity: 0; pointer-events: none; }
}
@media (max-width: 575px) {
    .yt-row-track { gap: 10px; }
    .yt-row-track > .yt-card { flex-basis: 168px; }
    .yt-row-title { font-size: .95rem; }
}

.yt-picker-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 6px;
}

.yt-picker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 12px;
    color: #8a929c;
    text-align: center;
}
    .yt-picker-empty .material-icons { font-size: 44px; color: var(--yt-red); opacity: .85; }
    .yt-picker-empty p { margin: 8px 0 0; font-size: .9rem; }
    .yt-picker-empty[hidden] { display: none; }

.yt-card { display: flex; flex-direction: column; min-width: 0; }
    .yt-card-media { position: relative; }
    .yt-card-media .yt-facade { border-radius: 10px; }
    .yt-card-media .yt-facade-play { width: 52px; height: 36px; border-radius: 10px; }
    .yt-card-media .yt-facade-play::after { border-width: 8px 0 8px 13px; }
    .yt-card-dur {
        position: absolute;
        right: 6px;
        bottom: 6px;
        padding: 1px 5px;
        border-radius: 4px;
        background: rgba(0,0,0,.8);
        color: #fff;
        font-size: .72rem;
        font-weight: 600;
        pointer-events: none;
    }
    .yt-card-media .yt-facade.is-playing ~ .yt-card-dur { display: none; }
    /* "Watched" — the video is in the member's imported YouTube history. */
    .yt-card-watched {
        position: absolute;
        top: 8px;
        left: 8px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 2px 7px 2px 5px;
        border-radius: 999px;
        background: rgba(15, 15, 15, .78);
        color: #fff;
        font-size: .7rem;
        font-weight: 600;
        pointer-events: none;
    }
    .yt-card-watched .material-icons { font-size: 13px; }

/* "Your YouTube" with nothing imported: a pointer to Edit Profile. */
.yt-picker-note--cta {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f4faf9;
    color: #374151 !important;
}
    .yt-picker-note--cta .material-icons { font-size: 18px; color: #2B988F; }
    .yt-picker-note--cta a { color: #2B988F; font-weight: 600; white-space: nowrap; }
    .yt-card-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 2px 0; min-width: 0; }
    .yt-card-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-weight: 600;
        font-size: .92rem;
        line-height: 1.3;
    }
    /* In the picker the title is a <button> that opens the player modal. */
    button.yt-card-title {
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        text-align: left;
        cursor: pointer;
    }
    button.yt-card-title:hover { color: #2B988F; }
    button.yt-card-title:focus-visible { outline: 2px solid #2B988F; outline-offset: 2px; border-radius: 3px; }
    .yt-card-meta {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #6b7380;
        font-size: .8rem;
    }
    /* The channel name opens the channel view (embedded-pick-youtube.js openChannel). */
    .yt-card-channel {
        max-width: 100%;
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
        font: inherit;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: top;
        cursor: pointer;
        transition: color .15s ease;
    }
    .yt-card-channel:hover { color: #2B988F; text-decoration: underline; text-underline-offset: 2px; }
    .yt-card-channel:focus-visible { outline: 2px solid #2B988F; outline-offset: 2px; border-radius: 3px; }
    /* "1.2M views · 3 weeks ago" — the dot sits between spans, never dangling. */
    .yt-card-stats { font-size: .76rem; color: #8a929c; }
    .yt-card-stats span + span::before { content: "·"; margin: 0 5px; }

/* ── Channel view (embedded-pick-youtube.js openChannel) ───────────────── */
.yt-channel { margin: 2px 0 10px; }
    .yt-channel[hidden] { display: none; }
.yt-channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e3ecea;
    border-radius: 14px;
    background: linear-gradient(135deg, #f4faf9 0%, #fff 70%);
}
.yt-channel-avatar {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5ecea;
    box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(15, 23, 42, .15);
}
.yt-channel-avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2B988F;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
}
.yt-channel-info { flex: 1 1 auto; min-width: 0; }
.yt-channel-title {
    margin: 0;
    overflow: hidden;
    color: #1a1d2e;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.yt-channel-stats { margin-top: 2px; color: #6b7380; font-size: .8rem; }
    .yt-channel-stats span + span::before { content: "·"; margin: 0 6px; color: #b5bcc6; }
.yt-channel-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 6px 0 0;
    overflow: hidden;
    color: #4b5563;
    font-size: .8rem;
    line-height: 1.45;
    white-space: pre-line;
    cursor: pointer;
}
    .yt-channel-desc.is-open { display: block; -webkit-line-clamp: unset; }
.yt-channel-out {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px 0 11px;
    border-radius: 999px;
    background: #0f0f0f;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, transform .15s ease;
}
    .yt-channel-out .fa-youtube { color: var(--yt-red); font-size: 1.05rem; transition: color .15s ease; }
    .yt-channel-out:hover { background: #2B988F; color: #fff; transform: translateY(-1px); }
    .yt-channel-out:hover .fa-youtube { color: #fff; }
@media (max-width: 575px) {
    .yt-channel-card { flex-wrap: wrap; gap: 10px 12px; padding: 12px; }
    .yt-channel-avatar { width: 52px; height: 52px; }
    .yt-channel-title { font-size: 1rem; }
    .yt-channel-out { width: 100%; justify-content: center; }
}

/* ── Video details view (embedded-pick-youtube.js openVideo) ───────────── */
/* It covers the picker's grid without clearing it, so Back is instant. */
.yt-picker.yt-is-video > :not(.yt-video):not(.yt-picker-bar) { display: none !important; }
.yt-video { margin: 2px 0 6px; }
    .yt-video[hidden] { display: none; }
.yt-video-player .yt-facade { border-radius: 14px; }
    .yt-video-player .yt-facade img { position: absolute; inset: 0; height: 100%; max-height: none; }
.yt-video-player .yt-iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; }
.yt-video-title {
    margin: 14px 0 0;
    color: #1a1d2e;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}
.yt-video-row {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    margin-top: 8px;
}
.yt-video-meta { flex: 1 1 auto; min-width: 0; }
.yt-video-channel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: #1a1d2e;
    font-size: .9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
    .yt-video-channel .material-icons { font-size: 20px; color: #9ca3af; }
    .yt-video-channel:hover { color: #2B988F; }
.yt-video-watched { display: inline-flex; align-items: center; gap: 3px; color: #2B988F; font-weight: 600; }
    .yt-video-watched .material-icons { font-size: 14px; }
.yt-video-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
/* .yt-video prefix: these must beat the --lb rules further down. */
.yt-video .yt-pick-btn--detail { height: 34px; font-size: .82rem; }
    .yt-video .yt-pick-btn--detail.is-queued { background: #DEF1EF; color: #237d76; }
    .yt-video .yt-pick-btn--detail.is-queued:hover { background: #b42318; color: #fff; }
.yt-video-desc {
    margin-top: 12px;
    /* Bottom spacing is a border, not padding: overflow is clipped at the
       padding edge, so bottom padding would let a 4th line peek through. */
    padding: 10px 12px 0;
    border-bottom: 10px solid #f4f6f8;
    border-radius: 12px;
    background: #f4f6f8;
    -webkit-line-clamp: 3;
    max-height: calc(1.45em * 3 + 20px);
}
    .yt-video-desc.is-open { max-height: none; }
/* Desktop: player on the left, details in a column beside it. */
@media (min-width: 768px) {
    .yt-video-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 20px;
        align-items: start;
    }
    .yt-video-title { margin-top: 0; }
    .yt-video-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .yt-video-actions { flex-wrap: wrap; }
    .yt-video-actions > * { flex: 1 1 auto; justify-content: center; }
    .yt-video-desc { -webkit-line-clamp: 5; max-height: calc(1.45em * 5 + 20px); }
    /* Stats move under the player as chips; the meta's plain line is phones-only. */
    .yt-video-meta .yt-channel-stats { display: none; }
    /* One row, always: thin dividers between items, nothing wraps. */
    .yt-video-stats {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        margin-top: 10px;
        overflow: hidden;
        color: #4b5563;
        font-size: .78rem;
        font-weight: 600;
        white-space: nowrap;
    }
    .yt-video-stats[hidden] { display: none; }
    .yt-video-stat {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        flex: 0 1 auto;
        min-width: 0;
    }
        .yt-video-stat .material-icons { flex: 0 0 auto; font-size: 15px; color: #9ca3af; }
    .yt-video-stat + .yt-video-stat::before {
        content: "";
        flex: 0 0 auto;
        width: 1px;
        height: 12px;
        margin: 0 6px 0 10px;   /* + the 4px gap = 10px each side */
        background: #d6dde6;
    }
    .yt-video-stat--watched { color: #2B988F; }
        .yt-video-stat--watched .material-icons { color: #2B988F; }
}
@media (max-width: 767.98px) {
    .yt-video-stats { display: none !important; }
}
@media (max-width: 575px) {
    .yt-video-title { font-size: 1rem; margin-top: 12px; }
    .yt-video-row { flex-direction: column; align-items: stretch; }
    .yt-video-actions > * { flex: 1 1 0; justify-content: center; }
}

/* ── Max length restriction (window.clubYoutubeMaxDuration) ────────────── */
.yt-limit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    padding: 8px 12px;
    border: 1px solid #c8e3df;
    border-radius: 10px;
    background: #f3faf9;
    color: #2f6f6a;
    font-size: .82rem;
}
    .yt-limit[hidden] { display: none; }
    /* Clear of the category chips when they're showing above it. */
    .yt-chips:not([hidden]) ~ .yt-limit { margin-top: 12px; }
    .yt-limit .material-icons { font-size: 18px; color: #2B988F; }
    .yt-limit strong { font-weight: 700; }
/* "Hide restricted" switch, pushed to the right of the notice. */
.yt-limit-switch {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
    .yt-limit-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
    .yt-limit-switch__track {
        position: relative;
        width: 32px;
        height: 18px;
        border-radius: 999px;
        background: #c7d3d1;
        transition: background .18s ease;
    }
    .yt-limit-switch__track::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
        transition: transform .18s ease;
    }
    .yt-limit-switch input:checked + .yt-limit-switch__track { background: #2B988F; }
    .yt-limit-switch input:checked + .yt-limit-switch__track::after { transform: translateX(14px); }
    .yt-limit-switch input:focus-visible + .yt-limit-switch__track { outline: 2px solid #2B988F; outline-offset: 2px; }
.yt-hide-restricted .yt-card.is-too-long { display: none; }
/* Over the limit: the card fades back, the badge and button say why. */
.yt-card.is-too-long .yt-facade img { filter: grayscale(.7) brightness(.75); }
.yt-card.is-too-long .yt-card-title { color: #8a929c; }
.yt-card.is-too-long .yt-card-dur { background: #b42318; }
.yt-pick-btn.is-blocked,
.yt-pick-btn.is-blocked:disabled {
    background: rgba(180, 35, 24, .88);
    opacity: 1;
    cursor: not-allowed;
}
.yt-pick-btn.is-blocked:hover { background: rgba(180, 35, 24, .88); transform: none; }
.yt-pick-btn--lb.is-blocked { background: rgba(180, 35, 24, .9); }

.yt-picker-more { display: flex; justify-content: center; margin: 16px 0 4px; }
    .yt-picker-more[hidden] { display: none; }
.yt-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 16px 0 12px;
    border: 1px solid #dbe7e6;
    border-radius: 999px;
    background: #fff;
    color: #2B988F;
    font-size: .85rem;
    font-weight: 600;
    transition: background .15s ease, border-color .15s ease;
}
    .yt-more-btn:hover { background: #DEF1EF; border-color: #2B988F; }
    .yt-more-btn:disabled { opacity: .6; cursor: default; }

/* Add / Select pill, overlaid in the thumbnail's bottom-left corner (the
   duration badge has the bottom-right). --lb is the same button in the
   player modal's footer (embedded-pick-youtube.js openPlayer). */
.yt-pick-btn {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 11px 0 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 15, 15, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    transition: background .15s ease, transform .15s ease;
}
    .yt-pick-btn .material-icons { font-size: 16px; }
    .yt-pick-btn > span:not(.material-icons) { display: inline-flex; align-items: center; gap: 4px; }
    .yt-pick-btn:hover { background: #2B988F; transform: translateY(-1px); }
    .yt-pick-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .yt-pick-btn.is-done,
    .yt-pick-btn.is-queued { background: #2B988F; }
    .yt-pick-btn .yt-pick-off { display: none !important; }
    .yt-pick-btn.is-queued:hover { background: #b42318; }
    .yt-pick-btn.is-queued:hover .yt-pick-on { display: none !important; }
    .yt-pick-btn.is-queued:hover .yt-pick-off { display: inline-flex !important; }
    .yt-pick-btn:disabled { opacity: .75; cursor: default; transform: none; }
    .yt-pick-btn--lb {
        position: static;
        height: 38px;
        padding: 0 16px 0 12px;
        background: #2B988F;
        font-size: .88rem;
        box-shadow: none;
    }
    .yt-pick-btn--lb .material-icons { font-size: 19px; }
    .yt-pick-btn--lb:hover { background: #237d76; }
    .yt-pick-btn--lb.is-queued,
    .yt-pick-btn--lb.is-done { background: rgba(255, 255, 255, .14); }
    .yt-pick-btn--lb.is-queued:hover { background: #b42318; }

@media (max-width: 575px) {
    /* Two columns on phones: shrink the overlays and type to suit ~170px cards. */
    .yt-picker-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
    .yt-card-media .yt-facade { border-radius: 8px; }
    .yt-card-media .yt-facade-play { width: 40px; height: 28px; border-radius: 8px; }
    .yt-card-media .yt-facade-play::after { border-width: 6px 0 6px 10px; }
    .yt-card-media .yt-pick-btn { left: 5px; bottom: 5px; height: 24px; padding: 0 8px 0 6px; gap: 3px; font-size: .68rem; }
    .yt-card-media .yt-pick-btn .material-icons { font-size: 14px; }
    .yt-card-media .yt-pick-btn > span:not(.material-icons) { gap: 3px; }
    .yt-card-dur { right: 5px; bottom: 5px; font-size: .66rem; }
    .yt-card-watched { top: 5px; left: 5px; font-size: .64rem; }
    .yt-card-body { padding-top: 6px; }
    .yt-card-title { font-size: .82rem; }
    .yt-card-meta { font-size: .72rem; }
    .yt-card-stats { font-size: .68rem; }
}

/* Club Home tab: the current video under the pick card (partials/tabs/home.php). */
/* Same 14px gutters as the other Home sections (.ch-section, .ch-callout). */
.ch-yt-player { margin: 0 14px 20px; }

/* Club hero (templates/dash-mobile-layout.php, .m-hero--youtube): the 16:9
   thumbnail plays the video in the lightbox; a play mark sits on it. */
.m-hero-art-link--play { position: relative; display: block; }
.m-hero-art-link--play .yt-facade-play {
    width: 46px;
    height: 32px;
    border-radius: 9px;
    pointer-events: none;
}
.m-hero-art-link--play .yt-facade-play::after { border-width: 7px 0 7px 12px; }
.m-hero-art-link--play:hover .yt-facade-play { background: var(--yt-red); }
.m-hero-spotify.m-hero-youtube { background: #fff; color: var(--yt-red); }
/* Desktop: the shared .m-hero-pill (dash-mobile.css), with a red glyph. */
@media (min-width: 992px) {
    .m-hero-youtube .fa-youtube { color: var(--yt-red); }
    .m-hero-youtube:hover .fa-youtube { color: #fff; }
}

/* Archive tab (assets/js/archive.js): 16:9 cover + a YouTube link button. */
/* #pane-archive in the selector: the mobile dash sizes the square cover with
   id-level !important rules (dash-mobile.css), loaded after this file. */
.archive-album-header--wide .archive-cover-wrap,
.archive-album-header--wide .archive-cover-skeleton,
.archive-album-header--wide .archive-cover-img,
.archive-album-header--wide .arch-cover-img,
#pane-archive .archive-album-header--wide .archive-cover-wrap,
#pane-archive .archive-album-header--wide .archive-cover-skeleton,
#pane-archive .archive-album-header--wide .arch-cover-img {
    width: 240px !important;
    height: 135px !important;
    object-fit: cover;
}
@media (max-width: 575.98px) {
    #pane-archive .archive-album-header--wide .archive-cover-wrap,
    #pane-archive .archive-album-header--wide .archive-cover-skeleton,
    #pane-archive .archive-album-header--wide .arch-cover-img {
        width: 160px !important;
        height: 90px !important;
    }
}
.arch-spotify-btn.arch-ext-youtube {
    background: rgba(255, 0, 51, .12);
    color: var(--yt-red) !important;
    border-color: rgba(255, 0, 51, .3);
}
    .arch-spotify-btn.arch-ext-youtube:hover {
        background: var(--yt-red);
        color: #fff !important;
        box-shadow: 0 0 14px rgba(255, 0, 51, .35);
    }
