/* ==========================================================================
   Transmisiones en vivo (Jueves Minero y otros eventos)
   --------------------------------------------------------------------------
   Archivo independiente a propósito: NO se compila dentro de public/css/app.css.
   El despliegue de este proyecto es por SFTP reemplazando archivos, y regenerar
   app.css con laravel-mix podría sobrescribir estilos construidos desde otro
   estado del código. Con un archivo aparte, subir esta funcionalidad no toca
   ningún asset existente.

   Paleta institucional de referencia: marrón #C19052, negro #3A3A39.
   El color de énfasis llega por la variable --live-accent desde el panel.
   ========================================================================== */

.liveStream,
.livePage {
    --live-accent: #D32F2F;
}

/* --------------------------------------------------------------------------
   Etiqueta e indicador "en vivo"
   -------------------------------------------------------------------------- */
.liveStream__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 5px 11px;
    border-radius: 3px;
    background-color: var(--live-accent);
    color: #fff;
    font-family: "Archivo", sans-serif;
    font-size: 0.813rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.liveStream__badge--lg {
    font-size: 1rem;
    padding: 8px 15px;
}

.liveStream__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
    flex: 0 0 auto;
    animation: liveStreamPulse 1.6s ease-in-out infinite;
}

@keyframes liveStreamPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.75); }
}

/* --------------------------------------------------------------------------
   Barra de aviso superior
   -------------------------------------------------------------------------- */
.liveStream__bar {
    background-color: #221E1D;
    color: #fff;
    font-family: "Archivo", sans-serif;
    position: relative;
    z-index: 2;
}

.liveStream__bar[hidden] {
    display: none;
}

.liveStream__bar__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    min-height: 46px;
}

.liveStream__bar__title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.35;
    color: #fff;
    /* Una sola línea: nunca debe empujar el alto de la barra. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.liveStream__bar__title strong {
    font-weight: 700;
}

.liveStream__bar__sep {
    margin: 0 6px;
    opacity: 0.5;
}

.liveStream__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    border: 1px solid var(--live-accent);
    background-color: var(--live-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color .3s, color .3s;
    white-space: nowrap;
}

.liveStream__cta:hover,
.liveStream__cta:focus {
    background-color: transparent;
    color: #fff;
    text-decoration: none;
}

.liveStream__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    opacity: 0.65;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity .3s;
}

.liveStream__close:hover,
.liveStream__close:focus {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Botón flotante
   -------------------------------------------------------------------------- */
.liveStream__float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    /* Respeta la zona segura en iPhone con notch. */
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    max-width: calc(100vw - 40px);
    padding: 11px 20px 11px 15px;
    border-radius: 40px;
    background-color: var(--live-accent);
    color: #fff;
    font-family: "Archivo", sans-serif;
    text-decoration: none;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    transition: transform .3s, box-shadow .3s;
}

.liveStream__float:hover,
.liveStream__float:focus {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.liveStream__float[hidden] {
    display: none;
}

.liveStream__float__pulse {
    position: absolute;
    inset: 0;
    border-radius: 40px;
    border: 2px solid var(--live-accent);
    animation: liveStreamRipple 2.2s ease-out infinite;
    pointer-events: none;
}

@keyframes liveStreamRipple {
    0%   { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.18); }
}

.liveStream__float__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.22);
}

.liveStream__float__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.liveStream__float__badge {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.85;
}

.liveStream__float__title {
    font-size: 0.938rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Enlace en el header superior (barra marrón, solo escritorio)
   -------------------------------------------------------------------------- */
.liveStream__headerLink {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.liveStream__headerLink .liveStream__badge {
    padding: 3px 8px;
    font-size: 0.75rem;
}

/* Enlace en el menú móvil (acordeón) */
.liveStream__mobileLink {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background-color: var(--live-accent, #D32F2F);
    color: #fff !important;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Reproductor (relación 16:9)
   -------------------------------------------------------------------------- */
.liveStream__player {
    position: relative;
    width: 100%;
    background-color: #000;
    overflow: hidden;
}

/* Respaldo para navegadores sin aspect-ratio */
.liveStream__player::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.liveStream__player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@supports (aspect-ratio: 16 / 9) {
    .liveStream__player {
        aspect-ratio: 16 / 9;
    }
    .liveStream__player::before {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Modal con el reproductor
   -------------------------------------------------------------------------- */
.liveStream__modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.liveStream__modal[hidden] {
    display: none;
}

.liveStream__modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.78);
}

.liveStream__modal__dialog {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px;
    background-color: #fff;
    font-family: "Archivo", sans-serif;
}

.liveStream__modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3A3A39;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.liveStream__modal__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 40px;
}

.liveStream__modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #3A3A39;
}

.liveStream__modal__empty {
    margin: 0;
    padding: 40px 0;
    text-align: center;
    color: #3A3A39;
}

.liveStream__modal__link {
    display: inline-block;
    margin-top: 16px;
    color: #C19052;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Página /en-vivo
   -------------------------------------------------------------------------- */
.livePage__hero {
    position: relative;
    padding: 90px 0;
    background-color: #3A3A39;
    background-size: cover;
    background-position: center;
}

.livePage__hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 100%);
}

.livePage__hero__card {
    position: relative;
    z-index: 2;
    max-width: 860px;
    border-left: 2px solid var(--live-accent);
    padding-left: 32px;
}

.livePage__hero__event {
    margin: 16px 0 6px;
    color: #C19052;
    text-transform: uppercase;
}

.livePage__hero__title {
    color: #fff;
    text-transform: uppercase;
}

.livePage__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.livePage__meta li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 300;
}

