/*
Raster Feedback Terminal — Newser / Overscan Bridge layer
====================================
Applies the "ClassicPress Newser / Overscan Bridge" dispatch-feed presentation
(the wire prototype: green-accent terminal modules, dispatch cards with
ticker/category/time meta, inline mini tearsheets and overscan pipeline hooks)
onto Raster Feedback Terminal's wire pages (search results and archives).

Scope: everything here is gated behind body.fl-nb-wire, which the theme adds
to the wire pages only (search results and the category/tag/author/date and
company archives — see inc/newser-bridge.php). The blog home is not a wire
page since 1.1.2: it keeps the classic Feedback Loop front page, and the
built-in Home1/Home2 terminal modules render there in the framed paper
sidebar (see the 1.1.2 block at the foot of this file). Single posts, pages
and the 404 keep the full Raster / Overscan editorial chrome untouched.

All colours ride the --os-* chrome tokens defined in overscan-chrome.css, so
the layer flips correctly between TERMINAL (dark) and SCHEMATIC (light) mode
with the existing Dark/Light toggle. On wire pages the in-shell accent is
re-mapped from cyan to the terminal *green* used by the wire prototype.

Loaded AFTER fl-raster-feedback-terminal.css, so every rule here wins.
*/

/* ==========================================================================
   Wire accent — the prototype's green (os-up) takes over from cyan inside
   the drafting-paper shell while the feed is active.
   ========================================================================== */
body.fl-nb-wire #main{
	--color-accent: var(--os-up);
	--color-accent-hover: var(--os-up);
	--color-accent-on-dark: var(--os-up);
	--color-good: var(--os-up);
}
body.fl-nb-wire #main a{ color:var(--os-up); }
body.fl-nb-wire #main a:hover{ color:var(--os-cyan); text-decoration:underline; }

/* Sans stack for the headline/body copy of dispatch cards (prototype uses a
   system sans for reading text, mono reserved for wire metadata). */
body.fl-nb-wire{ --nb-sans: "Helvetica Neue", Helvetica, Arial, sans-serif; }

/* ==========================================================================
   Chrome status bar — the datetime strip becomes the "Newser Wire" sys-bar
   ========================================================================== */
body.fl-nb-wire .fl-datetime-strip::before{
	content:"NEWSER WIRE :: REAL-TIME DISPATCH FEED";
	color:var(--os-up);
	font-weight:800;
}
.fl-newser-status{
	display:inline-flex; align-items:center; gap:6px;
	border:1px solid var(--os-chromeline);
	color:var(--os-chromedim);
	font-size:.62rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase;
	padding:3px 9px;
	white-space:nowrap;
}
.fl-newser-status .fl-newser-status-dot{
	width:6px; height:6px; border-radius:50%;
	background:var(--os-up);
	animation:fl-blink 1.4s infinite;
}
.fl-newser-status strong{ color:var(--os-up); }

/* ==========================================================================
   Layout — content column widens, sidebar becomes the fixed 340px terminal
   rail of the prototype. Both collapse to a single column on small screens.
   ========================================================================== */
body.fl-nb-wire .fl-home-wrap,
body.fl-nb-wire .fl-content-wrap{
	grid-template-columns:minmax(0,1fr) 340px;
	gap:14px;
}

/* Feed stack — one dispatch card after another (the prototype's wire). */
body.fl-nb-wire .fl-latest-grid{
	display:grid;
	grid-template-columns:1fr;
	gap:14px;
	background:transparent;
	border-top:0;
}

/* ==========================================================================
   Dispatch card
   ========================================================================== */
body.fl-nb-wire .nb-dispatch{
	display:block;
	background:var(--os-paper2);
	border:1px solid var(--os-grid2);
	padding:14px 16px 0;
	margin:0 0 14px;
	box-shadow:0 1px 0 rgba(0,0,0,.25);
	font-family:var(--font-body);
	position:relative;
}
html.fl-schematic body.fl-nb-wire .nb-dispatch{ box-shadow:0 1px 0 rgba(0,0,0,.06); }
body.fl-nb-wire .nb-dispatch:last-child{ margin-bottom:0; }
body.fl-nb-wire .nb-dispatch--high{ border-left:3px solid var(--os-up); }

/* Meta row — ticker chip, category tag, UTC time */
.nb-dispatch-meta{
	display:flex; align-items:center; flex-wrap:wrap; gap:8px;
	font-size:10px; letter-spacing:.14em; text-transform:uppercase;
	color:var(--os-inkdim);
	margin-bottom:9px;
	font-variant-numeric:tabular-nums;
}
.nb-tag{
	display:inline-flex; align-items:center;
	padding:2px 7px; line-height:1.3;
	font-weight:800; letter-spacing:.12em;
}
.nb-tag--ticker{
	background:var(--os-paper);
	border:1px solid var(--os-grid2);
	color:var(--os-cyan);
}
.nb-tag--cat{
	border:1px solid var(--os-grid2);
	color:var(--os-inkdim);
}
.nb-time{ margin-left:auto; }

