/* live.css — AJ-style Live Updates Panel + Breaking Banner + Thumbnail Fixes */
/* Append this to style.css or include separately */

/* =========================================================
   BREAKING BANNER — full-width red block (AJ style)
   ========================================================= */
.breaking-banner {
  background: var(--c-red);
  color: #fff;
  padding: 28px 0 32px;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.breaking-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,.18) 0%, transparent 60%);
  pointer-events: none;
}
.breaking-banner .container { position: relative; z-index: 1 }

.breaking-kicker {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.breaking-kicker-dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
  flex-shrink: 0;
}

.breaking-banner-headline {
  font-family: var(--f-display);
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.18;
  color: #fff;
  letter-spacing: -.01em;
  max-width: 820px;
}

.breaking-banner-sub {
  font-family: var(--f-ui);
  font-size: 14px;
  color: rgba(255,255,255,.7);
  margin-top: 10px;
  max-width: 680px;
  line-height: 1.5;
}

/* =========================================================
   LIVE UPDATES PANEL — AJ timeline design
   ========================================================= */
.live-updates-section {
  background: var(--c-white);
  border-top: 3px solid var(--c-red);
  margin-bottom: 32px;
}
body.dark-mode .live-updates-section {
  background: var(--c-dm-surface);
}

.live-updates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border);
}
body.dark-mode .live-updates-header {
  border-color: var(--c-dm-border);
}

.live-updates-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-red);
}
.live-updates-label .live-ring {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--c-red);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-updates-label .live-ring::after {
  content: '';
  width: 8px; height: 8px;
  background: var(--c-red);
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

.live-updates-count {
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--c-grey);
  font-weight: 500;
}

.live-updates-list {
  padding: 0 20px;
  list-style: none;
  position: relative;
}

/* Vertical timeline line */
.live-updates-list::before {
  content: '';
  position: absolute;
  left: 38px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--c-border);
}
body.dark-mode .live-updates-list::before {
  background: var(--c-dm-border);
}

/* Individual update item */
.live-update-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0 18px 0;
  border-bottom: 1px solid var(--c-border);
  position: relative;
  cursor: pointer;
  transition: background var(--dur);
}
body.dark-mode .live-update-item {
  border-color: var(--c-dm-border);
}
.live-update-item:last-child { border-bottom: none }
.live-update-item:hover { background: var(--c-bg) }
body.dark-mode .live-update-item:hover { background: var(--c-dm-surface2) }
.live-update-item:hover { margin: 0 -20px; padding-left: 20px; padding-right: 20px }

/* Red circle dot on timeline */
.live-update-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--c-red);
  background: var(--c-white);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
  transition: background var(--dur);
}
body.dark-mode .live-update-dot {
  background: var(--c-dm-surface);
}
.live-update-item.is-new .live-update-dot {
  background: var(--c-red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.15);
}

.live-update-body {
  flex: 1;
  min-width: 0;
}

.live-update-time {
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--c-grey);
  font-weight: 600;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-update-time .new-tag {
  background: var(--c-red);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 1px;
}

.live-update-title {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--c-ink);
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.dark-mode .live-update-title { color: var(--c-dm-text) }
.live-update-item:hover .live-update-title { color: var(--c-red) }

.live-update-summary {
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--c-grey-dark);
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.dark-mode .live-update-summary { color: var(--c-dm-muted) }

/* Thumbnail on live update items */
.live-update-thumb {
  width: 90px;
  height: 60px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--c-border);
  position: relative;
}
.live-update-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s var(--ease);
}
.live-update-item:hover .live-update-thumb img { transform: scale(1.06) }

/* Show more button */
.live-updates-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--c-border);
}
body.dark-mode .live-updates-more { border-color: var(--c-dm-border) }
.live-updates-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-red);
  padding: 7px 18px;
  border: 1.5px solid var(--c-red);
  border-radius: 1px;
  transition: all var(--dur);
  cursor: pointer;
  background: none;
}
.live-updates-more-btn:hover {
  background: var(--c-red);
  color: #fff;
}
.live-updates-more-btn.loading { opacity: .6; pointer-events: none }

/* NEW update notification bar */
.live-new-bar {
  background: var(--c-live-bg);
  border: 1px solid rgba(200,16,46,.2);
  border-radius: 2px;
  padding: 8px 16px;
  margin: 12px 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-red);
  cursor: pointer;
  transition: background var(--dur);
  display: none; /* shown via JS when new items arrive */
}
.live-new-bar.visible { display: flex }
.live-new-bar:hover { background: rgba(200,16,46,.08) }

/* =========================================================
   THUMBNAIL FIX — card images always show properly
   ========================================================= */

