/**
 * Solution pages - the four workload pages under the Solutions menu.
 *
 * Built for the BALA sequence agreed with Lars on 11 November 2026
 * (.claude/skills/brand-voice-copy/references/page-formulas.md, "Solution
 * page"): problem cards, one short example, solution cards that mirror the
 * problems one-to-one, a short product block with one link, and one closing
 * band. Enqueued on those four pages only (inc/assets.php), after
 * product-landing.css, whose card, screenshot and FAQ components it extends.
 *
 * New sizes come from the theme.json scale only (visual-identity.md, "Type:
 * three sizes per section").
 */

/* stylelint-disable no-descending-specificity -- each component below is
   self-contained; its descendant selectors never match another component's
   elements, so source order carries no cascade meaning here. */

/* One accent per page, by subject: Microsoft 365 is Foundation blue; the
   SharePoint, Power Platform and Fabric pages take the accessible companion
   of the governance-family green, as their product pages do. */
body.page-microsoft-365-governance {
	--moca-product-accent: var(--wp--preset--color--foundation);
}

body.page-sharepoint-content-governance,
body.page-power-platform-governance,
body.page-microsoft-fabric-governance {
	--moca-product-accent: #247b1a;
}

/* Section intro under an H2: one sentence, never a second heading. */
.moca-solution-intro {
	max-width: var(--wp--custom--width--prose, 820px);
	margin-top: 0.75rem;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.6;
}

/* --- Problem and solution cards ---
   Both are .moca-editorial-cards, so they share its grid, tile and icon.
   The two variants differ in tone only: problems in neutral grey, solutions
   in the page accent. A number in the corner pairs each solution with the
   problem it answers, so the mirror is visible rather than implied. */
.moca-solution-need,
.moca-solution-answer {
	counter-reset: moca-solution;
}

.moca-solution-need > article,
.moca-solution-answer > article {
	counter-increment: moca-solution;
}

.moca-solution-need > article {
	--moca-card-accent: var(--wp--preset--color--gray);
}

/* Five cards in a two-column grid would leave one alone in its row; the
   last card of an odd count takes the full row instead. */
.moca-solution-need > article:last-child:nth-child(odd),
.moca-solution-answer > article:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

.moca-solution-need > article h3,
.moca-solution-answer > article h3 {
	margin: 0 0 0.5rem;
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 700;
	line-height: 1.35;
}

.moca-solution-need > article p,
.moca-solution-answer > article p {
	margin: 0;
	color: var(--wp--preset--color--ink);
	line-height: 1.6;
}

.moca-solution-need > article h3::before,
.moca-solution-answer > article h3::before {
	position: absolute;
	top: 1.75rem;
	right: 1.75rem;
	color: var(--moca-card-accent);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.04em;
	content: counter(moca-solution, decimal-leading-zero);
}

/* Solution cards carry a coloured top edge, so the two grids read as
   "before" and "after" at a glance. Two classes, so it outranks the rule in
   product-landing.css that clears card borders on a tinted band. */
.moca-editorial-cards.moca-solution-answer > article {
	border-top: 3px solid var(--moca-card-accent);
}

/* Icons used here that the shared map in product-landing.css lacks. */
[data-icon="user-x"] {
	--moca-card-icon: url(../icons/user-round-x.svg);
}

[data-icon="sparkles"] {
	--moca-card-icon: url(../icons/sparkles.svg);
}

[data-icon="archive"] {
	--moca-card-icon: url(../icons/archive.svg);
}

[data-icon="bell"] {
	--moca-card-icon: url(../icons/bell.svg);
}

[data-icon="badge"] {
	--moca-card-icon: url(../icons/badge-check.svg);
}

/* --- The example (BALA "acceptance") ---
   One short situation the reader recognizes, set large between the problem
   and the solution. Hard limit two sentences (page-formulas.md). */
.moca-solution-example {
	position: relative;
	max-width: 980px;
	margin: 0;
	padding: 0 0 0 1.75rem;
	border-left: 4px solid var(--moca-product-accent, var(--wp--preset--color--foundation));
}

.moca-solution-example p {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 400;
	line-height: 1.4;
}

