/*
Theme Name: SJH Theme
Theme URI: http://st-james.local/
Description: A standalone St James's House theme made by SJH, with editorial Work pages, theme settings, and lightweight SEO built in.
Author: SJH
Author URI: http://st-james.local/
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: sjh-theme
*/

:root {
	--sjh-ink: #201a16;
	--sjh-muted: #746a62;
	--sjh-paper: #fbf8f4;
	--sjh-card: #fffdf9;
	--sjh-line: #e4d8cf;
	--sjh-warm: #a96549;
	--sjh-shadow: 0 18px 60px rgba(32, 26, 22, 0.08);
	--sjh-header-height: 82px;
	--sjh-wrap: min(1280px, calc(100% - 32px));
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--sjh-paper);
	color: var(--sjh-ink);
	font-family: Inter, Arial, Helvetica, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

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

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

.sjh-skip-link:focus {
	z-index: 1000;
	top: 1rem;
	left: 1rem;
	width: auto;
	height: auto;
	padding: 0.65rem 0.9rem;
	clip: auto;
	background: var(--sjh-ink);
	color: #fff;
}

.sjh-site-header {
	position: relative;
	z-index: 50;
	background: rgba(255, 255, 255, 0.94);
	border-bottom: 1px solid rgba(32, 26, 22, 0.08);
	backdrop-filter: blur(18px);
}

.sjh-site-header.is-sticky {
	position: sticky;
	top: 0;
}

.sjh-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1rem, 3vw, 2.5rem);
	width: var(--sjh-wrap);
	min-height: var(--sjh-header-height);
	margin: 0 auto;
}

.sjh-logo,
.custom-logo-link {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	min-width: 3.2rem;
	color: var(--sjh-ink);
	font-weight: 800;
	letter-spacing: 0.02em;
	text-decoration: none;
}

.sjh-logo__mark {
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 50%;
	background: var(--sjh-warm);
	color: #fff;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.72rem;
	line-height: 1;
}

.sjh-logo img,
.custom-logo-link img {
	width: auto;
	max-height: 3.6rem;
}

.sjh-primary-nav {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 2.2vw, 2rem);
	margin-left: auto;
}

.sjh-primary-nav ul {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 2vw, 1.8rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sjh-primary-nav a {
	color: var(--sjh-ink);
	font-size: 0.98rem;
	line-height: 1;
	text-decoration: none;
}

.sjh-primary-nav a:hover,
.sjh-primary-nav a:focus-visible {
	color: var(--sjh-warm);
}

.sjh-header-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.9rem;
	padding: 0.65rem 1.25rem;
	border: 1px solid rgba(32, 26, 22, 0.3);
	border-radius: 999px;
	color: var(--sjh-ink);
	text-decoration: none;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.sjh-header-cta:hover,
.sjh-header-cta:focus-visible {
	background: var(--sjh-ink);
	border-color: var(--sjh-ink);
	color: #fff;
}

.sjh-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border: 1px solid rgba(32, 26, 22, 0.18);
	border-radius: 50%;
	background: transparent;
	color: var(--sjh-ink);
	cursor: pointer;
}

