/* ==========================================================================
   Ficha de jogo — tab «Vídeos» (template-parts/components/match/match-videos.php)

   Grelha de miniaturas por grupo (Resumo, Golos, Lances, Expulsões…). Cada
   cartão leva à página do vídeo; aqui não há player nem embed.

   Enfileirado por inc/video-single-helpers.php só em fichas com vídeos.
   Mobile-first (docs/RESPONSIVO.md): 2 colunas no telemóvel (a 320px cada
   miniatura fica com ~130px, legível), 3 no tablet, 4 no desktop.
   ========================================================================== */

.sp-match-videos__total {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--sp-radius-pill);
    background: var(--sp-surface-subtle);
    font-size: 12px;
    font-weight: 700;
    color: var(--sp-ink-muted);
    font-variant-numeric: tabular-nums;
}

.sp-match-videos__grupo + .sp-match-videos__grupo {
    margin-top: 1.75rem;
}

.sp-match-videos__grupo-titulo {
    margin: 0 0 0.75rem;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: var(--sp-tracking-kicker-lg);
    color: var(--sp-ink-muted);
}

.sp-match-videos__grelha {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sp-match-videos__item {
    min-width: 0;
    margin: 0;
}

.sp-match-videos__cartao {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    min-height: 44px;
    border-radius: var(--sp-radius-sm);
    color: var(--sp-ink);
    text-decoration: none;
}

.sp-match-videos__cartao:focus-visible {
    outline: 2px solid var(--sp-porto);
    outline-offset: 2px;
}

.sp-match-videos__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--sp-radius-sm);
    background: var(--sp-navy);
}

.sp-match-videos__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.sp-match-videos__cartao:hover .sp-match-videos__media img {
    opacity: 0.85;
}

.sp-match-videos__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: var(--sp-radius-pill);
    background: color-mix(in srgb, var(--sp-navy) 72%, transparent);
}

.sp-match-videos__play::after {
    content: '';
    position: absolute;
    top: 11px;
    left: 14px;
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent var(--sp-surface);
}

.sp-match-videos__minuto {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--sp-radius-xs);
    background: color-mix(in srgb, var(--sp-navy) 85%, transparent);
    color: var(--sp-surface);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sp-match-videos__corpo {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.sp-match-videos__tipo {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: var(--sp-tracking-kicker);
    color: var(--sp-porto);
}

.sp-match-videos__nome {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.sp-match-videos__cartao:hover .sp-match-videos__nome {
    color: var(--sp-porto);
}

.sp-match-videos__fonte {
    margin: 1.75rem 0 0;
    font-size: 13px;
    color: var(--sp-ink-soft);
}

.sp-match-videos__fonte a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
    color: var(--sp-porto);
    text-decoration: none;
}

.sp-match-videos__fonte a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .sp-match-videos__grelha {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem 1rem;
    }
}

@media (min-width: 1024px) {
    .sp-match-videos__grelha {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-match-videos__media img {
        transition: none;
    }
}
