/*
 * Article body (prototype article.html "article-body"). Pattern cmc/article-body: a constrained Group (text 716px) whose
 * sections mirror the prototype's, each a full-width Group named after its BLOCK comment:
 *
 *   paragraphs (text-7)                               50px under a section, 20px between paragraphs
 *   .section-article-image-caption   quote | image   Group grid: 480 | 72 | 709 from 1024px
 *   .section-article-testimonial     Cover + Quote style "Testimonial", 30px from the screen edges (20 < 1024)
 *   .section-article-image-pair      Gallery of two (1082 wide), stacked below 640px
 *   .section-article-video           Cover (still + "Play video" button linked to the file; assets/js/article.js plays
 *                                    it in place), 898 wide
 *   .section-article-slider          Pager (sections/pager.css + pager.js) | text: 709 | 72 | 476 from 1024px
 * Sections carry their 50px as padding (the prototype's section pt-50), so their boxes match the design's.
 */
.wp-block-group.is-style-article-body {
	padding-block: 50px;
	overflow-wrap: break-word;
}

.wp-block-group.is-style-article-body > * {
	margin-block: 0;
}

.wp-block-group.is-style-article-body > * + * {
	margin-block-start: 50px;
}

.wp-block-group.is-style-article-body > :is(p, ul, ol) + :is(p, ul, ol) {
	margin-block-start: 20px;
}

.wp-block-group.is-style-article-body > [class*="section-article-"] {
	margin-block-start: 0;
	padding-top: 50px;
}

.wp-block-group.is-style-article-body > [class*="section-article-"]:first-child {
	padding-top: 0;
}

/* the slider section is the prototype's section py-50: its 50px below is part of its box, not the body's */
.wp-block-group.is-style-article-body > .section-article-slider {
	padding-bottom: 50px;
}

.wp-block-group.is-style-article-body:has(> .section-article-slider:last-child) {
	padding-bottom: 0;
}

.wp-block-group.is-style-article-body :is(ul, ol):where(.wp-block-list) {
	padding-inline-start: 1.5em;
}

/* quote | image */
.is-style-article-body .article-image-caption {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 30px;
	align-items: center;
}

@media (width >= 1024px) {
	.is-style-article-body .article-image-caption {
		grid-template-columns: minmax(0, 480px) minmax(0, 709px);
		column-gap: 72px;
	}
}

.is-style-article-body .article-image-caption .wp-block-quote {
	min-width: 0;
}

.is-style-article-body :is(.article-image-caption, .pager__track) .wp-block-image {
	margin: 0;
}

.is-style-article-body :is(.article-image-caption, .pager__track) .wp-block-image img {
	display: block;
	width: 100%;
	border-radius: var(--wp--custom--radius--card);
}

/* testimonial: photo under charcoal at 55%, the quote centred */
.wp-block-group.is-style-article-body > .section-article-testimonial {
	padding-inline: 20px;
}

@media (width >= 1024px) {
	.wp-block-group.is-style-article-body > .section-article-testimonial {
		padding-inline: 30px;
	}
}

.is-style-article-body .wp-block-cover.article-testimonial {
	min-height: 420px;
	padding: 70px 30px;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--card);
}

@media (width >= 1024px) {
	.is-style-article-body .wp-block-cover.article-testimonial {
		min-height: 630px;
	}
}

.is-style-article-body .article-testimonial > .wp-block-cover__background.has-background-dim {
	opacity: 0.55;
}

.is-style-article-body .article-testimonial > .wp-block-cover__inner-container {
	color: var(--wp--preset--color--white);
}

/* two images, 24px apart (core gallery), stacked below 640px */
.is-style-article-body .article-image-pair.wp-block-gallery.has-nested-images {
	--wp--style--unstable-gallery-gap: 24px;
	gap: 24px;
}

.is-style-article-body .article-image-pair.wp-block-gallery.has-nested-images figure.wp-block-image img {
	width: 100%;
	border-radius: var(--wp--custom--radius--card);
}

@media (width < 640px) {
	.is-style-article-body figure.article-image-pair.wp-block-gallery.has-nested-images > figure.wp-block-image:not(#individual-image) {
		width: 100%;
	}
}

/* video: the still under black at 50% with the Play video button; the player replaces it (assets/js/article.js) */
.is-style-article-body .wp-block-cover.article-video {
	aspect-ratio: 898 / 506;
	min-height: 0;
	padding: 0;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--preset--color--charcoal);
}

.is-style-article-body .article-video > .article-video__player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* image slider | text */
.is-style-article-body .article-slider {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 30px;
	align-items: center;
}

@media (width >= 1024px) {
	.is-style-article-body .article-slider {
		grid-template-columns: minmax(0, 709px) minmax(0, 476px);
		column-gap: 72px;
	}
}

.is-style-article-body .article-slider .is-style-pager {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 15px;
	min-width: 0;
}

.is-style-article-body .article-slider .pager__track {
	grid-column: 1 / -1;
	border-radius: var(--wp--custom--radius--card);
}

.is-style-article-body .article-slider .pager__track > * {
	width: 100%;
}

.is-style-article-body .article-slider .pager__nav {
	flex-wrap: nowrap;
	gap: 15px;
}

/* the slider's own arrows: 44px circles with no outline (the prototype's border-greige draws no border), off-white on
   hover (not the 52px round-arrow buttons). Both arrows look alike at the ends too, as drawn (the prototype wraps round). */
.is-style-article-body .article-slider .pager__nav .wp-block-button .wp-block-button__link {
	box-sizing: border-box;
	display: flex;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--charcoal);
	font-size: 0;
	line-height: 0;
	transition: background-color 300ms var(--wp--custom--ease);
}

.is-style-article-body .article-slider .pager__nav .wp-block-button .wp-block-button__link:is(:hover, :focus-visible) {
	transform: none;
	background-color: var(--wp--preset--color--off-white);
	color: var(--wp--preset--color--charcoal);
}

.is-style-article-body .article-slider .pager__nav .wp-block-button .wp-block-button__link::before {
	display: none;
}

.is-style-article-body .article-slider .pager__nav .wp-block-button .wp-block-button__link::after {
	--cmc-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
	width: 18px;
	height: 18px;
	transform: none;
	transition: none;
}

.is-style-article-body .article-slider .pager__nav .pager__prev .wp-block-button__link::after {
	--cmc-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3C/svg%3E");
}

.is-style-article-body .article-slider .pager__nav .is-disabled {
	opacity: 1;
}

.is-style-article-body .article-slider .pager__count {
	line-height: 1.3;
}

.is-style-article-body .article-slider__text {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-article-body .article-slider .pager__nav .wp-block-button .wp-block-button__link {
		transition: none;
	}
}
