/*
 * Base bundle: reset, a11y helpers, layout primitives, base elements.
 * Colors/typography/spacing come from theme.json presets
 * (--wp--preset--*). Never hardcode a token value here.
 */

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

* {
	margin: 0;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

input,
button,
textarea,
select {
	font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

ul[class],
ol[class] {
	list-style: none;
	padding: 0;
}

a {
	text-decoration-skip-ink: auto;
}

/* --- A11y helpers --- */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wp--preset--color--surface);
	clip-path: none;
	color: var(--wp--preset--color--primary);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 1rem 1.5rem;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.skip-link {
	left: -9999rem;
	position: absolute;
	top: 2.5rem;
	z-index: 999999;
}

.skip-link:focus {
	left: 6px;
	top: 7px;
}

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

/* --- Layout primitives --- */
.container {
	margin-inline: auto;
	/*
	 * The cap is the CONTENT measure, so the gutter is ADDED to it rather than
	 * taken out of it. Everything here is border-box, so a bare
	 * `max-width: <wide-size>` renders a 1168px column for a declared 1200px
	 * wide-size, while `.entry__content` right below honours content-size
	 * exactly because it has no padding. One layout source, two meanings, is
	 * the bug — and reproducing a design then means fighting the primitive.
	 *
	 * Both uses carry the same fallback: without one, a project that dropped
	 * the spacing preset would make this calc() invalid and lose the cap
	 * entirely.
	 */
	max-width: calc(
		var(--wp--style--global--wide-size, 1200px) + 2 * var(--wp--preset--spacing--30, 1rem)
	);
	padding-inline: var(--wp--preset--spacing--30, 1rem);
	width: 100%;
}

.content-area {
	padding-block: var(--wp--preset--spacing--50);
}

.entry--page .entry__content,
.entry--single .entry__content {
	margin-inline: auto;
	max-width: var(--wp--style--global--content-size, 720px);
}

/* --- Base elements --- */
h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.2;
	margin-block-end: var(--wp--preset--spacing--30);
}

p,
ul,
ol,
figure,
blockquote {
	margin-block-end: var(--wp--preset--spacing--30);
}

.entry__header {
	margin-block-end: var(--wp--preset--spacing--40);
}

.entry--teaser {
	border-block-end: 1px solid var(--wp--preset--color--surface);
	padding-block: var(--wp--preset--spacing--40);
}

.entry__meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.archive-header {
	margin-block-end: var(--wp--preset--spacing--40);
}

button,
.button,
input[type="submit"] {
	background: var(--wp--preset--color--primary);
	border: none;
	border-radius: 4px;
	color: var(--wp--preset--color--base);
	cursor: pointer;
	padding: 0.6em 1.4em;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 4px;
	color: var(--wp--preset--color--contrast);
	max-width: 100%;
	padding: 0.5em 0.75em;
}

/* --- Footer --- */
.site-footer {
	background: var(--wp--preset--color--surface);
	margin-block-start: var(--wp--preset--spacing--60);
	padding-block: var(--wp--preset--spacing--50);
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--40);
	justify-content: space-between;
}

.site-footer__menu {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
}

.site-footer__copyright {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
	width: 100%;
}
