/*
Theme Name: The Ellery
Author: The Ellery
Description: A neutral modern classic theme foundation for The Ellery.
Version: 0.2.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: ellery
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

html {
	scroll-padding-top: 2rem;
	color: var(--ellery-ink);
	background: var(--ellery-paper);
	text-rendering: optimizeLegibility;
}

:root {
	--ellery-paper: var(--wp--preset--color--base, #fbfaf6);
	--ellery-ink: var(--wp--preset--color--contrast, #172027);
	--ellery-ink-soft: var(--wp--preset--color--muted, #4f5957);
	--ellery-rule: rgba(23, 32, 39, 0.16);
	--ellery-accent: var(--wp--preset--color--accent, #4f6658);
	--ellery-accent-soft: rgba(79, 102, 88, 0.18);
	--ellery-font-body: var(--wp--preset--font-family--body, "Source Sans 3", "Segoe UI", Arial, sans-serif);
	--ellery-font-display: var(--wp--preset--font-family--display, "Newsreader", Georgia, "Times New Roman", serif);
	--ellery-text-xs: 0.8125rem;
	--ellery-text-sm: 0.9375rem;
	--ellery-text-base: 1.0625rem;
	--ellery-text-lg: 1.1875rem;
	--ellery-leading-body: 1.62;
	--ellery-leading-snug: 1.25;
	--ellery-leading-tight: 1.08;
	--ellery-measure: 66ch;
	--ellery-measure-wide: 78ch;
	--ellery-space-1: 0.375rem;
	--ellery-space-2: 0.625rem;
	--ellery-space-3: 1rem;
	--ellery-space-4: 1.5rem;
	--ellery-space-5: 2.25rem;
	--ellery-space-6: 3.25rem;
	--ellery-space-7: 4.75rem;
	--ellery-fast: 140ms;
}

body {
	margin: 0;
	background: var(--ellery-paper);
	color: var(--ellery-ink);
	font-family: var(--ellery-font-body);
	font-size: var(--ellery-text-base);
	line-height: var(--ellery-leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: var(--ellery-accent);
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-color: transparent;
}

:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

::selection {
	background: var(--ellery-accent-soft);
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
}

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

input,
select,
textarea {
	max-width: 100%;
	padding: 0.7rem 0.8rem;
	color: inherit;
	background: #fff;
	border: 1px solid var(--ellery-rule);
	border-radius: 0;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline-color: var(--ellery-accent);
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.8rem;
	padding: 0.65rem 1rem;
	color: var(--ellery-paper);
	background: var(--ellery-ink);
	border: 1px solid var(--ellery-ink);
	border-radius: 0;
	font-size: var(--ellery-text-sm);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--ellery-fast) ease,
		color var(--ellery-fast) ease,
		border-color var(--ellery-fast) ease;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
	color: var(--ellery-ink);
	background: transparent;
	border-color: currentColor;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	margin: 0;
	clip: auto;
	clip-path: none;
	background: var(--wp--preset--color--base, #ffffff);
}

.site-header {
	border-bottom: 1px solid var(--ellery-rule);
}

.site-footer {
	margin-top: var(--ellery-space-7);
	border-top: 1px solid var(--ellery-rule);
}

.site-header__inner,
.site-footer__inner,
.site-main {
	width: min(calc(100% - 2rem), var(--wp--style--global--content-size, 44rem));
	margin-inline: auto;
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	padding-block: 1rem;
}

.site-main {
	padding-block: var(--ellery-space-6);
}

.site-footer__inner {
	padding-block: var(--ellery-space-5);
}

.site-title {
	margin: 0;
	font-family: var(--ellery-font-display);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: var(--ellery-leading-snug);
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-description,
.site-credit,
.entry-meta {
	color: var(--ellery-ink-soft);
	font-size: var(--ellery-text-sm);
}

.primary-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-navigation a {
	display: inline-block;
	min-height: 44px;
	padding-block: 0.55rem;
	color: inherit;
	font-size: var(--ellery-text-sm);
	font-weight: 600;
	text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current_page_item > a {
	text-decoration: underline;
}

.primary-navigation .sub-menu {
	flex-basis: 100%;
	padding-inline-start: 1rem;
	font-size: var(--ellery-text-sm);
}

.entry-header,
.page-header,
.not-found {
	margin-bottom: var(--ellery-space-5);
}

.entry-title,
.page-title {
	margin-top: 0;
}

.post-summary {
	padding-block: var(--ellery-space-5);
	border-top: 1px solid var(--ellery-rule);
}

.post-summary:first-of-type {
	border-top: 0;
}

.post-thumbnail {
	margin-bottom: var(--ellery-space-5);
}

.post-thumbnail img {
	display: block;
}

.page-links,
.posts-navigation,
.post-navigation,
.pagination,
.comments-area {
	margin-top: var(--ellery-space-6);
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
}

.page-numbers,
.page-links a,
.page-links .post-page-numbers {
	display: inline-block;
	padding: 0.35rem 0.5rem;
}

@media (max-width: 42rem) {
	:root {
		--ellery-text-base: 1rem;
	}
}

@media (max-width: 48rem) {
	.site-header__inner {
		display: block;
	}

	.primary-navigation {
		margin-top: 1rem;
	}

	.primary-navigation ul {
		display: block;
	}
}
