/*
 * Writing list: /writing/ (templates/home.html) and category pages
 * (templates/archive.html), both via patterns/writing-list.php. Loaded on the
 * front end and in the editor.
 *
 * Rows follow Selected writing on the homepage (sections.css): hairlines,
 * whole-row link, arrow that nudges on hover, 23px serif titles, rust label.
 * Where Selected writing has its number (01, 02 ...), each row shows the
 * month and year in the same muted sans.
 *
 *   .bl-writing-intro    H1 and lede under the "Writing" label
 *   .bl-writing-list     the list section (one spine marker)
 *   .bl-archive__date    "Nov 2026"
 *   .bl-archive__kicker  category label; hidden for the default category
 *                        (inc/writing.php)
 *   .bl-archive__title   H2, linked; its ::after covers the row
 *   .bl-archive__excerpt first paragraph or manual excerpt, two lines at most
 *   .bl-pagination       Newer / page numbers / Older
 */

.bl-writing-intro {
	padding-bottom: 72px;
}

.bl-writing-list {
	--bl-pt: 0px;
	padding-bottom: 128px;
}

/* No-JS spine estimate: half the first title's line */
.is-style-section.bl-writing-list {
	--bl-mk-c: 58px;
}

.bl-archive,
.bl-archive > * {
	margin-block-start: 0;
}

.bl-archive__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--wp--preset--color--hairline);
}

/* One post */
.bl-archive__list > li {
	position: relative;
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) 24px;
	gap: 16px;
	align-items: start;
	margin: 0;
	padding: 30px 0 32px;
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}

/* No hairline under the last row; pagination has its own */
.bl-archive__list > li:last-child {
	border-bottom: 0;
}

.bl-archive__list > li > * {
	margin-block: 0;
}

.bl-archive__list > li::after {
	content: "";
	align-self: center;
	width: 20px;
	height: 12px;
	background: var(--wp--preset--color--muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12' fill='none' stroke='%23000' stroke-width='1.3'%3E%3Cpath d='M0 6h18M13 1l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12' fill='none' stroke='%23000' stroke-width='1.3'%3E%3Cpath d='M0 6h18M13 1l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.35s ease, background-color 0.35s ease;
}

.bl-archive__list > li:hover::after {
	transform: translateX(6px);
	background: var(--wp--custom--color--accent);
}

.bl-archive__date {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.1em;
	line-height: normal;
	white-space: nowrap;
	color: var(--wp--preset--color--muted);
}

/* Without a label the date lines up with the title's first line */
.bl-archive__list > li:not(:has(.bl-archive__kicker)) .bl-archive__date {
	padding-top: 7px;
}

.bl-archive__text > * {
	margin-block: 0;
}

.bl-archive__kicker {
	margin-bottom: 10px !important; /* outranks the reset above */
	font-family: var(--wp--preset--font-family--sans);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.16em;
	line-height: normal;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-text);
}

/* The label is not a separate link: the whole row goes to the post */
.bl-archive__kicker a {
	color: inherit;
	text-decoration: none;
	pointer-events: none;
}

.bl-archive__title {
	font-size: 23px;
	line-height: 1.3;
	letter-spacing: 0;
	font-variation-settings: normal;
	color: var(--wp--preset--color--contrast);
}

.bl-archive__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.35s ease;
}

.bl-archive__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.bl-archive__list > li:hover .bl-archive__title a {
	color: var(--wp--preset--color--accent-text);
}

/* The focus ring goes round the whole row, which is the click target */
.bl-archive__title a:focus-visible {
	outline: none;
}

.bl-archive__title a:focus-visible::after {
	outline: 2px solid var(--wp--custom--color--accent);
	outline-offset: 4px;
	border-radius: 2px;
}

.bl-archive__excerpt {
	margin-top: 10px !important;
	font-size: 17px;
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

.bl-archive__excerpt p {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Pagination */
.bl-pagination {
	margin-block-start: 40px !important;
	gap: 8px 24px;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 15px;
	letter-spacing: 0.02em;
}

.bl-pagination a {
	text-decoration: none;
}

.bl-pagination .wp-block-query-pagination-previous,
.bl-pagination .wp-block-query-pagination-next {
	padding: 10px 0;
	color: var(--wp--preset--color--accent-text);
	border-bottom: 1px solid var(--wp--preset--color--hairline);
}

.bl-pagination .wp-block-query-pagination-previous:hover,
.bl-pagination .wp-block-query-pagination-next:hover {
	color: var(--wp--preset--color--contrast);
	border-bottom-color: var(--wp--custom--color--accent);
}

.bl-pagination .wp-block-query-pagination-numbers {
	display: flex;
	gap: 4px 16px;
	color: var(--wp--preset--color--muted);
}

.bl-pagination .page-numbers {
	padding: 10px 2px;
	color: var(--wp--preset--color--muted);
}

.bl-pagination .page-numbers:hover {
	color: var(--wp--preset--color--accent-text);
}

.bl-pagination .page-numbers.current {
	color: var(--wp--preset--color--contrast);
	border-bottom: 1px solid var(--wp--custom--color--accent);
}

/* Older sits on the right even on the first page, where there is no Newer */
.bl-pagination .wp-block-query-pagination-next {
	margin-left: auto;
}

/* Empty state */
.bl-archive-empty {
	color: var(--wp--preset--color--muted);
}

@media (max-width: 820px) {
	.bl-writing-intro {
		padding-bottom: 48px;
	}

	.bl-writing-list {
		padding-bottom: 96px;
	}

	.is-style-section.bl-writing-list {
		--bl-mk-c: 50px;
	}

	/* Date above the title; arrow on the right */
	.bl-archive__list > li {
		grid-template-columns: minmax(0, 1fr) 20px;
		grid-template-areas: "date arrow" "text arrow";
		gap: 8px 12px;
		padding: 24px 0 26px;
	}

	.bl-archive__date {
		grid-area: date;
	}

	.bl-archive__list > li:not(:has(.bl-archive__kicker)) .bl-archive__date {
		padding-top: 0;
	}

	.bl-archive__text {
		grid-area: text;
	}

	.bl-archive__list > li::after {
		grid-area: arrow;
	}

	.bl-archive__title {
		font-size: 21px;
	}

	.bl-archive__excerpt {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bl-archive__list > li::after,
	.bl-archive__title a {
		transition: none;
	}

	.bl-archive__list > li:hover::after {
		transform: none;
	}
}
