/*
 * Imported AEO articles. Everything is scoped to .mpdi-article, the group that wraps each
 * import, so it holds up on themes with a CSS reset (Tailwind preflight strips margins,
 * bullets and heading sizes from bare blocks). Fonts come from the theme; the accent comes
 * from the plugin setting (--mpdi-accent, printed inline by the plugin).
 */

.mpdi-article {
	--mpdi-accent: #3b82f6;
	--mpdi-tint: color-mix(in srgb, var(--mpdi-accent) 7%, transparent);
	--mpdi-line: color-mix(in srgb, var(--mpdi-accent) 18%, transparent);
	--mpdi-muted: #6b7280;
	--mpdi-rule: rgba(128, 128, 128, 0.22);
	font-size: 17px;
	line-height: 1.7;
}

/* Block gap from WordPress layouts would double our margins. */
.mpdi-article > *,
.mpdi-article .wp-block-group > * {
	margin-block-start: 0;
}

/* ---- Text ------------------------------------------------------------ */

.mpdi-article p {
	margin: 0 0 1.2em;
}

.mpdi-article h2 {
	font-size: 1.5em;
	line-height: 1.3;
	font-weight: 700;
	margin: 2em 0 0.6em;
}

.mpdi-article h3 {
	font-size: 1.2em;
	line-height: 1.4;
	font-weight: 700;
	margin: 1.6em 0 0.5em;
}

.mpdi-article h4 {
	font-size: 1.05em;
	font-weight: 700;
	margin: 1.4em 0 0.4em;
}

.mpdi-article a {
	color: var(--mpdi-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.mpdi-article strong {
	font-weight: 700;
}

.mpdi-article em {
	font-style: italic;
}

.mpdi-article ul,
.mpdi-article ol {
	margin: 0 0 1.2em;
	padding-left: 1.5em;
}

.mpdi-article ul {
	list-style: disc;
}

.mpdi-article ol {
	list-style: decimal;
}

.mpdi-article li {
	margin: 0 0 0.45em;
	padding-left: 0.2em;
}

.mpdi-article li::marker {
	color: var(--mpdi-accent);
	font-weight: 700;
}

/* ---- Tables, images, quotes ----------------------------------------- */

.mpdi-article .wp-block-table {
	margin: 1.6em 0;
	overflow-x: auto;
}

.mpdi-article table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
	line-height: 1.55;
}

.mpdi-article th,
.mpdi-article td {
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid var(--mpdi-rule);
	text-align: left;
	vertical-align: top;
}

.mpdi-article th {
	background: var(--mpdi-tint);
	font-weight: 700;
}

.mpdi-article .wp-block-image {
	margin: 1.8em 0;
}

.mpdi-article .wp-block-image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.mpdi-article figcaption,
.mpdi-article .wp-element-caption {
	margin: 8px 0 0;
	font-size: 13px;
	font-style: italic;
	color: var(--mpdi-muted);
	text-align: center;
}

.mpdi-article blockquote,
.mpdi-teaser {
	margin: 1.6em 0;
	padding: 16px 20px;
	border-left: 4px solid var(--mpdi-accent);
	font-size: 1.08em;
	line-height: 1.7;
}

.mpdi-article blockquote > :last-child,
.mpdi-teaser > :last-child {
	margin-bottom: 0;
}

/* ---- Feature boxes -------------------------------------------------- */

.mpdi-box {
	margin: 1.8em 0;
	padding: 24px 28px;
	border: 1px solid var(--mpdi-line);
	border-radius: 12px;
	background: linear-gradient(135deg, var(--mpdi-tint), transparent);
}

.mpdi-box > :last-child,
.mpdi-callout > :last-child,
.mpdi-cta > :last-child {
	margin-bottom: 0;
}

.mpdi-article .mpdi-label {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 700;
	color: var(--mpdi-accent);
}

.mpdi-quick-answer {
	margin-top: 0;
}

.mpdi-callout {
	margin: 1.6em 0 2em;
	padding: 20px 24px;
	border-left: 4px solid var(--mpdi-accent);
	border-radius: 8px;
	background: var(--mpdi-tint);
}

.mpdi-sources {
	border-color: var(--mpdi-rule);
	background: rgba(128, 128, 128, 0.04);
}

.mpdi-sources > h3:first-child,
.mpdi-faq > h2:first-child {
	margin-top: 0;
}

.mpdi-sources ol {
	font-size: 0.92em;
}

/* FAQ: the Yoast FAQ block inside the box. */
.mpdi-faq {
	border-color: var(--mpdi-rule);
	background: rgba(128, 128, 128, 0.05);
}

.mpdi-faq > h2:first-child {
	font-size: 18px;
	color: var(--mpdi-accent);
	margin-bottom: 20px;
}

.mpdi-faq .schema-faq-section {
	padding: 16px 0;
	border-top: 1px solid var(--mpdi-rule);
}

.mpdi-faq .schema-faq-question {
	display: block;
	margin-bottom: 6px;
	font-size: 1.1em;
	font-weight: 700;
	line-height: 1.4;
}

.mpdi-faq .schema-faq-answer {
	margin: 0;
}

/* Call to action */
.mpdi-cta {
	margin: 2em 0;
	padding: 28px 32px;
	text-align: center;
	border: 2px solid var(--mpdi-line);
	border-radius: 12px;
	background: linear-gradient(135deg, var(--mpdi-tint), transparent);
}

.mpdi-cta > h2:first-child {
	margin-top: 0;
}

.mpdi-cta .wp-block-buttons {
	display: flex;
	justify-content: center;
	margin-top: 16px;
}

.mpdi-article .wp-block-button__link {
	display: inline-block;
	padding: 12px 28px;
	border-radius: 7px;
	background: var(--mpdi-accent);
	color: #ffffff;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
}

.mpdi-article .wp-block-button__link:hover {
	filter: brightness(0.92);
}

/* ---- Theme layout: images and tables sit between Raw Content blocks --- */

.mpdi-figure {
	margin: 2rem 0;
}

.mpdi-figure img {
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.mpdi-figure figcaption {
	margin: 8px 0 0;
	font-size: 13px;
	font-style: italic;
	color: #6b7280;
	text-align: center;
}

.mpdi-table {
	margin: 2rem 0;
	overflow-x: auto;
}

.mpdi-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
	line-height: 1.55;
}

.mpdi-table th,
.mpdi-table td {
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
	text-align: left;
	vertical-align: top;
}

.mpdi-table th {
	background: rgba(128, 128, 128, 0.08);
	font-weight: 700;
}

/* ---- "How we checked this" sources box (matches the hand-built Brown Moore box) ---- */

.mpdi-sources-box {
	--mpdi-src-ink: #2b3a55;
	--mpdi-src-line: #b6c3e0;
	--mpdi-src-tint: #f4f6fb;
	box-sizing: border-box;
	max-width: 100%;
	margin: 2rem 0;
	padding: 24px 28px;
	background: var(--mpdi-src-tint);
	border: 1px solid var(--mpdi-src-line);
	border-left: 4px solid var(--mpdi-src-ink);
	border-radius: 12px;
	color: var(--mpdi-src-ink);
	font-size: 1rem;
	line-height: 1.6;
}

.mpdi-sources-box * {
	box-sizing: border-box;
}

.mpdi-sources-box__title {
	margin: 0 0 12px;
	font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--mpdi-src-ink);
}

