/* ==========================================================================
   Blog listings (template-parts/blog-listing.php): blog page, categories, yearly archives.
   Graphite hero with a wall of the category's photographs laid like tiles, porcelain body with
   article cards and the original sidebar widgets.
   ========================================================================== */

.bl {
	--bl-ink: #141414;
	--bl-graphite: #121211;
	--bl-porcelain: #f4f2ee;
	--bl-line: #e6e2da;
	--bl-text: #4f4c47;
	--bl-muted: #8a867e;
	--bl-gold: #c99a3f;
	--bl-gold-soft: #e3c27a;
	--bl-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--bl-head: "Red Hat Display", var(--o-heading, sans-serif);
	font-family: var(--o-body, Arial, sans-serif);
	color: var(--bl-text);
	background: var(--bl-porcelain);
}
.bl-wrap {
	width: min(1240px, 100% - 40px);
	margin-inline: auto;
}

/* ------------------------------------------------------------ Hero */
.bl-hero {
	position: relative;
	padding: calc(var(--header-h) + 34px) 0 56px;
	overflow: hidden;
	color: #fff;
	background:
		radial-gradient(60% 80% at 80% 30%, #2a2621 0%, rgba(42, 38, 33, 0) 65%),
		linear-gradient(180deg, #0c0c0b, var(--bl-graphite));
}
.bl-hero__inner {
	display: grid;
	gap: 36px;
	align-items: center;
}
.bl-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 26px;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.6);
}
.bl-crumbs a {
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
}
.bl-crumbs a:hover {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 4px;
}
.bl-kicker {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font-family: var(--bl-head);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--bl-gold-soft);
}
.bl-kicker span {
	width: 36px;
	height: 1px;
	background: currentColor;
}
.bl-hero__title {
	margin: 0;
	font-family: var(--bl-head);
	font-size: clamp(2.4rem, 1.3rem + 4.6vw, 4.6rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.025em;
	text-wrap: balance;
	animation: bl-rise 1s var(--bl-ease) 0.1s backwards;
}
.bl-hero__intro {
	max-width: 60ch;
	margin: 22px 0 0;
	font-size: 16px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.76);
	animation: bl-rise 1s var(--bl-ease) 0.25s backwards;
}
.bl-hero__count {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	margin: 26px 0 0;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	font-size: 15px;
	color: rgba(255, 255, 255, 0.65);
}
.bl-hero__count strong {
	font-family: var(--bl-head);
	font-size: 2rem;
	font-weight: 700;
	color: #fff;
}

/* Wall of photographs, set like tiles with a fine joint. */
.bl-wall {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	grid-template-rows: repeat(4, minmax(0, 1fr));
	gap: 6px;
	aspect-ratio: 4 / 3;
	padding: 6px;
	border-radius: 6px;
	background: rgba(227, 194, 122, 0.14);
}
.bl-wall__tile {
	position: relative;
	overflow: hidden;
	border-radius: 2px;
	background: #222;
	animation: bl-lay 0.9s var(--bl-ease) backwards;
	animation-delay: calc(0.2s + var(--i) * 0.14s);
}
.bl-wall__tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	animation: bl-drift 18s ease-in-out infinite alternate;
}
.bl-wall__tile--1 {
	grid-column: 1 / 4;
	grid-row: 1 / 5;
}
.bl-wall__tile--2 {
	grid-column: 4 / 7;
	grid-row: 1 / 3;
}
.bl-wall__tile--3 {
	grid-column: 4 / 6;
	grid-row: 3 / 5;
}
.bl-wall__tile--4 {
	grid-column: 6 / 7;
	grid-row: 3 / 5;
}
.bl-wall__tile--5 {
	display: none;
}

