/**
 * WordPress-specific rules.
 *
 * The design system covers everything the React site drew. This file covers
 * what only WordPress produces: editor prose, alignments, captions, galleries,
 * pagination, comments, the search form and card thumbnails. Nothing here
 * introduces a colour — every value resolves to a token from base.css.
 */

/* ---------------- Editor prose ---------------- */

.entry-content > * + * {
	margin-top: 22px;
}

.entry-content p,
.entry-content li {
	color: var(--ink-2);
	font-size: 1.05rem;
	line-height: 1.7;
}

.band-deep .entry-content p,
.band-deep .entry-content li {
	color: var(--on-deep-2);
}

.entry-content h2 {
	margin-top: clamp(38px, 4vw, 56px);
}

.entry-content h3,
.entry-content h4 {
	margin-top: clamp(28px, 3vw, 38px);
}

.entry-content a:not(.btn) {
	color: var(--brand);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.band-deep .entry-content a:not(.btn) {
	color: var(--bright);
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.3em;
}

.entry-content li + li {
	margin-top: 8px;
}

.entry-content blockquote {
	border-left: 3px solid var(--brand);
	padding-left: 22px;
	font-size: 1.15rem;
	line-height: 1.6;
	color: var(--ink);
}

.entry-content code,
.entry-content kbd {
	background: var(--cream);
	padding: 2px 6px;
	border-radius: 5px;
	font-size: 0.92em;
}

.entry-content pre {
	background: var(--deep-ink);
	color: #fff;
	padding: 20px 22px;
	border-radius: var(--radius);
	overflow-x: auto;
}

.entry-content pre code {
	background: none;
	padding: 0;
	color: inherit;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	display: block;
	overflow-x: auto;
}

.entry-content th,
.entry-content td {
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
}

.entry-content hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: clamp(32px, 4vw, 52px) 0;
}

/* ---------------- Media, alignments, captions ---------------- */

.entry-content img,
.entry-content iframe,
.entry-content video {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
}

.entry-content .alignleft {
	float: left;
	margin: 6px 26px 18px 0;
	max-width: 50%;
}

.entry-content .alignright {
	float: right;
	margin: 6px 0 18px 26px;
	max-width: 50%;
}

.entry-content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.entry-content .alignwide {
	width: min(var(--max), 100vw - var(--gutter) * 2);
	max-width: none;
	margin-left: calc(50% - min(var(--max), 100vw - var(--gutter) * 2) / 2);
}

@media (max-width: 700px) {
	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		margin: 18px 0;
		max-width: 100%;
	}

	.entry-content .alignwide {
		width: 100%;
		margin-left: 0;
	}
}

.entry-content figure {
	margin: 0;
}

.entry-content figcaption,
.wp-caption-text {
	font-size: 0.9rem;
	color: var(--ink-2);
	margin-top: 10px;
	line-height: 1.55;
}

.band-deep .entry-content figcaption {
	color: var(--on-deep-2);
}

.wp-block-gallery,
.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
}

.gallery-item {
	margin: 0;
}

/* Card thumbnails: the design's `.res-top` is padded, so the image sits above it. */
.res-media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--cream);
}

.res-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---------------- Pagination ---------------- */

.pagination,
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: center;
	margin-top: clamp(36px, 4vw, 52px);
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border-radius: var(--pill);
	border: 2px solid var(--line);
	font-family: 'Inter Tight', 'Inter', sans-serif;
	font-weight: 700;
	color: var(--ink);
}

.pagination .page-numbers:hover {
	border-color: var(--brand);
	color: var(--brand);
}

.pagination .page-numbers.current {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

.pagination .page-numbers.dots {
	border-color: transparent;
}

.band-deep .pagination .page-numbers {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.28);
}

.page-links {
	display: flex;
	gap: 8px;
	margin-top: 28px;
	font-weight: 700;
}

/* ---------------- Search form ---------------- */

.lg-search {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.lg-search input[type="search"] {
	flex: 1 1 200px;
	min-width: 0;
	background: #fff;
	border: 2px solid var(--line);
	border-radius: var(--pill);
	padding: 13px 20px;
	font-family: inherit;
	font-size: 1rem;
	color: var(--ink);
}

.lg-search input[type="search"]:focus {
	border-color: var(--brand);
	outline: none;
}

.hero-page .lg-search input[type="search"] {
	border-color: transparent;
}

/* ---------------- Comments ---------------- */

.comment-list {
	list-style: none;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 26px;
}

.comment-list .children {
	list-style: none;
	padding-left: clamp(18px, 3vw, 38px);
	margin-top: 26px;
	display: flex;
	flex-direction: column;
	gap: 26px;
}

.comment-body {
	background: #fff;
	border-radius: var(--radius);
	padding: 24px 26px;
}

.comment-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.9rem;
	color: var(--ink-2);
	margin-bottom: 12px;
}

.comment-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 32px;
}

.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea {
	width: 100%;
	background: #fff;
	border: 2px solid var(--line);
	border-radius: 10px;
	padding: 13px 16px;
	font-family: inherit;
	font-size: 1rem;
	color: var(--ink);
}

.comment-form textarea {
	min-height: 140px;
	resize: vertical;
}

.comment-form input[type="submit"] {
	align-self: flex-start;
	background: var(--brand);
	border: 2px solid var(--brand);
	color: #fff;
	font-family: 'Inter Tight', 'Inter', sans-serif;
	font-weight: 700;
	font-size: 1.02rem;
	padding: 16px 30px;
	border-radius: var(--pill);
	cursor: pointer;
}

.comment-form input[type="submit"]:hover {
	background: var(--deep);
	border-color: var(--deep);
}

/* ---------------- Admin bar ---------------- */

.admin-bar header.site {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar header.site {
		top: 46px;
	}
}

/* ---------------- Motion ---------------- */

@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;
	}
}
