/* Structural block presentation consumes native theme.json variables only. */

.awp-grid {
	display: grid;
	grid-template-columns: repeat(var(--awp-grid-columns, 3), minmax(0, 1fr));
	align-items: stretch;
	min-width: 0;
	gap: var(--awp-grid-gap, var(--wp--preset--spacing--40));
}

.awp-grid--columns-1 { --awp-grid-columns: 1; }
.awp-grid--columns-2 { --awp-grid-columns: 2; }
.awp-grid--columns-3 { --awp-grid-columns: 3; }
.awp-grid--columns-4 { --awp-grid-columns: 4; }
.awp-grid--gap-small { --awp-grid-gap: var(--wp--preset--spacing--30); }
.awp-grid--gap-medium { --awp-grid-gap: var(--wp--preset--spacing--40); }
.awp-grid--gap-large { --awp-grid-gap: var(--wp--preset--spacing--60); }
.wp-block-atomic-wp-grid.awp-grid { display: grid; }
.awp-grid > * { min-width: 0; }
.awp-grid--equal-height > * { align-self: stretch; }
.awp-grid--natural-height { align-items: start; }
.awp-grid--align-top { align-items: start; }
.awp-grid--align-center { align-items: center; }
.awp-grid--align-bottom { align-items: end; }

/* Group corners consume the parent theme's single normal-surface radius. */
.wp-block-group.awp-corners-resolved-rounded {
	border-radius: var(--wp--custom--radius--md);
}
.wp-block-group.awp-corners-resolved-square,
.wp-block-image.awp-corners-square img {
	border-radius: 0;
}
.wp-block-image.awp-corners-rounded img {
	border-radius: var(--wp--custom--radius--md);
}

/* Surface presets remain site-owned CSS, but the shared Group layer stack must
   continue to preserve Atomic's canonical media and shape ordering.

   ============================================================
   CANONICAL VISUAL LAYER LADDER — single source of truth
   ============================================================
   z0  Surface::before (substrate gradient mask) + Background Media explicit layer
   z1  Surface::after  (texture / secondary surface mask)
   z2  Decoration explicit children (SVG splines, ribbons, particles, anchors)
   z3  Real content (interactive blocks, text, CTA)
   z4  Shapes / edge overlays (concave-up/convex-down/wavy SVG shape wrappers)
   z5  Interaction Effect layers (Energy Border, Soft Glow, Recipes)

   The stacking context is established via isolation:isolate on the host group
   wrapper by whichever system activates first (surface, shapes, decorations,
   or interaction effects).
   Child/site CSS (e.g. OCN ::before/::after z0/z1) MUST mirror these exact values.
   Any z-index divergence from this ladder is a contract violation.
   ============================================================ */

.wp-block-group.awp-has-surface > .awp-background-media,
.wp-block-group.awp-has-decoration > .awp-background-media,
.wp-block-group.awp-group-has-shapes > .awp-background-media,
.wp-block-group.awp-has-effect > .awp-background-media {
	z-index: 0;
}

.wp-block-group.awp-has-surface > .awp-dec-layer,
.wp-block-group.awp-has-decoration > .awp-dec-layer,
.wp-block-group.awp-group-has-shapes > .awp-dec-layer,
.wp-block-group.awp-has-effect > .awp-dec-layer {
	z-index: 2;
}

.wp-block-group.awp-has-surface > .awp-group-shape,
.wp-block-group.awp-has-decoration > .awp-group-shape,
.wp-block-group.awp-group-has-shapes > .awp-group-shape,
.wp-block-group.awp-has-effect > .awp-group-shape {
	z-index: 4;
}

.wp-block-group.awp-has-surface > .awp-fx-layer,
.wp-block-group.awp-has-decoration > .awp-fx-layer,
.wp-block-group.awp-group-has-shapes > .awp-fx-layer,
.wp-block-group.awp-has-effect > .awp-fx-layer {
	z-index: 5;
}

/* Edge shapes are trusted inline SVG decoration. They belong to the Group,
   occupy no flow height, and share exactly the Group's rendered width. */
.awp-group-has-shapes {
	position: relative;
	isolation: isolate;
}
.awp-group-shape {
	box-sizing: border-box;
	display: block;
	inset-inline-start: 0;
	inline-size: 100%;
	max-inline-size: none;
	margin: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
	transform-origin: center;
	z-index: 4;
}
.awp-group-shape--top {
	block-size: var(--awp-group-shape-top-height, 100px);
	color: var(--awp-group-shape-top-color, currentColor);
	top: -1px;
}
.awp-group-shape--bottom {
	block-size: var(--awp-group-shape-bottom-height, 100px);
	bottom: -1px;
	color: var(--awp-group-shape-bottom-color, currentColor);
}
/* Gutenberg `is-layout-constrained` caps every direct child that lacks an
   explicit alignment class at the global content size. Atomic decorative
   layers are structural (not content) and must span the full Group width.
   Override matches the Background Media precedent (commit fe7d616); no
   !important — specificity (0,2,0) outranks Core's (0,1,0). */
