/*
 * ============================================================================
 * assets/css/cms.css — CMS Base Stylesheet
 * Loaded after Bootstrap 5 to override and extend.
 * Dark-mode streaming aesthetic, < 4 KB unminified.
 * ============================================================================
 */

/* ── Global ── */
:root {
    --cms-bg:       #111318;
    --cms-surface:  #1a1d24;
    --cms-border:   #2a2d36;
    --cms-text:     #d0d3dc;
    --cms-muted:    #6b7080;
    --cms-accent:   #dc3545;
    --cms-accent-h: #bb2d3b;
    --cms-radius:   6px;
}

html, body {
    background-color: var(--cms-bg);
    color: var(--cms-text);
    font-size: 15px;
}

a { color: var(--cms-text); }
a:hover { color: #fff; }

/* ── Navbar overrides ── */
.navbar.bg-dark {
    background-color: var(--cms-surface) !important;
    border-bottom: 1px solid var(--cms-border);
}

/* ── Cards ── */
.card.bg-dark {
    background-color: var(--cms-surface) !important;
    border-color: var(--cms-border) !important;
    border-radius: var(--cms-radius);
    overflow: hidden;
}

/* ── Buttons ── */
.btn-danger {
    background-color: var(--cms-accent);
    border-color: var(--cms-accent);
}
.btn-danger:hover {
    background-color: var(--cms-accent-h);
    border-color: var(--cms-accent-h);
}

/* ── Footer ── */
footer.bg-dark {
    background-color: var(--cms-surface) !important;
    border-top: 1px solid var(--cms-border);
}

/* ── Lazy-load fade-in for thumbnails ── */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity .3s ease;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cms-bg); }
::-webkit-scrollbar-thumb { background: var(--cms-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cms-muted); }

/* ── Breadcrumb ── */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    color: var(--cms-muted);
    content: "›";
}
.breadcrumb-item.active {
    color: var(--cms-text);
}

/* ── Badges ── */
.badge {
    font-weight: 500;
    letter-spacing: .02em;
}

/* ── Alerts ── */
.alert-info {
    background-color: #1a2535;
    border-color: #1e3a5f;
    color: #90c4f9;
}

/* ── Pagination ── */
.pagination .page-link {
    transition: background-color .15s ease, color .15s ease;
}
.pagination .page-link:focus {
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .35);
}

/* ── Broadcaster card (global — supplements listing.php inline block) ── */
.broadcaster-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.broadcaster-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.broadcaster-thumb {
    object-fit: cover;
    aspect-ratio: 3 / 4;
    width: 100%;
    height: auto;
    display: block;
}

/* ── Live badge pulse ── */
.live-badge {
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}

/* ── Skeleton loader (used while JS waits for async content) ── */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--cms-surface) 25%,
        var(--cms-border)  50%,
        var(--cms-surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--cms-radius);
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Stream embed responsive wrapper ── */
.stream-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--cms-radius);
    overflow: hidden;
}
.stream-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Utility: visually hidden (accessible) ── */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ── Responsive tweaks ── */
@media (max-width: 575.98px) {
    .broadcaster-thumb { aspect-ratio: 1 / 1; }  /* square crop on tiny screens */
    .card-title.h6     { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .live-badge         { animation: none; }
    .skeleton           { animation: none; }
    .broadcaster-card   { transition: none; }
    img[loading="lazy"] { transition: none; opacity: 1; }
}
