/*
 * Author-controlled Gutenberg surface opt-outs.
 *
 * The App Shell deliberately paints editorial blocks as readable surfaces.
 * Selecting the registered "Transparent · ohne Rahmen" block style is the
 * stable editor-owned exception for one block. Important declarations are
 * intentional here: they override both first-paint surface rules and inline
 * Gutenberg background/border values when the explicit opt-out is selected.
 * Layout, spacing, typography and focus outlines remain untouched.
 */
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-transparent {
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* Native disclosures use the same touch target in every editorial page. */
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-details > summary {
	min-height: 44px;
	padding-block: .65rem;
	cursor: pointer;
}

/* Explicit editor-owned components. These survive Shell normalization and use
 * the very same inset/border/ink tokens as the existing native editorial pages.
 * Important surface/layout declarations intentionally beat automatic cards and
 * Core's column layout, only when this native block style has been selected. */
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-section {
	container-type: inline-size;
	padding: clamp(1.1rem, 2.6vw, 2.25rem) !important;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-card {
	min-width: 0;
	padding: clamp(1rem, 1.6vw, 1.4rem) !important;
	border: 1px solid var(--nxs-neon-content-border, var(--mth-line));
	border-radius: .7rem;
	color: var(--mth-ink);
	background: var(--nxs-neon-content-inset, var(--mth-brand)) !important;
	box-shadow: none !important;
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	overflow-wrap: break-word;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-card > :first-child { margin-block-start: 0; }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-card > :last-child { margin-block-end: 0; }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: 1rem !important;
	margin-block: 1.5rem !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid > .wp-block-column { min-width: 0; margin: 0; }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid > .wp-block-column > .is-style-nxs-card {
	display: flex;
	flex-direction: column;
	gap: .85rem;
	height: 100%;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid .is-style-nxs-card > :where(p, h3) { margin-block: 0; }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid .is-style-nxs-card > .is-style-nxs-callout:last-child { margin-block-start: auto; }
@container (min-width: 38rem) {
	:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
	:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid .is-style-nxs-card > h3 { min-block-size: 2lh; }
}
@container (min-width: 50rem) {
	:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid:has(> .wp-block-column:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@container (min-width: 66rem) {
	:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
	:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .wp-block-columns.is-style-nxs-card-grid:has(> .wp-block-column:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-eyebrow {
	color: var(--mth-ink);
	font-size: .8rem;
	font-weight: 750;
	letter-spacing: .06em;
	line-height: 1.5;
	text-transform: uppercase;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-section figcaption {
	color: var(--mth-muted);
	font-size: .85rem;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-callout {
	border-inline-start: 3px solid var(--mth-accent);
	padding: .55rem 0 .55rem 1rem;
	color: var(--mth-ink);
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-facts {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	padding: 0;
	list-style: none;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-facts > li {
	margin: 0;
	padding: .5rem .8rem;
	border: 1px solid var(--nxs-neon-content-border, var(--mth-line));
	border-radius: .45rem;
	color: var(--mth-ink);
	background: var(--nxs-neon-content-inset, var(--mth-brand));
	font-size: .9rem;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-lined-list { padding-inline-start: 1.25rem; }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-lined-list > li {
	padding: .65rem 0 .65rem .2rem;
	border-block-end: 1px solid var(--nxs-neon-content-border, var(--mth-line));
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .is-style-nxs-lined-list > li::marker { color: var(--mth-accent); }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) details.is-style-nxs-card {
	margin-block: 1rem;
	padding-block: 0 !important;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) details.is-style-nxs-card > summary {
	padding-block: .9rem;
	font-weight: 700;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) details.is-style-nxs-card[open] { padding-block-end: 1rem !important; }
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) details.is-style-nxs-card > summary:focus-visible {
	outline: 2px solid var(--mth-accent);
	outline-offset: 3px;
}
/* APA bibliography is ordinary page content, not a second design system.
 * Half-inch hanging indent and double line spacing also apply in the editor. */
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .nxs-mth-references .nxs-reference {
	max-width: 78ch;
	padding-inline-start: 1.27cm;
	text-indent: -1.27cm;
	line-height: 2;
	text-align: start;
	overflow-wrap: anywhere;
	word-break: normal;
}
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .nxs-mth-references .nxs-reference a {
	text-decoration: underline;
	text-underline-offset: .15em;
}

/* Privacy links share the readable surface foreground in both palettes.
 * Scope to this editorial document; never alter Studio or public navigation. */
:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) .nxs-privacy-policy a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: .18em;
}

@media (forced-colors: active) {
	:is(body.mth-theme, .nxs-shell, .editor-styles-wrapper) :is(.is-style-nxs-card, .is-style-nxs-facts > li) { background: Canvas !important; color: CanvasText; border-color: CanvasText; }
}