.awp-group-has-shapes > .awp-group-shape,
.awp-has-decoration > .awp-dec-layer,
.awp-has-effect > .awp-fx-layer,
.awp-has-edge-clip > .awp-edge-clip__surface,
.awp-has-edge-fx > .awp-edge-fx {
	max-width: none;
	max-inline-size: none;
}
.awp-group-shape--flip-horizontal { transform: scaleX(-1); }
.awp-group-has-shapes > :not(.awp-background-media):not(.awp-group-shape):not(.awp-dec-layer):not(.awp-fx-layer):not(.awp-edge-clip__surface):not(.awp-edge-clip-defs):not(.awp-edge-fx),
.awp-has-decoration > :not(.awp-background-media):not(.awp-group-shape):not(.awp-dec-layer):not(.awp-fx-layer):not(.awp-edge-clip__surface):not(.awp-edge-clip-defs):not(.awp-edge-fx),
.awp-has-surface.awp-group-has-shapes.awp-has-decoration > :not(.awp-background-media):not(.awp-group-shape):not(.awp-dec-layer):not(.awp-fx-layer):not(.awp-edge-clip__surface):not(.awp-edge-clip-defs):not(.awp-edge-fx),
.awp-has-effect > :not(.awp-background-media):not(.awp-group-shape):not(.awp-dec-layer):not(.awp-fx-layer):not(.awp-edge-clip__surface):not(.awp-edge-clip-defs):not(.awp-edge-fx) {
	position: relative;
	z-index: 3;
}

/* Reserve the selected edge height in normal flow without changing the
   author's serialized Core padding. The SVG remains absolutely positioned at
   the edge; this anonymous block is structural space only. */
.awp-group-shape-reserves-top::before,
.awp-group-shape-reserves-bottom::after {
	content: "";
	display: block;
	inline-size: 100%;
	block-size: var(--awp-group-shape-top-height, 0px);
	pointer-events: none;
}
.awp-group-shape-reserves-bottom::after {
	block-size: var(--awp-group-shape-bottom-height, 0px);
}

/* SVG Edge Clip V2 — fixed-depth band mask.

   The cut is a fixed-height band strip at the clipped edge: the band shape is
   unioned with a solid strip covering the rest of the box, so the visual depth
   never depends on the section height. The masked layers keep their full-height
   background, so gradients and textures are never fragmented (no seam).
   One canonical depth drives geometry, overlap and spacing compensation. */

.awp-edge-clip-defs {
	display: block;
	inline-size: 0;
	block-size: 0;
	overflow: hidden;
	position: absolute;
	pointer-events: none;
}

.awp-has-edge-clip {
	/* Author contract: --awp-edge-depth is the MAXIMUM REAL cut depth, whatever
	   the shape. The band is sized so the shape's deepest point reaches exactly
	   that depth (band = depth / shape intrusion ratio), so the same number
	   drives the mask geometry, the overlap margin and the compensation. */
	--awp-edge-band: calc(var(--awp-edge-depth, 100px) / max(var(--awp-edge-bite-ratio, 0.5), 0.05));
	--awp-edge-mask-band: min(var(--awp-edge-band), 100%);
	--awp-edge-bite: var(--awp-edge-depth, 100px);
	/* Additive reserve: the author's own padding is never reset or subtracted.
	   The echo extent is covered, not added: `max()` keeps a wide safety margin
	   from double-counting, so enabling a decoration can never inflate the empty
	   strip around a junction nor shift the section contents. */
	--awp-edge-compensation: calc(var(--awp-edge-bite) + max(var(--awp-edge-safety-margin, 0px), var(--awp-edge-fx-extent, 0px)));
	--awp-edge-mask-image: var(--awp-edge-shape-mask), linear-gradient(#000 0 0);
	--awp-edge-mask-size: 100% var(--awp-edge-mask-band), 100% calc(100% - var(--awp-edge-mask-band));
	position: relative;
	/* The clipping section owns and paints the boundary, so it must sit above
	   its neighbour in the same stacking context. Deck ladder z0-z5 inside the
	   group is untouched; this is a page-level value kept below header chrome. */
	z-index: var(--awp-z-overlap, 1);
}
.awp-edge-clip--edge-top { --awp-edge-mask-position: top, bottom; }
.awp-edge-clip--edge-bottom { --awp-edge-mask-position: bottom, top; }

@media (max-width: 1024px) {
	.awp-has-edge-clip {
		--awp-edge-band: calc(var(--awp-edge-depth-tablet, var(--awp-edge-depth, 100px)) / max(var(--awp-edge-bite-ratio, 0.5), 0.05));
		--awp-edge-bite: var(--awp-edge-depth-tablet, var(--awp-edge-depth, 100px));
	}
}
@media (max-width: 782px) {
	.awp-has-edge-clip {
		--awp-edge-band: calc(var(--awp-edge-depth-mobile, var(--awp-edge-depth-tablet, var(--awp-edge-depth, 100px))) / max(var(--awp-edge-bite-ratio, 0.5), 0.05));
		--awp-edge-bite: var(--awp-edge-depth-mobile, var(--awp-edge-depth-tablet, var(--awp-edge-depth, 100px)));
	}
}

/* Surface-only: the shared visual layer group is masked, content is not.
   The host's box already spans the real Section box (alignfull/alignwide/normal
   inside the WordPress root-padding aware layout), so the mask follows the
   outer box without 100vw and without horizontal overflow. */
.awp-has-edge-clip.awp-edge-clip--scope-surface-only > .awp-edge-clip__surface,
.awp-has-edge-clip.awp-edge-clip--scope-surface-only.awp-has-surface::before,
.awp-has-edge-clip.awp-edge-clip--scope-surface-only.awp-has-surface::after,
.awp-has-edge-clip.awp-edge-clip--scope-surface-only > .awp-background-media,
.awp-has-edge-clip.awp-edge-clip--scope-surface-only > .awp-dec-layer--material {
	-webkit-mask-image: var(--awp-edge-mask-image);
	mask-image: var(--awp-edge-mask-image);
	-webkit-mask-size: var(--awp-edge-mask-size);
	mask-size: var(--awp-edge-mask-size);
	-webkit-mask-position: var(--awp-edge-mask-position);
	mask-position: var(--awp-edge-mask-position);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-composite: source-over;
	mask-composite: add;
}

/* The dedicated surface layer carries the section background for Gutenberg
   backgrounds and is the clipped substrate in surface-only mode. */
.awp-has-edge-clip.awp-edge-clip--scope-surface-only > .awp-edge-clip__surface {
	background: var(--awp-edge-surface-bg, var(--awp-surface-background, transparent));
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}
.awp-has-edge-clip.awp-edge-clip--scope-surface-only > :not(.awp-edge-clip-defs):not(.awp-edge-clip__surface):not(.awp-edge-clip__reserve):not(.awp-background-media):not(.awp-group-shape):not(.awp-dec-layer):not(.awp-fx-layer):not(.awp-edge-fx) {
	position: relative;
	z-index: 1;
}

/* Demo-only readability scrim: when a section opts in with
   .awp-demo-f-overlay, a dark gradient is painted above the surface
   background but below content. Follows the band because it lives on the
   clipped surface layer. */
.awp-has-edge-clip.awp-demo-f-overlay > .awp-edge-clip__surface::after {
	background: linear-gradient(135deg, rgba(20, 0, 30, 0.72), rgba(20, 0, 30, 0.42));
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
}

/* Full clip (opt-in): mask the whole group including content. */
.awp-has-edge-clip.awp-edge-clip--scope-full {
	-webkit-mask-image: var(--awp-edge-mask-image);
	mask-image: var(--awp-edge-mask-image);
	-webkit-mask-size: var(--awp-edge-mask-size);
	mask-size: var(--awp-edge-mask-size);
	-webkit-mask-position: var(--awp-edge-mask-position);
	mask-position: var(--awp-edge-mask-position);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-composite: source-over;
	mask-composite: add;
}

/* Overlap: the clipping section is the boundary owner, so it always absorbs
   the negative margin toward its neighbour (edge-top pulls up into the section
   above, edge-bottom pulls down into the section below). Applying the offset to
   the neighbour instead is geometrically identical for adjacent Groups, which is
   why overlap-self and overlap-neighbor now share one deterministic rule. */
.awp-has-edge-clip.awp-edge-clip--edge-top {
	margin-block-start: calc(-1 * var(--awp-edge-bite));
}
.awp-has-edge-clip.awp-edge-clip--edge-bottom {
	margin-block-end: calc(-1 * var(--awp-edge-bite));
}

/* Detectable mask failure: a linear surface, never an invisible section.
   Neutralise the overlap and both reserves together, including adjacent Groups. */
.awp-edge-linear-fallback .awp-has-edge-clip,
.awp-edge-linear-fallback .awp-has-edge-reserve-top,
.awp-edge-linear-fallback .awp-has-edge-reserve-bottom {
        --awp-edge-bite: 0px !important;
        --awp-edge-compensation: 0px !important;
        --awp-edge-reserve-top-current: 0px !important;
        --awp-edge-reserve-bottom-current: 0px !important;
        --awp-edge-mask-image: none !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
}
.awp-edge-linear-fallback .awp-has-edge-clip > .awp-edge-fx { display: none; }
@supports not ((mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000))) {
        .awp-has-edge-clip,
        .awp-has-edge-reserve-top,
        .awp-has-edge-reserve-bottom {
                --awp-edge-bite: 0px !important;
                --awp-edge-compensation: 0px !important;
                --awp-edge-reserve-top-current: 0px !important;
                --awp-edge-reserve-bottom-current: 0px !important;
                --awp-edge-mask-image: none !important;
                -webkit-mask-image: none !important;
                mask-image: none !important;
        }
        .awp-has-edge-clip > .awp-edge-fx { display: none; }
}

