/* ============================================================
   Live Blog — archive + single event page.
   Loaded only on /live-blog routes (via $extraHead), so nothing
   here can affect the rest of the site.
   Colour/radius tokens come from theme.cache.css + frontend.css.
   ============================================================ */

:root {
    --lb-live:      var(--color-accent, #e63946);
    --lb-update:    #1f6feb;
    --lb-highlight: var(--color-accent, #e63946);
    --lb-image:     #16a34a;
    --lb-video:     #ea580c;
    --lb-pinned:    #f59e0b;
    --lb-ended:     #6b7280;
}

.lb-wrap { padding: 28px 0 56px; }

.lb-page-head { margin-bottom: 24px; }
.lb-page-head h1 { font-size: 30px; margin: 0 0 6px; }
.lb-page-head p  { margin: 0; color: var(--color-text); opacity: .75; font-size: 15px; }

/* ── Status badges ───────────────────────────────────────── */
.lb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
    color: #fff;
    background: var(--lb-ended);
}
.lb-badge.is-live { background: var(--lb-live); }
.lb-badge .lb-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: lb-pulse 1.5s ease-out infinite;
}
@keyframes lb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.75); }
    70%  { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ── Archive card grid ───────────────────────────────────── */
.lb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.lb-card {
    display: flex;
    flex-direction: column;
    background: var(--tti-card-bg, #fff);
    border: 1px solid var(--tti-border, rgba(0,0,0,.08));
    border-radius: var(--tti-radius, 6px);
    box-shadow: var(--tti-shadow, 0 2px 12px rgba(0,0,0,.08));
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.lb-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }

.lb-card-media { display: block; position: relative; aspect-ratio: 16 / 9; background: var(--color-secondary, #f1f1f1); }
.lb-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-card-media .lb-badge { position: absolute; top: 10px; left: 10px; }

.lb-card-body { padding: 14px 16px 4px; flex: 1; }
.lb-card-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-accent, #e63946);
    margin-bottom: 6px;
}
.lb-card-title { font-size: 18px; line-height: 1.35; margin: 0 0 8px; }
.lb-card-title a { color: var(--color-heading, #111); text-decoration: none; }
.lb-card-title a:hover { color: var(--color-accent, #e63946); }
.lb-card-summary { font-size: 14px; line-height: 1.6; margin: 0; color: var(--color-text); opacity: .8; }

.lb-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    border-top: 1px solid var(--tti-border, rgba(0,0,0,.08));
    font-size: 12px;
    color: var(--color-text);
    opacity: .7;
}

/* ── Empty state ─────────────────────────────────────────── */
.lb-empty {
    text-align: center;
    padding: 70px 20px;
    border: 1px dashed var(--tti-border, rgba(0,0,0,.14));
    border-radius: var(--tti-radius, 6px);
    color: var(--color-text);
    opacity: .8;
}
.lb-empty svg { opacity: .45; margin-bottom: 14px; }
.lb-empty p { margin: 0; font-size: 15px; }

/* ── Single page layout ──────────────────────────────────── */
.lb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: start;
}
@media (max-width: 900px) {
    .lb-layout { grid-template-columns: minmax(0, 1fr); }
}

.lb-header-card {
    background: var(--tti-card-bg, #fff);
    border: 1px solid var(--tti-border, rgba(0,0,0,.08));
    border-radius: var(--tti-radius, 6px);
    padding: 22px;
    margin-bottom: 24px;
}
.lb-header-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lb-chip {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-accent, #e63946);
    text-decoration: none;
}
.lb-title { font-size: 30px; line-height: 1.25; margin: 0 0 10px; }
.lb-summary { font-size: 16px; line-height: 1.65; margin: 0 0 16px; color: var(--color-text); opacity: .85; }
.lb-cover { width: 100%; border-radius: var(--tti-radius, 6px); display: block; margin-bottom: 16px; }

.lb-byline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text); opacity: .8; }
.lb-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.lb-avatar-fallback {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--color-accent, #e63946);
    color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.lb-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--tti-border, rgba(0,0,0,.08));
    font-size: 13px;
    color: var(--color-text);
    opacity: .8;
}
.lb-updating { display: inline-flex; align-items: center; gap: 7px; color: var(--lb-live); font-weight: 600; opacity: 1; }
/* The halo fades the accent var out to transparent rather than hardcoding an
   rgba() of one brand colour — the site's accent is an admin setting. */
.lb-updating .lb-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lb-live); animation: lb-pulse-accent 1.5s ease-out infinite; }
@keyframes lb-pulse-accent {
    0%   { box-shadow: 0 0 0 0 var(--lb-live); }
    70%  { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── "N new updates" bar ─────────────────────────────────── */
.lb-newbar {
    position: sticky;
    top: 8px;
    z-index: 50;
    width: 100%;
    margin-bottom: 14px;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--lb-live);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.lb-newbar[hidden] { display: none; }

/* ── Timeline ────────────────────────────────────────────── */
.lb-timeline { position: relative; }
.lb-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 92px;
    width: 2px;
    background: var(--tti-border, rgba(0,0,0,.1));
}

.lb-entry { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0; padding-bottom: 26px; }
.lb-gutter { position: relative; padding-right: 18px; text-align: right; }
.lb-time { display: block; line-height: 1.3; }
.lb-time-h { display: block; font-size: 14px; font-weight: 700; color: var(--color-heading, #111); }
.lb-time-d { display: block; font-size: 11px; color: var(--color-text); opacity: .6; }
.lb-dot {
    position: absolute;
    top: 4px;
    right: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lb-update);
    border: 2px solid var(--tti-card-bg, #fff);
}

.lb-body {
    background: var(--tti-card-bg, #fff);
    border: 1px solid var(--tti-border, rgba(0,0,0,.08));
    border-radius: var(--tti-radius, 6px);
    padding: 16px 18px;
    margin-left: 20px;
    min-width: 0;
}

.lb-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lb-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    color: #fff;
    background: var(--lb-update);
}
.lb-tag-pin { background: var(--lb-pinned); }

.lb-entry-title { font-size: 19px; line-height: 1.35; margin: 0 0 8px; }
.lb-content { font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.lb-content > *:first-child { margin-top: 0; }
.lb-content > *:last-child  { margin-bottom: 0; }
.lb-content img { max-width: 100%; height: auto; border-radius: 4px; }
.lb-content iframe { max-width: 100%; }
.lb-content .tti-yt-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 16px 0; border-radius: 6px; background: #000; }
.lb-content .tti-yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lb-entry-img { margin: 12px 0 0; }
.lb-entry-img img { width: 100%; border-radius: 4px; display: block; }
.lb-author { margin-top: 10px; font-size: 12px; color: var(--color-text); opacity: .65; }

/* Type colours — pinned wins over the entry type. */
.lb-t-highlight .lb-dot, .lb-t-highlight .lb-tag:first-child { background: var(--lb-highlight); }
.lb-t-image     .lb-dot, .lb-t-image     .lb-tag:first-child { background: var(--lb-image); }
.lb-t-video     .lb-dot, .lb-t-video     .lb-tag:first-child { background: var(--lb-video); }
.lb-entry.is-pinned .lb-dot { background: var(--lb-pinned); }
.lb-entry.is-pinned .lb-body { border-color: var(--lb-pinned); }

/* Freshly polled entries fade their highlight away. */
.lb-entry.lb-new .lb-body { animation: lb-flash 2.2s ease-out forwards; }
@keyframes lb-flash {
    0%   { box-shadow: 0 0 0 3px var(--lb-live); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Waiting / ended footers ─────────────────────────────── */
.lb-waiting, .lb-closed {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 112px;
    padding: 14px 18px;
    border-radius: var(--tti-radius, 6px);
    font-size: 14px;
    /* --color-secondary is an admin setting and is white on some themes, which
       would make this box vanish against the card. The border carries it. */
    background: var(--color-secondary, #f1f1f1);
    border: 1px solid var(--tti-border, rgba(0,0,0,.08));
    color: var(--color-text);
}
.lb-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid var(--tti-border, rgba(0,0,0,.15));
    border-top-color: var(--lb-live);
    border-radius: 50%;
    animation: lb-spin .9s linear infinite;
    flex: none;
}
@keyframes lb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .lb-spinner, .lb-pulse, .lb-entry.lb-new .lb-body { animation: none; }
}

@media (max-width: 640px) {
    .lb-timeline::before { left: 6px; }
    .lb-entry { grid-template-columns: minmax(0, 1fr); }
    .lb-gutter { text-align: left; padding: 0 0 8px 22px; }
    .lb-dot { top: 5px; right: auto; left: 0; }
    .lb-time-h, .lb-time-d { display: inline; font-size: 12px; }
    .lb-time-d::before { content: " · "; }
    .lb-body { margin-left: 22px; }
    .lb-waiting, .lb-closed { margin-left: 22px; }
    .lb-title { font-size: 24px; }
}
