/* ==========================================================================
   Señales M3U8 · bloque de enlaces HLS para cableras / IPTV
   Prefijo: .m3u8  ·  Todo el CSS vive dentro de .m3u8 para no tocar el theme.
   ========================================================================== */

.m3u8 {
    --m3u8-accent: #1d4ed8;
    --m3u8-code-bg: #0a0a0a;
    --m3u8-code-text: #f8fafc;
    display: block;
    width: 100%;
    margin: 28px 0;
    color: inherit;
    font-family: inherit;
}

.m3u8 *,
.m3u8 *::before,
.m3u8 *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------- cabecera -- */
.m3u8 .m3u8-title {
    margin: 0 0 16px;
    text-align: center;
    font-family: inherit;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--m3u8-accent) !important;
    text-wrap: balance;
}

/* --------------------------------------------------------------- contenido -- */
.m3u8 .m3u8-content {
    max-width: 900px;
    margin: 0 auto 22px;
    text-align: center;
    font-size: 17px;
    line-height: 1.6;
}

.m3u8 .m3u8-content p { margin: 0 0 .8em; }
.m3u8 .m3u8-content p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ enlaces -- */
.m3u8 .m3u8-list {
    display: grid;
    gap: 16px;
    margin: 0 0 20px;
}

.m3u8 .m3u8-item { min-width: 0; }

.m3u8 .m3u8-label {
    margin: 0 0 7px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--m3u8-accent) !important;
}

.m3u8 .m3u8-url {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--m3u8-code-bg);
    color: var(--m3u8-code-text);
}

.m3u8 .m3u8-code {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: var(--m3u8-code-text) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    user-select: all;
}

.m3u8 .m3u8-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid color-mix(in srgb, var(--m3u8-code-text) 26%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--m3u8-code-text) 8%, transparent);
    color: var(--m3u8-code-text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.2;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.m3u8 .m3u8-copy:hover {
    background: color-mix(in srgb, var(--m3u8-code-text) 16%, transparent);
    border-color: color-mix(in srgb, var(--m3u8-code-text) 45%, transparent);
}

.m3u8 .m3u8-copy.is-copied {
    background: var(--m3u8-accent);
    border-color: var(--m3u8-accent);
    color: #ffffff;
}

.m3u8 .m3u8-copy:focus-visible {
    outline: 2px solid var(--m3u8-accent);
    outline-offset: 2px;
}

.m3u8 .m3u8-copy-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

/* -------------------------------------------------------------------- pie -- */
.m3u8 .m3u8-foot {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    opacity: .82;
}

/* ------------------------------------------------------------------ móvil -- */
@media (max-width: 640px) {
    .m3u8 { margin: 22px 0; }
    .m3u8 .m3u8-title { font-size: 24px; }
    .m3u8 .m3u8-content { font-size: 16px; }
    .m3u8 .m3u8-url {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 13px;
    }
    .m3u8 .m3u8-code { font-size: 14px; }
    .m3u8 .m3u8-copy { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .m3u8 .m3u8-copy { transition: none; }
}
