/**
 * Global semantic and accessibility defaults layered on top of Blocksy.
 */

html {
	color-scheme: light;
	font-size: calc(100% * var(--btc-user-scale));
	scroll-behavior: smooth;
}

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

body {
	background: var(--btc-colour-cream);
	color: var(--btc-colour-text);
	font-family: var(--btc-font-interface);
	font-size: var(--btc-step-0);
	line-height: 1.6;
}

:where(h1, h2, h3, h4, h5, h6) {
	color: var(--btc-colour-primary-strong);
	font-family: var(--btc-font-display);
	font-weight: 600;
	line-height: 1.15;
	text-wrap: balance;
}

h1 {
	font-size: var(--btc-step-4);
}

h2 {
	font-size: var(--btc-step-3);
}

h3 {
	font-size: var(--btc-step-2);
}

:where(p, li) {
	max-width: 72ch;
}

:where(h1, h2, h3, h4, h5, h6, p, ul, ol) {
	margin-block-start: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--btc-colour-focus);
	outline-offset: 3px;
}

a {
	color: var(--btc-colour-primary);
	text-decoration-thickness: 0.1em;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--btc-colour-primary-strong);
}

::selection {
	background: var(--btc-colour-gold);
	color: var(--btc-colour-primary-strong);
}

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

:where(input, select, textarea) {
	background: var(--btc-colour-white);
	border: var(--btc-border-width) solid var(--btc-colour-muted);
	border-radius: var(--btc-radius-sm);
	color: var(--btc-colour-text);
	font: inherit;
	min-height: var(--btc-control-height);
	padding: 0.625rem 0.75rem;
}

:where(input, select, textarea):hover {
	border-color: var(--btc-colour-primary);
}

:where(input, select, textarea):disabled {
	background: var(--btc-colour-surface-subtle);
	cursor: not-allowed;
	opacity: 0.75;
}

label {
	display: inline-block;
	font-weight: 700;
	margin-block-end: var(--btc-space-xs);
}

textarea {
	min-height: 10rem;
}

.site-main :target,
:where(main [id]) {
	scroll-margin-top: 9rem;
}

table {
	border-collapse: collapse;
	width: 100%;
}

:where(th, td) {
	border-bottom: var(--btc-border-width) solid var(--btc-colour-border);
	padding: var(--btc-space-sm);
	text-align: left;
	vertical-align: top;
}

th {
	background: var(--btc-colour-info);
	font-weight: 700;
}

caption {
	font-family: var(--btc-font-display);
	font-size: var(--btc-step-2);
	font-weight: 600;
	padding-block-end: var(--btc-space-sm);
	text-align: left;
}

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

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

@media (max-width: 60rem) {
	.site-main :target,
	:where(main [id]) {
		scroll-margin-top: 12rem;
	}
}
