/**
 * OSHIDA — reset.
 *
 * Modern and minimal. Direction-agnostic: RTL comes from WordPress's
 * `language_attributes()` on <html>, never from a hardcoded rule here.
 *
 * Owner: work package A1.
 */

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

* {
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	tab-size: 4;
	scrollbar-gutter: stable;
}

body {
	min-block-size: 100svb;
	background-color: var(--o-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: break-word;
}

/* Replaced elements behave like blocks and never overflow their column. */
img,
picture,
video,
canvas,
svg,
iframe {
	display: block;
	max-inline-size: 100%;
	block-size: auto;
}

svg {
	fill: currentColor;
}

/* Form controls inherit type instead of falling back to the UA font. */
input,
button,
textarea,
select {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
	background: none;
	border: 0;
}

button,
[type="button"],
[type="submit"],
[type="reset"] {
	cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
	cursor: not-allowed;
}

textarea {
	resize: vertical;
	field-sizing: content;
}

/* Lists that carry layout, not semantics, are unstyled at the call site — the
 * marker is kept here so real prose lists still read as lists. */
ul,
ol {
	padding-inline-start: 1.25em;
}

table {
	border-collapse: collapse;
	inline-size: 100%;
}

th {
	text-align: start;
}

hr {
	border: 0;
	block-size: 1px;
	background-color: var(--o-line-soft);
}

fieldset {
	border: 0;
	min-inline-size: 0;
}

legend {
	padding: 0;
}

summary {
	cursor: pointer;
	list-style: none;
}

summary::-webkit-details-marker {
	display: none;
}

dialog {
	border: 0;
	background: none;
	color: inherit;
	max-inline-size: 100%;
	max-block-size: 100%;
}

/* One focus ring for the whole theme. */
:focus-visible {
	outline: 2px solid var(--o-gold);
	outline-offset: 3px;
	border-radius: 2px;
}

:focus:not(:focus-visible) {
	outline: none;
}

::selection {
	background-color: var(--o-gold);
	color: var(--o-text-on-gold);
}

[hidden] {
	display: none;
}

/* Smooth scrolling is opt-in, never forced on people who asked for stillness. */
@media (prefers-reduced-motion: no-preference) {
	html:focus-within {
		scroll-behavior: smooth;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		/* Must beat any component rule, so these four are the theme's only !important. */
		animation-duration: 0.01ms !important; /* important-ok */
		animation-iteration-count: 1 !important; /* important-ok */
		transition-duration: 0.01ms !important; /* important-ok */
		scroll-behavior: auto !important; /* important-ok */
	}
}
