/*
 * Theme-aware overrides for the parts the theme itself can't reach.
 *
 * The theme (theme.json, style.css, login-style.css) and the events calendar
 * were converted at source. What is left are the plugins whose colours are
 * printed inline from PHP and whose design we don't own. An inline <style>
 * always wins on order against an enqueued sheet, so these rules carry
 * !important by design.
 *
 * Everything resolves through the shared tokens in mena-theme.css, so these
 * follow the light/dark switch rather than pinning one of them.
 */

:root {
	--mena-l-bg: var(--mena-elevated);
	--mena-l-surface: var(--mena-surface);
	--mena-l-surface-2: var(--mena-surface-2);
	--mena-l-text: var(--mena-text);
	--mena-l-muted: var(--mena-muted);
	--mena-l-muted-strong: var(--mena-text-2);
	--mena-l-border: var(--mena-border);
	--mena-l-gold: var(--mena-gold);
	--mena-l-gold-deep: var(--mena-gold-text);
}

/* ---------------------------------------------------------------- EPG grid */

.epg-single-channel img {
	background: var(--mena-l-surface) !important;
	border: 1px solid var(--mena-l-border) !important;
}

.custom-channel-table thead th { background: var(--mena-l-surface-2) !important; }
.custom-channel-table td { border-bottom: 1px solid var(--mena-l-border) !important; }
.pr-time { color: var(--mena-gold-text) !important; }
.highlight-now { background-color: var(--mena-l-gold) !important; }

/* --------------------------------------------------------- satellite chart */

/*
 * Nothing left to override here.
 *
 * Two rules used to live at this spot. One filled .sat-chart .freq-block and
 * .channel-search-box, which put a panel behind the whole widget and behind
 * every data row; the plugin now leaves those transparent and fills only the
 * two header bars. The other reached in and repainted the block header by
 * matching on its style attribute — [style*="#3f3f3f"] — because that colour
 * was hardcoded inline. It is a token in the plugin's own sheet now, so there
 * is nothing to catch.
 */

.sat-chart [style*="color: #7b7b7b"] { color: var(--mena-l-muted) !important; }

/* ------------------------------------------------------------ series table */

.mena-container th { background-color: var(--mena-l-surface-2) !important; }
.mena-container th,
.mena-container td { border-bottom: 1px dotted var(--mena-l-border) !important; }

/* ------------------------------------------------------------ user profile */

.csp-profile-container {
	background: var(--mena-l-bg) !important;
	border: 1px solid var(--mena-l-border) !important;
}

/* ---------------------------------------------------- Nextend social login */

.nsl-container .nsl-button-default span.nsl-button-label-container { color: inherit; }

/* --------------------------------------------------- generic dark leftovers */

/*
 * A last-resort sweep for inline styles that hard-code the old page background.
 * Light mode only — in dark those greys are exactly the right colour, so the
 * rule is scoped rather than applied unconditionally. Narrow on purpose: only
 * the two exact greys the original design used.
 */
:root:not([data-mena-theme="dark"]) .entry-content [style*="background:#131415"],
:root:not([data-mena-theme="dark"]) .entry-content [style*="background: #131415"],
:root:not([data-mena-theme="dark"]) .entry-content [style*="background:#1a1a1a"],
:root:not([data-mena-theme="dark"]) .entry-content [style*="background: #1a1a1a"] {
	background: var(--mena-surface) !important;
	color: var(--mena-text) !important;
}
