/* ==========================================================================
   Pringomart — dark theme token overrides.

   Only the tokens change here; every component in main.css reads them, so no
   component rules need duplicating. `data-theme` is set on <html> by the inline
   boot script in header.php before first paint, so there is no light flash.
   ========================================================================== */

[data-theme="dark"] {
	--bg-primary: #0d1117;
	--bg-secondary: #161b22;
	--bg-card: #1c2128;
	--text-primary: #e6edf3;
	--text-secondary: #8b949e;
	--text-muted: #656d76;
	--border-color: #30363d;
	--accent-color: #7c6af7;
	--accent-hover: #6a57f0;
	--secondary-color: #f87171;
	--nav-bg: #010409;
	--nav-text: #e6edf3;
	--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);

	--success-color: #2ecc8f;
	--warning-color: #e3b341;
	--danger-color: #f87171;
	--online-color: #3fb950;

	color-scheme: dark;
}

/* Swap the logo variants. */
[data-theme="dark"] .pm-logo__img--light { display: none; }
[data-theme="dark"] .pm-logo__img--dark { display: block; }

/* Images and embeds are slightly dimmed so they do not glare on a dark page. */
[data-theme="dark"] .pm-entry__thumb img,
[data-theme="dark"] .pm-card img {
	filter: brightness(0.92);
}

/* The nav sits on near-black in dark mode, so translucent white hovers that
   work on the light theme's navy need a touch more contrast. */
[data-theme="dark"] .pm-icon-btn:hover,
[data-theme="dark"] .pm-usermenu__btn {
	background: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .pm-usermenu__btn:hover {
	background: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .pm-search__input {
	background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .pm-footer a { color: var(--text-secondary); }
[data-theme="dark"] .pm-footer a:hover { color: var(--text-primary); }

[data-theme="dark"] .pm-footer__bottom {
	border-top-color: var(--border-color);
}

/* Scrollbars inside dropdowns. */
[data-theme="dark"] .pm-notify__list,
[data-theme="dark"] .pm-search__results {
	scrollbar-color: var(--border-color) transparent;
}

/* Honour the OS preference for visitors who have not chosen a theme.
   The boot script writes data-theme on every load, so this only covers the
   no-JS case. */
@media (prefers-color-scheme: dark) {
	html:not([data-theme]) {
		--bg-primary: #0d1117;
		--bg-secondary: #161b22;
		--bg-card: #1c2128;
		--text-primary: #e6edf3;
		--text-secondary: #8b949e;
		--text-muted: #656d76;
		--border-color: #30363d;
		--accent-color: #7c6af7;
		--accent-hover: #6a57f0;
		--nav-bg: #010409;
		--nav-text: #e6edf3;
		--card-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
		color-scheme: dark;
	}
}
