/* ==========================================================================
   Today Roast — Base: design tokens, reset, typography, accessibility
   Palette: US flag red #B31942 + navy #0A3161 on a clean editorial white.
   ========================================================================== */

:root {
	/* Brand red */
	--tr-red-50: #fdf2f5;
	--tr-red-100: #fbe4eb;
	--tr-red-200: #f6c8d5;
	--tr-red-300: #e993aa;
	--tr-red-400: #d55d7e;
	--tr-red-500: #b31942;
	--tr-red-600: #97123a;
	--tr-red-700: #7a0e2f;
	--tr-red-800: #610b25;
	--tr-red-900: #4a081c;

	/* Brand navy */
	--tr-navy-50: #f2f6fb;
	--tr-navy-100: #e5ecf6;
	--tr-navy-200: #c8d6ea;
	--tr-navy-300: #9db4d5;
	--tr-navy-400: #5d7ba8;
	--tr-navy-500: #2e4f80;
	--tr-navy-600: #163a6b;
	--tr-navy-700: #0a3161;
	--tr-navy-800: #07264b;
	--tr-navy-900: #051d3a;

	/* Ink */
	--tr-ink-950: #060d18;
	--tr-ink-900: #0b1220;
	--tr-ink-800: #1c2634;
	--tr-ink-700: #2b3646;
	--tr-ink-600: #465264;
	--tr-ink-500: #5f6b7c;
	--tr-ink-400: #66707e;
	--tr-ink-300: #aeb7c3;
	--tr-ink-200: #d4dae2;

	/* Surfaces */
	--tr-paper: #ffffff;
	--tr-paper-2: #f5f7fa;
	--tr-paper-3: #ecf0f5;
	--tr-line: #e2e7ee;
	--tr-line-strong: #d0d7e1;

	/* Functional */
	--tr-success: #1b9c6b;
	--tr-warning: #d99a00;
	--tr-danger: #d93a47;

	/* Filled calls to action keep the same solid red in both colour modes,
	   so white button text always clears 4.5:1. */
	--tr-cta: #b31942;
	--tr-cta-hover: #97123a;

	/* Type */
	--tr-font-display: "Google Sans", ui-sans-serif, system-ui, sans-serif;
	--tr-font-ui: "Google Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--tr-font-reading: "Google Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--tr-font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

	/* Space */
	--tr-space-1: 4px;
	--tr-space-2: 8px;
	--tr-space-3: 12px;
	--tr-space-4: 16px;
	--tr-space-5: 20px;
	--tr-space-6: 24px;
	--tr-space-8: 32px;
	--tr-space-10: 40px;
	--tr-space-12: 48px;
	--tr-space-16: 64px;
	--tr-space-20: 80px;
	--tr-space-24: 96px;
	--tr-space-30: 120px;

	/* Radius */
	--tr-r-xs: 2px;
	--tr-r-sm: 4px;
	--tr-r-md: 8px;
	--tr-r-lg: 12px;
	--tr-r-pill: 999px;

	/* Elevation — only two levels exist on purpose */
	--tr-shadow-sm: 0 1px 2px rgba(6, 13, 24, 0.06);
	--tr-shadow-md: 0 8px 24px -8px rgba(6, 13, 24, 0.14);

	/* Layout */
	--tr-container: 1280px;
	--tr-wide: 1120px;
	--tr-content: 720px;
	--tr-gutter: 24px;

	/* Motion */
	--tr-t-fast: 120ms;
	--tr-t-base: 200ms;
	--tr-t-slow: 320ms;
	--tr-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	--tr-z-header: 100;
	--tr-z-overlay: 200;
}

@media (min-width: 1024px) {
	:root {
		--tr-gutter: 32px;
	}
}

/* Dark mode: override both our tokens and the theme.json presets so core
   blocks follow along without per-block overrides. */
html[data-theme="dark"] {
	--tr-paper: #08152b;
	--tr-paper-2: #0d1e38;
	--tr-paper-3: #132644;
	--tr-line: #1e3355;
	--tr-line-strong: #2a4267;
	--tr-ink-900: #f2f5fa;
	--tr-ink-800: #e2e8f2;
	--tr-ink-700: #d2dae7;
	--tr-ink-600: #b3bfd1;
	--tr-ink-500: #93a1b7;
	--tr-ink-400: #8d9bb0;
	--tr-ink-300: #64738c;
	--tr-ink-200: #2c3f5e;
	--tr-red-500: #d9557a;
	--tr-red-600: #c34066;
	--tr-red-100: #3a1622;
	--tr-red-50: #2a111b;
	--tr-navy-700: #8fb4e6;
	--tr-navy-800: #b6cdf0;
	--tr-navy-100: #13294a;
	--tr-navy-50: #0f223c;
	--tr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
	--tr-shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);

	--wp--preset--color--paper: #08152b;
	--wp--preset--color--paper-2: #0d1e38;
	--wp--preset--color--paper-3: #132644;
	--wp--preset--color--line: #1e3355;
	--wp--preset--color--ink: #f2f5fa;
	--wp--preset--color--ink-2: #d2dae7;
	--wp--preset--color--ink-3: #93a1b7;
	--wp--preset--color--ink-4: #7a889f;
	--wp--preset--color--navy-700: #8fb4e6;
	--wp--preset--color--navy-100: #13294a;
	--wp--preset--color--navy-50: #0f223c;
	--wp--preset--color--red: #d9557a;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 7rem;
}

body {
	margin: 0;
	background: var(--tr-paper);
	color: var(--tr-ink-900);
	font-family: var(--tr-font-ui);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: clip;
	transition: background-color var(--tr-t-base) ease, color var(--tr-t-base) ease;
}

img,
svg,
video,
canvas,
iframe {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	font-family: var(--tr-font-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.12;
	color: var(--tr-navy-700);
	text-wrap: balance;
}

p {
	margin: 0 0 1.1em;
}

p:last-child {
	margin-bottom: 0;
}

a {
	color: var(--tr-navy-700);
	text-decoration: none;
	transition: color var(--tr-t-fast) ease;
}

a:hover {
	color: var(--tr-navy-800);
}

strong,
b {
	font-weight: 650;
}

small {
	font-size: 0.8125rem;
}

hr {
	border: 0;
	border-top: 1px solid var(--tr-line);
	margin: 2.5rem 0;
}

figure {
	margin: 0;
}

code,
kbd,
pre,
samp {
	font-family: var(--tr-font-mono);
	font-size: 0.9em;
}

::selection {
	background: var(--tr-red-100);
	color: var(--tr-ink-900);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

:focus-visible {
	outline: 2px solid var(--tr-red-500);
	outline-offset: 2px;
	border-radius: var(--tr-r-xs);
}

.screen-reader-text,
.wp-block-post-terms .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--tr-ink-900);
	color: #fff;
	padding: 12px 20px;
	border-radius: 0 0 var(--tr-r-sm) 0;
}

.skip-link:focus {
	left: 0;
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* --------------------------------------------------------------------------
   Text selection of utilities
   -------------------------------------------------------------------------- */

.tr-mono {
	font-family: var(--tr-font-mono);
	font-variant-numeric: tabular-nums;
}

.tr-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
