/**
 * Base: document, typography, links, focus and WordPress content classes.
 * Mobile first; breakpoints 480, 768, 1024, 1280 px.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--wot-header-height) + var(--wot-space-4));
}

body {
	margin: 0;
	background: var(--wot-canvas);
	color: var(--wot-ink);
	font-family: var(--wot-font-sans);
	font-size: var(--wot-text-base);
	line-height: var(--wot-leading-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

img,
video {
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--wot-space-4);
	color: var(--wot-ink);
	font-weight: 700;
	line-height: var(--wot-leading-heading);
	letter-spacing: -0.01em;
}

h1 {
	font-size: var(--wot-text-3xl);
}

h2 {
	font-size: var(--wot-text-2xl);
}

h3 {
	font-size: var(--wot-text-xl);
}

h4 {
	font-size: var(--wot-text-lg);
}

h5,
h6 {
	font-size: var(--wot-text-base);
}

@media (min-width: 768px) {
	h1 {
		font-size: var(--wot-text-4xl);
	}

	h2 {
		font-size: var(--wot-text-3xl);
	}
}

p,
ul,
ol,
dl,
blockquote,
figure,
pre,
table {
	margin: 0 0 var(--wot-space-4);
}

ul,
ol {
	padding-left: var(--wot-space-5);
}

a {
	color: var(--wot-color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--wot-color-primary-hover);
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--wot-color-focus);
	outline-offset: 2px;
}

/* Date and time fields hold a calendar button inside them; when it has
   focus the field itself is not :focus-visible, so the ring would vanish
   (0.8.0). Keep it on the field while any part of it has focus. */
input:is([type="date"], [type="month"], [type="week"], [type="time"], [type="datetime-local"]):is(:focus, :focus-within) {
	outline: 2px solid var(--wot-color-focus);
	outline-offset: 2px;
}

::selection {
	background: var(--wot-green-100);
	color: var(--wot-ink);
}

hr {
	height: 1px;
	margin: var(--wot-space-6) 0;
	border: 0;
	background: var(--wot-line);
}

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

pre {
	overflow-x: auto;
	padding: var(--wot-space-4);
	border-radius: var(--wot-radius-control);
	background: var(--wot-surface);
	border: 1px solid var(--wot-line);
}

blockquote {
	padding-left: var(--wot-space-4);
	border-left: 4px solid var(--wot-color-accent);
	color: var(--wot-ink);
	font-size: var(--wot-text-lg);
}

small {
	font-size: var(--wot-text-sm);
}

/* Tables in page content (component tables have their own class). */
.wot-prose table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.wot-prose th,
.wot-prose td {
	padding: var(--wot-space-2) var(--wot-space-3);
	border-bottom: 1px solid var(--wot-line);
	text-align: left;
}

/* Screen reader text and the skip link. */
.screen-reader-text,
.wot-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* The icon sprite holds symbols only; it takes no space. */
.wot-sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.wot-skip-link {
	position: absolute;
	top: var(--wot-space-2);
	left: var(--wot-space-2);
	z-index: 1000;
	padding: var(--wot-space-3) var(--wot-space-4);
	border-radius: var(--wot-radius-control);
	background: var(--wot-surface);
	color: var(--wot-color-primary);
	font-weight: 600;
	transform: translateY(-200%);
}

.wot-skip-link:focus {
	transform: none;
}

/* Below the WordPress toolbar for signed-in editors (0.8.0). */
.admin-bar .wot-skip-link {
	top: calc(32px + var(--wot-space-2));
}

@media (max-width: 782px) {
	.admin-bar .wot-skip-link {
		top: calc(46px + var(--wot-space-2));
	}
}

/* WordPress content classes. */
.alignleft {
	float: left;
	margin: 0 var(--wot-space-5) var(--wot-space-4) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--wot-space-4) var(--wot-space-5);
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.wp-caption,
.wp-caption-text,
.wp-block-image figcaption,
figcaption {
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.sticky,
.bypostauthor,
.gallery-caption {
	/* Required by WordPress theme review; no special look. */
	display: revert;
}

/* Windows high contrast and other forced colours drop backgrounds, so the
   current page in a menu is marked with a border instead (0.8.0). */
@media (forced-colors: active) {
	:is(.wot-nav, .wot-drawer, .wot-sidebar, .wot-account-nav, .wot-profile, .wds-tabs, .wot-tabs) [aria-current="page"] {
		outline: 2px solid CanvasText;
		outline-offset: -2px;
	}

	:is(.wot-nav, .wot-drawer, .wot-sidebar, .wot-account-nav, .wot-profile, .wds-tabs, .wot-tabs) [aria-current="page"]:focus-visible {
		outline-color: Highlight;
		outline-offset: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0ms !important;
		animation-duration: 0ms !important;
	}
}
