/* -----------------------------------------------------------------------------
   Blog: listings, single post, search and 404.
   -------------------------------------------------------------------------- */

.l4u-post-grid {
	display: grid;
	gap: clamp(1.25rem, 3vw, 2rem);
	grid-template-columns: 1fr;
	margin-block-end: 2.5rem;
}

@media (min-width: 700px) {
	.l4u-post-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1100px) {
	.l4u-post-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.l4u-post-card {
	display: flex;
	flex-direction: column;
	background: var(--l4u-white);
	border: 1px solid var(--l4u-border);
	border-radius: 12px;
	overflow: hidden;
	transition: border-color .15s, box-shadow .15s, transform .15s;
}

.l4u-post-card:hover {
	border-color: color-mix(in srgb, var(--l4u-blue) 45%, var(--l4u-border));
	box-shadow: 0 8px 22px rgb(0 0 0 / .07);
	transform: translateY(-2px);
}

.l4u-post-card__media img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.l4u-post-card__body {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	padding: 1.15rem 1.25rem 1.35rem;
	flex: 1;
}

.l4u-post-card__title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.35;
}

.l4u-post-card__title a {
	color: var(--l4u-black);
	text-decoration: none;
}

.l4u-post-card__title a:hover {
	color: var(--l4u-blue);
}

.l4u-post-card__meta {
	margin: 0;
	color: var(--l4u-muted);
	font-size: .85rem;
}

.l4u-post-card__excerpt {
	margin: 0;
	color: var(--l4u-muted);
	font-size: .95rem;
}

.l4u-post-card__more {
	margin-block-start: auto;
	padding-block-start: .35rem;
	font-weight: 500;
	text-decoration: none;
}

/* Single post --------------------------------------------------------------- */

.l4u-single__head {
	max-width: 68ch;
	margin-inline: auto;
	margin-block-end: 1.5rem;
	text-align: center;
}

.l4u-single__head h1 {
	font-size: clamp(1.7rem, 4vw, 2.6rem);
	line-height: 1.2;
}

.l4u-single__meta {
	margin: 0;
	color: var(--l4u-muted);
	font-size: .9rem;
}

.l4u-single__media {
	margin: 0 0 2rem;
}

.l4u-single__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

/* Long-form text ------------------------------------------------------------ */

.l4u-prose {
	max-width: var(--l4u-measure);
	margin-inline: auto;
	font-size: 1.05rem;
	line-height: 1.7;
}

.l4u-prose > * + * {
	margin-block-start: 1.1em;
}

.l4u-prose h2 {
	margin-block-start: 2em;
	font-size: 1.5rem;
}

.l4u-prose h3 {
	margin-block-start: 1.6em;
	font-size: 1.2rem;
}

.l4u-prose ul,
.l4u-prose ol {
	padding-inline-start: 1.35rem;
}

.l4u-prose li + li {
	margin-block-start: .35em;
}

.l4u-prose img {
	border-radius: var(--l4u-radius);
}

.l4u-prose blockquote {
	margin-inline: 0;
	padding-inline-start: 1.25rem;
	border-inline-start: 3px solid var(--l4u-blue);
	color: var(--l4u-muted);
}

.l4u-prose table {
	width: 100%;
	border-collapse: collapse;
}

/* Legacy content -------------------------------------------------------------
   The long text pages were written in Elementor and carry its markup: list items
   wrapped in paragraphs, hard-coded widths and inline styles. Rather than rewrite
   every page by hand, normalise the shapes that actually cause trouble. */

.l4u-page__title {
	max-width: var(--l4u-measure);
	margin-inline: auto;
	margin-block-end: 1rem;
	font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.l4u-prose--legacy {
	overflow-wrap: break-word;
}

/*
 * The legal pages carry white-space: pre from however the text was originally pasted in.
 * That makes every source line break render, so bullets land on their own line and long
 * sentences never wrap - which is what pushed the page sideways. Real <pre> blocks are
 * excluded so code samples keep their formatting.
 */
.l4u-prose--legacy :not(pre):not(code) {
	/* The rule sits in an inline style attribute on the elements themselves, so a normal
	   declaration loses. This is the case !important exists for: overriding inline styles
	   in content that cannot practically be rewritten by hand. */
	white-space: normal !important;
}

/* Elementor wrapped list text in paragraphs, which pushed it onto its own line
   below the bullet. */
.l4u-prose--legacy li > p {
	display: inline;
	margin: 0;
}

.l4u-prose--legacy li {
	margin-block-end: .4em;
}

/* Inline widths and floats from the old editor overflow on narrow screens. */
.l4u-prose--legacy [style*="width"],
.l4u-prose--legacy [width] {
	max-width: 100%;
	height: auto;
}

.l4u-prose--legacy table {
	display: block;
	overflow-x: auto;
}

.l4u-prose--legacy iframe,
.l4u-prose--legacy video,
.l4u-prose--legacy embed {
	max-width: 100%;
}

/* Nothing in the content may push the page sideways. */
body {
	overflow-x: hidden;
}

.l4u-prose th,
.l4u-prose td {
	padding: .6rem .75rem;
	border: 1px solid var(--l4u-border);
	text-align: start;
}

/* Post navigation ----------------------------------------------------------- */

.l4u-post-nav {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
	max-width: 72ch;
	margin: 3rem auto 0;
	padding-block-start: 1.5rem;
	border-block-start: 1px solid var(--l4u-border);
}

@media (min-width: 700px) {
	.l4u-post-nav {
		grid-template-columns: repeat(2, 1fr);
	}
}

.l4u-post-nav__link {
	display: block;
	padding: 1rem 1.15rem;
	background: var(--l4u-surface);
	border-radius: var(--l4u-radius);
	text-decoration: none;
	color: var(--l4u-black);
}

.l4u-post-nav__link:hover {
	background: color-mix(in srgb, var(--l4u-blue) 8%, var(--l4u-surface));
}

.l4u-post-nav__link span {
	display: block;
	color: var(--l4u-muted);
	font-size: .82rem;
}

.l4u-post-nav__link--next {
	text-align: end;
}

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

.pagination .nav-links,
.woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .4rem;
	padding: 0;
	list-style: none;
	border: 0;
}

.pagination .page-numbers,
.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span {
	display: grid;
	place-items: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding-inline: .6rem;
	border: 1px solid var(--l4u-border);
	border-radius: var(--l4u-radius);
	background: var(--l4u-white);
	text-decoration: none;
	color: var(--l4u-black);
}

.pagination .page-numbers.current,
.woocommerce-pagination .page-numbers li span.current {
	background: var(--l4u-blue);
	border-color: var(--l4u-blue);
	color: var(--l4u-white);
}

/* Search and 404 ------------------------------------------------------------ */

.l4u-404 {
	max-width: 56ch;
	margin-inline: auto;
	padding-block: clamp(2rem, 6vw, 4rem);
	text-align: center;
}

.l4u-404 h1 {
	font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.l4u-404 .l4u-search {
	max-width: 26rem;
	margin: 1.5rem auto;
}

.l4u-404__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .65rem;
	justify-content: center;
}

.l4u-archive-head .l4u-search {
	max-width: 26rem;
	margin-inline: auto;
	margin-block-start: 1rem;
}
