/**
 * Surface - specimen frames for the Surface page.
 *
 * The contract itself is not here. It is the Dialog block's stylesheet,
 * products/wordpress/plugins/axismundi-dialogs/blocks/dialog/style.css, copied
 * in by tools/generators/sync_styleguide_assets.py as components/dialog.css and
 * loaded before this file. A second authored copy would drift; see the style
 * guide's AGENTS.md.
 *
 * What stays is what this page needs to show an open surface inside a mock
 * window. A static <dialog open> is not in the top layer, so it has no
 * ::backdrop and cannot be fixed to a frame; the specimen draws the scrim as an
 * element and positions the host inside the frame instead. The overrides name
 * `dialog.` so they outrank the contract's rules for a real <dialog>, and load
 * after them.
 */

.sg-surface-specimens {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
	gap: 1.5rem;
	margin-block: 1rem 2rem;
}

.sg-surface-specimen {
	margin: 0;
}

.sg-surface-specimen--wide {
	grid-column: 1 / -1;
}

.sg-surface-specimen figcaption {
	margin-block-start: 0.5rem;
	font-size: var(--md-sys-typescale-body-small-size);
	line-height: var(--md-sys-typescale-body-small-line-height);
	color: var(--md-sys-color-on-surface-variant);
}

/* A mock window. Its width stands for a breakpoint, so a compact frame is
 * phone-narrow whatever the page's own width. */
.sg-surface-frame {
	position: relative;
	display: flex;
	block-size: 440px;
	overflow: hidden;
	border: 1px solid var(--md-sys-color-outline-variant);
	border-radius: var(--md-sys-shape-corner-value-medium);
	background: var(--md-sys-color-surface-container-lowest, var(--md-sys-color-surface));
}

.sg-surface-frame--compact {
	max-inline-size: 360px;
}

.sg-surface-frame__page {
	flex: 1 1 auto;
	padding: 16px;
	display: grid;
	align-content: start;
	gap: 12px;
}

.sg-surface-frame__page::before,
.sg-surface-frame__page::after {
	content: "";
	display: block;
	block-size: 72px;
	border-radius: var(--md-sys-shape-corner-value-medium);
	background: var(--md-sys-color-surface-container);
}

.sg-surface-frame__scrim {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent);
}

.sg-surface-frame > dialog.wp-block-axismundi-dialog {
	position: absolute;
	inset: 0;
	z-index: auto;
}

/* A standard side sheet is not an overlay: it takes its width from the page,
 * which is the guidelines' "the body area shrinks". */
.sg-surface-frame > dialog.wp-block-axismundi-dialog[data-modality="standard"] {
	position: static;
	flex: 0 0 auto;
	border-inline-start: 1px solid var(--md-sys-color-outline-variant);
}