/* Padding compensation and junction reserve are in-flow reserve elements
   rendered by the filter: they add the separation reserve without rewriting the
   author's padding and without targeting a technical layer (background media,
   materials, shapes). */
.awp-edge-clip__reserve,
.awp-edge-reserve {
	inline-size: 100%;
	max-inline-size: none;
	pointer-events: none;
}
.awp-edge-clip__reserve {
	block-size: var(--awp-edge-compensation, 0px);
}
/* Neighbour of a clipped section: the clipped section is the front (occluding)
   one, so the neighbour is hidden behind it inside the overlap band and needs
   the same reserve on the facing side. */
.awp-edge-reserve--top { block-size: var(--awp-edge-reserve-top-current, 0px); }
.awp-edge-reserve--bottom { block-size: var(--awp-edge-reserve-bottom-current, 0px); }
.awp-has-edge-reserve-top { --awp-edge-reserve-top-current: var(--awp-edge-reserve-top, 0px); }
.awp-has-edge-reserve-bottom { --awp-edge-reserve-bottom-current: var(--awp-edge-reserve-bottom, 0px); }
@media (max-width: 1024px) {
	.awp-has-edge-reserve-top { --awp-edge-reserve-top-current: var(--awp-edge-reserve-top-tablet, var(--awp-edge-reserve-top, 0px)); }
	.awp-has-edge-reserve-bottom { --awp-edge-reserve-bottom-current: var(--awp-edge-reserve-bottom-tablet, var(--awp-edge-reserve-bottom, 0px)); }
}
@media (max-width: 782px) {
	.awp-has-edge-reserve-top { --awp-edge-reserve-top-current: var(--awp-edge-reserve-top-mobile, var(--awp-edge-reserve-top-tablet, var(--awp-edge-reserve-top, 0px))); }
	.awp-has-edge-reserve-bottom { --awp-edge-reserve-bottom-current: var(--awp-edge-reserve-bottom-mobile, var(--awp-edge-reserve-bottom-tablet, var(--awp-edge-reserve-bottom, 0px))); }
}