/* Headline */
.nb-dispatch-title{
	font-family:var(--nb-sans);
	font-size:1.12rem; font-weight:900;
	letter-spacing:-.02em;
	line-height:1.28;
	margin:0 0 7px;
}
.nb-dispatch-title a{
	color:var(--os-ink);
	text-decoration:none;
}
body.fl-nb-wire .nb-dispatch-title a:hover{ color:var(--os-up); text-decoration:none; }

/* Deck / subtitle */
.nb-dispatch-subtitle{
	font-family:var(--font-mono);
	font-size:.72rem; letter-spacing:.04em;
	color:var(--os-inkfaint);
	font-style:italic;
	margin:0 0 8px;
}

/* Teaser copy */
.nb-dispatch-body{
	font-family:var(--nb-sans);
	font-size:.82rem;
	line-height:1.6;
	color:var(--os-ink);
	margin:0 0 12px;
}
/* The theme's generic excerpt appends its own "Read more" link; the wire
   card has its own pipeline hook, so drop the duplicate. */
.nb-dispatch-body .fl-read-more{ display:none; }

/* ==========================================================================
   Mini tearsheet — the compact financial table inside a dispatch card
   ========================================================================== */
.nb-mini-tearsheet{
	background:rgba(0,0,0,.24);
	border:1px solid var(--os-grid2);
	padding:7px 11px;
	margin:0 0 13px;
	font-family:var(--font-mono);
	font-size:11px;
	line-height:1.5;
}
html.fl-schematic .nb-mini-tearsheet{ background:rgba(0,0,0,.045); }
.nb-ts-row{
	display:flex; align-items:baseline; justify-content:space-between;
	gap:14px;
	padding:3px 0;
	border-bottom:1px dashed var(--os-grid2);
}
.nb-ts-row:last-child{ border-bottom:none; }
.nb-ts-lbl{
	color:var(--os-inkfaint);
	letter-spacing:.08em;
	text-transform:uppercase;
	font-size:9px;
	flex-shrink:0;
}
.nb-ts-val{
	color:var(--os-ink);
	font-weight:800;
	text-align:right;
	font-variant-numeric:tabular-nums;
	word-break:break-word;
}
.nb-ts-val.up{ color:var(--os-up); }
.nb-ts-val.dn{ color:var(--os-dn); }
.nb-ts-val.flat{ color:var(--os-fl); }

/* ==========================================================================
   Overscan pipeline hook — the conversion strip at the foot of each card
   ========================================================================== */
.nb-bridge-hook{
	display:flex; justify-content:space-between; align-items:center;
	gap:10px; flex-wrap:wrap;
	border-top:1px solid var(--os-grid2);
	margin:0 -16px;
	padding:9px 16px;
	background:rgba(0,0,0,.16);
	font-family:var(--font-mono);
	font-size:.62rem; letter-spacing:.14em; text-transform:uppercase;
	color:var(--os-inkdim);
}
html.fl-schematic .nb-bridge-hook{ background:rgba(0,0,0,.03); }
.nb-bridge-label{ opacity:.9; }
.nb-bridge-link{
	color:var(--os-up) !important;
	font-weight:800;
	text-decoration:none;
	white-space:nowrap;
}
.nb-bridge-link::after{ content:" \2192"; }
.nb-bridge-link:hover{ text-decoration:underline !important; }

/* ==========================================================================
   Sidebar rail — built-in terminal modules (.nb-widget) replace the framed
   paper widget column while the wire feed is active.
   ========================================================================== */
body.fl-nb-wire .fl-sidebar{
	background:transparent;
	border:0;
	padding:0;
	font-family:var(--font-mono);
}
body.fl-nb-wire .fl-sidebar::before{ display:none; }
body.fl-nb-wire .fl-sidebar .fl-widget{
	background:var(--os-paper2);
	border:1px solid var(--os-grid2);
	padding:12px;
	margin-bottom:14px;
}
body.fl-nb-wire .fl-sidebar .fl-widget-title{
	color:var(--os-ink);
	border-bottom-color:var(--os-grid2);
}