/* Ensure card image container never shows shimmer after image loads */
.card-image {
  background: #e8e8e8;
  background-image: none !important;
  animation: none !important;
}
body.dark-mode .card-image { background: #1a1a1a }

/* Shimmer only when no image loaded yet */
.card-image:not(:has(img.loaded)):not(:has(.img-placeholder)) {
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%) !important;
  background-size: 200% 100% !important;
  animation: img-shimmer 1.4s ease-in-out infinite !important;
}
body.dark-mode .card-image:not(:has(img.loaded)):not(:has(.img-placeholder)) {
  background: linear-gradient(90deg, #1e1e1e 25%, #252525 50%, #1e1e1e 75%) !important;
  background-size: 200% 100% !important;
}

@keyframes img-shimmer {
  0%   { background-position: 200% 0 }
  100% { background-position: -200% 0 }
}

/* Make all card images always display + proper fallback */
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease), opacity .3s ease;
  opacity: 0;
}
.card-image img.loaded { opacity: 1 }
.card-image img[src*="placeholder"] { opacity: 1 }

/* Hero side images - always visible */
.hero-side-image {
  opacity: 1 !important;
  transition: transform .4s var(--ease) !important;
}

/* Org thumbnail fallback display */
.og-thumb-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f0eeea;
}
body.dark-mode .og-thumb-wrap { background: #1a1a1a }
.og-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.og-thumb-label {
  position: absolute;
  bottom: 5px;
  right: 6px;
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.75);
  font-family: var(--f-ui);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 1px;
}

/* =========================================================
   ENHANCED CARD STYLES
   ========================================================= */

/* Card image ratio — enforce 16:9 always */
.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.card.card-featured .card-image {
  flex: 0 0 55%;
  aspect-ratio: auto;
  min-height: 220px;
}

/* Source logo / favicon badge on cards */
.card-source-favicon {
  width: 14px; height: 14px;
  border-radius: 2px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 3px;
}

/* =========================================================
   AJ-STYLE HERO STRIP (BREAKING banner integrated)
   ========================================================= */

/* Breaking news strip above hero */
.hero-breaking-strip {
  background: var(--c-ink);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.hero-breaking-strip .container {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hero-breaking-strip-badge {
  background: var(--c-red);
  color: #fff;
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hero-breaking-strip-text {
  font-family: var(--f-ui);
  font-size: 13px;
  color: rgba(255,255,255,.85);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-breaking-strip-text strong { color: #fff; font-weight: 700 }

/* =========================================================
   LIVE UPDATES — SIDEBAR WIDGET VERSION
   ========================================================= */
.sidebar-live-updates {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--c-red);
}
body.dark-mode .sidebar-live-updates {
  background: var(--c-dm-surface);
  border-color: var(--c-dm-border);
}

.sidebar-live-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-red);
}
body.dark-mode .sidebar-live-header { border-color: var(--c-dm-border) }

.sidebar-live-list { list-style: none; position: relative }
.sidebar-live-list::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--c-border);
}
body.dark-mode .sidebar-live-list::before { background: var(--c-dm-border) }

.sidebar-live-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--dur);
  position: relative;
}
body.dark-mode .sidebar-live-item { border-color: var(--c-dm-border) }
.sidebar-live-item:last-child { border-bottom: none }
.sidebar-live-item:hover { background: var(--c-bg) }
body.dark-mode .sidebar-live-item:hover { background: var(--c-dm-surface2) }

.sidebar-live-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--c-red);
  background: var(--c-white);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
body.dark-mode .sidebar-live-dot { background: var(--c-dm-surface) }
.sidebar-live-item:first-child .sidebar-live-dot { background: var(--c-red) }

.sidebar-live-content { flex: 1; min-width: 0 }
.sidebar-live-time {
  font-family: var(--f-ui);
  font-size: 10px;
  color: var(--c-grey);
  font-weight: 600;
  margin-bottom: 3px;
}
.sidebar-live-title {
  font-family: var(--f-display);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--c-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.dark-mode .sidebar-live-title { color: var(--c-dm-text) }
.sidebar-live-item:hover .sidebar-live-title { color: var(--c-red) }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 700px) {
  .live-update-thumb { display: none }
  .live-updates-list::before { left: 34px }
  .breaking-banner-headline { font-size: 22px }
  .live-update-title { font-size: 14px }
  .live-update-item:hover { margin: 0; padding-left: 0; padding-right: 0 }
}

/* =========================================================
   PULSE ANIMATION (shared)
   ========================================================= */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }

/* =========================================================
   FADE-IN for new live updates
   ========================================================= */
@keyframes liveItemIn {
  from { opacity: 0; transform: translateY(-8px); background: rgba(200,16,46,.06) }
  to   { opacity: 1; transform: translateY(0);    background: transparent }
}
.live-update-item.just-added {
  animation: liveItemIn .5s var(--ease) both;
}