/* Editor preview — aligned with the frontend.
   Full scope masks the whole block wrapper exactly like the frontend.
   Surface-only paints the cut on a background layer only, so editable content
   is never masked (the frontend keeps content unclipped too). */
.block-editor-block-list__block.awp-has-edge-clip.awp-edge-clip--scope-full {
	-webkit-mask-image: var(--awp-edge-mask-image);
	mask-image: var(--awp-edge-mask-image);
	-webkit-mask-size: var(--awp-edge-mask-size);
	mask-size: var(--awp-edge-mask-size);
	-webkit-mask-position: var(--awp-edge-mask-position);
	mask-position: var(--awp-edge-mask-position);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-composite: source-over;
	mask-composite: add;
}
.block-editor-block-list__block.awp-has-edge-clip.awp-edge-clip--scope-surface-only {
	background-color: transparent !important;
	background-image: none !important;
}
.block-editor-block-list__block.awp-has-edge-clip.awp-edge-clip--scope-surface-only::before {
	background: var(--awp-edge-editor-bg, var(--awp-surface-background, transparent));
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 0;
	-webkit-mask-image: var(--awp-edge-mask-image);
	mask-image: var(--awp-edge-mask-image);
	-webkit-mask-size: var(--awp-edge-mask-size);
	mask-size: var(--awp-edge-mask-size);
	-webkit-mask-position: var(--awp-edge-mask-position);
	mask-position: var(--awp-edge-mask-position);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-composite: source-over;
	mask-composite: add;
}
.block-editor-block-list__block.awp-has-edge-clip.awp-edge-clip--scope-surface-only > .block-editor-inner-blocks {
	position: relative;
	z-index: 1;
}
/* The editor canvas cannot contain the frontend reserve element, so the same
   compensation shifts the inner blocks instead. */
.block-editor-block-list__block.awp-has-edge-clip.awp-edge-clip--edge-top > .block-editor-inner-blocks {
	margin-block-start: var(--awp-edge-compensation, 0px);
}
.block-editor-block-list__block.awp-has-edge-clip.awp-edge-clip--edge-bottom > .block-editor-inner-blocks {
	margin-block-end: var(--awp-edge-compensation, 0px);
}

/* SVG Edge FX (ADR-048) — decorative echoes and vector liner on a clipped edge.

   The whole layer is server-rendered at rest: a visitor without JavaScript, or
   with reduced motion, sees exactly the geometry the runtime animates. Nothing
   here draws content — every node is aria-hidden, pointer-transparent and sits
   under the editable content, never over a heading, paragraph or control. */

/* The layer owns its own geometry. The selector is deliberately a two-class
   descendant: themes and modules that enumerate technical layers with
   `:where(...)` (zero specificity) can then never turn the layer back into a
   flow element, which would push the section content down by the band height
   and detach the decoration from the cut. */
.awp-has-edge-clip > .awp-edge-fx,
.awp-has-edge-fx > .awp-edge-fx {
	block-size: var(--awp-edge-mask-band);
	/* The liner is an accent on the boundary, never a foreground element. */
	color: var(--awp-edge-fx-ink, currentColor);
	inline-size: 100%;
	inset-inline: 0;
	overflow: visible;
	pointer-events: none;
	position: absolute;
	z-index: 2;
}
.awp-edge-fx--top { top: 0; }
.awp-edge-fx--bottom { bottom: 0; }
.awp-edge-fx__svg {
	block-size: 100%;
	display: block;
	inline-size: 100%;
	overflow: visible;
}
.awp-edge-fx__frame { fill: none; }
/* Non-scaling strokes keep the liner weight literal in px: the band is stretched
   non-uniformly, so a scaled stroke would thicken differently per shape. */
.awp-edge-fx__line,
.awp-edge-fx__echo {
	fill: none;
	stroke: var(--awp-edge-fx-line-paint, var(--awp-edge-fx-line-color, currentColor));
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}
.awp-edge-fx__line { stroke-width: var(--awp-edge-fx-weight, 2px); }
.awp-edge-fx__echo {
	opacity: var(--awp-edge-fx-echo-opacity, 0.18);
	stroke-width: calc(var(--awp-edge-fx-weight, 2px) * 0.8);
}
/* Live cut.

   The animated boundary is NOT a second cutting mechanism: the runtime rewrites
   `--awp-edge-shape-mask`, the exact variable the Edge Clipping band mask above
   already consumes. Mask, liner and echoes are therefore three representations
   of one canonical geometry, updated on the same frame. A CSS `clip-path`
   referencing an SVG `clipPath` was tried and removed: on an HTML element the
   user space of the referencing SVG does not match the element's pixel box, so
   a pixel path was read in viewBox units and produced giant crossing diagonals. */

/* Editor canvas: the FX layer is render-filter output, so the same artwork is
   painted as a background from the same registry path and the same variables. */
.block-editor-block-list__block.awp-has-edge-fx:not(.awp-group-shape-reserves-bottom)::after {
	background-image: var(--awp-edge-fx-editor-art);
	background-position: var(--awp-edge-fx-editor-position, top);
	background-repeat: no-repeat;
	background-size: 100% var(--awp-edge-mask-band);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}

/* The editor block wrapper cannot contain render-filter markup. It paints a
   mask generated from the same localized registry path used by frontend SVG. */
