/* Luminous Headlines front end. Type inherits the theme; tokens cover secondary colors. */
.lmhl {
	--lmhl-muted: #5b636d;
	--lmhl-rule: rgba(0, 0, 0, 0.12);
	--lmhl-tile: #eceef1;
	--lmhl-tile-text: #39414a;
	--lmhl-card: #ffffff;
	--lmhl-card-edge: #d9dde2;
	--lmhl-icon-bg: #ffffff;
	--lmhl-panel: #f3f5f7; /* logo panels stay light in every color scheme */
	--lmhl-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
	--lmhl-shadow-hover: 0 4px 10px rgba(16, 24, 40, 0.07), 0 10px 24px rgba(16, 24, 40, 0.06);
	--lmhl-mark: 56px;
	margin: 0 0 1.75em;
	/* Page links jump here; leave room for the admin bar and sticky headers. */
	scroll-margin-top: 140px;
}
@media (prefers-color-scheme: dark) {
	.lmhl {
		--lmhl-muted: #a7afb8;
		--lmhl-rule: rgba(255, 255, 255, 0.16);
		--lmhl-tile: #2b3037;
		--lmhl-tile-text: #d6dbe0;
		--lmhl-card: rgba(255, 255, 255, 0.04);
		--lmhl-card-edge: #4a5059;
		--lmhl-icon-bg: #f4f5f7;
		--lmhl-shadow: none;
		--lmhl-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.35);
	}
}
.fanrev-is-dark .lmhl {
	--lmhl-muted: #a7afb8;
	--lmhl-rule: rgba(255, 255, 255, 0.16);
	--lmhl-tile: #2b3037;
	--lmhl-tile-text: #d6dbe0;
	--lmhl-card: rgba(255, 255, 255, 0.04);
	--lmhl-card-edge: #4a5059;
	--lmhl-icon-bg: #f4f5f7;
	--lmhl-shadow: none;
	--lmhl-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Cards */
.lmhl .lmhl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.lmhl .lmhl-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 18px;
	margin: 0;
	padding: 18px 20px 18px 18px;
	background: var(--lmhl-card);
	border: 1px solid var(--lmhl-card-edge);
	border-left: 5px solid var(--lmhl-c, var(--lmhl-rule));
	border-radius: 12px;
	box-shadow: var(--lmhl-shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.lmhl .lmhl-item:hover {
	box-shadow: var(--lmhl-shadow-hover);
	transform: translateY(-2px);
}
.lmhl .lmhl-item:focus-within {
	outline: 2px solid var(--lmhl-c, currentColor);
	outline-offset: 3px;
}

/* Logo, favicon, or letter tile */
.lmhl .lmhl-mark {
	flex: 0 0 var(--lmhl-mark);
	width: var(--lmhl-mark);
	display: flex;
	justify-content: center;
	padding-top: 2px;
}
.lmhl .lmhl-mark img {
	display: block;
	max-width: 100%;
	max-height: 44px;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: 0;
	border: 0;
	box-shadow: none;
}
.lmhl .lmhl-mark .lmhl-icon {
	box-sizing: content-box;
	width: 28px;
	height: 28px;
	padding: 8px;
	background: var(--lmhl-icon-bg);
	border: 1px solid var(--lmhl-card-edge);
	border-radius: 12px;
}
.lmhl .lmhl-tile {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--lmhl-c, var(--lmhl-tile));
	color: var(--lmhl-on, var(--lmhl-tile-text));
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 19px;
	line-height: 1;
}

/* Text */
.lmhl .lmhl-body { flex: 1 1 auto; min-width: 0; }
.lmhl .lmhl-meta {
	margin: 0 0 8px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	font-size: 0.8em;
	line-height: 1.4;
	color: var(--lmhl-muted);
}
.lmhl .lmhl-pill {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 999px;
	background: var(--lmhl-c, var(--lmhl-tile));
	color: var(--lmhl-on, var(--lmhl-tile-text));
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.45;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.lmhl .lmhl-newtab { display: inline-flex; align-items: center; gap: 4px; }
.lmhl .lmhl-newtab svg { width: 12px; height: 12px; flex: none; }

.lmhl .lmhl-title {
	margin: 0 0 6px;
	padding: 0;
	font-size: 1.15em;
	line-height: 1.3;
	font-weight: 700;
	text-wrap: balance;
}
.lmhl .lmhl-title a { color: inherit; text-decoration: none; outline: none; }
/* Whole card is clickable through the headline link. */
.lmhl .lmhl-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}
.lmhl .lmhl-item:hover .lmhl-title a {
	text-decoration: underline;
	text-decoration-color: var(--lmhl-c, currentColor);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.lmhl .lmhl-excerpt {
	margin: 0;
	line-height: 1.6;
	max-width: 70ch;
	opacity: 0.85;
}

.lmhl .lmhl-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Featured image for stories from this site */
.lmhl .lmhl-thumb {
	flex: 0 0 200px;
	width: 200px;
	align-self: stretch;
	margin: -18px 0 -18px -18px;
	border-radius: 7px 0 0 7px;
	overflow: hidden;
	background: var(--lmhl-tile);
}
.lmhl .lmhl-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 140px;
	max-width: none;
	object-fit: cover;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: transform 0.35s ease;
}
.lmhl .lmhl-item.lmhl-has-image { overflow: hidden; }
.lmhl .lmhl-item.lmhl-has-image:hover .lmhl-thumb img { transform: scale(1.04); }
.lmhl .lmhl-mark[hidden] { display: none; }

/* Pagination */
.lmhl .lmhl-pages {
	margin: 24px 0 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	align-items: center;
}
.lmhl .lmhl-pages .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4em;
	padding: 6px 14px;
	border: 1px solid var(--lmhl-card-edge);
	border-radius: 999px;
	background: var(--lmhl-card);
	text-decoration: none;
	line-height: 1.4;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lmhl .lmhl-pages a.page-numbers:hover { border-color: currentColor; }
.lmhl .lmhl-pages a.page-numbers:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lmhl .lmhl-pages .current {
	font-weight: 700;
	border-color: currentColor;
	box-shadow: inset 0 0 0 1px currentColor;
}
.lmhl .lmhl-pages .dots { border-color: transparent; background: none; padding: 6px 4px; min-width: 0; }

@media (max-width: 600px) {
	.lmhl .lmhl-item.lmhl-has-image { flex-direction: column; }
	.lmhl .lmhl-thumb {
		flex: none;
		width: auto;
		align-self: stretch;
		margin: -14px -14px 0 -12px;
		border-radius: 5px 5px 0 0;
		aspect-ratio: 16 / 9;
	}
	.lmhl .lmhl-thumb img { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.lmhl .lmhl-thumb img { transition: none; }
	.lmhl .lmhl-item.lmhl-has-image:hover .lmhl-thumb img { transform: none; }
	.lmhl .lmhl-item, .lmhl .lmhl-pages .page-numbers { transition: none; }
	.lmhl .lmhl-item:hover { transform: none; }
}

@media (max-width: 480px) {
	.lmhl { --lmhl-mark: 40px; }
	.lmhl .lmhl-item { gap: 12px; padding: 14px 14px 14px 12px; }
	.lmhl .lmhl-mark img { max-height: 34px; }
	.lmhl .lmhl-mark .lmhl-icon { width: 22px; height: 22px; padding: 6px; border-radius: 10px; }
	.lmhl .lmhl-tile { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
	.lmhl .lmhl-title { font-size: 1.05em; }
}

/* News Sources widget */
.lmhl.lmhl-sources {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}
.lmhl.lmhl-sources .lmhl-source {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0 12px 0 0;
	list-style: none;
	background: var(--lmhl-card);
	border: 1px solid var(--lmhl-card-edge);
	border-left: 4px solid var(--lmhl-c, var(--lmhl-rule));
	border-radius: 10px;
	box-shadow: var(--lmhl-shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.lmhl.lmhl-sources .lmhl-source::before { content: none; }
.lmhl.lmhl-sources .lmhl-source:hover {
	box-shadow: var(--lmhl-shadow-hover);
	transform: translateY(-1px);
}
.lmhl.lmhl-sources .lmhl-source.is-current {
	border-color: var(--lmhl-c, currentColor);
	box-shadow: inset 0 0 0 1px var(--lmhl-c, currentColor);
}
.lmhl.lmhl-sources .lmhl-src-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0 8px 10px;
	color: inherit;
	text-decoration: none;
	border-radius: 8px;
}
.lmhl.lmhl-sources .lmhl-src-main:hover .lmhl-src-name,
.lmhl.lmhl-sources .is-current .lmhl-src-name {
	text-decoration: underline;
	text-decoration-color: var(--lmhl-c, currentColor);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.lmhl.lmhl-sources a:focus-visible { outline: 2px solid var(--lmhl-c, currentColor); outline-offset: 2px; }
.lmhl.lmhl-sources .lmhl-src-visit {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border: 1px solid var(--lmhl-card-edge);
	border-radius: 999px;
	font-size: 0.78em;
	line-height: 1.4;
	color: var(--lmhl-muted);
	text-decoration: none;
	white-space: nowrap;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.lmhl.lmhl-sources .lmhl-src-visit:hover {
	border-color: var(--lmhl-c, currentColor);
	color: inherit;
}
.lmhl.lmhl-sources .lmhl-src-visit svg { width: 11px; height: 11px; flex: none; }
.lmhl-sources .lmhl-src-icon {
	flex: none;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lmhl-icon-bg);
	border: 1px solid var(--lmhl-card-edge);
	border-radius: 8px;
	overflow: hidden;
}
.lmhl-sources .lmhl-src-icon img {
	display: block;
	width: 20px;
	height: 20px;
	max-width: none;
	object-fit: contain;
	margin: 0;
	border: 0;
	box-shadow: none;
}
.lmhl-sources .lmhl-src-letter {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lmhl-c, var(--lmhl-tile));
	color: var(--lmhl-on, var(--lmhl-tile-text));
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
}
.lmhl-sources .lmhl-src-name {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.lmhl-sources .lmhl-src-ext { flex: none; display: inline-flex; color: var(--lmhl-muted); }
.lmhl-sources .lmhl-src-ext svg,
.lmhl.lmhl-src-note svg { width: 12px; height: 12px; flex: none; }
.lmhl.lmhl-src-note {
	margin: 10px 0 0;
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.8em;
	color: var(--lmhl-muted);
}

/* "Showing headlines from" bar on the headlines page */
.lmhl .lmhl-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin: 0 0 16px;
	padding: 10px 14px;
	background: var(--lmhl-card);
	border: 1px solid var(--lmhl-card-edge);
	border-radius: 10px;
	font-size: 0.9em;
}
.lmhl .lmhl-filter-label { color: var(--lmhl-muted); }
.lmhl .lmhl-filter-clear { margin-left: auto; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
	.lmhl.lmhl-sources .lmhl-source, .lmhl.lmhl-sources .lmhl-src-visit { transition: none; }
	.lmhl.lmhl-sources .lmhl-source:hover { transform: none; }
}

/* ------------------------------------------------------------
 * Layouts: list (default), magazine, grid, compact
 * ---------------------------------------------------------- */

/* List: keep excerpts to three lines */
.lmhl--list .lmhl-excerpt,
.lmhl--grid .lmhl-excerpt,
.lmhl--magazine .lmhl-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}

/* Grid and magazine share a column-card shape: image or logo panel on top */
.lmhl--grid .lmhl-list {
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}
.lmhl--grid .lmhl-item,
.lmhl--magazine .lmhl-item {
	flex-direction: column;
	gap: 0;
	padding: 0;
	overflow: hidden;
	border-left: 1px solid var(--lmhl-card-edge);
	border-top: 5px solid var(--lmhl-c, var(--lmhl-rule));
}
.lmhl--grid .lmhl-thumb,
.lmhl--magazine .lmhl-item .lmhl-thumb {
	flex: none;
	width: auto;
	align-self: stretch;
	margin: 0;
	border-radius: 0;
	aspect-ratio: 16 / 9;
}
.lmhl--grid .lmhl-thumb img,
.lmhl--magazine .lmhl-item .lmhl-thumb img { min-height: 0; }
.lmhl--grid .lmhl-mark,
.lmhl--magazine .lmhl-item .lmhl-mark {
	flex: none;
	width: auto;
	align-self: stretch;
	aspect-ratio: 16 / 9;
	padding: 0;
	align-items: center;
	background: var(--lmhl-panel);
}
.lmhl--grid .lmhl-mark img, .lmhl--magazine .lmhl-mark img { max-height: 56px; max-width: 70%; }
.lmhl--grid .lmhl-mark .lmhl-icon,
.lmhl--magazine .lmhl-item .lmhl-mark .lmhl-icon { width: 36px; height: 36px; padding: 10px; }
.lmhl--grid .lmhl-tile,
.lmhl--magazine .lmhl-item .lmhl-tile { width: 56px; height: 56px; font-size: 24px; border-radius: 14px; }
.lmhl--grid .lmhl-body,
.lmhl--magazine .lmhl-item .lmhl-body { padding: 14px 16px 16px; }
.lmhl--grid .lmhl-title { font-size: 1.05em; }
.lmhl--grid .lmhl-item:hover,
.lmhl--magazine .lmhl-item:hover { transform: translateY(-2px); }

/* Magazine: lead story across the top, the rest two-up below */
.lmhl--magazine .lmhl-list {
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}
.lmhl--magazine .lmhl-item .lmhl-title { font-size: 1.05em; }
.lmhl--magazine .lmhl-hero { grid-column: 1 / -1; }
.lmhl--magazine .lmhl-hero .lmhl-thumb { aspect-ratio: 2 / 1; max-height: 380px; }
.lmhl--magazine .lmhl-hero .lmhl-mark { aspect-ratio: 3 / 1; }
.lmhl--magazine .lmhl-hero .lmhl-body { padding: 18px 22px 22px; }
.lmhl--magazine .lmhl-hero .lmhl-title { font-size: 1.5em; line-height: 1.25; margin-bottom: 8px; }
.lmhl--magazine .lmhl-hero .lmhl-excerpt { font-size: 1.05em; }

/* Compact: one line per headline */
.lmhl--compact .lmhl-list {
	display: block;
	background: var(--lmhl-card);
	border: 1px solid var(--lmhl-card-edge);
	border-radius: 12px;
	overflow: hidden;
}
.lmhl--compact .lmhl-row {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0;
	padding: 11px 16px;
	list-style: none;
	border-top: 1px solid var(--lmhl-card-edge);
	transition: background-color 0.15s ease;
}
.lmhl--compact .lmhl-row:first-child { border-top: 0; }
.lmhl--compact .lmhl-row:hover { background: var(--lmhl-tile); }
.lmhl--compact .lmhl-row:focus-within { outline: 2px solid var(--lmhl-c, currentColor); outline-offset: -2px; }
.lmhl--compact .lmhl-dot {
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--lmhl-c, var(--lmhl-muted));
	transform: translateY(-1px);
}
.lmhl--compact .lmhl-row-title {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	line-height: 1.4;
	color: inherit;
	text-decoration: none;
	outline: none;
}
.lmhl--compact .lmhl-row-title::after { content: ""; position: absolute; inset: 0; }
.lmhl--compact .lmhl-row:hover .lmhl-row-title {
	text-decoration: underline;
	text-decoration-color: var(--lmhl-c, currentColor);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.lmhl--compact .lmhl-row-meta {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8em;
	color: var(--lmhl-muted);
	white-space: nowrap;
}
.lmhl--compact .lmhl-row-source { font-weight: 600; }
.lmhl--compact .lmhl-row-ext { display: inline-flex; }
.lmhl--compact .lmhl-row-ext svg { width: 12px; height: 12px; }

/* Narrow areas (sidebars) and phones */
@media (max-width: 640px) {
	.lmhl--magazine .lmhl-hero .lmhl-title { font-size: 1.25em; }
	.lmhl--compact .lmhl-row { flex-wrap: wrap; row-gap: 2px; }
	.lmhl--compact .lmhl-row-title { flex: 1 1 0; }
	.lmhl--compact .lmhl-row-meta { flex-basis: 100%; padding-left: 19px; }
}
@media (max-width: 600px) {
	.lmhl--grid .lmhl-thumb,
	.lmhl--magazine .lmhl-thumb { margin: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.lmhl--grid .lmhl-item:hover,
	.lmhl--magazine .lmhl-item:hover { transform: none; }
	.lmhl--compact .lmhl-row { transition: none; }
}

/* Faint oversized logo behind cards that have a logo but no featured image */
.lmhl .lmhl-item.lmhl-has-watermark { overflow: hidden; }
.lmhl .lmhl-wm {
	position: absolute;
	pointer-events: none;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.07;
	transform: rotate(-8deg);
	transition: transform 0.6s ease, opacity 0.6s ease;
	z-index: 0;
}
.lmhl .lmhl-has-watermark .lmhl-mark > img,
.lmhl .lmhl-has-watermark .lmhl-body { position: relative; z-index: 1; }
.lmhl .lmhl-has-watermark:hover .lmhl-wm { transform: rotate(-8deg) scale(1.06); opacity: 0.1; }

/* List: same image column as cards with a featured image, so the text lines up */
.lmhl--list .lmhl-has-watermark .lmhl-mark {
	position: relative;
	overflow: hidden;
	flex: 0 0 200px;
	width: 200px;
	align-self: stretch;
	align-items: center;
	margin: -18px 0 -18px -18px;
	padding: 0;
	min-height: 140px;
	border-radius: 7px 0 0 7px;
	background: var(--lmhl-panel);
}
.lmhl--list .lmhl-has-watermark .lmhl-mark > img { max-height: 64px; max-width: 60%; }
.lmhl--list .lmhl-wm { inset: -40%; opacity: 0.09; }
@media (max-width: 600px) {
	.lmhl--list .lmhl-item.lmhl-has-watermark { flex-direction: column; }
	.lmhl--list .lmhl-has-watermark .lmhl-mark {
		flex: none;
		width: auto;
		min-height: 0;
		margin: -14px -14px 0 -12px;
		border-radius: 5px 5px 0 0;
		aspect-ratio: 16 / 9;
	}
}

/* Grid and magazine: fills the top panel and overflows it */
.lmhl--grid .lmhl-has-watermark .lmhl-mark,
.lmhl--magazine .lmhl-has-watermark .lmhl-mark {
	position: relative;
	overflow: hidden;
}
.lmhl--grid .lmhl-wm,
.lmhl--magazine .lmhl-wm {
	inset: -40%;
	opacity: 0.09;
}
.lmhl--grid .lmhl-has-watermark .lmhl-mark > img, .lmhl--magazine .lmhl-has-watermark .lmhl-mark > img { max-height: 72px; max-width: 60%; }
.lmhl--magazine .lmhl-hero.lmhl-has-watermark .lmhl-mark > img { max-height: 96px; }

@media (prefers-color-scheme: dark) {
	.lmhl .lmhl-wm { opacity: 0.1; }
}
.fanrev-is-dark .lmhl .lmhl-wm { opacity: 0.1; }
@media (prefers-reduced-motion: reduce) {
	.lmhl .lmhl-wm { transition: none; }
	.lmhl .lmhl-has-watermark:hover .lmhl-wm { transform: rotate(-8deg); }
}
