/* Dark mode (spec 6.5). A token swap and nothing more.
   Every component styles through the theme.json palette, so redefining the
   eight palette variables re-inks the whole site. Same hues as the light
   palette (steel 209, amber 39), lightened for contrast on a dark ground.
   Enqueued on every page, after core's global styles.

   Do not add component rules here. If a component looks wrong in dark, it is
   hard-coding a colour: fix the component.

   Satellite tracker (satdata.windythink.com): its own stylesheet is hard-coded
   dark (#1e293b card, #334155 border). It is deliberately left alone, no
   wrapper, no filter, no ground. On the light page it is a dark slab; here the
   card sits one step lighter than the ground and reads as native. */

:root {
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root:root {
		--wp--preset--color--structure: #7fa8d1;
		--wp--preset--color--emphasis: #e0a030;
		--wp--preset--color--emphasis-ink: #e0a030;
		--wp--preset--color--ground: #14181d;
		--wp--preset--color--surface: #1d232b;
		--wp--preset--color--ink: #e8ecf0;
		--wp--preset--color--ink-soft: #a3afbb;
		--wp--preset--color--rule: #38424e;
	}

	/* Jetpack comment form. It is an iframe on jetpack.wordpress.com and cannot
	   inherit the palette; its document stays light.
	   The iframe itself gets only color-scheme: Jetpack writes
	   style="width:100%; height:430px; border:0" inline, which beats any rule
	   here, so a border on the iframe would silently never apply. The frame is
	   therefore the .comment-respond container, which we control, and only when
	   it actually holds the iframe (the native core form is tokenised and needs
	   no card). The container paints NO ground: Jetpack leaves native text in it
	   (the "Leave a Reply" heading and "Cancel reply" link), which must stay
	   palette ink on the dark ground. The iframe paints its own light canvas
	   (color-scheme: light), so the border alone frames it. */
	iframe.jetpack_remote_comment,
	iframe[name="jetpack_remote_comment"] {
		color-scheme: light;
	}

	.comment-respond:has(iframe.jetpack_remote_comment) {
		border: 1px solid var(--wp--preset--color--rule);
		border-radius: 6px;
		padding: var(--wp--preset--spacing--30);
	}
}