.block-editor-block-list__block.awp-group-has-shapes::before,
.block-editor-block-list__block.awp-group-has-shapes::after {
	background: var(--awp-group-shape-preview-color, currentColor);
	box-sizing: border-box;
	content: "";
	display: none;
	inset-inline-start: 0;
	inline-size: 100%;
	max-inline-size: none;
	margin: 0;
	pointer-events: none;
	position: absolute;
	-webkit-mask-image: var(--awp-group-shape-preview-mask);
	mask-image: var(--awp-group-shape-preview-mask);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	transform-origin: center;
	z-index: 4;
}
.block-editor-block-list__block.awp-group-shape-preview--top::before {
	--awp-group-shape-preview-color: var(--awp-group-shape-top-color, currentColor);
	--awp-group-shape-preview-mask: var(--awp-group-shape-top-mask);
	block-size: var(--awp-group-shape-top-height, 100px);
	display: block;
	top: -1px;
	transform: scale(var(--awp-group-shape-top-flip-x, 1), -1);
}
.block-editor-block-list__block.awp-group-shape-preview--bottom::after {
	--awp-group-shape-preview-color: var(--awp-group-shape-bottom-color, currentColor);
	--awp-group-shape-preview-mask: var(--awp-group-shape-bottom-mask);
	block-size: var(--awp-group-shape-bottom-height, 100px);
	bottom: -1px;
	display: block;
	transform: scale(var(--awp-group-shape-bottom-flip-x, 1), 1);
}

/* BlockListBlock cannot add a second pseudo-element for flow reservation, so
   the editor moves the native inner-blocks wrapper by the same canonical
   edge height while preserving Core padding attributes. */
.block-editor-block-list__block.awp-group-shape-reserves-top > .block-editor-inner-blocks {
	margin-block-start: var(--awp-group-shape-top-height, 0px);
}
.block-editor-block-list__block.awp-group-shape-reserves-bottom > .block-editor-inner-blocks {
	margin-block-end: var(--awp-group-shape-bottom-height, 0px);
}

.awp-shape-picker {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-block-end: 16px;
}
.awp-shape-picker__choice {
	display: grid;
	gap: 4px;
	height: auto;
	justify-items: stretch;
	padding: 6px;
}
.awp-shape-picker__choice svg {
	display: block;
	inline-size: 100%;
	block-size: 32px;
}
.awp-shape-picker__label { font-size: 11px; text-align: center; }

.awp-section--inner-width-content > .wp-block-group__inner-container,
.awp-section--inner-width-content > * { max-width: var(--wp--style--global--content-size); margin-inline: auto; }
.awp-section--inner-width-wide > .wp-block-group__inner-container,
.awp-section--inner-width-wide > * { max-width: var(--wp--style--global--wide-size); margin-inline: auto; }
.awp-section--inner-width-full > .wp-block-group__inner-container,
.awp-section--inner-width-full > * { width: auto; max-width: none; margin-inline: 0; }
.awp-section--width-full,
.awp-section.alignfull { max-width: none; }
.awp-section.awp-has-background-media > .awp-background-media { width: auto; max-width: none; margin-inline: 0; }
.awp-section--spacing-none { padding-block: 0; }
.awp-section--spacing-small { padding-block: var(--wp--preset--spacing--40); }
.awp-section--spacing-medium { padding-block: var(--wp--preset--spacing--60); }
.awp-section--spacing-large { padding-block: var(--wp--preset--spacing--80); }

/* Semantic Group roles are global defaults layered beneath native local block
   styles. Hero min-height is intentionally a minimum; content may expand it. */
.wp-block-group.awp-group-role-section {
	padding-block: var(--awp-group-role-section-spacing, var(--wp--preset--spacing--60));
}
.wp-block-group.awp-group-role-hero {
	min-height: var(--awp-group-role-hero-min-height, min(60svh, 40rem));
	display: flex;
	flex-direction: column;
	justify-content: var(--awp-group-role-hero-justify-content, center);
	padding-block: var(--awp-group-role-hero-padding, var(--wp--preset--spacing--80));
}
.wp-block-group.awp-group-role-hero--top { justify-content: flex-start; }
.wp-block-group.awp-group-role-hero--center { justify-content: center; }
.wp-block-group.awp-group-role-hero--bottom { justify-content: flex-end; }

/* Semantic foreground contexts affect ordinary inherited content only. Core
   local colors and Button styles remain authoritative on their own elements.
   Headings/paragraphs/lists/quotes/captions that have an explicit Gutenberg
   text color (.has-text-color) explicitly opt out of the contextual default,
   so an editorially-set H2 color inside a Dark container still wins. */
.wp-block-group.awp-content-color-light,
.wp-block-group.awp-content-color-dark { color: var(--awp-content-color); }

.wp-block-group.awp-content-color-light
  :where(h1,h2,h3,h4,h5,h6,.wp-block-heading,p,li,blockquote,figcaption):not(.has-text-color),
.wp-block-group.awp-content-color-dark
  :where(h1,h2,h3,h4,h5,h6,.wp-block-heading,p,li,blockquote,figcaption):not(.has-text-color) {
    color: var(--awp-content-color);
}

.wp-block-group.awp-content-color-light a:not(.wp-element-button):not(.wp-block-button__link),
.wp-block-group.awp-content-color-dark a:not(.wp-element-button):not(.wp-block-button__link) { color: var(--awp-content-link-color); }

