/* ============================================================
   Live Blog — Frontend Styles
   ============================================================ */

:root {
	--liveblog-accent:      #e74c3c;
	--lb-bar-bg:            #12192b;
	--lb-bar-hover:         #0e1520;
	--lb-text:              #ffffff;
	--lb-panel-bg:          #ffffff;
	--lb-panel-text:        #374151;
	--lb-border:            #e5e7eb;
	--lb-bar-min-height:    44px;
	--lb-panel-max-height:  55vh;
	--lb-entry-font-size:   14px;
	--lb-entry-title-size:  15px;
	--lb-entry-radius:      0px;
	--lb-shadow:            0 -4px 24px rgba(0, 0, 0, 0.18);
	--lb-font:              -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---- Sticky container ---- */
#lb-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	font-family: var(--lb-font);
	box-shadow: var(--lb-shadow);
	transition: bottom 0.3s ease, top 0.3s ease;
}

#lb-sticky-bar.lb-pos-bottom { bottom: var(--lb-bar-offset, 0px); }
#lb-sticky-bar.lb-pos-top    { top: var(--lb-bar-offset, 0px); }

/* ---- Bar header ---- */
.lb-bar-header {
	background: var(--lb-bar-bg);
	color: var(--lb-text);
	padding: 0 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	transition: background 0.2s;
	min-height: var(--lb-bar-min-height);
	box-sizing: border-box;
}

.lb-bar-header:hover {
	background: var(--lb-bar-hover);
}

/* ---- Status badge ---- */
.lb-status-badge {
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 1.2px;
	padding: 4px 9px;
	border-radius: 3px;
	text-transform: uppercase;
	white-space: nowrap;
	flex-shrink: 0;
}

#lb-sticky-bar.lb-status-live .lb-status-badge {
	background: var(--liveblog-accent);
	animation: lb-live-pulse 2.2s ease-in-out infinite;
}

#lb-sticky-bar.lb-status-ended .lb-status-badge {
	background: #4b5563;
}

@keyframes lb-live-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.65; }
}

/* ---- Bar title ---- */
.lb-bar-title {
	font-size: 13px;
	font-weight: 600;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--lb-text);
}

