/*
Theme Name:        Next Move
Theme URI:         https://future.sortmypages.com/
Description:       A calm, mobile-first, high-trust theme for the Next Move site: a country-aware AI advisor plus country guides and problem guides. Built for ordinary people on ordinary phones, in any language direction. Translation-ready (text domain next-move-theme), RTL-ready (rtl.css), light and dark by device setting, WCAG 2.1 AA contrast measured rather than guessed, 44px minimum tap targets, self-hosted Space Grotesk and Inter under the SIL Open Font License, and no third-party requests of any kind.
Version:           1.0.0
Requires at least: 6.4
Tested up to:      6.9
Requires PHP:      8.2
Author:            Next Move
Author URI:        https://future.sortmypages.com/
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       next-move-theme
Tags:              one-column, custom-menu, editor-style, featured-images, rtl-language-support, translation-ready, block-styles, wide-blocks
*/

/* -------------------------------------------------------------------------
 * WHERE THE REAL STYLES LIVE
 *
 * WordPress requires this file, and it is enqueued first, but it holds only the
 * critical layer: the pieces that must exist before anything else paints, so
 * the page never flashes an unusable state and so the skip link and focus ring
 * keep working even if a later stylesheet fails to load.
 *
 *   assets/css/fonts.css    @font-face for the five self-hosted WOFF2 faces
 *   assets/css/theme.css    the full design system: tokens, layout, all blocks
 *   assets/css/advisor.css  the advisor tool, loaded only on pages using it
 *   rtl.css                 overrides for right-to-left text (Urdu, Arabic)
 *
 * The tokens below are a subset of theme.css and match theme.json exactly. If
 * you change a colour, change it in all three places: theme.json feeds the
 * block editor palette, theme.css feeds the site, this file feeds first paint.
 *
 * Contrast, measured:
 *   light  #1B5E86 on #FFFFFF =  7.02:1   dark  #7FC4E8 on #0E1418 =  9.69:1
 *   light  #1F2933 on #FFFFFF = 14.76:1   dark  #E7EDF1 on #0E1418 = 15.71:1
 *   light  #4A5560 on #FFFFFF =  7.61:1   dark  #A9B7C2 on #0E1418 =  9.05:1
 *   #7C8B96 on #FFFFFF        =  3.51:1   (non-text parts and focus rings)
 * ------------------------------------------------------------------------- */

:root {
	--nm-accent: #1B5E86;
	--nm-accent-strong: #14496B;
	--nm-on-accent: #FFFFFF;
	--nm-bg: #FFFFFF;
	--nm-text: #1F2933;
	--nm-text-muted: #4A5560;
	--nm-border: #D7E0E6;
	--nm-border-strong: #7C8B96;
	--nm-warn-bg: #FFF6E0;
	--nm-warn-text: #6B4A00;
	--nm-danger-bg: #FDECEC;
	--nm-danger-text: #B4232A;
	--nm-radius: 10px;
	--nm-font-head: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
	--nm-font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--nm-accent: #7FC4E8;
		--nm-accent-strong: #A9D9F2;
		--nm-on-accent: #06121A;
		--nm-bg: #0E1418;
		--nm-text: #E7EDF1;
		--nm-text-muted: #A9B7C2;
		--nm-border: #2A353D;
		--nm-border-strong: #8FA3B0;
		--nm-warn-bg: #2A2113;
		--nm-warn-text: #FFD79A;
		--nm-danger-bg: #2A1618;
		--nm-danger-text: #FF9C9C;
	}
}

/* First paint. Stops a white flash behind dark mode and gives text a readable
 * size before the rest arrives. 17px/1.65 is deliberate: this site is read by
 * tired people, on small screens, sometimes in a second language. */
html {
	background-color: var(--nm-bg);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--nm-bg);
	color: var(--nm-text);
	font-family: var(--nm-font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--nm-font-head);
	color: var(--nm-text);
	line-height: 1.25;
	overflow-wrap: break-word;
}

a { color: var(--nm-accent); }
a:hover { color: var(--nm-accent-strong); }

img { max-width: 100%; height: auto; }

