/* ==========================================================================
   Video Gallery Pro — modelo "YouTube"
   Barra superior + trilho lateral + início em prateleiras + tela de exibição.
   Herda as variáveis de cor da galeria (--vgp-*) definidas em frontend.css.
   ========================================================================== */

.vgp-yt {
    --yt-bar-h: 56px;
    --yt-rail-w: 240px;
    --yt-rail-mini: 76px;
    --yt-gap: 16px;
    --yt-thumb-radius: 12px;
    --yt-side-w: 402px;

    /* Altura das barras fixas do tema; medida pelo JS. */
    --vgp-yt-top: 0px;

    padding: 0;
    max-width: none;
}

.vgp-yt button { color: inherit; }

/* ------------------------------ Barra superior --------------------------- */

.vgp-yt-bar {
    position: sticky;
    top: var(--vgp-yt-top);
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--yt-bar-h);
    padding: 0 12px;
    background: var(--vgp-bg, #fff);
    border-bottom: 1px solid var(--vgp-border, #e5e5e5);
}

.vgp-yt-bar-left { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
/* Só existe quando a busca ocupa a barra inteira (telas estreitas). */
.vgp-yt-search-close { display: none; flex: 0 0 auto; }
.vgp-yt-bar-center { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.vgp-yt-bar-right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.vgp-yt-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background .15s;
}
.vgp-yt-iconbtn:hover { background: var(--vgp-soft); }

.vgp-yt-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: none;
    padding: 4px 6px;
    cursor: pointer;
    max-width: 240px;
}
.vgp-yt-brand-logo {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--vgp-accent, #f00);
    color: var(--vgp-accent-text, #fff);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.vgp-yt-brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Marca da barra em telas largas (a versão estreita fica no bloco de 900px).
   A bolinha com a inicial ajuda a identificar a galeria, mas nem toda página a
   quer — sobretudo quando o tema já tem o logo do site logo acima. */
.vgp-yt-brand-desk-off  .vgp-yt-brand      { display: none; }
.vgp-yt-brand-desk-name .vgp-yt-brand-logo { display: none; }
.vgp-yt-brand-desk-logo .vgp-yt-brand-name { display: none; }

/* Busca ------------------------------------------------------------------ */

.vgp-yt-searchbox {
    position: relative;
    display: flex;
    align-items: center;
    width: min(640px, 100%);
    height: 40px;
    border: 1px solid var(--vgp-border, #ccc);
    border-radius: var(--vgp-radius-pill, 999px);
    background: color-mix(in srgb, var(--vgp-text, #000) 4%, transparent);
    padding: 0 4px 0 14px;
}
.vgp-yt-searchbox:focus-within {
    border-color: var(--vgp-accent, #f00);
    background: var(--vgp-bg, #fff);
}
.vgp-yt-search-ic { display: none; color: var(--vgp-text-muted, #606060); margin-right: 8px; }
.vgp-yt-searchbox:focus-within .vgp-yt-search-ic { display: inline-flex; }

.vgp-yt-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    background: none;
    color: inherit;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    padding: 0;
}
.vgp-yt-search-input::-webkit-search-cancel-button { display: none; }
.vgp-yt-search-input::placeholder { color: var(--vgp-text-muted, #606060); }

.vgp-yt-search-clear,
.vgp-yt-search-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--vgp-text-muted, #606060);
}
.vgp-yt-search-clear:hover, .vgp-yt-search-go:hover { background: var(--vgp-soft); color: var(--vgp-text); }

/* Sugestões da busca */
.vgp-yt-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    padding: 6px 0;
    background: var(--vgp-popup-bg, var(--vgp-card-bg, #fff));
    border: 1px solid var(--vgp-border, #e5e5e5);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
.vgp-yt-sugitem {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 16px;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}
.vgp-yt-sugitem:hover, .vgp-yt-sugitem.active { background: var(--vgp-soft); }
.vgp-yt-sugitem mark { background: none; color: inherit; font-weight: 700; }
.vgp-yt-sugthumb {
    width: 64px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    background: var(--vgp-soft-strong) center/cover no-repeat;
    flex-shrink: 0;
}
.vgp-yt-sugtext { min-width: 0; }
.vgp-yt-sugtitle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vgp-yt-sugmeta { display: block; font-size: 12px; color: var(--vgp-text-muted, #606060); }

.vgp-yt-subscribe {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--vgp-radius-pill, 999px);
    background: var(--vgp-accent, #f00);
    color: var(--vgp-accent-text, #fff);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.vgp-yt-subscribe:hover { filter: brightness(1.08); color: var(--vgp-accent-text, #fff); }

/* ------------------------------ Corpo ----------------------------------- */

.vgp-yt-body { display: flex; align-items: flex-start; }

.vgp-yt-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 16px 16px 48px;
}

/* Trilho lateral --------------------------------------------------------- */

.vgp-yt-rail {
    flex: 0 0 var(--yt-rail-w);
    width: var(--yt-rail-w);
    position: sticky;
    top: calc(var(--vgp-yt-top) + var(--yt-bar-h));
    max-height: calc(100vh - var(--vgp-yt-top) - var(--yt-bar-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 8px 24px;
    scrollbar-width: thin;
}
.vgp-yt-rail-inner { display: flex; flex-direction: column; gap: 4px; }

.vgp-yt-railgroup { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vgp-yt-railsep { border: 0; border-top: 1px solid var(--vgp-border, #e5e5e5); margin: 10px 6px; }
.vgp-yt-railtitle {
    padding: 6px 12px;
    font-size: 15px;
    font-weight: 700;
}

.vgp-yt-railitem {
    display: flex;
    align-items: center;
    gap: 22px;
    width: 100%;
    padding: 9px 12px;
    padding-left: calc(12px + var(--vgp-item-depth, 0) * 14px);
    border: 0;
    border-radius: 10px;
    background: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    line-height: 1.3;
}
.vgp-yt-railitem:hover { background: var(--vgp-soft); }
.vgp-yt-railitem.active { background: var(--vgp-soft-strong); font-weight: 600; }
.vgp-yt-railicon { display: inline-flex; flex-shrink: 0; }
.vgp-yt-raillabel {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vgp-yt-railcount { font-size: 12px; color: var(--vgp-text-muted, #606060); }
.vgp-yt-railcount:empty { display: none; }

/* Trilho reduzido: só ícones, com o rótulo miúdo embaixo (como no YouTube). */
.vgp-yt-rail-collapsed .vgp-yt-rail,
.vgp-yt-sidebar-mini .vgp-yt-rail {
    flex-basis: var(--yt-rail-mini);
    width: var(--yt-rail-mini);
    padding: 12px 4px;
}
.vgp-yt-rail-collapsed .vgp-yt-railitem,
.vgp-yt-sidebar-mini .vgp-yt-railitem {
    flex-direction: column;
    gap: 6px;
    padding: 14px 2px 12px;
    font-size: 10px;
    text-align: center;
}
.vgp-yt-rail-collapsed .vgp-yt-raillabel,
.vgp-yt-sidebar-mini .vgp-yt-raillabel {
    white-space: normal;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    text-align: center;
}
.vgp-yt-rail-collapsed .vgp-yt-railcount,
.vgp-yt-sidebar-mini .vgp-yt-railcount,
.vgp-yt-rail-collapsed .vgp-yt-railtitle,
.vgp-yt-sidebar-mini .vgp-yt-railtitle { display: none; }

.vgp-yt-railscrim {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, .5);
    animation: vgp-fade .2s ease;
}

/* ------------------------------ Chips ----------------------------------- */

.vgp-yt-chips {
    position: sticky;
    top: calc(var(--vgp-yt-top) + var(--yt-bar-h));
    z-index: 30;
    display: flex;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--vgp-bg, #fff);
}
.vgp-yt-chips::-webkit-scrollbar { display: none; }
.vgp-yt-chips:empty { display: none; }

.vgp-yt-chip {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--vgp-border, #e5e5e5);
    border-radius: var(--vgp-radius-pill, 999px);
    background: var(--vgp-soft);
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.vgp-yt-chip:hover { background: var(--vgp-soft-strong); }
.vgp-yt-chip.active {
    background: var(--vgp-tab-active, var(--vgp-text, #0f0f0f));
    color: var(--vgp-bg, #fff);
    border-color: transparent;
}

/* ------------------------------ Prateleiras ------------------------------ */

.vgp-yt-shelf { margin: 0 0 30px; }
.vgp-yt-shelf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.vgp-yt-shelf-title {
    margin: 0;
    font-size: clamp(17px, 2.2vw, 20px);
    font-weight: 700;
    letter-spacing: -.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vgp-yt-shelf-count { font-size: 13px; font-weight: 500; color: var(--vgp-text-muted, #606060); }
.vgp-yt-shelf-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.vgp-yt-seeall {
    border: 0;
    background: none;
    border-radius: var(--vgp-radius-pill, 999px);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--vgp-text-muted, #606060);
}
.vgp-yt-seeall:hover { background: var(--vgp-soft); color: var(--vgp-text); }

.vgp-yt-arrow {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--vgp-border, #e5e5e5);
    border-radius: 50%;
    background: var(--vgp-bg, #fff);
    cursor: pointer;
}
.vgp-yt-arrow:hover { background: var(--vgp-soft); }
.vgp-yt-arrow[disabled] { opacity: .35; cursor: default; }

/* A fileira rola na horizontal e "encaixa" nos cards. */
.vgp-yt-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--yt-cols) - 1) * var(--yt-gap)) / var(--yt-cols));
    gap: var(--yt-gap);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 4px;
    --yt-cols: var(--vgp-columns, 4);
}
.vgp-yt-track::-webkit-scrollbar { display: none; }
.vgp-yt-track > * { scroll-snap-align: start; }

/* ------------------------------ Grade ----------------------------------- */

.vgp-yt-grid {
    display: grid;
    grid-template-columns: repeat(var(--vgp-columns, 3), minmax(0, 1fr));
    gap: 24px var(--yt-gap);
}

.vgp-yt-section { margin: 0 0 30px; }
.vgp-yt-section-title {
    margin: 0 0 16px;
    font-size: clamp(18px, 2.4vw, 22px);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.vgp-yt-section-sub { font-size: 13px; font-weight: 500; color: var(--vgp-text-muted, #606060); }

/* ------------------------------ Card ------------------------------------ */

.vgp-yt-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
    position: relative;
}
.vgp-yt-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--yt-thumb-radius);
    overflow: hidden;
    background: #000;
}
.vgp-yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.vgp-yt-card:hover .vgp-yt-thumb img { transform: scale(1.03); }

/* Vídeo sem capa: um símbolo discreto em vez de imagem quebrada. */
.vgp-yt-thumb-blank {
    display: grid;
    place-items: center;
    background: var(--vgp-soft-strong);
    color: var(--vgp-text-muted, #888);
}

.vgp-yt-dur {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .8);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}
/* Barra de progresso do que já foi visto (histórico). */
.vgp-yt-seen {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, .35);
}
.vgp-yt-seen span { display: block; height: 100%; background: var(--vgp-accent, #f00); }

.vgp-yt-info { display: flex; gap: 12px; min-width: 0; }
.vgp-yt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--vgp-accent, #f00);
    color: var(--vgp-accent-text, #fff);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.vgp-yt-text { min-width: 0; flex: 1 1 auto; }
.vgp-yt-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vgp-yt-meta {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--vgp-text-muted, #606060);
    line-height: 1.4;
}
.vgp-yt-meta span + span::before { content: " • "; }

/* Menu do card (favoritar / remover do histórico) */
.vgp-yt-cardmenu {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
    display: grid;
    place-items: center;
}
.vgp-yt-card:hover .vgp-yt-cardmenu,
.vgp-yt-cardmenu:focus-visible,
.vgp-yt-cardmenu.active { opacity: 1; }
.vgp-yt-cardmenu.on { color: var(--vgp-accent, #f00); }

@media (hover: none) {
    .vgp-yt-cardmenu { opacity: 1; }
}

/* Card em linha (histórico, busca, lista lateral) ------------------------- */

.vgp-yt-row {
    display: grid;
    grid-template-columns: var(--yt-row-thumb, 168px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 6px;
    border-radius: var(--vgp-radius-sm, 10px);
    cursor: pointer;
    position: relative;
}
.vgp-yt-row:hover { background: var(--vgp-soft); }
.vgp-yt-row.current { background: var(--vgp-soft-strong); }
.vgp-yt-row .vgp-yt-title { font-size: 14px; }
.vgp-yt-row .vgp-yt-meta { font-size: 12px; }
.vgp-yt-row .vgp-yt-thumb { border-radius: 8px; }
.vgp-yt-rowlist { display: flex; flex-direction: column; gap: 8px; }

/* ------------------------------ Tela de exibição ------------------------- */

.vgp-yt-watch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--yt-side-w);
    gap: 24px;
    align-items: start;
}
.vgp-yt-watch-main { min-width: 0; }
.vgp-yt-watch-side { min-width: 0; }

/* Modo expandido: o vídeo toma a largura toda e a lista desce. */
.vgp-yt.is-theater .vgp-yt-watch,
.vgp-yt-watch-below .vgp-yt-watch { grid-template-columns: minmax(0, 1fr); }

.vgp-yt-playerbox {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--yt-thumb-radius);
    overflow: hidden;
}
.vgp-yt.is-theater .vgp-yt-playerbox {
    border-radius: 0;
    max-height: calc(100vh - var(--vgp-yt-top) - var(--yt-bar-h) - 90px);
    margin-inline: calc(-1 * var(--yt-gap));
    width: calc(100% + 2 * var(--yt-gap));
}
.vgp-yt-playerbox iframe,
.vgp-yt-playerbox video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.vgp-yt-watch-title {
    margin: 14px 0 6px;
    font-size: clamp(17px, 2.4vw, 20px);
    font-weight: 700;
    line-height: 1.3;
}

.vgp-yt-watch-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 14px;
}
.vgp-yt-watch-channel { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.vgp-yt-watch-channel .vgp-yt-avatar { width: 40px; height: 40px; }
.vgp-yt-watch-cname { font-weight: 600; font-size: 15px; line-height: 1.2; }
.vgp-yt-watch-csub { font-size: 12px; color: var(--vgp-text-muted, #606060); }

/* Duas fileiras: navegação (anterior/próximo) e ferramentas (favoritar,
   compartilhar, origem, expandir). No desktop elas fluem lado a lado e a barra
   parece uma linha só; em telas estreitas viram uma pilha. */
.vgp-yt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vgp-yt-actions-nav,
.vgp-yt-actions-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Ligado só numa largura: some na outra. */
.vgp-yt-a-desk, .vgp-yt-a-mob { display: none; }

.vgp-yt-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--vgp-radius-pill, 999px);
    background: var(--vgp-soft);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.vgp-yt-action:hover { background: var(--vgp-soft-strong); }
/* O "abrir na origem" é um link de verdade, mas veste o mesmo botão. */
a.vgp-yt-action { text-decoration: none; color: inherit; }
.vgp-yt-action[disabled] { opacity: .4; cursor: default; }
.vgp-yt-action.on { background: var(--vgp-accent, #f00); color: var(--vgp-accent-text, #fff); }

/* Só ícone: o botão vira redondo e o rótulo continua no aria-label/title —
   some da tela, não da leitura de tela. */
.vgp-yt-labels-never .vgp-yt-actions-tools .vgp-yt-action-label { display: none; }
.vgp-yt-labels-never .vgp-yt-actions-tools .vgp-yt-action {
    width: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

/* Larguras: o que está ligado nas duas aparece sempre; o resto escolhe. */
@media (min-width: 901px) {
    .vgp-yt-a-desk { display: inline-flex; }
    .vgp-yt-a-desk.vgp-yt-watch-channel { display: flex; }
}

.vgp-yt-desc {
    background: var(--vgp-soft);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.vgp-yt-desc-head { font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.vgp-yt-desc-body { overflow: hidden; }
.vgp-yt-desc-body.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}
.vgp-yt-desc-body a { color: var(--vgp-accent, #f00); }
.vgp-yt-desc-toggle {
    border: 0;
    background: none;
    padding: 6px 0 0;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    color: var(--vgp-text-muted, #606060);
}
.vgp-yt-desc-toggle:hover { color: var(--vgp-text); }

.vgp-yt-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}
.vgp-yt-side-head small { font-size: 12px; font-weight: 500; color: var(--vgp-text-muted, #606060); }

/* Lista lateral com rolagem própria em telas altas. */
.vgp-yt-watch-side .vgp-yt-rowlist { --yt-row-thumb: 168px; }

/* ------------------------------ Vazios / avisos -------------------------- */

.vgp-yt-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--vgp-text-muted, #606060);
    font-size: 15px;
}
.vgp-yt-empty strong { display: block; color: var(--vgp-text); font-size: 17px; margin-bottom: 6px; }

.vgp-yt-loadmore {
    display: block;
    margin: 24px auto 0;
    height: 38px;
    padding: 0 22px;
    border: 1px solid var(--vgp-border, #ccc);
    border-radius: var(--vgp-radius-pill, 999px);
    background: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.vgp-yt-loadmore:hover { background: var(--vgp-soft); }

.vgp-yt-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 100000;
    padding: 10px 18px;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
    animation: vgp-fade .2s ease;
}

/* Conteúdo só para buscadores/sem JS. */
.vgp-yt-seo {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.vgp-yt-nojs { padding: 24px 16px; font-size: 15px; line-height: 1.7; }
.vgp-yt-nojs ul { margin: 12px 0 0; padding-left: 20px; }
.vgp-yt-nojs a { color: var(--vgp-accent, #f00); }

/* Esqueleto exibido até o app desenhar a primeira tela. */
.vgp-yt-skeleton {
    display: grid;
    grid-template-columns: repeat(var(--vgp-columns, 3), minmax(0, 1fr));
    gap: 24px var(--yt-gap);
}
.vgp-yt-skel-card { display: flex; flex-direction: column; gap: 8px; }
.vgp-yt-skel-thumb { aspect-ratio: 16 / 9; border-radius: var(--yt-thumb-radius); }
.vgp-yt-skel-line { height: 12px; border-radius: 6px; }
.vgp-yt-skel-short { width: 55%; }
.vgp-yt-skel-thumb, .vgp-yt-skel-line { background: var(--vgp-soft); animation: vgp-yt-pulse 1.4s ease-in-out infinite; }

@keyframes vgp-yt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ------------------------------ Responsivo ------------------------------- */

/* Telas médias: o trilho encolhe sozinho, como no YouTube. */
@media (max-width: 1300px) {
    .vgp-yt-sidebar-full .vgp-yt-rail { flex-basis: var(--yt-rail-mini); width: var(--yt-rail-mini); padding: 12px 4px; }
    .vgp-yt-sidebar-full .vgp-yt-railitem { flex-direction: column; gap: 6px; padding: 14px 2px 12px; font-size: 10px; text-align: center; }
    .vgp-yt-sidebar-full .vgp-yt-raillabel { white-space: normal; line-height: 1.2; max-height: 2.4em; overflow: hidden; text-align: center; }
    .vgp-yt-sidebar-full .vgp-yt-railcount,
    .vgp-yt-sidebar-full .vgp-yt-railtitle { display: none; }

    /* Com o trilho recolhido, o botão do menu passa a ABRIR a gaveta cheia. */
    .vgp-yt-rail-open .vgp-yt-rail {
        position: fixed;
        top: var(--vgp-yt-top);
        left: 0;
        bottom: 0;
        z-index: 50;
        flex-basis: var(--yt-rail-w);
        width: var(--yt-rail-w);
        max-height: none;
        padding: 12px 8px 24px;
        background: var(--vgp-bg, #fff);
        box-shadow: 0 0 40px rgba(0, 0, 0, .4);
        animation: vgp-yt-slidein .18s ease;
    }
    .vgp-yt-rail-open .vgp-yt-railitem { flex-direction: row; gap: 22px; padding: 9px 12px; font-size: 14px; text-align: left; }
    .vgp-yt-rail-open .vgp-yt-raillabel { white-space: nowrap; max-height: none; text-align: left; }
    .vgp-yt-rail-open .vgp-yt-railcount,
    .vgp-yt-rail-open .vgp-yt-railtitle { display: block; }
}

@media (max-width: 1100px) {
    .vgp-yt-watch { grid-template-columns: minmax(0, 1fr); }
    .vgp-yt.is-theater .vgp-yt-playerbox { margin-inline: 0; width: 100%; max-height: none; }
    .vgp-yt-watch-side .vgp-yt-rowlist { --yt-row-thumb: 168px; }
}

/* Telas estreitas: trilho vira gaveta e a barra fica compacta. */
@media (max-width: 900px) {
    .vgp-yt-rail {
        position: fixed;
        top: var(--vgp-yt-top);
        left: 0;
        bottom: 0;
        z-index: 50;
        width: min(var(--yt-rail-w), 82vw);
        flex-basis: auto;
        max-height: none;
        background: var(--vgp-bg, #fff);
        box-shadow: 0 0 40px rgba(0, 0, 0, .4);
        transform: translateX(-100%);
        transition: transform .18s ease;
    }
    .vgp-yt-rail-open .vgp-yt-rail { transform: none; }
    .vgp-yt-sidebar-full .vgp-yt-railitem,
    .vgp-yt-sidebar-mini .vgp-yt-railitem { flex-direction: row; gap: 22px; padding: 11px 12px; font-size: 14px; text-align: left; }
    .vgp-yt-sidebar-full .vgp-yt-raillabel,
    .vgp-yt-sidebar-mini .vgp-yt-raillabel { white-space: nowrap; max-height: none; text-align: left; }
    .vgp-yt-sidebar-full .vgp-yt-railcount,
    .vgp-yt-sidebar-full .vgp-yt-railtitle { display: block; }

    .vgp-yt-main { padding: 12px 12px 40px; }
    .vgp-yt-bar-center { display: none; }
    .vgp-yt-bar { gap: 4px; padding: 0 8px; }

    /* Marca da barra em telas estreitas: a escolha é independente da do
       desktop, então cada variante repõe o que a outra escondeu. */
    .vgp-yt-brand-mob-off  .vgp-yt-brand      { display: none; }
    .vgp-yt-brand-mob-full .vgp-yt-brand,
    .vgp-yt-brand-mob-name .vgp-yt-brand,
    .vgp-yt-brand-mob-logo .vgp-yt-brand      { display: inline-flex; }
    .vgp-yt-brand-mob-name .vgp-yt-brand-logo { display: none; }
    .vgp-yt-brand-mob-logo .vgp-yt-brand-name { display: none; }
    .vgp-yt-brand-mob-full .vgp-yt-brand-logo,
    .vgp-yt-brand-mob-logo .vgp-yt-brand-logo { display: grid; }
    .vgp-yt-brand-mob-full .vgp-yt-brand-name,
    .vgp-yt-brand-mob-name .vgp-yt-brand-name { display: inline; }

    /* No desktop é o campo de busca (que estica) que empurra as ações para a
       borda. Escondido aqui, nada empurra: sem isto a lupa fica grudada no
       botão de menu, do lado errado da barra. */
    .vgp-yt-bar-right { margin-left: auto; }

    /* Nome longo não pode espremer as ações. */
    .vgp-yt-brand { max-width: 45vw; }

    /* Abaixo do vídeo: canal, depois a fileira de navegação ocupando a
       largura toda, depois as ferramentas. Empilhado em vez de embolado —
       era isso que quebrava a tela estreita. */
    .vgp-yt-watch-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .vgp-yt-watch-channel { margin-right: 0; }

    .vgp-yt-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; }
    .vgp-yt-actions-nav { flex-wrap: nowrap; }
    /* Os dois botões dividem a linha em partes iguais: sem isso "Próximo
       vídeo" empurra "Vídeo anterior" para a linha de cima. */
    .vgp-yt-actions-nav .vgp-yt-action { flex: 1 1 0; min-width: 0; justify-content: center; }
    .vgp-yt-actions-nav .vgp-yt-action-label { overflow: hidden; text-overflow: ellipsis; }
    .vgp-yt-actions-tools { gap: 10px; }

    /* Modo "texto só no desktop": aqui as ferramentas viram ícones redondos.
       O alvo sobe para 40px — no dedo, 36 é apertado. */
    .vgp-yt-labels-desktop .vgp-yt-actions-tools .vgp-yt-action-label { display: none; }
    .vgp-yt-labels-desktop .vgp-yt-actions-tools .vgp-yt-action,
    .vgp-yt-labels-never .vgp-yt-actions-tools .vgp-yt-action {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .vgp-yt-a-mob { display: inline-flex; }
    .vgp-yt-a-mob.vgp-yt-watch-channel { display: flex; }

    /* Busca em tela cheia (a lupa abre a barra sobre o conteúdo).
       Como a camada cobre a barra inteira — a lupa que a abriu inclusive —,
       ela traz a própria saída: a seta à esquerda. */
    .vgp-yt-searching .vgp-yt-bar-center {
        display: flex;
        align-items: center;
        gap: 4px;
        position: absolute;
        inset: 0;
        z-index: 5;
        padding: 8px;
        background: var(--vgp-bg, #fff);
    }
    .vgp-yt-searching .vgp-yt-search-close { display: inline-flex; }
    .vgp-yt-searching .vgp-yt-searchbox { flex: 1 1 auto; width: auto; min-width: 0; }

    /* O player acompanha a rolagem, como no aplicativo. */
    .vgp-yt-watch-main .vgp-yt-playerbox {
        position: sticky;
        top: calc(var(--vgp-yt-top) + var(--yt-bar-h));
        z-index: 25;
        border-radius: 0;
        margin-inline: -12px;
        width: calc(100% + 24px);
    }

    .vgp-yt-grid,
    .vgp-yt-skeleton { grid-template-columns: repeat(var(--vgp-columns-tablet, 2), minmax(0, 1fr)); }
    .vgp-yt-track { --yt-cols: var(--vgp-columns-tablet, 2); }
}

@media (max-width: 600px) {
    .vgp-yt-grid,
    .vgp-yt-skeleton { grid-template-columns: repeat(var(--vgp-columns-mobile, 1), minmax(0, 1fr)); }
    /* A fileira mostra um pedaço do próximo card (os 86%): é o que avisa, no
       celular, que dá para arrastar para o lado. */
    .vgp-yt-track {
        --yt-cols: var(--vgp-columns-mobile, 1);
        grid-auto-columns: calc((86% - (var(--yt-cols) - 1) * var(--yt-gap)) / var(--yt-cols));
    }

    .vgp-yt-row { grid-template-columns: var(--yt-row-thumb, 140px) minmax(0, 1fr); }
    .vgp-yt-watch-side .vgp-yt-rowlist { --yt-row-thumb: 140px; }

    /* Numa coluna só, a capa do card encosta nas bordas (como no app). */
    .vgp-yt-grid .vgp-yt-card .vgp-yt-thumb,
    .vgp-yt-shelf .vgp-yt-track > .vgp-yt-card .vgp-yt-thumb { border-radius: 10px; }
    .vgp-yt-title { font-size: 14px; }
    .vgp-yt-shelf { margin-bottom: 22px; }
}

@keyframes vgp-yt-slidein { from { transform: translateX(-100%); } to { transform: none; } }

/* ------------------- Reforços nos esquemas escuros ---------------------- */

.vgp-yt.vgp-is-dark .vgp-yt-searchbox { background: rgba(255, 255, 255, .06); }
.vgp-yt.vgp-is-dark .vgp-yt-arrow { background: var(--vgp-card-bg, #181818); }
.vgp-yt.vgp-is-dark .vgp-yt-suggest { box-shadow: 0 8px 28px rgba(0, 0, 0, .6); }
.vgp-yt.vgp-is-dark .vgp-yt-toast { background: #f1f1f1; color: #0f0f0f; }

/* Quando a galeria pinta a página inteira, a barra some no fundo do tema. */
.vgp-has-pagebg .vgp-yt-bar,
.vgp-has-pagebg .vgp-yt-chips,
.vgp-has-pagebg .vgp-yt-rail { background: var(--vgp-bg, #fff); }

@media (prefers-reduced-motion: reduce) {
    .vgp-yt-track { scroll-behavior: auto; }
    .vgp-yt-card:hover .vgp-yt-thumb img { transform: none; }
    .vgp-yt-skel-thumb, .vgp-yt-skel-line { animation: none; }
}
