/* ==========================================================================
   AFP News  (salient-child)
   Listing: [afp_news]   Single: single-post.php
   Matches https://www.theafp.co.uk/news/ and the single news articles.
   ========================================================================== */

.afp-news,
.afp-news-banner,
.afp-news-single {
	--afp-news-teal: #57b197;
	--afp-news-dark: #221f20;
	--afp-news-purple: #8e68a6;
	--afp-news-text: #3c4547;
	--afp-news-muted: #7c8181;
	--afp-news-grey: #f2f2f2;
}

.afp-news *,
.afp-news-single * {
	box-sizing: border-box;
}

/* ============================================================== listing */
.afp-news {
	padding: 40px 0 60px;
}

.afp-news__heading {
	margin: 0 0 70px;
	padding-left: 12%;
}

.afp-news .afp-news__heading-title {
	margin: 0 0 18px;
	padding: 0;
	color: var(--afp-news-teal);
	font-size: 48px;
	font-weight: 500;
	line-height: 1.2;
}

.afp-news__heading-sub {
	display: inline-block;
	color: var(--afp-news-teal);
	font-size: 17px;
	font-weight: 500;
	text-transform: uppercase;
	border-bottom: 2px solid rgba(87, 177, 151, 0.42);
}

.afp-news__list {
	display: grid;
	row-gap: 0;
	transition: opacity 0.2s ease;
}

.afp-news.is-loading .afp-news__list {
	opacity: 0.45;
}

.afp-news__empty {
	margin: 20px 0;
	text-align: center;
	font-size: 18px;
}

/* ---------------------------------------------------------------- item */
.afp-news__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	background-color: var(--afp-news-grey);
}

.afp-news__item--no-image {
	grid-template-columns: minmax(0, 1fr);
}

/* Even rows: image on the right (same zig-zag as the live site). Uses
   :nth-child so it keeps alternating after "Load More". */
.afp-news__item:nth-child(even) .afp-news__media {
	order: 2;
}

.afp-news__media {
	position: relative;
	display: block;
	min-height: 360px;
	overflow: hidden;
	background-color: #fff;
}

.afp-news__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s ease;
}

.afp-news__item:hover .afp-news__media img {
	transform: scale(1.04);
}

/* Slanted wedge at the foot of the image, as on the live site: grey and
   on the left for odd rows, white and on the right for even rows. */
.afp-news__media::after {
	content: "";
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 64%;
	height: 110px;
	background-color: var(--afp-news-grey);
	clip-path: polygon(0 0, 92% 0, 100% 100%, 0 100%);
	z-index: 1;
	pointer-events: none;
}

.afp-news__item:nth-child(even) .afp-news__media::after {
	left: auto;
	right: 0;
	background-color: #fff;
	clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}

.afp-news__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 75px;
	color: var(--afp-news-text);
}

.afp-news .afp-news__title {
	margin: 0 0 28px;
	padding: 0;
	font-size: 30px;
	font-weight: 500;
	line-height: 1.3;
}

.afp-news .afp-news__title a {
	color: var(--afp-news-teal);
	text-decoration: none;
	transition: color 0.3s ease;
}

.afp-news .afp-news__title a:hover {
	color: var(--afp-news-dark);
}

.afp-news__date {
	font-size: 17px;
	font-weight: 500;
}

.afp-news .afp-news__excerpt {
	margin: 0;
	padding: 28px 0;
	color: var(--afp-news-muted);
	font-size: 18px;
	line-height: 1.7;
}

.afp-news__cats {
	padding-bottom: 30px;
}

.afp-news-cat {
	display: inline-block;
	margin-right: 14px;
	color: var(--afp-news-teal);
	font-size: 16px;
	font-weight: 500;
	text-transform: uppercase;
}

.afp-news .afp-news__btn,
.afp-news .afp-news__more-btn {
	display: inline-block;
	padding: 10px 50px 9px;
	border: 0;
	border-radius: 50px;
	background-color: var(--afp-news-purple);
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.5px;
	line-height: 1.5;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.5s ease;
}

.afp-news .afp-news__btn:hover,
.afp-news .afp-news__btn:focus-visible,
.afp-news .afp-news__more-btn:hover,
.afp-news .afp-news__more-btn:focus-visible {
	background-color: var(--afp-news-dark);
	color: #fff;
}

.afp-news__more {
	margin-top: 50px;
	text-align: center;
}

.afp-news__more[hidden] {
	display: none;
}

.afp-news .afp-news__more-btn[disabled] {
	opacity: 0.7;
	cursor: wait;
}

/* =============================================================== single */
.afp-news-banner {
	display: flex;
	align-items: center;
	min-height: 300px;
	padding: 50px 0;
	background-color: #1f2324;
	background-size: cover;
	background-position: center;
}