/* ---- New entries badge ---- */
.lb-new-badge {
	background: var(--liveblog-accent);
	color: white;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 11px;
	border-radius: 20px;
	white-space: nowrap;
	flex-shrink: 0;
	animation: lb-badge-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lb-badge-pop {
	0%   { transform: scale(0.5); opacity: 0; }
	100% { transform: scale(1);   opacity: 1; }
}

/* ---- Toggle arrow ---- */
.lb-toggle-arrow {
	font-size: 11px;
	opacity: 0.6;
	transition: transform 0.3s ease, opacity 0.2s;
	flex-shrink: 0;
	color: var(--lb-text);
}

#lb-sticky-bar.lb-panel-open .lb-toggle-arrow { transform: rotate(180deg); opacity: 1; }
.lb-bar-header:hover .lb-toggle-arrow         { opacity: 1; }

/* ---- Panel ---- */
.lb-panel {
	background: var(--lb-panel-bg);
	max-height: var(--lb-panel-max-height);
	overflow-y: auto;
	overscroll-behavior: contain;
	border-top: 2px solid var(--liveblog-accent);
}

.lb-pos-top .lb-panel {
	border-top: none;
	border-bottom: 2px solid var(--liveblog-accent);
}

.lb-panel::-webkit-scrollbar       { width: 5px; }
.lb-panel::-webkit-scrollbar-track { background: #f3f4f6; }
.lb-panel::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ---- Entries ---- */
.lb-loading,
.lb-empty {
	padding: 28px 20px;
	text-align: center;
	color: #9ca3af;
	font-size: var(--lb-entry-font-size);
	font-style: italic;
}

.lb-entry {
	padding: 13px 16px;
	border-bottom: 1px solid var(--lb-border);
	background: var(--lb-panel-bg);
	animation: lb-entry-slide 0.3s ease;
	border-radius: var(--lb-entry-radius);
}

@keyframes lb-entry-slide {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}

.lb-entry:last-child               { border-bottom: none; }
.lb-entry:first-child:not(.lb-entry-pinned) { background: color-mix(in srgb, var(--lb-panel-bg) 95%, #fffef5); }

/* Pinned */
.lb-entry-pinned {
	border-left: 3px solid var(--liveblog-accent);
	background: color-mix(in srgb, var(--lb-panel-bg) 95%, #fff8f8) !important;
}

.lb-pinned-label {
	font-size: 10px;
	color: var(--liveblog-accent);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	margin-bottom: 6px;
}

/* ---- Entry meta ---- */
.lb-entry-meta {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
	margin-bottom: 5px;
}

.lb-label {
	background: var(--liveblog-accent);
	color: white;
	font-size: 9px;
	font-weight: 800;
	padding: 2px 8px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.lb-score {
	font-size: 13px;
	font-weight: 800;
	color: var(--lb-panel-text);
	background: color-mix(in srgb, var(--lb-panel-bg) 80%, #f3f4f6);
	padding: 2px 9px;
	border-radius: 4px;
	border: 1px solid var(--lb-border);
}

.lb-time   { font-size: 11px; color: #9ca3af; }
.lb-author { font-size: 11px; color: #6b7280; }
.lb-author::before { content: '·'; margin-right: 5px; color: #d1d5db; }

/* ---- Entry content ---- */
.lb-entry-title {
	font-size: var(--lb-entry-title-size);
	font-weight: 700;
	color: var(--lb-panel-text);
	margin: 0 0 6px 0;
	line-height: 1.35;
}

.lb-entry-image          { margin: 8px 0; }
.lb-entry-image img      { max-width: 100%; max-height: 220px; border-radius: 6px; object-fit: cover; display: block; }

.lb-entry-content {
	font-size: var(--lb-entry-font-size);
	color: var(--lb-panel-text);
	line-height: 1.55;
}

.lb-entry-content p            { margin: 0 0 8px; }
.lb-entry-content p:last-child { margin-bottom: 0; }
.lb-entry-content a            { color: var(--liveblog-accent); }
.lb-entry-content strong       { font-weight: 700; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
	.lb-panel      { max-height: min(calc(var(--lb-panel-max-height) + 10vh), 85vh); }
	.lb-bar-header { padding: 0 12px; }
	.lb-entry      { padding: 11px 12px; }
	.lb-bar-title  { font-size: 12px; }
}

@media (min-width: 1200px) {
	#lb-sticky-bar {
		left: 50%;
		transform: translateX(-50%);
		width: 900px;
		border-radius: 12px 12px 0 0;
	}
	#lb-sticky-bar.lb-pos-top {
		border-radius: 0 0 12px 12px;
	}
}

/* ============================================================
   Live Blog — Sekcja ZAKOŃCZONO (inline pod postem)
   ============================================================ */

.lb-ended-section {
	margin: 36px 0 0;
	border: 2px solid var(--lb-border, #e5e7eb);
	border-top: 4px solid var(--liveblog-accent, #e74c3c);
	border-radius: var(--lb-entry-radius, 0px);
	font-family: var(--lb-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
	background: var(--lb-panel-bg, #fff);
	overflow: hidden;
}

/* Header */
.lb-ended-header {
	padding: 14px 18px 12px;
	border-bottom: 1px solid var(--lb-border, #e5e7eb);
	background: #f9fafb;
}

.lb-ended-header-top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.lb-ended-badge {
	background: #4b5563;
	color: #fff;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 1.2px;
	padding: 3px 9px;
	border-radius: 3px;
	text-transform: uppercase;
	flex-shrink: 0;
}

.lb-ended-title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	color: #111827 !important;
	border: none !important;
	line-height: 1.3 !important;
}

.lb-ended-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.lb-ended-count {
	font-size: 12px;
	color: #6b7280;
	background: #e5e7eb;
	padding: 2px 8px;
	border-radius: 10px;
}

.lb-ended-date {
	font-size: 12px;
	color: #9ca3af;
}

/* Entries */
.lb-ended-entries {
	padding: 0;
}

.lb-entry-hidden {
	display: none !important;
}

.lb-ended-entry {
	padding: 13px 18px;
	border-bottom: 1px solid var(--lb-border, #e5e7eb);
	background: var(--lb-panel-bg, #fff);
}

.lb-ended-entry:last-child {
	border-bottom: none;
}

.lb-ended-entry-pinned {
	border-left: 3px solid var(--liveblog-accent, #e74c3c);
	background: #fff8f8;
}

.lb-ended-pinned-label {
	font-size: 10px;
	color: var(--liveblog-accent, #e74c3c);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	margin-bottom: 5px;
}

/* Entry meta row */
.lb-ended-entry-meta {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
	margin-bottom: 5px;
}

.lb-ended-label {
	background: var(--liveblog-accent, #e74c3c);
	color: #fff;
	font-size: 9px;
	font-weight: 800;
	padding: 2px 8px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.lb-ended-score {
	font-size: 13px;
	font-weight: 800;
	color: #111827;
	background: #f3f4f6;
	padding: 2px 9px;
	border-radius: 4px;
	border: 1px solid var(--lb-border, #e5e7eb);
}

.lb-ended-time {
	font-size: 11px;
	color: #9ca3af;
}

.lb-ended-author {
	font-size: 11px;
	color: #6b7280;
}

.lb-ended-author::before {
	content: '·';
	margin-right: 5px;
	color: #d1d5db;
}

/* Entry content */
.lb-ended-entry-title {
	font-size: var(--lb-entry-title-size, 15px) !important;
	font-weight: 700 !important;
	color: var(--lb-panel-text, #374151) !important;
	margin: 0 0 6px !important;
	padding: 0 !important;
	line-height: 1.35 !important;
	border: none !important;
}

.lb-ended-image {
	margin: 8px 0;
}

.lb-ended-image img {
	max-width: 100%;
	max-height: 220px;
	border-radius: 6px;
	object-fit: cover;
	display: block;
}

.lb-ended-content {
	font-size: var(--lb-entry-font-size, 14px);
	color: var(--lb-panel-text, #374151);
	line-height: 1.55;
}

.lb-ended-content p            { margin: 0 0 8px; }
.lb-ended-content p:last-child { margin-bottom: 0; }
.lb-ended-content a            { color: var(--liveblog-accent, #e74c3c); }

/* Show more button */
.lb-ended-more-wrap {
	padding: 14px 18px;
	text-align: center;
	border-top: 1px solid var(--lb-border, #e5e7eb);
	background: #f9fafb;
}

.lb-ended-more-btn {
	background: var(--liveblog-accent, #e74c3c);
	color: #fff !important;
	border: none !important;
	padding: 9px 24px !important;
	border-radius: 4px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: opacity 0.2s !important;
	box-shadow: none !important;
}

.lb-ended-more-btn:hover {
	opacity: 0.88 !important;
}

/* ============================================================
   Live Blog — Status AKTUALIZACJA
   ============================================================ */

/* Badge na sticky barze */
#lb-sticky-bar.lb-status-update .lb-status-badge {
	background: var(--lb-update-color, #f97316);
}

#lb-sticky-bar.lb-status-update.lb-pulse-update .lb-status-badge {
	animation: lb-live-pulse 2.2s ease-in-out infinite;
}

/* Wpis oznaczony jako AKTUALIZACJA */
.lb-entry-update {
	border-left: var(--lb-update-border, 3px) solid var(--lb-update-color, #f97316) !important;
	background: color-mix(in srgb, var(--lb-panel-bg) 96%, #fff7ed) !important;
}

.lb-update-prefix {
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--lb-update-color, #f97316);
	margin-bottom: 5px;
}

/* Badge etykiety AKTUALIZACJA */
.lb-label-update {
	background: var(--lb-update-color, #f97316) !important;
	animation: lb-update-pulse 2.5s ease-in-out infinite;
}

@keyframes lb-update-pulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
	50%       { opacity: 0.85; box-shadow: 0 0 0 4px rgba(249, 115, 22, 0); }
}
