/* MAP post body: WYSIWYG output inside .map-prose (Bricks Post Content) and the map-pc-* blocks. Same file loads in the editor. */

:is(.map-prose, .editor-styles-wrapper) {
	--map-flow: 26px;
	font-family: var(--font-body);
	color: var(--map-slate);
}

.map-prose--press {
	--map-flow: 22px;
}

.map-prose--story {
	--map-flow: 24px;
}

.map-prose {
	display: flex;
	flex-direction: column;
	gap: var(--map-flow);
}

.map-prose > * {
	margin-block: 0;
}

/* Legacy content (Stackable images, fixed-width embeds) must not push past the column. */
.map-prose :is(img, video, iframe, figure, [class*="stk-"]) {
	max-width: 100%;
}

.map-prose img {
	height: auto;
}

/* Legacy full/wide blocks pull themselves out to the viewport edges; keep them in the column. */
.map-prose > :is(.alignfull, .alignwide) {
	left: auto;
	right: auto;
	width: auto;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Legacy Stackable blocks set their own offsets inline (!important), e.g. margin-top:-300px. */
.map-prose .stk-block {
	top: auto !important;
	margin-top: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	transform: none !important;
}

/* Legacy posts carry empty paragraphs; in a gapped column each one doubles a gap. */
.map-prose > p:empty {
	display: none;
}

:is(.map-prose, .editor-styles-wrapper) p {
	font-size: var(--text-post);
	line-height: var(--leading-post);
}

:is(.map-prose, .editor-styles-wrapper) :is(strong, b) {
	font-weight: 700;
	color: var(--map-ink);
}

:is(.map-prose, .editor-styles-wrapper) a {
	color: var(--map-teal);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

:is(.map-prose, .editor-styles-wrapper) a:hover {
	color: var(--map-red);
	text-decoration: underline;
}

:is(.map-prose, .editor-styles-wrapper) h2 {
	margin-top: 10px;
	font-family: var(--font-display);
	font-size: var(--text-post-h2);
	font-weight: 700;
	line-height: var(--leading-post-h2);
	letter-spacing: var(--tracking-post-h2);
	color: var(--map-ink);
}

:is(.map-prose, .editor-styles-wrapper) h3 {
	font-family: var(--font-body);
	font-size: var(--text-post-h3);
	font-weight: 600;
	line-height: 1.24;
	letter-spacing: 0;
	color: var(--map-ink);
}

/* Story of Hope opens on a lede: the first paragraph with text. */
.map-prose--story > p:not(:empty) {
	font-size: var(--text-title);
	line-height: 1.66;
	color: var(--map-ink);
}

.map-prose--story > p:not(:empty) ~ p {
	font-size: var(--text-post);
	line-height: 1.72;
	color: inherit;
}

/* The story closes on a thank-you line in ink. */
.map-prose--story > p:last-child {
	color: var(--map-ink);
}

.map-prose--story .map-pc-pullquote {
	margin: 10px 0;
}

.map-prose--story .map-pc-pullquote p {
	font-size: var(--text-title-lg);
	line-height: 1.4;
}

:is(.map-prose, .editor-styles-wrapper) :is(ul, ol):where(:not([class]), .wp-block-list) {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin-left: 0;
	padding: 0;
	list-style: none;
}

:is(.map-prose, .editor-styles-wrapper) :is(ul, ol):where(:not([class]), .wp-block-list) > li {
	position: relative;
	padding-left: 20px;
	font-size: var(--text-body);
	line-height: var(--leading-list);
}

:is(.map-prose, .editor-styles-wrapper) ul:where(:not([class]), .wp-block-list) > li::before {
	content: "·";
	position: absolute;
	left: 0;
	color: var(--map-red);
}

:is(.map-prose, .editor-styles-wrapper) ol:where(:not([class]), .wp-block-list) {
	gap: 13px;
	counter-reset: map-ol;
}

:is(.map-prose, .editor-styles-wrapper) ol:where(:not([class]), .wp-block-list) > li {
	padding-left: 34px;
	counter-increment: map-ol;
}

:is(.map-prose, .editor-styles-wrapper) ol:where(:not([class]), .wp-block-list) > li::before {
	content: counter(map-ol);
	position: absolute;
	top: 1px;
	left: 0;
	border-bottom: 1.5px solid var(--map-red);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--map-teal);
}

/* 04 Numbered guideline rows */
.map-pc-guidelines {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--map-line);
	counter-reset: map-guide;
}

.map-pc-guidelines li {
	display: flex;
	align-items: baseline;
	gap: var(--space-16);
	padding: 18px 0;
	border-bottom: 1px solid var(--map-line);
	counter-increment: map-guide;
}

.map-pc-guidelines li::before {
	content: counter(map-guide, decimal-leading-zero);
	flex: 0 0 26px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--map-red);
}

.map-pc-guidelines p {
	margin: 0;
	font-size: var(--text-body);
	line-height: var(--leading-list);
}

/* 05 Pull quote */
.map-pc-pullquote {
	margin: 16px 0;
	padding: 0 0 0 26px;
	border: 0;
	border-left: 3px solid var(--map-red);
}

.map-pc-pullquote p {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-quote);
	font-weight: 700;
	line-height: var(--leading-quote);
	letter-spacing: var(--tracking-quote);
	color: var(--map-teal);
}