@media (max-width: 782px) {
	.awp-grid--columns-3,
	.awp-grid--columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Gutenberg adds two editor-only wrappers around InnerBlocks. The block-list
   wrapper directly owns the children, so it receives the same grid contract
   while the outer block remains a normal editor selection surface. */
.block-editor .wp-block-atomic-wp-grid.awp-grid { display: block; }
.block-editor .wp-block-atomic-wp-grid.awp-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: grid;
	grid-template-columns: repeat(var(--awp-grid-columns, 3), minmax(0, 1fr));
	gap: var(--awp-grid-gap, var(--wp--preset--spacing--40));
	align-items: stretch;
	min-width: 0;
}
.block-editor .wp-block-atomic-wp-grid.awp-grid > .block-editor-inner-blocks > .block-editor-block-list__layout > * { min-width: 0; }
.block-editor .awp-grid--equal-height > .block-editor-inner-blocks > .block-editor-block-list__layout > * { align-self: stretch; }
.block-editor .awp-grid--natural-height > .block-editor-inner-blocks > .block-editor-block-list__layout,
.block-editor .awp-grid--align-top > .block-editor-inner-blocks > .block-editor-block-list__layout { align-items: start; }
.block-editor .awp-grid--align-center > .block-editor-inner-blocks > .block-editor-block-list__layout { align-items: center; }
.block-editor .awp-grid--align-bottom > .block-editor-inner-blocks > .block-editor-block-list__layout { align-items: end; }

@media (max-width: 782px) {
	.block-editor .awp-grid--columns-3 > .block-editor-inner-blocks > .block-editor-block-list__layout,
	.block-editor .awp-grid--columns-4 > .block-editor-inner-blocks > .block-editor-block-list__layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
	.block-editor .awp-grid--columns-2 > .block-editor-inner-blocks > .block-editor-block-list__layout,
	.block-editor .awp-grid--columns-3 > .block-editor-inner-blocks > .block-editor-block-list__layout,
	.block-editor .awp-grid--columns-4 > .block-editor-inner-blocks > .block-editor-block-list__layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
	.awp-grid--columns-2,
	.awp-grid--columns-3,
	.awp-grid--columns-4 { grid-template-columns: 1fr; }
}

/* Atomic Separator V1 is an explicit full-aligned transition layer. Its
   fill is a semantic source selected by the block; theme variables provide
   the actual presentation values. */
.awp-separator {
	box-sizing: border-box;
	position: relative;
	z-index: 2;
	display: block;
	width: 100%;
	max-width: none;
	height: var(--awp-separator-height, var(--wp--preset--spacing--60));
	margin-block: calc(var(--awp-separator-height, var(--wp--preset--spacing--60)) / -2);
	overflow: hidden;
	pointer-events: none;
}
.awp-separator--height-small { --awp-separator-height: var(--wp--preset--spacing--50); }
.awp-separator--height-medium { --awp-separator-height: var(--wp--preset--spacing--70); }
.awp-separator--height-large { --awp-separator-height: var(--wp--preset--spacing--90); }
.awp-separator__shape {
	position: absolute;
	inset: 0;
	display: block;
	background-color: var(--awp-separator-fill-color, var(--wp--preset--color--background));
	clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
}
.awp-separator--fill-upper { --awp-separator-fill-color: var(--awp-separator-upper-color, var(--wp--preset--color--surface)); }
.awp-separator--fill-lower { --awp-separator-fill-color: var(--awp-separator-lower-color, var(--wp--preset--color--background)); }
.awp-separator--fill-custom { --awp-separator-fill-color: var(--awp-separator-custom-color, var(--wp--preset--color--background)); }
.awp-separator--shape-none { height: 0; margin-block: 0; }
.awp-separator--shape-none .awp-separator__shape { display: none; }
.awp-separator--shape-curve .awp-separator__shape { clip-path: ellipse(75% 100% at 50% 100%); }
.awp-separator--shape-wave .awp-separator__shape { clip-path: polygon(0 35%, 12% 15%, 25% 35%, 38% 15%, 50% 35%, 62% 15%, 75% 35%, 88% 15%, 100% 35%, 100% 100%, 0 100%); }
.awp-separator--shape-diagonal .awp-separator__shape { clip-path: polygon(0 0, 100% 45%, 100% 100%, 0 100%); }
.awp-separator--shape-arc .awp-separator__shape { clip-path: ellipse(85% 100% at 50% 100%); }
.awp-separator--shape-organic .awp-separator__shape { clip-path: polygon(0 25%, 15% 40%, 31% 18%, 47% 36%, 64% 12%, 82% 32%, 100% 20%, 100% 100%, 0 100%); }
.awp-separator--flip-horizontal .awp-separator__shape { transform: scaleX(-1); }

/* Atomic Rail V1 structural grammar. Presentation values are inherited from
   theme-owned --awp-rail-* variables so all consumers share one visual system. */