@media (max-width: 599px) {

	.moca-solution-example {
		padding-left: 1.1rem;
	}

	.moca-solution-example p {
		overflow-wrap: anywhere;
	}
}

.moca-solution-example figcaption {
	margin-top: 1rem;
	color: var(--wp--preset--color--gray);
	font-size: var(--wp--preset--font-size--sm);
}

/* --- Solution section: cards beside the screen ---
   Above 1100px the screenshot sits to the right of the cards, so the section
   is one screen tall rather than two. */
.moca-solution-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
	margin-top: 2rem;
}

/* One column, then exactly two. An auto-fit grid gave three columns between
   about 980 and 1100px, where the odd-card rule above left card 04 alone
   beside a hole (Power Platform, five cards). */
.moca-solution-split > .moca-editorial-cards {
	grid-template-columns: minmax(0, 1fr);
	margin-top: 0;
}

@media (min-width: 640px) {

	.moca-solution-split > .moca-editorial-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.moca-solution-split > .moca-product-shot {
	margin: 0;
}

@media (min-width: 1100px) {

	.moca-solution-split {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	}

	.moca-solution-split > .moca-product-shot {
		position: sticky;
		top: 6rem;
	}
}

/* "Go deeper" links to the capability pages, as one compact row. */
.moca-solution-deeper {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.moca-solution-deeper li:first-child {
	margin-right: 0.4rem;
	color: var(--wp--preset--color--blue);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.moca-solution-deeper a {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--wp--preset--color--border-strong, #cfd8ee);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 700;
	text-decoration: none;
}

.moca-solution-deeper a:hover,
.moca-solution-deeper a:focus-visible {
	border-color: var(--moca-product-accent, var(--wp--preset--color--foundation));
	color: var(--moca-product-accent, var(--wp--preset--color--foundation));
}

/* --- Product block: monogram, 3-5 selling points, one link --- */
.moca-solution-product {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem 3rem;
	margin-top: 1.5rem;
}

@media (min-width: 900px) {

	.moca-solution-product {
		grid-template-columns: 5.5rem minmax(0, 1fr);
	}
}

.moca-solution-product__mark {
	display: grid;
	width: 5.5rem;
	height: 5.5rem;
	place-items: center;
	border-radius: 18px;
	background: color-mix(in srgb, var(--moca-product-accent, var(--wp--preset--color--foundation)) 10%, #fff);
	color: var(--moca-product-accent, var(--wp--preset--color--foundation));
}

.moca-solution-product__mark svg {
	width: 3rem;
	height: 3rem;
}

/* Two columns for four points, three for five: never a lone orphan. */
.moca-solution-points {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 700px) {

	.moca-solution-points {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {

	.moca-solution-points:has(> li:nth-child(5)) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.moca-solution-points li {
	padding-left: 1rem;
	border-left: 2px solid var(--moca-product-accent, var(--wp--preset--color--foundation));
	color: var(--wp--preset--color--ink);
	line-height: 1.55;
}

.moca-solution-points strong {
	display: block;
	margin-bottom: 0.2rem;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--xl);
}

.moca-solution-product__link {
	margin: 1.75rem 0 0;
	font-weight: 700;
}

/* --- Audience row (Power Platform) --- */
.moca-solution-audience {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 1.25rem;
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.moca-solution-audience li {
	padding: 1.5rem;
	border-radius: var(--wp--custom--radius--md, 10px);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	line-height: 1.6;
}

.moca-solution-audience strong {
	display: block;
	margin-bottom: 0.4rem;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--xl);
}

/* --- Closing band: one proof line and the button --- */
.moca-solution-proof {
	margin: 0;
	padding: 0;
	border: 0;
}

.moca-solution-proof p {
	margin: 0;
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 400;
	line-height: 1.45;
}

.moca-solution-proof cite {
	display: block;
	margin-top: 0.6rem;
	font-size: var(--wp--preset--font-size--sm);
	font-style: normal;
	opacity: 0.9;
}

/* The FAQ's visible H2 matches the section headings around it. */
.moca-product-faq > h2.wp-block-heading {
	margin-top: 0;
}