/* -------------------------------------------------------------------------
 * Focus visibility. Never removed, never thinned. The ring uses
 * --nm-border-strong (3.51:1 on white, 7.10:1 on the dark background) so it is
 * visible in both modes, including on top of accent-coloured buttons.
 * ------------------------------------------------------------------------- */
:focus-visible {
	outline: 3px solid var(--nm-border-strong);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Safari before 15.4 has no :focus-visible. Keep a usable fallback there
 * without drawing a ring on every mouse click. */
@supports not selector(:focus-visible) {
	a:focus,
	button:focus,
	input:focus,
	select:focus,
	textarea:focus,
	[tabindex]:focus {
		outline: 3px solid var(--nm-border-strong);
		outline-offset: 2px;
	}
}

/* -------------------------------------------------------------------------
 * Skip link. The most valuable accessibility control on a page that starts
 * with a menu and a cookie notice. It must never be display:none, or it cannot
 * be reached by keyboard at all - hence the off-screen position instead.
 * ------------------------------------------------------------------------- */
.skip-link {
	position: absolute;
	inset-inline-start: 0.5rem;
	inset-block-start: -100px;
	z-index: 1000;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.75rem 1.25rem;
	background-color: var(--nm-accent);
	color: var(--nm-on-accent);
	font-family: var(--nm-font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border-radius: 0 0 var(--nm-radius) var(--nm-radius);
	transition: inset-block-start 0.15s ease-out;
}

.skip-link:hover { color: var(--nm-on-accent); }

.skip-link:focus,
.skip-link:focus-visible {
	inset-block-start: 0;
	color: var(--nm-on-accent);
	outline: 3px solid var(--nm-border-strong);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Reduced motion, honoured globally. The advisor streams text and animates a
 * caret; vestibular disorders are not rare among people under stress.
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* -------------------------------------------------------------------------
 * No-JavaScript notice. The advisor needs JS; every other page does not. This
 * has to be visible immediately, so it is styled here rather than downstream.
 * ------------------------------------------------------------------------- */
.nm-noscript {
	margin: 0;
	padding: 0.9rem 1rem;
	background-color: var(--nm-warn-bg);
	color: var(--nm-warn-text);
	border-block-end: 1px solid var(--nm-border-strong);
	font-size: 0.9375rem;
	text-align: center;
}

.nm-noscript a {
	color: inherit;
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Editor-only review banner, shown when a logged-in editor views a draft that
 * still carries unverified facts. Never rendered for visitors.
 * ------------------------------------------------------------------------- */
.nm-verify-box {
	margin: 1.5rem 0;
	padding: 1rem 1.25rem;
	background-color: var(--nm-danger-bg);
	color: var(--nm-danger-text);
	border: 1px solid var(--nm-danger-text);
	border-radius: var(--nm-radius);
}

.nm-verify-box h2 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	color: inherit;
}

.nm-verify-box pre {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.6;
	white-space: pre-wrap;
	color: inherit;
	background: transparent;
	border: 0;
	padding: 0;
}

/* -------------------------------------------------------------------------
 * Print. People print these answers and carry them to an office, so this is a
 * real use case rather than an afterthought: ink-friendly, no dark mode, URLs
 * shown after external links, tool chrome hidden.
 * ------------------------------------------------------------------------- */
@media print {
	:root {
		--nm-bg: #FFFFFF;
		--nm-text: #000000;
		--nm-text-muted: #333333;
		--nm-accent: #000000;
		--nm-accent-strong: #000000;
		--nm-border: #CCCCCC;
		--nm-border-strong: #666666;
		--nm-danger-bg: #FFFFFF;
		--nm-danger-text: #000000;
		--nm-warn-bg: #FFFFFF;
		--nm-warn-text: #000000;
	}

	body {
		font-size: 11pt;
		line-height: 1.5;
		color: #000000;
	}

	.skip-link,
	.nm-noscript,
	.nm-site-header,
	.nm-site-footer,
	.nm-cookie,
	.nm-answer__actions,
	.nm-advisor__followup,
	button,
	.nm-btn {
		display: none !important;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		color: #333333;
		word-break: break-all;
	}

	.nm-notice,
	.nm-verify-box {
		border: 1px solid #666666 !important;
	}
}
