/*
 * MisterGadget-owned public content components.
 *
 * V26 rendered the saved profile/list blocks through an in-house compatibility
 * layer modelled on the then-installed block plugin. V27's saved-block
 * migration replaces those third-party class names with neutral mg-* classes.
 * This stylesheet carries the proven V26 proportions, palette families and
 * responsive behaviour forward under the sole mg-experience presentation
 * owner. It deliberately contains no third-party selectors or unscoped SWELL
 * overrides.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

[data-mg-experience="true"] .mg-content-panel {
	--mgx-panel-accent: #4b5e66;
	--mgx-panel-surface: #fff;
	box-sizing: border-box;
	max-width: 37.5rem;
	margin: 2em auto;
	padding: 0;
	overflow: hidden;
	color: #24292f;
	background: var(--mgx-panel-surface);
	border: 0;
	border-radius: 4px;
	box-shadow: 0 3px 5px rgb(0 0 0 / 7%);
}

/*
 * SWELL keeps WordPress's compatibility wrapper around core/group output.
 * `display: contents` lets the saved children participate in the panel grid
 * without tying the canonical component contract to that wrapper's lifetime.
 */
[data-mg-experience="true"] .mg-content-panel > .wp-block-group__inner-container {
	display: contents;
}

[data-mg-experience="true"] .mg-content-panel--warning {
	--mgx-panel-accent: #825b09;
	--mgx-panel-accent: color-mix(in srgb, var(--pb_colset_yellow, #fdc44f) 66%, #000);
	--mgx-panel-surface: var(--pb_colset_yellow_thin, #fef9ed);
}

[data-mg-experience="true"] .mg-content-panel--note {
	--mgx-panel-accent: #9a4650;
	--mgx-panel-accent: color-mix(in srgb, var(--pb_colset_pink, #fd9392) 66%, #000);
	--mgx-panel-surface: var(--pb_colset_pink_thin, #ffefef);
}

[data-mg-experience="true"] .mg-content-panel--success {
	--mgx-panel-accent: #52751e;
	--mgx-panel-accent: color-mix(in srgb, var(--pb_colset_green, #91c13e) 66%, #000);
	--mgx-panel-surface: var(--pb_colset_green_thin, #f2f8e8);
}

[data-mg-experience="true"] .mg-content-panel--info {
	--mgx-panel-accent: #2f7185;
	--mgx-panel-accent: color-mix(in srgb, var(--pb_colset_blue, #6fc7e1) 66%, #000);
	--mgx-panel-surface: var(--pb_colset_blue_thin, #f0f9fc);
}

[data-mg-experience="true"] :is(
	.mg-content-panel,
	.mg-content-panel > .wp-block-group__inner-container
) > :first-child:is(
	h2,
	h3,
	h4,
	.wp-block-heading,
	.mg-content-panel__title
) {
	margin: 0 !important;
	padding: 1em 2em !important;
	color: #fff !important;
	font-size: 1rem !important;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.05em;
	text-align: center;
	background: var(--mgx-panel-accent) !important;
	border: 0 !important;
	border-radius: 4px 4px 0 0 !important;
	box-shadow: none !important;
}

[data-mg-experience="true"] :is(
	.mg-content-panel,
	.mg-content-panel > .wp-block-group__inner-container
) > :first-child:is(
	h2,
	h3,
	h4,
	.wp-block-heading,
	.mg-content-panel__title
)::before,
[data-mg-experience="true"] :is(
	.mg-content-panel,
	.mg-content-panel > .wp-block-group__inner-container
) > :first-child:is(
	h2,
	h3,
	h4,
	.wp-block-heading,
	.mg-content-panel__title
)::after {
	display: none !important;
	content: none !important;
}

[data-mg-experience="true"] :is(
	.mg-content-panel,
	.mg-content-panel > .wp-block-group__inner-container
) > :not(:first-child) {
	margin-inline: 2em;
}

[data-mg-experience="true"] :is(
	.mg-content-panel,
	.mg-content-panel > .wp-block-group__inner-container
) > :nth-child(2) {
	margin-block-start: 2em;
}

[data-mg-experience="true"] :is(
	.mg-content-panel,
	.mg-content-panel > .wp-block-group__inner-container
) > :last-child {
	margin-block-end: 2em;
}

[data-mg-experience="true"] .mg-content-panel--has-profile {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(5.5rem, 3fr);
	align-items: center;
	column-gap: 1.5rem;
	padding-block-end: 2em;
}

[data-mg-experience="true"] :is(
	.mg-content-panel--has-profile,
	.mg-content-panel--has-profile > .wp-block-group__inner-container
) > :first-child {
	grid-column: 1 / -1;
	margin-inline: 0;
}

[data-mg-experience="true"] :is(
	.mg-content-panel--has-profile,
	.mg-content-panel--has-profile > .wp-block-group__inner-container
) > .mg-list {
	grid-row: 2 / span 2;
	grid-column: 1;
	margin-block: 2em 0 !important;
	margin-inline: 2em 0 !important;
}

[data-mg-experience="true"] :is(
	.mg-content-panel--has-profile,
	.mg-content-panel--has-profile > .wp-block-group__inner-container
) > .mg-content-panel__comment,
[data-mg-experience="true"] :is(
	.mg-content-panel--has-profile,
	.mg-content-panel--has-profile > .wp-block-group__inner-container
) > .mg-content-panel__figure {
	grid-column: 2;
	margin-inline: 0 1.5rem;
}

[data-mg-experience="true"] :is(
	.mg-content-panel--has-profile,
	.mg-content-panel--has-profile > .wp-block-group__inner-container
) > .mg-content-panel__comment {
	grid-row: 2;
	align-self: end;
	margin-block: 2em 0.75rem;
}

[data-mg-experience="true"] :is(
	.mg-content-panel--has-profile,
	.mg-content-panel--has-profile > .wp-block-group__inner-container
) > .mg-content-panel__figure {
	grid-row: 3;
	align-self: start;
}

[data-mg-experience="true"] .mg-content-panel__comment {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: 10px;
	color: #333;
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: center;
	background: #fff;
	border: 1px solid #555;
	border-radius: 10px;
}

[data-mg-experience="true"] .mg-content-panel__comment::before,
[data-mg-experience="true"] .mg-content-panel__comment::after {
	position: absolute;
	top: 100%;
	left: 50%;
	width: 0;
	height: 0;
	border: solid transparent;
	content: "";
	transform: translateX(-50%);
}

[data-mg-experience="true"] .mg-content-panel__comment::before {
	margin-top: 1px;
	border-width: 11px;
	border-top-color: #555;
}

[data-mg-experience="true"] .mg-content-panel__comment::after {
	border-width: 10px;
	border-top-color: #fff;
}

[data-mg-experience="true"] .mg-content-panel__figure {
	max-width: 8.75rem;
	margin-block: 0 !important;
	padding: 0;
	text-align: center;
}

[data-mg-experience="true"] .mg-content-panel__figure img {
	display: block;
	width: 100%;
	height: auto;
	margin-inline: auto;
}

[data-mg-experience="true"] .mg-list {
	box-sizing: border-box;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	list-style: none !important;
	counter-reset: mgx-list;
}

[data-mg-experience="true"] .mg-list > li {
	position: relative;
	box-sizing: border-box;
	margin: 0.7em 0 !important;
	padding: 0 0 0 1.4em !important;
	line-height: 1.5 !important;
	list-style: none !important;
}

[data-mg-experience="true"] .mg-list > li:not(:last-child) {
	padding-block-end: 0.7em !important;
	border-block-end: 1px dashed #cdcdcd;
}

[data-mg-experience="true"] .mg-list > li::before {
	position: absolute !important;
	top: 0.1em !important;
	left: 0 !important;
	display: block !important;
	box-sizing: content-box !important;
	margin: 0 !important;
	padding: 0 !important;
	color: var(--mgx-panel-accent, #52751e);
	font-weight: 700;
	line-height: 1;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
}

[data-mg-experience="true"] .mg-list > li::after {
	content: none !important;
}

[data-mg-experience="true"] .mg-list--check > li::before {
	content: "✓" !important;
}

[data-mg-experience="true"] .mg-list--comment > li::before {
	top: 0.25em !important;
	font-size: 0.6em;
	content: "●" !important;
}

[data-mg-experience="true"] .mg-list--chevron-right > li::before {
	font-size: 1.25em;
	content: "›" !important;
}

[data-mg-experience="true"] .mg-list--dot > li::before {
	top: 0.25em !important;
	font-size: 0.6em;
	content: "●" !important;
}

/* V26 multilingual article notice, now owned by the child presentation CSS. */
[data-mg-experience="true"] .gsm-translation-notice {
	margin-block-start: 2em;
	padding: 1em 1.2em;
	color: #6b7280;
	font-size: 0.8125rem;
	line-height: 1.6;
	background: #f8f9fa;
	border-inline-start: 3px solid #6b7280;
}

@media screen and (max-width: 959px) {
	[data-mg-experience="true"] :is(
		.mg-content-panel,
		.mg-content-panel > .wp-block-group__inner-container
	) > :first-child:is(
		h2,
		h3,
		h4,
		.wp-block-heading,
		.mg-content-panel__title
	) {
		font-size: 0.875rem !important;
	}

	[data-mg-experience="true"] .mg-content-panel--has-profile {
		grid-template-columns: minmax(0, 7fr) minmax(4.5rem, 3fr);
		column-gap: 0.75rem;
		padding-block-end: 1em;
	}

	[data-mg-experience="true"] :is(
		.mg-content-panel,
		.mg-content-panel > .wp-block-group__inner-container
	) > :not(:first-child) {
		margin-inline: 1em;
	}

	[data-mg-experience="true"] :is(
		.mg-content-panel,
		.mg-content-panel > .wp-block-group__inner-container
	) > :nth-child(2) {
		margin-block-start: 1em;
	}

	[data-mg-experience="true"] :is(
		.mg-content-panel,
		.mg-content-panel > .wp-block-group__inner-container
	) > :last-child {
		margin-block-end: 1em;
	}

	[data-mg-experience="true"] :is(
		.mg-content-panel--has-profile,
		.mg-content-panel--has-profile > .wp-block-group__inner-container
	) > .mg-list {
		margin-block-start: 1em !important;
		margin-inline-start: 1em !important;
	}

	[data-mg-experience="true"] :is(
		.mg-content-panel--has-profile,
		.mg-content-panel--has-profile > .wp-block-group__inner-container
	) > .mg-content-panel__comment,
	[data-mg-experience="true"] :is(
		.mg-content-panel--has-profile,
		.mg-content-panel--has-profile > .wp-block-group__inner-container
	) > .mg-content-panel__figure {
		margin-inline-end: 0.75rem;
	}

	[data-mg-experience="true"] :is(
		.mg-content-panel--has-profile,
		.mg-content-panel--has-profile > .wp-block-group__inner-container
	) > .mg-content-panel__comment {
		margin-block-start: 1em;
		font-size: 0.75rem;
	}

	[data-mg-experience="true"] .mg-content-panel__figure {
		max-width: 6.25rem;
	}
}

@media screen and (max-width: 340px) {
	[data-mg-experience="true"] .mg-content-panel--has-profile {
		grid-template-columns: minmax(0, 1fr) 5rem;
	}
}
