/**
 * TV Atlântica 2026
 * Página de vídeo — layout e componentes informativos.
 *
 * Não modifica o Player V5.
 * Mobile-first.
 */

/* =========================================================
   1. ESTRUTURA DA PÁGINA
   ========================================================= */

.pagina-video {
    --video-bg: var(--cor-fundo-site);
    --video-text: #ffffff;
    --video-muted: #b7c3d7;
    --video-accent: #8c65f5;
    --video-action-bg: #233b60;
    --video-divider: rgba(255, 255, 255, 0.22);

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;

    width: 100%;
    min-width: 0;
    margin: 0 auto;

    background: var(--video-bg);
    color: var(--video-text);
}

.pagina-video *,
.pagina-video *::before,
.pagina-video *::after {
    box-sizing: border-box;
}

.video-page__main,
.video-page__related {
    min-width: 0;
}

.video-page__main {
    display: flex;
    flex-direction: column;
}

/* =========================================================
   2. INFORMAÇÕES DO VÍDEO
   ========================================================= */

.video-info {
    padding: 20px 16px 24px;
}

.video-info__program {
    display: inline-block;
    max-width: 100%;
    padding: 6px 12px;

    border-radius: 5px;
    background: #35148a;

    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.video-info__title {
    margin: 14px 0 8px;

    color: #ffffff;
    font-size: clamp(1.35rem, 4.5vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.video-info__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;

    margin: 0;
    color: var(--video-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* =========================================================
   3. AÇÕES
   ========================================================= */

.video-info__actions {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 22px;
    padding-bottom: 18px;

    border-bottom: 1px solid var(--video-divider);
}

.video-info__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 42px;
    padding: 9px 14px;

    border: 0;
    border-radius: 999px;

    background: var(--video-action-bg);
    color: #ffffff;

    font: inherit;
    font-size: 0.875rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;

    transition: background-color 0.2s;
}

.video-info__action:hover {
    background: #36537f;
}

.video-info__action:focus-visible {
    outline: 2px solid var(--video-accent);
    outline-offset: 3px;
}

.video-info__action:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.video-info__action svg {
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    flex-shrink: 0;
}

.video-info__action--share {
    margin-left: auto;
}

/* =========================================================
   4. DESCRIÇÃO
   ========================================================= */

.video-info__description {
    margin-top: 20px;
    color: #e3e9f5;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.video-info__description-toggle {
    display: block;
    cursor: pointer;
    list-style: none;
}

.video-info__description-toggle::-webkit-details-marker {
    display: none;
}

.video-info__description-toggle::marker {
    content: "";
}

.video-info__description-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.video-info__description-toggle::after {
    display: block;
    margin-top: 8px;
    color: var(--video-accent);
    font-weight: 700;
    content: "Mostrar mais";
}

.video-info__description[open]
.video-info__description-preview {
    display: none;
}

.video-info__description[open]
.video-info__description-toggle::after {
    content: "Mostrar menos";
}

.video-info__description-toggle-label {
    display: none;
}

.video-info__description-toggle:focus-visible {
    outline: 2px solid var(--video-accent);
    outline-offset: 3px;
}

.video-info__description-text {
    margin: 8px 0 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* =========================================================
   5. VÍDEOS RELACIONADOS
   ========================================================= */

.related-videos {
    padding: 20px 16px 30px;
    border-top: 1px solid var(--video-divider);
}

.related-videos__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    margin-bottom: 16px;
}

.related-videos__heading {
    margin: 0;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

.related-videos__all {
    color: #e0e6f3;
    font-size: 0.8125rem;
    text-decoration: none;
    white-space: nowrap;
}

.related-videos__all:hover {
    color: var(--video-accent);
}

.related-videos__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
}

.related-videos__item {
    min-width: 0;
}

.related-videos__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.related-videos__thumbnail {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;

    border-radius: 9px;
    background: #203859;
}

.related-videos__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.related-videos__link:hover img {
    transform: scale(1.03);
}

.related-videos__duration {
    position: absolute;
    right: 6px;
    bottom: 6px;

    padding: 3px 6px;
    border-radius: 4px;

    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;

    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.related-videos__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;

    margin: 9px 0 5px;

    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.related-videos__link:hover
.related-videos__title {
    color: #d2bfff;
}

.related-videos__channel,
.related-videos__meta {
    margin: 0;
    color: var(--video-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

/* =========================================================
   6. MOBILE PEQUENO
   ========================================================= */

@media (max-width: 370px) {
    .video-info {
        padding-inline: 12px;
    }

    .video-info__actions {
        gap: 5px;
    }

    .video-info__action {
        padding: 9px 11px;
        font-size: 0.8125rem;
    }

    .related-videos {
        padding-inline: 12px;
    }
}

/* =========================================================
   7. TABLET E DESKTOP
   ========================================================= */

@media (min-width: 768px) {
    .pagina-video {
        grid-template-columns:
            minmax(0, 1fr)
            clamp(260px, 30vw, 380px);

        gap: 20px;
        align-items: start;

        padding: 20px;
    }

    .video-info {
        padding: 20px 0 24px;
    }

    .video-info__title {
        font-size: clamp(1.4rem, 2.4vw, 2rem);
    }

    .video-page__related {
        align-self: start;
    }

    .related-videos {
        padding: 0;
        border-top: 0;
    }

    .related-videos__list {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
}

/* =========================================================
   8. DESKTOP AMPLO
   ========================================================= */

@media (min-width: 1200px) {
    .pagina-video {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(320px, 380px);

        gap: 28px;
        padding: 28px;
    }

    .related-videos__item {
        min-width: 0;
    }

    .related-videos__title {
        font-size: 0.9375rem;
    }
}


/* Miniaturas provisórias, sem imagens externas */
.related-videos__thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        135deg,
        #263e71,
        #111d3b 70%,
        #39247d
    );
}

.related-videos__placeholder {
    padding: 16px;

    color: #ffffff;
    font-size: clamp(0.875rem, 2vw, 1.2rem);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}


/* =========================================================
   9. VOTAÇÃO — ESTADO ATIVO
   ========================================================= */

.video-info__action[data-video-vote][aria-pressed="true"] {
    background: var(--video-accent);
    color: #ffffff;
}

.video-info__action[data-video-vote][aria-pressed="true"]:hover {
    background: #a185ff;
}

/* =========================================================
   10. MODAL DE COMPARTILHAMENTO
   ========================================================= */

.video-share[hidden],
.video-share__check-symbol[hidden] {
    display: none !important;
}

.video-share {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #ffffff;
}

.video-share__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 8, 26, 0.78);
}

.video-share__dialog {
    position: relative;
    width: min(100%, 470px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: #102448;
    box-shadow: 0 20px 65px rgba(0, 0, 0, 0.45);
    color: #ffffff;
}

.video-share__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.video-share__header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
}

.video-share__close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #233b60;
    color: #ffffff;
    cursor: pointer;
}

.video-share__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.video-share__options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.video-share__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #e6ecfa;
    font: inherit;
    font-size: 0.75rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.video-share__icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: #233b60;
    transition: transform 0.2s, background-color 0.2s;
}

.video-share__option:hover .video-share__icon {
    transform: translateY(-3px);
    background: #36537f;
}

.video-share__icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.video-share__icon--whatsapp { color: #45e58b; }
.video-share__icon--facebook { color: #78aaff; }
.video-share__icon--linkedin { color: #7fc5ff; }
.video-share__icon--copy { color: #d4baff; }

.video-share__link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-top: 28px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: #071b3a;
}

.video-share__url {
    flex: 1;
    min-width: 0;
    padding-left: 6px;
    overflow: hidden;
    color: #c4d0e6;
    font-size: 0.8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-share__link-copy {
    flex-shrink: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: #8c65f5;
    color: #ffffff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.video-share__link-copy:hover { background: #a185ff; }

.video-share__feedback {
    min-height: 1.5em;
    margin: 12px 0 0;
    color: #b9a4ff;
    font-size: 0.8125rem;
    text-align: center;
}

.video-share__close:focus-visible,
.video-share__option:focus-visible,
.video-share__link-copy:focus-visible {
    outline: 2px solid #b9a4ff;
    outline-offset: 4px;
}

@media (max-width: 400px) {
    .video-share { padding: 12px; }
    .video-share__dialog { padding: 20px 14px; }
    .video-share__options { gap: 5px; }
    .video-share__icon { width: 50px; height: 50px; }
    .video-share__option { font-size: 0.6875rem; }
    .video-share__link-copy { padding: 10px 8px; }
}