/**
 * Base styles: page background, element typography, focus.
 *
 * Loads after GeneratePress main.min.css and its inline dynamic CSS,
 * so rules with the same selectors as GeneratePress win by order.
 */

/* Page */

body {
	background-color: var(--color-ivory);
	color: var(--color-text);
	font-size: var(--text-body);
	line-height: 1.75;
}

/*
 * GeneratePress paints these containers white (var(--base-3)) in its
 * dynamic CSS. Same selectors, loaded later, so ivory wins.
 */
.separate-containers .inside-article,
.separate-containers .comments-area,
.separate-containers .page-header,
.separate-containers .paging-navigation,
.one-container .container,
.inside-page-header,
.sidebar .widget {
	background-color: var(--color-ivory);
}

/*
 * No GeneratePress inner padding (40px, 30px on mobile, from its dynamic
 * CSS) inside articles and widgets, so their text lines up with the
 * column edges. Same selectors, loaded later.
 */
.separate-containers .inside-article,
.widget-area .widget {
	padding: 0;
}

/*
 * GeneratePress page container (#page on the blog page, archives, single
 * posts and static pages) matches .bst-container: content up to
 * --container wide, --gap side padding outside it, so the content column
 * and the sidebar line up with the header and footer edges. Beats the
 * GeneratePress `.grid-container` max-width (cached dynamic CSS) by
 * specificity and load order. The front page drops these classes
 * (inc/front-page.php) and is not affected.
 */
.site.grid-container {
	box-sizing: border-box;
	max-width: calc(var(--container) + 2 * var(--gap));
	padding-right: var(--gap);
	padding-left: var(--gap);
}

/*
 * GeneratePress main.min.css sets a system font stack on
 * `body, button, input, select, textarea`. Same selector, loaded later.
 */
body,
button,
input,
select,
textarea {
	font-family: var(--font-body);
}

/* Headings */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: var(--color-forest);
	font-family: var(--font-heading);
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

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

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

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

/* Small headings get a heavier weight and wider tracking to stay legible. */
h4,
h5,
h6 {
	margin-bottom: 0.75em;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.04em;
}

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

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

/* Space above headings that follow other content in post/page bodies. */
:where(.entry-content, .page-content, .comment-content) > * + :is(h2, h3, h4, h5, h6) {
	margin-top: 1.5em;
}

/*
 * Linked headings (post titles) keep the heading color, no underline.
 * `.entry-title a` matches the GeneratePress inline selector.
 */
:is(h1, h2, h3, h4, h5, h6) a,
.entry-title a,
.entry-title a:hover {
	color: inherit;
	text-decoration: none;
}

/* Body text */

p {
	margin: 0 0 1.5em;
}

strong,
b {
	font-weight: 500;
}

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

ul,
ol {
	margin: 0 0 1.5em 1.5em;
	padding: 0;
}

/*
 * Content-only rules: kept out of menus and widgets, which style their
 * own lists in later steps.
 */
/* strong in body text: Montserrat 600 (the only use of that weight), forest. */
:where(.entry-content, .page-content, .comment-content) strong,
:where(.entry-content, .page-content, .comment-content) b {
	color: var(--color-forest);
	font-weight: 600;
}

:where(.entry-content, .page-content, .comment-content) li + li {
	margin-top: 0.5em;
}

:where(.entry-content, .page-content, .comment-content) li > :is(ul, ol) {
	margin-top: 0.5em;
	margin-bottom: 0;
}

hr {
	height: 1px;
	margin: 2.5em 0;
	border: 0;
	background-color: var(--color-border);
}

/* Links. Same selectors as the GeneratePress inline CSS. */

a {
	color: var(--color-forest);
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--motion-fast) ease, text-decoration-color var(--motion-fast) ease;
}

a:hover,
a:focus,
a:active {
	color: var(--color-forest);
	text-decoration-color: var(--color-accent);
}

/* Focus. Dark surfaces set --focus-color: var(--color-white). */

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

/*
 * Reduced motion: turn off all transitions and animations site-wide.
 * !important so component rules cannot re-enable them. Near-zero
 * durations instead of `none`, so transitionend/animationend still fire.
 */
@media (prefers-reduced-motion: reduce) {

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