/* ============================================================
   Newspaper Widgets – Trending Ticker + Featured Grid
   ============================================================ */

/* ─── TRENDING NOW TICKER ─── */
.np-trending-ticker {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid #e5e7eb;
	overflow: hidden;
	font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
	transition: box-shadow 0.35s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.35s ease;
}

.np-trending-ticker:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
	border-color: #cbd5e1;
}

.ticker-label {
	display: flex;
	align-items: center;
	padding: 0.65rem 1.25rem;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	white-space: nowrap;
	background: #0f172a;
	color: #fff;
	flex-shrink: 0;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.ticker-entries {
	flex: 1;
	position: relative;
	overflow: hidden;
	min-width: 0;
}

.ticker-entry {
	position: absolute;
	top: 50%;
	left: 1.25rem;
	transform: translateY(-50%) translateY(6px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: calc(100% - 2.5rem);
	font-size: 0.9rem;
	font-weight: 500;
	color: #1e293b;
	text-decoration: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.45s cubic-bezier(0.25, 1, 0.5, 1),
	            transform 0.45s cubic-bezier(0.25, 1, 0.5, 1),
	            color 0.25s ease;
	pointer-events: none;
}
.ticker-entry:hover {
	color: #2563eb;
}
.ticker-entry.active {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateY(0);
	pointer-events: auto;
}

.ticker-nav {
	display: flex;
	align-items: stretch;
	flex-shrink: 0;
	border-left: 1px solid #e5e7eb;
}
.ticker-nav button {
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	width: 38px;
	height: 100%;
	color: #94a3b8;
	transition: color 0.25s ease, background-color 0.25s ease, transform 0.15s ease;
}
.ticker-nav button:hover {
	color: #0f172a;
	background: #f1f5f9;
}
.ticker-nav button:active {
	transform: scale(0.92);
}
.ticker-nav button + button {
	border-left: 1px solid #e5e7eb;
}
.ticker-nav .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}


/* ─── NEWSPAPER FEATURED GRID ─── */

/* Base grid */
.np-featured-grid {
	display: grid;
	gap: 4px;
	height: 500px;
	overflow: hidden;
	contain: layout paint;
}

/* Layout A – Big Left + Right Column */
.np-featured-grid.layout-a {
	grid-template-columns: 1fr 1fr;
}

/* Layout B – Big Right + Left Column (mirror) */
.np-featured-grid.layout-b {
	grid-template-columns: 1fr 1fr;
}

/* Layout C – Big Top + Bottom Row */
.np-featured-grid.layout-c {
	grid-template-columns: 1fr;
	grid-template-rows: 60% 1fr;
}

/* Layout D – Equal Grid */
.np-featured-grid.layout-d {
	grid-template-columns: repeat(2, 1fr);
}

/* Right column sub-grid */
.np-grid-right {
	display: grid;
	grid-template-rows: 1.15fr 1fr;
	gap: 4px;
	min-height: 0;
}

.np-grid-bottom-row,
.np-grid-top-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: 4px;
	min-height: 0;
}


/* ─── GRID CELLS (SILKY SMOOTH GPU-ACCELERATED) ─── */
.np-grid-cell {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	text-decoration: none !important;
	color: #fff;
	min-height: 0;
	background: #1e293b;
	isolation: isolate;
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	cursor: pointer;
}

/* Smooth background image layer with GPU hardware acceleration */
.np-grid-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transform: scale(1.001) translate3d(0, 0, 0);
	-webkit-transform: scale(1.001) translate3d(0, 0, 0);
	transition: transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
	will-change: transform;
	pointer-events: none;
	z-index: 0;
}

.np-grid-cell:hover .np-grid-bg {
	transform: scale(1.07) translate3d(0, 0, 0);
	-webkit-transform: scale(1.07) translate3d(0, 0, 0);
}

/* Darkening gradient overlay layer */
.np-grid-cell::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
	z-index: 1;
	opacity: 0.85;
	transition: opacity 0.55s cubic-bezier(0.25, 1, 0.5, 1);
	pointer-events: none;
}
.np-grid-cell:hover::before {
	opacity: 0.95;
}

/* Content overlay container */
.np-grid-overlay {
	position: relative;
	z-index: 2;
	padding: 20px;
	width: 100%;
	transform: translateY(0);
	transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
	pointer-events: none;
}
.np-grid-cell:hover .np-grid-overlay {
	transform: translateY(-4px);
}

/* Category badge */
.np-grid-badge {
	display: inline-block;
	padding: 0.2rem 0.7rem;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	background: #2563eb;
	color: #fff;
	margin-bottom: 0.6rem;
	line-height: 1.5;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
	            box-shadow 0.35s cubic-bezier(0.25, 1, 0.5, 1),
	            background-color 0.3s ease,
	            color 0.3s ease;
}
.np-grid-cell:hover .np-grid-badge {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Titles */
.np-grid-title {
	margin: 0;
	line-height: 1.25;
	font-weight: 700;
	color: #fff;
	transition: color 0.3s ease, text-shadow 0.4s ease;
}
.np-grid-cell:hover .np-grid-title {
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.np-title-lg {
	font-size: 1.55rem;
}
.np-title-md {
	font-size: 1.35rem;
}
.np-title-sm {
	font-size: 0.95rem;
}

/* Excerpt */
.np-grid-excerpt {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	line-height: 1.4;
	color: rgba(255,255,255,0.7);
	transition: color 0.3s ease;
}
.np-grid-cell:hover .np-grid-excerpt {
	color: rgba(255,255,255,0.88);
}

/* Meta */
.np-grid-meta {
	margin-top: 0.5rem;
	font-size: 0.78rem;
	color: rgba(255,255,255,0.8);
	transition: color 0.3s ease;
}
.np-grid-cell:hover .np-grid-meta {
	color: rgba(255,255,255,0.95);
}
.np-meta-sep {
	margin: 0 0.35rem;
}

/* Extra row container */
.np-grid-extra-row {
	overflow: hidden;
}
.np-grid-extra-row .np-grid-cell {
	min-height: 180px;
}


/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
	.np-featured-grid {
		height: auto !important;
	}

	.np-featured-grid.layout-a,
	.np-featured-grid.layout-b {
		grid-template-columns: 1fr !important;
	}

	.np-featured-grid.layout-c {
		grid-template-rows: auto auto !important;
	}

	.np-featured-grid.layout-d {
		grid-template-columns: 1fr !important;
	}

	.np-grid-cell.np-cell-large {
		min-height: 280px;
	}
	.np-grid-right {
		grid-template-rows: auto auto;
	}
	.np-grid-cell.np-cell-medium {
		min-height: 200px;
	}
	.np-grid-cell.np-cell-small {
		min-height: 170px;
	}

	.np-grid-bottom-row,
	.np-grid-top-row {
		grid-template-columns: 1fr !important;
	}

	.np-grid-extra-row {
		grid-template-columns: 1fr !important;
	}

	.np-title-lg {
		font-size: 1.25rem;
	}
	.np-title-md {
		font-size: 1.1rem;
	}
	.np-title-sm {
		font-size: 0.9rem;
	}

	.np-grid-overlay {
		padding: 14px;
	}

	/* Ticker responsive */
	.ticker-label {
		padding: 0.5rem 0.75rem;
		font-size: 0.6rem;
		letter-spacing: 1px;
	}
	.ticker-entry {
		font-size: 0.8rem;
	}
}