.sjh-menu-toggle span,
.sjh-menu-toggle::before,
.sjh-menu-toggle::after {
	content: "";
	display: block;
	width: 1.15rem;
	height: 1px;
	background: currentColor;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.sjh-menu-toggle::before {
	transform: translateY(-0.42rem);
}

.sjh-menu-toggle::after {
	transform: translateY(0.42rem);
}

.sjh-menu-toggle[aria-expanded="true"] span {
	opacity: 0;
}

.sjh-menu-toggle[aria-expanded="true"]::before {
	transform: translateY(1px) rotate(45deg);
}

.sjh-menu-toggle[aria-expanded="true"]::after {
	transform: translateY(-1px) rotate(-45deg);
}

.sjh-main {
	min-height: 60vh;
}

.sjh-section,
.sjh-archive,
.sjh-singular,
.sjh-not-found {
	width: var(--sjh-wrap);
	margin: 0 auto;
	padding: clamp(4rem, 8vw, 7rem) 0;
}

.sjh-page-header {
	max-width: 880px;
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.sjh-eyebrow {
	margin: 0 0 1rem;
	color: var(--sjh-warm);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

.sjh-page-title,
.sjh-entry-title {
	margin: 0;
	color: var(--sjh-ink);
	font-size: clamp(3rem, 7vw, 6.8rem);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 0.98;
}

.sjh-page-description {
	max-width: 760px;
	margin: 1.4rem 0 0;
	color: var(--sjh-muted);
	font-size: clamp(1.1rem, 2vw, 1.32rem);
	line-height: 1.7;
}

.sjh-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.4rem, 3vw, 2rem);
}

.sjh-card {
	display: grid;
	gap: 1rem;
	color: var(--sjh-ink);
	text-decoration: none;
}

.sjh-card__image {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--sjh-line);
}

.sjh-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.sjh-card:hover .sjh-card__image img,
.sjh-card:focus-visible .sjh-card__image img {
	transform: scale(1.045);
}

.sjh-card__meta {
	margin: 0;
	color: var(--sjh-warm);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.sjh-card__title {
	margin: 0;
	font-size: clamp(1.55rem, 2.7vw, 2.4rem);
	font-weight: 400;
	line-height: 1.08;
}

.sjh-entry {
	max-width: 840px;
}

.sjh-entry__media {
	aspect-ratio: 16 / 9;
	margin: 0 0 clamp(2rem, 5vw, 4rem);
	overflow: hidden;
	background: var(--sjh-line);
}

.sjh-entry__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sjh-entry-content {
	color: var(--sjh-muted);
	font-size: clamp(1.08rem, 1.6vw, 1.22rem);
}

.sjh-entry-content > *:first-child {
	margin-top: 0;
}

.sjh-entry-content h2,
.sjh-entry-content h3 {
	color: var(--sjh-ink);
	font-weight: 500;
	line-height: 1.15;
}

.sjh-pagination {
	display: flex;
	gap: 0.75rem;
	margin-top: clamp(3rem, 6vw, 5rem);
}

.sjh-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--sjh-line);
	color: var(--sjh-ink);
	text-decoration: none;
}

.sjh-pagination .current {
	background: var(--sjh-ink);
	color: #fff;
}

.sjh-site-footer {
	border-top: 1px solid var(--sjh-line);
	background: #fffaf6;
}

.sjh-site-footer__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: var(--sjh-wrap);
	margin: 0 auto;
	padding: 2rem 0;
	color: var(--sjh-muted);
	font-size: 0.92rem;
}

.sjh-footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sjh-footer-nav a {
	color: inherit;
	text-decoration: none;
}

@media (max-width: 980px) {
	.sjh-site-header__inner {
		min-height: 72px;
	}

	.sjh-menu-toggle {
		display: inline-flex;
	}

	.sjh-primary-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: grid;
		gap: 1.4rem;
		padding: 1.25rem 1rem 1.5rem;
		background: rgba(255, 255, 255, 0.98);
		border-bottom: 1px solid rgba(32, 26, 22, 0.08);
		box-shadow: var(--sjh-shadow);
		opacity: 0;
		pointer-events: none;
		transform: translateY(-0.5rem);
		transition: opacity 0.25s ease, transform 0.25s ease;
	}

	.sjh-primary-nav.is-open {
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0);
	}

	.sjh-primary-nav ul {
		display: grid;
		gap: 1rem;
		width: var(--sjh-wrap);
		margin: 0 auto;
	}

	.sjh-header-cta {
		width: var(--sjh-wrap);
		margin: 0 auto;
	}

	.sjh-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	body {
		font-size: 16px;
	}

	.sjh-grid {
		grid-template-columns: 1fr;
	}

	.sjh-site-footer__inner {
		display: grid;
	}
}
