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

html {
	scroll-padding-top: calc(var(--humera-header-height) + 1rem);
}

.admin-bar {
	scroll-padding-top: 8.5rem;
}

body {
	margin: 0;
	background-color: var(--humera-bg);
	color: var(--humera-muted);
	font-family: var(--humera-font-text);
	font-size: var(--humera-size-body);
	font-weight: 400;
	font-synthesis: none;
	line-height: var(--humera-leading-body);
	text-align: start;
}

h1,
h2,
h3 {
	font-family: var(--humera-font-display);
	font-weight: 700;
	line-height: var(--humera-leading-heading);
	color: var(--humera-heading);
	text-wrap: balance;
}

h1,
h2 {
	margin: 0;
}

h1 {
	font-size: var(--humera-size-page);
}

h2 {
	font-size: var(--humera-size-h2);
}

h3 {
	font-size: var(--humera-size-card);
	line-height: var(--humera-leading-card);
}

p {
	text-wrap: pretty;
}

/*
 * Bold must select a real face (font-synthesis is none).
 * Do not put font-weight on bare :lang() — it matched strong/b and cancelled bold.
 */
:where(strong, b) {
	font-weight: 700;
}

a {
	color: var(--humera-link);
	text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--humera-focus);
	outline-offset: 3px;
}

:lang(ar) {
	--humera-font-display: var(--humera-font-ar-display);
	--humera-font-text: var(--humera-font-ar-text);
	font-family: var(--humera-font-text);
}

html:lang(ar),
body:lang(ar) {
	font-weight: 400;
}

:lang(en),
:lang(tr),
:lang(id) {
	--humera-font-display: var(--humera-font-en-display);
	--humera-font-text: var(--humera-font-en-text);
	font-family: var(--humera-font-text);
}

html:lang(en),
body:lang(en),
html:lang(tr),
body:lang(tr),
html:lang(id),
body:lang(id) {
	font-weight: 400;
}

:lang(ar) :is(h1, h2, h3),
:lang(en) :is(h1, h2, h3),
:lang(tr) :is(h1, h2, h3),
:lang(id) :is(h1, h2, h3) {
	font-family: var(--humera-font-display);
	font-weight: 700;
}

/* Headings are already 700 — use Text Black so bold still reads heavier. */
:lang(ar) :is(h1, h2, h3) :where(strong, b) {
	font-family: var(--humera-font-text);
	font-weight: 900;
}

img {
	max-inline-size: 100%;
	block-size: auto;
}

.humera-skip {
	position: absolute;
	inset-inline-start: var(--humera-space-3);
	inset-block-start: -100%;
	background: var(--humera-white);
	color: var(--humera-text);
	padding: 0.5rem 0.75rem;
	border-radius: var(--humera-radius-control);
	z-index: var(--humera-z-skip);
}

.humera-skip:focus {
	inset-block-start: var(--humera-space-3);
}

/* Programmatic target for the skip link and the footer back-to-top control. */
#content:focus {
	outline: none;
}

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

.screen-reader-text {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
}