/* ------------------------------------------------------------ Body */
.bl-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* never wider than the screen */
	gap: 40px;
	padding: 48px 0 90px;
}
.bl-years {
	display: flex;
	gap: 8px;
	margin: 0 -20px 6px;
	padding: 2px 20px 8px;
	overflow-x: auto;
	scrollbar-width: none;
}
.bl-years::-webkit-scrollbar {
	display: none;
}
.bl-year {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--bl-line);
	border-radius: 999px;
	background: #fff;
	color: var(--bl-ink);
	font-family: var(--bl-head);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.3s var(--bl-ease), color 0.3s, border-color 0.3s;
}
.bl-year span {
	display: inline-grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--bl-porcelain);
	color: var(--bl-muted);
	font-size: 12px;
	font-weight: 700;
}
.bl-year[aria-pressed="true"] {
	border-color: var(--bl-ink);
	background: var(--bl-ink);
	color: #fff;
}
.bl-year[aria-pressed="true"] span {
	background: var(--bl-gold);
	color: #fff;
}
.bl-result {
	min-height: 1.4em;
	margin: 6px 0 18px;
	font-size: 15px;
	color: var(--bl-muted);
}
.bl-result strong {
	color: var(--bl-ink);
}

/* Cards */
.bl-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bl-card[hidden] {
	display: none;
}
.bl-card article {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--bl-line);
	border-radius: 16px;
	background: #fff;
	overflow: hidden;
	transition: transform 0.5s var(--bl-ease), box-shadow 0.5s var(--bl-ease), border-color 0.5s;
}
.bl-card.is-in {
	animation: bl-rise 0.6s var(--bl-ease) backwards;
	animation-delay: calc(var(--i, 0) * 50ms);
}
.bl-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #e9e6df;
}
.bl-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.9s var(--bl-ease);
}
.bl-card__date {
	position: absolute;
	left: 14px;
	top: 14px;
	display: grid;
	justify-items: center;
	min-width: 58px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(14, 14, 14, 0.78);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: rgba(255, 255, 255, 0.8);
	font-size: 11px;
	line-height: 1.2;
	text-align: center;
}
.bl-card__date span {
	font-family: var(--bl-head);
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}
.bl-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 20px 22px 22px;
}
.bl-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	font-size: 12px;
	color: var(--bl-muted);
}
.bl-card__cat {
	font-weight: 700;
	color: var(--bl-gold);
	text-decoration: none;
}
.bl-card__title {
	margin: 12px 0 18px;
	font-family: var(--bl-head);
	font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
	font-weight: 700;
	line-height: 1.25;
	color: var(--bl-ink);
	text-wrap: balance;
}
.bl-card__title a {
	color: inherit;
	text-decoration: none;
}
.bl-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin-top: auto;
	color: var(--bl-ink);
	font-family: var(--bl-head);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
.bl-card__more svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: var(--bl-gold);
	stroke-width: 1.8;
	transition: transform 0.4s var(--bl-ease);
}
.bl-empty {
	display: grid;
	justify-items: center;
	gap: 14px;
	padding: 48px 20px;
	border: 1px dashed #cfc9bd;
	border-radius: 16px;
	text-align: center;
	color: var(--bl-ink);
}
.bl-empty p {
	margin: 0;
}