/* Module shell */
.nb-widget{
	background:var(--os-paper2);
	border:1px solid var(--os-grid2);
	padding:12px;
	margin-bottom:14px;
	font-family:var(--font-mono);
	color:var(--os-inkdim);
}
.nb-widget--terminal{ border-color:var(--os-up); }
.nb-widget-head{
	display:flex; justify-content:space-between; align-items:center;
	gap:8px;
	border-bottom:1px solid var(--os-grid2);
	padding-bottom:6px;
	margin-bottom:10px;
	font-size:.64rem; font-weight:800;
	letter-spacing:.16em; text-transform:uppercase;
	color:var(--os-inkdim);
}
.nb-widget--terminal .nb-widget-title{ color:var(--os-up); }
.nb-widget-flag{ color:var(--os-inkfaint); }
.nb-widget-intro{
	font-family:var(--nb-sans);
	font-size:.74rem; line-height:1.55;
	color:var(--os-inkdim);
	margin:0 0 11px;
}

/* Stats / tearsheet table shared by the sidebar modules */
.nb-stat-table{ margin:0 0 11px; }

/* CTA button */
.nb-cta{
	display:block; width:100%;
	background:var(--os-up);
	color:var(--os-chromebg) !important;
	text-align:center;
	padding:8px 10px;
	font-family:var(--font-mono);
	font-size:.62rem; font-weight:800;
	letter-spacing:.14em; text-transform:uppercase;
	text-decoration:none;
	border:0;
}
html.fl-schematic .nb-cta{ color:#fff !important; }
.nb-cta:hover{
	filter:brightness(1.12);
	text-decoration:none !important;
}

/* Latest tearsheets list */
.nb-tearsheet-list{
	list-style:none; margin:0; padding:0;
	display:flex; flex-direction:column;
	font-family:var(--font-mono);
	font-size:11px;
}
.nb-tearsheet-list li{
	border-bottom:1px dashed var(--os-grid2);
	padding-bottom:6px;
	margin-bottom:6px;
}
.nb-tearsheet-list li:last-child{ border-bottom:none; padding-bottom:0; margin-bottom:0; }
.nb-ts-link{ display:block; text-decoration:none; }
.nb-ts-link .nb-ts-head{
	display:block;
	color:var(--os-ink);
	font-weight:800;
	letter-spacing:.04em;
	line-height:1.4;
}
.nb-ts-link:hover .nb-ts-head{ color:var(--os-up); }
.nb-ts-link .nb-ts-sub{
	display:block;
	margin-top:2px;
	color:var(--os-inkdim);
	line-height:1.45;
}
.nb-widget-empty{
	font-size:.72rem; line-height:1.5;
	color:var(--os-inkdim);
	margin:0;
}

/* ==========================================================================
   Feed headers on wire pages — the "Feedback in The Loop" / search banners
   read as terminal section markers.
   ========================================================================== */
body.fl-nb-wire .fl-section-banner{
	background:var(--os-paper2);
	border:1px solid var(--os-grid2);
	border-left:3px solid var(--os-up);
	margin-bottom:14px;
}
body.fl-nb-wire .fl-section-banner-title{ color:var(--os-up); }
body.fl-nb-wire .fl-section-banner-sub{ color:var(--os-inkdim); }
body.fl-nb-wire .fl-archive-header{ margin-bottom:14px; }
body.fl-nb-wire .fl-archive-title{
	font-family:var(--font-mono);
	font-size:1rem; letter-spacing:.1em; text-transform:uppercase;
	color:var(--os-ink);
}

/* ==========================================================================
   1.1.2 — the blog home is the classic Feedback Loop front page again, and
   the built-in terminal modules fall back into its Home1/Home2 areas too
   (sidebar.php / raster_feedback_terminal_newser_modules_active()). Outside
   the wire pages the sidebar is the framed paper column, so render the
   modules as in-column sections rather than boxed terminal panels. Only the
   home front reaches this state — sidebar.php is used on the home and the
   wire pages, and the wire pages are all body.fl-nb-wire.
   ========================================================================== */
body:not(.fl-nb-wire) .fl-sidebar .nb-widget{
	background:transparent;
	border:0;
	border-top:1px solid var(--os-grid2);
	border-bottom:1px solid var(--os-grid2);
	padding:12px 0 8px;
	margin:0 0 22px;
}
body:not(.fl-nb-wire) .fl-sidebar .nb-widget-head{
	border-bottom:0;
	padding-bottom:0;
	margin-bottom:8px;
}

/* ==========================================================================
   Responsive — collapse to a single column under 900px, same breakpoint the
   rest of the theme uses.
   ========================================================================== */
@media screen and (max-width: 900px){
	body.fl-nb-wire .fl-home-wrap,
	body.fl-nb-wire .fl-content-wrap{
		grid-template-columns:1fr;
		gap:14px;
	}
	body.fl-nb-wire .fl-sidebar{
		border-top:1px solid var(--os-grid2);
		padding-top:14px;
	}
	.fl-newser-status{ display:none; }
}

@media (prefers-reduced-motion: reduce){
	.fl-newser-status .fl-newser-status-dot{ animation:none; }
}