.map-pc-pullquote cite {
	display: block;
	margin-top: var(--space-12);
	font-size: 12.5px;
	font-style: normal;
	font-weight: 500;
	line-height: 1.4;
	color: var(--map-muted);
}

/* 06/07 Callouts */
.map-pc-callout {
	display: flex;
	flex-direction: column;
	gap: var(--space-8);
	padding: 22px 26px;
	border-left: 3px solid var(--map-teal);
	background-color: var(--map-paper);
}

.map-pc-callout--warning {
	border-left-color: var(--map-red);
	background-color: var(--map-red-tint);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-callout p {
	margin: 0;
	font-size: 15.5px;
	line-height: var(--leading-list);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-callout .map-pc-callout__label {
	font-size: var(--text-label);
	font-weight: 600;
	line-height: 1;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--map-teal);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-callout--warning .map-pc-callout__label {
	color: var(--map-red-deep);
}

/* 08 Stat callout */
.map-pc-stats {
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: 1px;
	border: 1px solid var(--map-line);
	background-color: var(--map-line);
}

.map-pc-stats__cell {
	padding: 26px 22px;
	background-color: var(--map-white);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-stats__figure {
	margin: 0 0 10px;
	font-family: var(--font-display);
	font-size: var(--text-h2-sm);
	font-weight: 700;
	line-height: 1;
	letter-spacing: var(--tracking-title);
	color: var(--map-teal);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-stats__caption {
	margin: 0;
	font-size: var(--text-caption);
	line-height: 1.5;
}

/* 09 Inline image */
.map-pc-figure {
	margin: 0;
}

.map-pc-figure img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.map-pc-figure figcaption {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	margin: var(--space-12) 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--map-muted);
}

.map-pc-figure figcaption span:first-child {
	max-width: 62ch;
}

/* Wide breaks out of the 694 measure to the full body column: the grid minus the 170px rail and 48px gap. */
@media (min-width: 861px) {
	.map-prose .map-pc-figure--wide {
		width: calc(100cqw - 21.8rem);
		max-width: none;
	}
}

.map-prose--story .map-pc-figure {
	margin: 10px 0;
}

.map-prose--story .map-pc-figure img {
	aspect-ratio: 3 / 2;
}

/* 10 Comparison */
.map-pc-compare {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--map-line);
	background-color: var(--map-line);
}

.map-pc-compare__col {
	display: flex;
	flex-direction: column;
	gap: var(--space-12);
	padding: 24px 22px;
	background-color: var(--map-white);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-compare__label {
	margin: 0;
	font-size: var(--text-label);
	font-weight: 600;
	line-height: 1;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--map-teal);
}

.map-pc-compare ul {
	display: flex;
	flex-direction: column;
	gap: var(--space-8);
	margin: 0;
	padding: 0;
	list-style: none;
}

.map-pc-compare li {
	position: relative;
	padding-left: 18px;
	font-size: 15px;
	line-height: 1.6;
}

.map-pc-compare li::before {
	content: "·";
	position: absolute;
	left: 0;
	color: var(--map-red);
}

/* 11 Inline CTA */
.map-pc-cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	margin: 10px 0;
	padding: 34px 36px;
	background-color: var(--map-teal);
	color: var(--map-white);
}

.map-pc-cta--red {
	background-color: var(--map-red);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-cta h3 {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--text-cta);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--map-white);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-cta p {
	max-width: 476px;
	margin: 0;
	font-size: var(--text-body);
	line-height: var(--leading-list);
	color: var(--map-mist);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-cta--red p {
	color: var(--map-white);
}

:is(.map-prose, .editor-styles-wrapper) a.map-pc-cta__button {
	padding: 15px 24px;
	background-color: var(--map-red);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: var(--map-white);
	text-decoration: none;
	transition: background-color 0.25s ease;
}

:is(.map-prose, .editor-styles-wrapper) a.map-pc-cta__button:hover {
	background-color: var(--map-red-hover);
	text-decoration: none;
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-cta--red a.map-pc-cta__button {
	background-color: var(--map-white);
	color: var(--map-ink);
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-cta--red a.map-pc-cta__button:hover {
	background-color: var(--map-paper);
}

/* LIB-58 Press quote */
.map-pc-quote {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 8px 0;
	padding: 28px 30px;
	border-left: 3px solid var(--map-teal);
	background-color: var(--map-paper);
}

.map-pc-quote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
}

:is(.map-prose, .editor-styles-wrapper) .map-pc-quote blockquote p {
	margin: 0;
	font-size: var(--text-lead);
	line-height: 1.56;
	color: var(--map-ink);
}

.map-pc-quote blockquote p::before {
	content: open-quote;
}

.map-pc-quote blockquote p::after {
	content: close-quote;
}

.map-pc-quote figcaption {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
}

.map-pc-quote__name {
	font-size: var(--text-caption);
	font-weight: 600;
	line-height: 1.4;
	color: var(--map-teal);
}

.map-pc-quote__title {
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--map-muted);
}

.map-pc-placeholder {
	padding: var(--space-16);
	border: 1px dashed var(--map-outline);
	font-size: 13px;
	color: var(--map-muted);
}

@media (max-width: 560px) {
	.map-pc-stats {
		grid-auto-flow: row;
	}

	.map-pc-compare {
		grid-template-columns: minmax(0, 1fr);
	}
}