.livePage__meta i {
    color: #C19052;
}

.livePage__body {
    padding: 55px 0 80px;
}

.livePage__replayNote {
    margin-top: 14px;
    color: #3A3A39;
    opacity: 0.7;
    font-size: 0.875rem;
}

.livePage__notice {
    padding: 55px 30px;
    background-color: #F9F4EE;
    border: 1px solid rgba(193, 144, 82, 0.28);
    text-align: center;
}

.livePage__notice__title {
    margin-bottom: 18px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3A3A39;
    text-transform: uppercase;
}

.livePage__notice__text {
    max-width: 620px;
    margin: 0 auto 22px;
    color: #3A3A39;
}

.livePage__countdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 26px;
}

.livePage__countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 74px;
    padding: 14px 10px;
    background-color: #fff;
    border: 1px solid rgba(193, 144, 82, 0.28);
}

.livePage__countdown__unit b {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--live-accent);
    font-variant-numeric: tabular-nums;
}

.livePage__countdown__unit small {
    font-size: 0.688rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #3A3A39;
    opacity: 0.7;
}

.livePage__description {
    margin-top: 38px;
    color: #3A3A39;
}

.livePage__description img {
    max-width: 100%;
    height: auto;
}

.livePage__share {
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid rgba(193, 144, 82, 0.28);
}

.livePage__share ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.livePage__share a,
.livePage__share button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(193, 144, 82, 0.5);
    background-color: transparent;
    color: #C19052;
    cursor: pointer;
    transition: background-color .3s, color .3s;
}

.livePage__share a:hover,
.livePage__share button:hover,
.livePage__share a:focus,
.livePage__share button:focus {
    background-color: #C19052;
    color: #fff;
}

.livePage__chat {
    height: 100%;
    min-height: 420px;
    border: 1px solid rgba(193, 144, 82, 0.28);
}

.livePage__chat iframe {
    width: 100%;
    height: 100%;
    min-height: 420px;
    border: 0;
    display: block;
}

/* --------------------------------------------------------------------------
   Responsive
   Breakpoints alineados con resources/assets/css/partials/_responsive.scss
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .liveStream__bar__inner {
        gap: 12px;
    }
    .liveStream__bar__title {
        font-size: 0.813rem;
    }
}

@media (max-width: 991.98px) {
    .livePage__hero {
        padding: 60px 0;
    }
    .livePage__hero__card {
        padding-left: 22px;
    }
    .livePage__body {
        padding: 35px 0 60px;
    }
    .livePage__chat {
        margin-top: 24px;
        min-height: 380px;
    }
}

@media (max-width: 767.98px) {
    /* La barra pasa a dos filas: el título arriba, el botón abajo a lo ancho.
       Así el CTA nunca queda apretado ni se corta en pantallas de 320-375px. */
    .liveStream__bar__inner {
        flex-wrap: wrap;
        gap: 8px 10px;
        padding: 9px 0;
    }
    .liveStream__badge {
        order: 1;
        font-size: 0.75rem;
        padding: 4px 9px;
    }
    .liveStream__close {
        order: 2;
        margin-left: auto;
        width: 26px;
        height: 26px;
        font-size: 1.25rem;
    }
    .liveStream__bar__title {
        order: 3;
        flex: 1 1 100%;
        font-size: 0.938rem;
        white-space: normal;
        /* Máximo dos líneas para no desplazar el header. */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .liveStream__bar__sep {
        display: none;
    }
    .liveStream__bar__title strong {
        display: block;
    }
    .liveStream__cta {
        order: 4;
        flex: 1 1 100%;
        justify-content: center;
        padding: 11px 16px;
    }

    /* Botón flotante compacto: solo icono y etiqueta corta. */
    .liveStream__float {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        gap: 9px;
        padding: 9px 16px 9px 12px;
    }
    .liveStream__float__icon {
        width: 26px;
        height: 26px;
    }
    .liveStream__float__title {
        max-width: 42vw;
    }

    .liveStream__modal {
        padding: 0;
        align-items: flex-end;
    }
    .liveStream__modal__dialog {
        max-width: none;
        max-height: 92vh;
        padding: 20px 16px 24px;
    }
    .liveStream__modal__title {
        font-size: 1.063rem;
    }

    .livePage__hero {
        padding: 45px 0;
    }
    .livePage__hero__card {
        padding-left: 16px;
    }
    .livePage__meta {
        gap: 8px 18px;
    }
    .livePage__meta li {
        font-size: 0.813rem;
    }
    .livePage__notice {
        padding: 38px 18px;
    }
    .livePage__notice__title {
        font-size: 1.188rem;
    }
    .livePage__countdown {
        gap: 8px;
    }
    .livePage__countdown__unit {
        min-width: 64px;
        padding: 11px 6px;
    }
    .livePage__countdown__unit b {
        font-size: 1.375rem;
    }
}

/* Pantallas muy angostas (320px) */
@media (max-width: 359.98px) {
    .liveStream__float__text {
        display: none;
    }
    .liveStream__float {
        padding: 12px;
    }
    .livePage__countdown__unit {
        min-width: 56px;
    }
}

/* Accesibilidad: sin animaciones si el usuario las desactivó */
@media (prefers-reduced-motion: reduce) {
    .liveStream__dot,
    .liveStream__float__pulse {
        animation: none;
    }
    .liveStream__float {
        transition: none;
    }
    .liveStream__float__pulse {
        opacity: 0;
    }
}
