/*
 * Thoughts About God — native 404 page
 * Scoped deliberately to .tag-404 so it cannot leak into other templates.
 */

.tag-404 {
	--tag-404-burgundy: #7a1f1f;
	--tag-404-burgundy-dark: #541616;
	--tag-404-brown: #3f3127;
	--tag-404-text: #40352e;
	--tag-404-muted: #766a62;
	--tag-404-paper: #fffdf9;
	--tag-404-canvas: #f7f6f2;
	--tag-404-border: rgba(63, 49, 39, 0.14);
	--tag-404-shadow: 0 18px 45px rgba(63, 49, 39, 0.08);
	background: var(--tag-404-canvas);
	color: var(--tag-404-text);
	width: 100%;
}

.tag-404,
.tag-404 * {
	box-sizing: border-box;
}

.tag-404__main {
	width: 100%;
}

.tag-404__hero {
	position: relative;
	overflow: hidden;
	padding: clamp(3.25rem, 7vw, 6.5rem) 1rem clamp(2.75rem, 6vw, 5rem);
	background:
		radial-gradient(circle at 50% -10%, rgba(122, 31, 31, 0.10), transparent 42rem),
		linear-gradient(180deg, #fffdf9 0%, #f7f6f2 100%);
	border-bottom: 1px solid var(--tag-404-border);
}

.tag-404__hero-inner,
.tag-404__resources-inner {
	width: min(100%, 1180px);
	margin-inline: auto;
}

.tag-404__hero-inner {
	max-width: 820px;
	text-align: center;
}

.tag-404__code {
	margin: 0 0 0.25rem;
	font-family: var(--wp--preset--font-family--editorial, Merriweather, Georgia, serif);
	font-size: clamp(5rem, 15vw, 10rem);
	font-weight: 700;
	letter-spacing: -0.07em;
	line-height: 0.88;
	color: rgba(122, 31, 31, 0.12);
	user-select: none;
}

.tag-404__eyebrow,
.tag-404__section-eyebrow {
	margin: 0 0 0.7rem;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.13em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--tag-404-burgundy);
}

.tag-404__title {
	max-width: 760px;
	margin: 0 auto;
	font-family: var(--wp--preset--font-family--editorial, Merriweather, Georgia, serif);
	font-size: clamp(2rem, 5vw, 3.7rem);
	font-weight: 700;
	line-height: 1.12;
	color: var(--tag-404-brown);
	text-wrap: balance;
}

.tag-404__intro {
	max-width: 680px;
	margin: 1.15rem auto 0;
	font-size: clamp(1rem, 2vw, 1.15rem);
	line-height: 1.75;
	color: var(--tag-404-muted);
	text-wrap: pretty;
}

.tag-404__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.8rem;
	margin-top: 1.8rem;
}

.tag-404__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.78rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-weight: 750;
	line-height: 1.2;
	text-decoration: none !important;
	transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tag-404__button:hover {
	transform: translateY(-1px);
}

.tag-404__button:focus-visible,
.tag-404 a:focus-visible {
	outline: 3px solid rgba(122, 31, 31, 0.28);
	outline-offset: 3px;
}

.tag-404__button--primary {
	background: var(--tag-404-burgundy);
	color: #fff !important;
}

.tag-404__button--primary:hover {
	background: var(--tag-404-burgundy-dark);
}

.tag-404__button--secondary {
	background: #fff;
	border-color: rgba(122, 31, 31, 0.22);
	color: var(--tag-404-burgundy) !important;
}

.tag-404__button--secondary:hover {
	border-color: var(--tag-404-burgundy);
	background: #fffaf6;
}

.tag-404__search {
	width: min(100%, 650px);
	margin: 2.25rem auto 0;
	padding: clamp(1.1rem, 3vw, 1.5rem);
	border: 1px solid var(--tag-404-border);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.88);
	box-shadow: var(--tag-404-shadow);
	text-align: left;
}

.tag-404__search-title {
	margin: 0 0 0.8rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 750;
	line-height: 1.4;
	color: var(--tag-404-brown);
}

/* Keep the existing Thoughts About God search component fluid inside the 404 card. */
.tag-404__search form,
.tag-404__search .search-form,
.tag-404__search .tag-site-search__form {
	width: 100%;
	max-width: none;
	margin: 0;
}

.tag-404__search input[type='search'] {
	width: 100%;
	min-width: 0;
}

.tag-404__resources {
	padding: clamp(2.8rem, 6vw, 5.5rem) 1rem clamp(3.5rem, 7vw, 6.5rem);
	background: var(--tag-404-canvas);
}

.tag-404__section-heading {
	max-width: 760px;
	margin-bottom: 1.75rem;
}

.tag-404__section-heading h2 {
	margin: 0;
	font-family: var(--wp--preset--font-family--editorial, Merriweather, Georgia, serif);
	font-size: clamp(1.65rem, 3.8vw, 2.55rem);
	line-height: 1.2;
	color: var(--tag-404-brown);
	text-wrap: balance;
}

.tag-404__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	align-items: stretch;
}

.tag-404__card {
	min-width: 0;
	padding: clamp(1.2rem, 2vw, 1.55rem);
	border: 1px solid var(--tag-404-border);
	border-radius: 16px;
	background: var(--tag-404-paper);
	box-shadow: 0 10px 24px rgba(63, 49, 39, 0.04);
}

.tag-404__card h3 {
	margin: 0 0 0.9rem;
	padding-bottom: 0.65rem;
	border-bottom: 2px solid rgba(122, 31, 31, 0.18);
	font-family: var(--wp--preset--font-family--editorial, Merriweather, Georgia, serif);
	font-size: 1.12rem;
	line-height: 1.3;
	color: var(--tag-404-brown);
}

.tag-404__card ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tag-404__card li + li {
	margin-top: 0.62rem;
}

.tag-404__card a {
	display: inline-block;
	color: var(--tag-404-burgundy);
	font-weight: 650;
	line-height: 1.45;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.tag-404__card a:hover {
	color: var(--tag-404-burgundy-dark);
	text-decoration-thickness: 2px;
}

@media (max-width: 900px) {
	.tag-404__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.tag-404__hero,
	.tag-404__resources {
		padding-inline: 0.9rem;
	}

	.tag-404__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.tag-404__button {
		width: 100%;
	}

	.tag-404__search {
		border-radius: 14px;
	}

	.tag-404__grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tag-404__button {
		transition: none;
	}

	.tag-404__button:hover {
		transform: none;
	}
}
