/* Bring category/tag archives and the article sidebar into line with the
	   front-page card system. Snippet 39 styles archives from wp_head; this runs
	   in the footer so equal-specificity rules here win without an !important
	   arms race. */

	/* ---- Archive header ------------------------------------------------ */
	/* Was a 3px solid #0046ad slab, far heavier than the 1px #dfe3ea rules the
	   front page settled on. */
	body.archive .page-title,
	body.category .page-title,
	body.tag .page-title {
		border-bottom: 1px solid #dfe3ea !important;
		padding-bottom: 12px !important;
		margin-bottom: 26px !important;
		letter-spacing: -0.02em;
	}

	/* ---- Archive cards ------------------------------------------------- */
	/* Themify's boxed card (1px #e5e7eb, 12px radius) is the look we removed
	   from the front page. Flatten to match: no chrome, rounded image, meta
	   in the same 11px grey as .ccs-ts. */
	body.archive #loops-wrapper .post.type-post,
	body.category #loops-wrapper .post.type-post,
	body.tag #loops-wrapper .post.type-post {
		border: 0 !important;
		border-radius: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
	}
	body.archive #loops-wrapper .post.type-post .post-image,
	body.category #loops-wrapper .post.type-post .post-image,
	body.tag #loops-wrapper .post.type-post .post-image {
		border-radius: 8px !important;
		overflow: hidden !important;
		margin: 0 !important;
	}
	body.archive #loops-wrapper .post.type-post .post-image img,
	body.category #loops-wrapper .post.type-post .post-image img,
	body.tag #loops-wrapper .post.type-post .post-image img {
		border-radius: 8px !important;
		transition: transform .35s ease;
	}
	body.archive #loops-wrapper .post.type-post:hover .post-image img,
	body.category #loops-wrapper .post.type-post:hover .post-image img,
	body.tag #loops-wrapper .post.type-post:hover .post-image img {
		transform: scale(1.03);
	}
	body.archive #loops-wrapper .post.type-post .post-content-inner,
	body.category #loops-wrapper .post.type-post .post-content-inner,
	body.tag #loops-wrapper .post.type-post .post-content-inner {
		padding: 12px 0 0 !important;
	}
	body.archive #loops-wrapper .post.type-post .ccs-card-date,
	body.category #loops-wrapper .post.type-post .ccs-card-date,
	body.tag #loops-wrapper .post.type-post .ccs-card-date {
		border-top: 0 !important;
		margin-top: 6px !important;
		padding-top: 0 !important;
		font-size: 11px !important;
		color: #98a2b3 !important;
	}

	@media (prefers-reduced-motion: reduce) {
		body.archive #loops-wrapper .post.type-post .post-image img,
		body.category #loops-wrapper .post.type-post .post-image img,
		body.tag #loops-wrapper .post.type-post .post-image img {
			transition: none;
		}
		body.archive #loops-wrapper .post.type-post:hover .post-image img,
		body.category #loops-wrapper .post.type-post:hover .post-image img,
		body.tag #loops-wrapper .post.type-post:hover .post-image img {
			transform: none;
		}
	}

	/* ---- "Latest from the Desk" sidebar -------------------------------- */
	/* This is the core wp-block-latest-posts block with featured images on.
	   Nothing styles it, so the thumbnail sat inline and the last line of each
	   headline wrapped underneath it. Make each row a proper flex pair. */
	.wp-block-latest-posts__list {
		margin: 0 !important;
		padding: 0 !important;
		list-style: none !important;
	}
	.wp-block-latest-posts__list li {
		display: flex !important;
		align-items: flex-start;
		gap: 12px;
		margin: 0 0 14px !important;
		padding: 0 0 14px !important;
		border-bottom: 1px solid #eef1f5;
		list-style: none !important;
	}
	.wp-block-latest-posts__list li:last-child {
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
		border-bottom: 0;
	}
	.wp-block-latest-posts__featured-image {
		flex: 0 0 64px;
		margin: 0 !important;
	}
	.wp-block-latest-posts__featured-image img {
		display: block;
		width: 64px;
		height: 48px;
		object-fit: cover;
		border-radius: 6px;
	}
	.wp-block-latest-posts__list li > a {
		flex: 1 1 auto;
		min-width: 0;
		color: #101828 !important;
		font-size: 14px !important;
		line-height: 1.35 !important;
		font-weight: 600;
		text-decoration: none !important;
	}
	.wp-block-latest-posts__list li > a:hover {
		color: #0057a8 !important;
	}

	/* ---- Archive cards on phones ---------------------------------------- */
	/* Full-bleed 4:3 thumbnails meant roughly one story per screen. Fold the
	   card into the front-page rail shape instead: thumb left, headline right,
	   excerpt dropped since there is no room for it at this width. */
	@media screen and (max-width: 780px) {
		body.archive #loops-wrapper .post.type-post,
		body.category #loops-wrapper .post.type-post,
		body.tag #loops-wrapper .post.type-post {
			display: grid !important;
			grid-template-columns: 112px 1fr;
			gap: 12px;
			align-items: start;
			padding-bottom: 14px !important;
			border-bottom: 1px solid #eef1f5 !important;
		}
		body.archive #loops-wrapper .post.type-post .post-image,
		body.category #loops-wrapper .post.type-post .post-image,
		body.tag #loops-wrapper .post.type-post .post-image {
			grid-column: 1;
			grid-row: 1;
		}
		body.archive #loops-wrapper .post.type-post .post-image img,
		body.category #loops-wrapper .post.type-post .post-image img,
		body.tag #loops-wrapper .post.type-post .post-image img {
			width: 112px !important;
			height: 84px !important;
			object-fit: cover !important;
			max-width: none !important;
		}
		body.archive #loops-wrapper .post.type-post .post-content,
		body.category #loops-wrapper .post.type-post .post-content,
		body.tag #loops-wrapper .post.type-post .post-content {
			grid-column: 2;
			grid-row: 1;
			min-width: 0;
		}
		body.archive #loops-wrapper .post.type-post .post-content-inner,
		body.category #loops-wrapper .post.type-post .post-content-inner,
		body.tag #loops-wrapper .post.type-post .post-content-inner {
			padding: 0 !important;
		}
		body.archive #loops-wrapper .post.type-post .post-title,
		body.category #loops-wrapper .post.type-post .post-title,
		body.tag #loops-wrapper .post.type-post .post-title {
			margin: 0 !important;
			font-size: 15px !important;
			line-height: 1.3 !important;
			letter-spacing: -0.01em;
			display: -webkit-box;
			-webkit-line-clamp: 3;
			-webkit-box-orient: vertical;
			overflow: hidden;
		}
		body.archive #loops-wrapper .post.type-post .ccs-excerpt,
		body.category #loops-wrapper .post.type-post .ccs-excerpt,
		body.tag #loops-wrapper .post.type-post .ccs-excerpt {
			display: none !important;
		}
		body.archive #loops-wrapper,
		body.category #loops-wrapper,
		body.tag #loops-wrapper {
			gap: 14px !important;
		}
	}

	/* ---- Market bar on narrow screens ---------------------------------- */
	/* The tile strip scrolls horizontally but ended in a hard clip mid-tile,
	   which reads as a broken edge rather than "there is more this way". */
	@media screen and (max-width: 1200px) {
		.ccs-topbar {
			position: relative;
		}
		.ccs-topbar::after {
			content: "";
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			width: 36px;
			pointer-events: none;
			background: linear-gradient(to right, rgba(247, 248, 250, 0), #f7f8fa);
		}
	}