/* ──────────────────────────────────────────────────────────────────────
 * live-module.css - Live / Streaming module styles.
 *
 * Loaded unconditionally from inc/header.php (small file, no FOUC tradeoff
 * worth gating). Themed via existing CSS custom properties (--primary,
 * --bg-alt, --aborder, --text, --amuted) so every tenant inherits its own
 * branding without per-tenant overrides.
 *
 * Mobile rules:
 *   - video player goes full-width with a 16/9 aspect ratio
 *   - chat (when video_and_chat) stacks BELOW video on narrow viewports
 *     instead of beside it; on desktop chat sits to the right at 360px
 *   - video alone keeps a sensible max-width (it's already big enough)
 * ─────────────────────────────────────────────────────────────────────── */

/* ── Shared dot/eyebrow used on homepage section + /live page ───────── */

.live-section-eyebrow,
.live-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary, #1d4ed8);
    margin-bottom: 8px;
}

.live-section-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary, #dc2626);
    box-shadow: 0 0 0 0 var(--primary, #dc2626);
    /* "Live now" pulse - always animates; we don't actually detect live
       state in V1 (per spec), but the animation reads as "stream link
       is hot" without making a strict promise. Future: attach a
       data-state attribute and gate the keyframe on data-state="live". */
    animation: live-dot-pulse 2.4s ease-in-out infinite;
}

@keyframes live-dot-pulse {
    0%   { box-shadow: 0 0 0 0   color-mix(in srgb, var(--primary, #dc2626) 60%, transparent); }
    70%  { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0   transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .live-section-dot { animation: none; }
}

/* ── Homepage section ─────────────────────────────────────────────── */

.live-section {
    padding: 64px 0;
    background: var(--bg-alt, #f8fafc);
    border-top: 1px solid var(--aborder, #e2e8f0);
    border-bottom: 1px solid var(--aborder, #e2e8f0);
}

.live-section-head {
    max-width: 720px;
    margin: 0 auto 28px;
    text-align: center;
}

.live-section-body {
    margin: 8px 0 0;
    color: var(--amuted, #64748b);
    font-size: 1.02rem;
    line-height: 1.6;
}

.live-section-schedule {
    margin: 12px 0 0;
    color: var(--amuted, #64748b);
    font-size: 0.88rem;
    font-style: italic;
}

.live-section-player {
    max-width: 960px;
    margin: 0 auto 24px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 48px -16px rgba(0,0,0,0.35);
}

.live-section-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.live-section-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── /live dedicated page ─────────────────────────────────────────── */

.live-page {
    padding: 56px 0 96px;
    min-height: 60vh;
}

.live-page-head {
    text-align: center;
    margin-bottom: 28px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.live-page-title {
    font-family: var(--font-heading, 'Barlow Condensed'), sans-serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--text, #0f172a);
    margin: 4px 0 12px;
}

.live-page-body {
    color: var(--amuted, #64748b);
    font-size: 1.02rem;
    line-height: 1.65;
    margin: 0;
}

.live-page-schedule {
    color: var(--amuted, #64748b);
    font-size: 0.92rem;
    font-style: italic;
    margin: 12px 0 0;
}

.live-page-offline {
    background: var(--bg-alt, #f8fafc);
    border: 1px dashed var(--aborder, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: var(--amuted, #64748b);
    font-size: 0.95rem;
    margin: 20px auto;
    max-width: 640px;
}

/* ── Display-mode grids ───────────────────────────────────────────── */

.live-page-grid {
    display: grid;
    gap: 16px;
    margin: 0 auto 24px;
    max-width: 1280px;
}

/* video_only - single column, capped width for readability */
.live-page-grid--video_only,
.live-page-grid--button_only {
    max-width: 1080px;
}

/* chat_only - single column, narrower */
.live-page-grid--chat_only {
    max-width: 540px;
}

/* video_and_chat - two columns on desktop, stacked on mobile */
.live-page-grid--video_and_chat {
    grid-template-columns: 1fr 360px;
    align-items: stretch;
}

.live-page-video {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 18px 48px -16px rgba(0,0,0,0.35);
}

.live-page-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.live-page-chat {
    background: var(--bg-alt, #f8fafc);
    border: 1px solid var(--aborder, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    min-height: 540px;
}

.live-page-grid--chat_only .live-page-chat {
    min-height: 720px;
}

.live-page-chat iframe {
    width: 100%;
    height: 100%;
    min-height: inherit;
    border: 0;
    display: block;
}

.live-page-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ── Mobile: stack everything, hide chat by default to keep page usable ─
   Per spec: "Do not let chat make the page unusable on mobile."
   We don't go as far as hiding it (the user opted into video_and_chat),
   but we re-stack and shrink the chat min-height so the page doesn't
   become a 1500px wall of chat scrollback before the user finds the
   external CTA. */

@media (max-width: 900px) {
    .live-page-grid--video_and_chat {
        grid-template-columns: 1fr;
    }
    .live-page-chat {
        min-height: 380px;
    }
    .live-page-grid--chat_only .live-page-chat {
        min-height: 480px;
    }
}

@media (max-width: 600px) {
    .live-section {
        padding: 48px 0;
    }
    .live-section-head {
        margin-bottom: 20px;
    }
}
