/* Blog: list, archives, search results and single posts (inc/blog.php). */

/* ---------- Heroes ---------- */

.blog-hero { padding-bottom: clamp(36px, 5vw, 56px); }
.blog-hero .ph__lede { max-width: 62ch; }

.blog-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 28px;
}

.blog-cats a {
	padding: 8px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--white);
	color: var(--ink-2);
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color .15s, color .15s;
}

.blog-cats a:hover { border-color: var(--c); color: var(--ink); }
.blog-cats a[aria-current] { border-color: var(--ink); background: var(--ink); color: var(--white); }

/* Post header: like the page hero (.ph) but without its entrance animation, so the
   title, usually the largest element on a post, paints straight away (LCP). */
.post-hero {
	position: relative;
	overflow: hidden;
	padding-block: clamp(36px, 6vw, 84px) clamp(32px, 4vw, 48px);
	background: var(--white);
}

.post-hero__in { position: relative; max-width: 880px; }
.post-hero__t { margin-bottom: 18px; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.08; }
.post-hero__lede { max-width: 62ch; color: var(--ink-2); font-size: var(--fs-lede); }

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-top: 18px;
	color: var(--muted);
	font-size: var(--fs-sm);
}

/* ---------- Post cards ---------- */

.blog-sec { padding-block: clamp(40px, 6vw, 72px); }

.post-grid {
	display: grid;
	gap: 24px;
}

@media (min-width: 680px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.post-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--white);
	transition: transform .2s ease-out, box-shadow .2s ease-out;
}

.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card:focus-within { box-shadow: 0 0 0 3px var(--indigo-ink); }

.post-card__img {
	aspect-ratio: 1200 / 630;
	overflow: hidden;
	background: var(--tint-rani);
}

.post-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-card__ph {
	display: grid;
	place-items: center;
	height: 100%;
	background: linear-gradient(135deg, var(--tint-saffron), var(--tint-rani) 55%, var(--tint-indigo));
}

.post-card__ph img { width: 56px; height: 56px; object-fit: contain; }

.post-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 22px 24px 24px;
}

.post-card__cat {
	margin-bottom: 8px;
	color: var(--rani-ink);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.post-card__t {
	margin-bottom: 10px;
	font-size: var(--fs-h3);
	line-height: 1.25;
}

.post-card__t a { color: var(--ink); text-decoration: none; }
.post-card__t a:focus { outline: none; }

/* The whole card is clickable through the title link. */
.post-card__t a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.post-card__ex { color: var(--ink-2); font-size: .97rem; line-height: 1.6; }
.post-card .post-meta { margin-top: auto; padding-top: 16px; }

.blog-empty {
	padding: 40px 24px;
	border: 1px dashed var(--line);
	border-radius: var(--r-lg);
	background: var(--white);
	color: var(--ink-2);
	text-align: center;
}

.blog-related__t {
	margin-bottom: 24px;
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

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

.pagination { margin-top: 40px; }

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--white);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}

.pagination .page-numbers.current { border-color: var(--ink); background: var(--ink); color: var(--white); }
.pagination a.page-numbers:hover { border-color: var(--ink); }
.pagination .dots { border: 0; background: none; }

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

.post-sec { padding-top: clamp(8px, 2vw, 24px); }

.post-wrap { max-width: 880px; }

.post-figure {
	margin: 0 0 clamp(28px, 4vw, 44px);
	overflow: hidden;
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
}

/* Block, so no inline gap shows under the image inside the rounded frame. */
.post-figure img { display: block; width: 100%; height: auto; }

.post-body {
	max-width: 72ch;
	color: var(--ink-2);
	font-size: 1.0625rem;
	line-height: 1.75;
}

.post-body > * + * { margin-top: 18px; }

.post-body h2 {
	margin-top: 44px;
	color: var(--ink);
	font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem);
	line-height: 1.2;
	scroll-margin-top: 110px;
}

.post-body h3 {
	margin-top: 30px;
	color: var(--ink);
	font-size: 1.2rem;
	line-height: 1.3;
}

.post-body h2 + *,
.post-body h3 + * { margin-top: 10px; }

.post-body ul,
.post-body ol { padding-left: 24px; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: 8px; }
.post-body li::marker { color: var(--rani-ink); }

.post-body a { color: var(--indigo-ink); text-underline-offset: 2px; }
.post-body strong,
.post-body b { color: var(--ink); }

/* "Quick answer" box: add the class post-summary to a paragraph or group. */
.post-body .post-summary {
	padding: 18px 20px;
	border-left: 4px solid var(--rani);
	border-radius: 0 var(--r-md) var(--r-md) 0;
	background: var(--paper);
	color: var(--ink);
}

.post-body blockquote {
	padding: 4px 0 4px 20px;
	border-left: 4px solid var(--saffron);
	color: var(--ink);
	font-size: 1.15rem;
}

.post-body figure { margin-inline: 0; }
.post-body img { height: auto; border-radius: var(--r-md); }
.post-body figcaption { margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }

.post-body table {
	width: 100%;
	border-collapse: collapse;
	font-size: .95rem;
	line-height: 1.5;
}

.post-body .wp-block-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.post-body .wp-block-table thead { border-bottom: 0; }
.post-body .wp-block-table th,
.post-body .wp-block-table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-body .wp-block-table th + th,
.post-body .wp-block-table td + td { border-left: 1px solid var(--line); }
.post-body .wp-block-table th { background: var(--paper); color: var(--ink); }
.post-body .wp-block-table tr:last-child td { border-bottom: 0; }

/* ---------- Share links ---------- */

.post-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	max-width: 72ch;
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.post-share > span { margin-right: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }

.post-share a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color .15s;
}

.post-share a:hover { border-color: var(--ink); }