.afp-news-banner .afp-news-banner__title {
	margin: 0;
	padding: 0 0 0 12%;
	color: var(--afp-news-teal);
	font-size: 70px;
	font-weight: 700;
	line-height: 1.05;
}

body .container-wrap.afp-news-single-wrap {
	padding-top: 0;
	background-color: #fff;
}

.afp-news-single__intro {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	padding: 80px 0 0;
}

.afp-news-single__intro--no-image {
	grid-template-columns: minmax(0, 1fr);
}

.afp-news-single__meta {
	padding: 0 60px 0 max(24px, 12vw);
}

.afp-news-single__back {
	display: inline-block;
	margin-bottom: 25px;
	color: var(--afp-news-teal);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.afp-news-single__back:hover {
	color: var(--afp-news-dark);
}

.afp-news-single .afp-news-single__title {
	margin: 0 0 45px;
	padding: 0;
	color: var(--afp-news-teal);
	font-size: 38px;
	font-weight: 500;
	line-height: 1.25;
}

.afp-news-single .afp-news-single__date {
	margin: 0 0 20px;
	padding: 0;
	color: var(--afp-news-text);
	font-size: 17px;
}

.afp-news-single__media {
	position: relative;
	clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}

.afp-news-single__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 460px;
	object-fit: cover;
}

.afp-news-single__content {
	padding: 70px 0 100px;
	color: var(--afp-news-text);
	font-size: 17px;
	line-height: 1.8;
}

.afp-news-single__content > *:first-child {
	margin-top: 0;
}

.afp-news-single__content p {
	margin: 0 0 1.3em;
	padding: 0;
}

.afp-news-single__content h2,
.afp-news-single__content h3,
.afp-news-single__content h4 {
	margin: 1.6em 0 0.7em;
	color: var(--afp-news-dark);
	font-weight: 600;
	line-height: 1.3;
}

.afp-news-single__content ul,
.afp-news-single__content ol {
	display: grid;
	gap: 8px;
	margin: 0 0 1.5em 1.3em;
	padding: 0;
}

.afp-news-single__content ul li {
	list-style: disc outside;
}

.afp-news-single__content ol li {
	list-style: decimal outside;
}

.afp-news-single__content a {
	color: var(--afp-news-teal);
	text-decoration: underline;
}

.afp-news-single__content a:hover {
	color: var(--afp-news-dark);
}

.afp-news-single__content img {
	max-width: 100%;
	height: auto;
}

.afp-news-single__content blockquote {
	margin: 1.5em 0;
	padding: 10px 0 10px 25px;
	border-left: 4px solid var(--afp-news-teal);
	font-style: italic;
}

/* ============================================================ responsive */
@media (max-width: 1299px) {
	.afp-news__content {
		padding: 55px;
	}
	.afp-news .afp-news__heading-title {
		font-size: 40px;
	}
}

@media (max-width: 999px) {
	.afp-news__heading {
		padding-left: 0;
		margin-bottom: 45px;
	}
	.afp-news__item {
		grid-template-columns: minmax(0, 1fr);
	}
	.afp-news__item + .afp-news__item {
		margin-top: 30px;
	}
	.afp-news__item:nth-child(even) .afp-news__media {
		order: 0;
	}
	.afp-news__media {
		min-height: 0;
		aspect-ratio: 16 / 9;
	}
	.afp-news__media::after,
	.afp-news__item:nth-child(even) .afp-news__media::after {
		display: none;
	}
	.afp-news__content {
		padding: 40px;
	}
	.afp-news .afp-news__title {
		font-size: 26px;
		margin-bottom: 18px;
	}
	.afp-news .afp-news__excerpt {
		padding: 20px 0;
		font-size: 17px;
	}
	.afp-news-banner .afp-news-banner__title {
		padding-left: 0;
		font-size: 54px;
	}
	.afp-news-single__intro {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 40px;
		padding-top: 50px;
	}
	.afp-news-single__meta {
		padding: 0 24px;
	}
	.afp-news-single__media {
		clip-path: none;
	}
	.afp-news-single .afp-news-single__title {
		font-size: 32px;
		margin-bottom: 25px;
	}
	.afp-news-single__content {
		padding: 45px 0 70px;
	}
}

@media (max-width: 767px) {
	.afp-news .afp-news__heading-title {
		font-size: 32px;
	}
	.afp-news__content {
		padding: 30px 24px 34px;
	}
	.afp-news-banner {
		min-height: 200px;
	}
	.afp-news-banner .afp-news-banner__title {
		font-size: 42px;
	}
	.afp-news-single .afp-news-single__title {
		font-size: 28px;
	}
	.afp-news-single__content {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.afp-news__media img,
	.afp-news__list {
		transition: none;
	}
	.afp-news__item:hover .afp-news__media img {
		transform: none;
	}
}