/* Sidebar */
.bl-side {
	display: grid;
	gap: 18px;
	align-content: start;
}
.bl-widget {
	padding: 22px;
	border: 1px solid var(--bl-line);
	border-radius: 16px;
	background: #fff;
}
.bl-widget__title {
	position: relative;
	margin: 0 0 16px;
	padding-bottom: 12px;
	font-family: var(--bl-head);
	font-size: 18px;
	font-weight: 700;
	color: var(--bl-ink);
}
.bl-widget__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 32px;
	height: 2px;
	background: var(--bl-gold);
}
.bl-search {
	display: flex;
	border: 1px solid var(--bl-line);
	border-radius: 999px;
	overflow: hidden;
	transition: border-color 0.3s;
}
.bl-search:focus-within {
	border-color: var(--bl-ink);
}
.bl-search input {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0 16px;
	border: 0;
	background: none;
	font: 16px var(--o-body, Arial, sans-serif);
	color: var(--bl-ink);
	outline: none;
}
.bl-search button {
	display: grid;
	place-items: center;
	width: 48px;
	border: 0;
	background: var(--bl-ink);
	color: #fff;
	cursor: pointer;
}
.bl-search svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}
.bl-list {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bl-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	border-bottom: 1px solid var(--bl-line);
	color: var(--bl-ink);
	font-size: 15px;
	text-decoration: none;
	transition: color 0.3s, padding-left 0.35s var(--bl-ease);
}
.bl-list li:last-child a {
	border-bottom: 0;
}
.bl-list a[aria-current] {
	font-weight: 700;
	color: var(--bl-gold);
}
.bl-list__count {
	display: inline-grid;
	place-items: center;
	min-width: 26px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--bl-porcelain);
	color: var(--bl-muted);
	font-size: 12px;
	font-weight: 700;
}
.bl-recent {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bl-recent a {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	color: var(--bl-ink);
	text-decoration: none;
}
.bl-recent__thumb {
	display: block;
	aspect-ratio: 1;
	border-radius: 10px;
	overflow: hidden;
	background: #e9e6df;
}
.bl-recent__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--bl-ease);
}
.bl-recent__meta {
	display: block;
	font-size: 12px;
	color: var(--bl-muted);
}
.bl-recent__title {
	display: -webkit-box;
	margin-top: 2px;
	font-family: var(--bl-head);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.bl-widget--logo {
	display: grid;
	place-items: center;
	padding: 26px;
}
.bl-widget--logo img {
	width: min(220px, 100%);
	height: auto;
}

.bl a:focus-visible,
.bl button:focus-visible,
.bl input:focus-visible {
	outline: 2px solid var(--bl-gold);
	outline-offset: 3px;
}

/* ------------------------------------------------------------ Motion */
@keyframes bl-rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
}
@keyframes bl-lay {
	from {
		opacity: 0;
		clip-path: inset(50% 50% 50% 50%);
	}
	to {
		opacity: 1;
		clip-path: inset(0);
	}
}
@keyframes bl-drift {
	from {
		transform: scale(1.04);
	}
	to {
		transform: scale(1.14) translate(-2%, -1%);
	}
}

@media (hover: hover) {
	.bl-card article:hover {
		transform: translateY(-6px);
		border-color: transparent;
		box-shadow: 0 28px 50px -30px rgba(20, 20, 20, 0.45);
	}
	.bl-card article:hover .bl-card__media img {
		transform: scale(1.06);
	}
	.bl-card article:hover .bl-card__more svg {
		transform: translateX(4px);
	}
	.bl-year:hover {
		border-color: var(--bl-ink);
	}
	.bl-list a:hover {
		padding-left: 6px;
		color: var(--bl-gold);
	}
	.bl-recent a:hover .bl-recent__thumb img {
		transform: scale(1.08);
	}
	.bl-recent a:hover .bl-recent__title {
		color: var(--bl-gold);
	}
}

/* ------------------------------------------------------------ Larger screens */
@media (min-width: 700px) {
	.bl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.bl-side {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.bl-years {
		flex-wrap: wrap;
		margin: 0 0 6px;
		padding: 2px 0 8px;
		overflow: visible;
	}
}
@media (min-width: 1000px) {
	.bl-hero {
		padding-bottom: 72px;
	}
	.bl-hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 64px;
	}
	.bl-body {
		grid-template-columns: minmax(0, 1fr) 340px;
		gap: 48px;
		padding: 64px 0 110px;
	}
	.bl-side {
		grid-template-columns: minmax(0, 1fr);
		position: sticky;
		top: calc(var(--mh-compact, 60px) + 24px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bl-hero__title,
	.bl-hero__intro,
	.bl-wall__tile,
	.bl-wall__tile img,
	.bl-card.is-in {
		animation: none;
	}
	.bl-card article,
	.bl-card__media img,
	.bl-list a {
		transition: none;
	}
}
.bl-main {
	min-width: 0;
	scroll-margin-top: calc(var(--mh-compact, 60px) + 20px);
}

/* Very small phones (≤ 400 px): the year chips stay inside the column. */
@media (max-width: 400px) {
	.bl-years {
		flex-wrap: wrap;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}
}

/* Sidebar never wider than the screen (the search field could force it on 320 px phones). */
.bl-side {
	grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px) and (max-width: 999px) {
	.bl-side {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.bl-search input {
	min-width: 0;
}