.mpdi-sources-box__intro {
	margin: 0 0 16px;
}

.mpdi-sources-box__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--mpdi-src-line);
}

.mpdi-sources-box__list li {
	margin: 0;
	padding: 12px 0;
	border-bottom: 1px solid var(--mpdi-src-line);
	font-size: 0.9375rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.mpdi-sources-box__list li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.mpdi-sources-box a {
	color: var(--mpdi-src-ink);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.mpdi-sources-box a:hover,
.mpdi-sources-box a:focus {
	text-decoration-thickness: 2px;
}

@media (max-width: 600px) {
	.mpdi-sources-box {
		padding: 20px 18px;
	}
}

/* ---- Kept AEO markup (quiz, chart, AI buttons) ---------------------- */

.mpdi-article .aeo-mvf p,
.mpdi-article .ai-summary p {
	margin-bottom: 0;
}

.mpdi-article .ai-summary a {
	text-decoration: none;
}

.aeo-mvf-row.is-correct .aeo-mvf-mark {
	color: #15803d !important;
}

.aeo-mvf-row.is-wrong .aeo-mvf-mark {
	color: #b91c1c !important;
}

.aeo-mvf-row.is-correct .aeo-mvf-mark::after {
	content: " You got it.";
	font-weight: 400;
}

.aeo-mvf-row.is-wrong .aeo-mvf-mark::after {
	content: " Not quite.";
	font-weight: 400;
}

@media (max-width: 600px) {
	.mpdi-box,
	.mpdi-cta {
		padding: 20px;
	}
}