.awp-rail { position: relative; min-width: 0; }
.awp-rail__track {
	position: absolute;
	display: block;
	background: var(--awp-rail-track-color, currentColor);
	z-index: 0;
}
.awp-rail--vertical > .awp-rail__track {
	top: calc(var(--awp-rail-marker-size, 0.75rem) / 2);
	bottom: calc(var(--awp-rail-marker-size, 0.75rem) / 2);
	left: 50%;
	width: var(--awp-rail-track-width, 2px);
	transform: translateX(-50%);
}
.awp-rail--horizontal > .awp-rail__track {
	top: 50%;
	right: calc(var(--awp-rail-marker-size, 0.75rem) / 2);
	left: calc(var(--awp-rail-marker-size, 0.75rem) / 2);
	height: var(--awp-rail-track-width, 2px);
	transform: translateY(-50%);
}
.awp-rail__marker {
	box-sizing: border-box;
	display: block;
	width: var(--awp-rail-marker-size, 0.75rem);
	height: var(--awp-rail-marker-size, 0.75rem);
	border: var(--awp-rail-track-width, 2px) solid var(--awp-rail-marker-color, currentColor);
	border-radius: 50%;
	background: var(--awp-rail-marker-color, currentColor);
	z-index: 1;
	justify-self: center;
	transform: scale(1);
	transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.awp-rail__marker--active,
.awp-timeline-item--active .awp-rail__marker {
	border-color: var(--awp-rail-marker-active-color, currentColor);
	background: var(--awp-rail-marker-active-color, currentColor);
	transform: scale(var(--awp-rail-active-scale, 1.15));
}
.awp-rail__label,
.awp-rail a,
.awp-rail button { color: var(--awp-rail-label-color, inherit); }
.awp-rail a:focus-visible,
.awp-rail button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Timeline V1 keeps the rail centered on desktop and becomes a single
   predictable marker/content flow on narrow screens. */
.awp-timeline { min-width: 0; }
.awp-timeline__items {
	position: relative;
	display: grid;
	gap: var(--awp-rail-gap, var(--wp--preset--spacing--60));
	margin: 0;
	padding: 0;
	list-style: none;
}
.awp-timeline-item {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--awp-rail-marker-size, 0.75rem) minmax(0, 1fr);
	column-gap: var(--awp-rail-gap, var(--wp--preset--spacing--40));
	align-items: start;
	min-width: 0;
}
.awp-timeline-item > .awp-rail__marker { grid-column: 2; grid-row: 1; margin-top: 0.35rem; }
.awp-timeline-item__media { grid-column: 1; grid-row: 1; min-width: 0; margin: 0; }
.awp-timeline-item__media-image { display: block; width: 100%; height: auto; }
.awp-timeline-item__body { grid-column: 3; grid-row: 1; min-width: 0; color: var(--awp-rail-label-color, inherit); }
.awp-timeline--alternating .awp-timeline-item > .awp-timeline-item__body {
	grid-column: 1 / 4;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--awp-rail-marker-size, 0.75rem) minmax(0, 1fr);
	column-gap: var(--awp-rail-gap, var(--wp--preset--spacing--40));
}
.awp-timeline--alternating .awp-timeline-item__body > .awp-timeline-item__date,
.awp-timeline--alternating .awp-timeline-item__body > .awp-timeline-item__accent-rule,
.awp-timeline--alternating .awp-timeline-item__body > .awp-timeline-item__heading,
.awp-timeline--alternating .awp-timeline-item__content > :not(.awp-timeline-item__media) { grid-column: 3; }
.awp-timeline--alternating .awp-timeline-item__content { display: contents; }
.awp-timeline--alternating .awp-timeline-item__content > .wp-block-image.awp-timeline-item__media { grid-column: 1; grid-row: 1 / span 3; align-self: stretch; }
.awp-timeline--alternating .awp-timeline-item__content > .wp-block-image.awp-timeline-item__media img { width: 100%; height: 100%; object-fit: cover; }
.awp-timeline--alternating .awp-timeline-item:nth-child(even) > .awp-timeline-item__media { grid-column: 3; }
.awp-timeline--alternating .awp-timeline-item:nth-child(even) > .awp-timeline-item__body { grid-column: 1 / 4; }
.awp-timeline--alternating .awp-timeline-item:nth-child(even) .awp-timeline-item__body > .awp-timeline-item__date,
.awp-timeline--alternating .awp-timeline-item:nth-child(even) .awp-timeline-item__body > .awp-timeline-item__accent-rule,
.awp-timeline--alternating .awp-timeline-item:nth-child(even) .awp-timeline-item__body > .awp-timeline-item__heading,
.awp-timeline--alternating .awp-timeline-item:nth-child(even) .awp-timeline-item__content > :not(.awp-timeline-item__media) { grid-column: 1; }
.awp-timeline--alternating .awp-timeline-item:nth-child(even) .awp-timeline-item__content > .wp-block-image.awp-timeline-item__media { grid-column: 3; }
.awp-timeline--left .awp-timeline-item > .awp-timeline-item__body,
.awp-timeline--right .awp-timeline-item > .awp-timeline-item__body { grid-row: 1; }
.awp-timeline--left .awp-timeline-item > .awp-timeline-item__media,
.awp-timeline--right .awp-timeline-item > .awp-timeline-item__media { grid-row: 2; }
.awp-timeline--right .awp-timeline-item > .awp-timeline-item__body { grid-column: 3; }
.awp-timeline--single-column .awp-timeline-item {
	grid-template-columns: var(--awp-rail-marker-size, 0.75rem) minmax(0, 1fr);
	grid-template-rows: auto auto;
}
.awp-timeline--single-column .awp-rail--vertical > .awp-rail__track { left: calc(var(--awp-rail-marker-size, 0.75rem) / 2); }
.awp-timeline--single-column .awp-timeline-item > .awp-rail__marker { grid-column: 1; grid-row: 1 / span 2; }
.awp-timeline--single-column .awp-timeline-item > .awp-timeline-item__body,
.awp-timeline--single-column .awp-timeline-item > .awp-timeline-item__media { grid-column: 2; }
.awp-timeline--single-column .awp-timeline-item > .awp-timeline-item__body { grid-row: 1; }
.awp-timeline--single-column .awp-timeline-item > .awp-timeline-item__media { grid-row: 2; }
.awp-timeline-item__date,
.awp-timeline-item__heading { margin-block-start: 0; }
.awp-timeline-item__date {
	margin-block-end: var(--wp--preset--spacing--20);
	color: var(--awp-rail-label-color, currentColor);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}
.awp-timeline-item--date-prominent .awp-timeline-item__date {
	font-family: var(--wp--preset--font-family--display-font, inherit);
	font-size: var(--wp--preset--font-size--x-large, 2.25rem);
	line-height: 1.1;
}
.awp-timeline-item__accent-rule {
	display: block;
	inline-size: var(--wp--preset--spacing--50, 2rem);
	block-size: var(--awp-rail-track-width, 2px);
	margin-block-end: var(--wp--preset--spacing--20);
	background: var(--awp-rail-marker-active-color, currentColor);
}
.awp-timeline-item__heading { margin-block-end: var(--wp--preset--spacing--20); }
.awp-timeline-item__content > :first-child { margin-block-start: 0; }
.awp-timeline-item__content > :last-child { margin-block-end: 0; }

.awp-timeline-item--text-date-aside > .awp-timeline-item__body {
	display: grid;
	grid-template-columns: minmax(0, 0.35fr) var(--wp--preset--spacing--40) minmax(0, 0.65fr);
	column-gap: 0;
}
.awp-timeline-item--text-date-aside .awp-timeline-item__date { grid-column: 1; margin-block-end: 0; }
.awp-timeline-item--text-date-aside .awp-timeline-item__accent-rule,
.awp-timeline-item--text-date-aside .awp-timeline-item__heading,
.awp-timeline-item--text-date-aside .awp-timeline-item__content { grid-column: 3; }

.awp-timeline--alternating .awp-timeline-item--text-date-aside > .awp-timeline-item__body {
	grid-template-columns:
		minmax(0, 0.35fr) var(--wp--preset--spacing--40) minmax(0, 0.65fr)
		var(--awp-rail-gap, var(--wp--preset--spacing--40)) var(--awp-rail-marker-size, 0.75rem)
		var(--awp-rail-gap, var(--wp--preset--spacing--40))
		minmax(0, 0.35fr) var(--wp--preset--spacing--40) minmax(0, 0.65fr);
}
.awp-timeline--alternating .awp-timeline-item--text-date-aside > .awp-timeline-item__body > .awp-timeline-item__date { grid-column: 7; }
.awp-timeline--alternating .awp-timeline-item--text-date-aside > .awp-timeline-item__body > .awp-timeline-item__accent-rule,
.awp-timeline--alternating .awp-timeline-item--text-date-aside > .awp-timeline-item__body > .awp-timeline-item__heading,
.awp-timeline--alternating .awp-timeline-item--text-date-aside .awp-timeline-item__content > :not(.awp-timeline-item__media) { grid-column: 9; }
.awp-timeline--alternating .awp-timeline-item--text-date-aside .awp-timeline-item__content > .wp-block-image.awp-timeline-item__media { grid-column: 1 / 4; }
.awp-timeline--alternating .awp-timeline-item--text-date-aside:nth-child(even) > .awp-timeline-item__body > .awp-timeline-item__date { grid-column: 1; }
.awp-timeline--alternating .awp-timeline-item--text-date-aside:nth-child(even) > .awp-timeline-item__body > .awp-timeline-item__accent-rule,
.awp-timeline--alternating .awp-timeline-item--text-date-aside:nth-child(even) > .awp-timeline-item__body > .awp-timeline-item__heading,
.awp-timeline--alternating .awp-timeline-item--text-date-aside:nth-child(even) .awp-timeline-item__content > :not(.awp-timeline-item__media) { grid-column: 3; }
.awp-timeline--alternating .awp-timeline-item--text-date-aside:nth-child(even) .awp-timeline-item__content > .wp-block-image.awp-timeline-item__media { grid-column: 7 / 10; }

@media (max-width: 782px) {
	.awp-timeline--alternating .awp-timeline-item,
	.awp-timeline--left .awp-timeline-item,
	.awp-timeline--right .awp-timeline-item,
	.awp-timeline--single-column .awp-timeline-item {
		grid-template-columns: var(--awp-rail-marker-size, 0.75rem) minmax(0, 1fr);
		column-gap: var(--awp-rail-gap, var(--wp--preset--spacing--40));
	}
	.awp-timeline--alternating .awp-timeline-item > .awp-timeline-item__body,
	.awp-timeline--left .awp-timeline-item > .awp-timeline-item__body,
	.awp-timeline--right .awp-timeline-item > .awp-timeline-item__body,
	.awp-timeline--single-column .awp-timeline-item > .awp-timeline-item__body { grid-column: 2; }
	.awp-timeline--alternating .awp-timeline-item > .awp-timeline-item__media,
	.awp-timeline--left .awp-timeline-item > .awp-timeline-item__media,
	.awp-timeline--right .awp-timeline-item > .awp-timeline-item__media { grid-column: 2; grid-row: 2; }
	.awp-timeline--alternating .awp-timeline-item > .awp-rail__marker,
	.awp-timeline--left .awp-timeline-item > .awp-rail__marker,
	.awp-timeline--right .awp-timeline-item > .awp-rail__marker { grid-column: 1; grid-row: 1 / span 2; }
	.awp-timeline--single-column .awp-timeline-item > .awp-rail__marker { grid-column: 1; grid-row: 1 / span 2; }
	.awp-timeline .awp-rail--vertical > .awp-rail__track { left: calc(var(--awp-rail-marker-size, 0.75rem) / 2); }
	.awp-timeline--alternating .awp-timeline-item > .awp-timeline-item__body { display: block; grid-column: 2; }
	.awp-timeline-item--text-date-aside > .awp-timeline-item__body { display: block; }
	.awp-timeline-item--text-date-aside .awp-timeline-item__date { margin-block-end: var(--wp--preset--spacing--20); }
	.awp-timeline--alternating .awp-timeline-item__content { display: block; }
	.awp-timeline--alternating .awp-timeline-item__content > .wp-block-image.awp-timeline-item__media { margin-block-end: var(--wp--preset--spacing--30); }
}

@media (prefers-reduced-motion: reduce) {
	.awp-rail__marker { transition: none; }
}
