/* AMX media blocks — full-bleed image / justified gallery / autoplay slider. */

/* Full-bleed breakout to the viewport width (front end). */
.amx-fw{
	width:100vw;
	max-width:100vw;
	margin-left:calc(50% - 50vw);
	margin-right:calc(50% - 50vw);
}

/* ---- Spacing option (gap BELOW the block): None / Small / Medium / Large ----
   Maps to the site spacing scale (--amx-space-* defined in amx-defense-skin.php).
   Fallbacks keep the blocks correct even if the skin CSS ever fails to load. */
.amx-fw.amx-space-none{margin-bottom:0;}
.amx-fw.amx-space-sm{margin-bottom:var(--amx-space-sm,24px);}
.amx-fw.amx-space-md{margin-bottom:var(--amx-space-md,48px);}
.amx-fw.amx-space-lg{margin-bottom:var(--amx-space-lg,80px);}

/* A full-bleed block leading the page sits flush under the header (cancels the theme's
   30px content-area top padding) so there's no gap between the header and the hero. */
.entry-content > .amx-fw:first-child{margin-top:-30px;}

/* ---- Full-width image ---- */
.amx-fw-image{margin:0;}
.amx-fw-image img{display:block;width:100%;height:auto;}
.amx-fw-image.has-height img{height:var(--amx-h);object-fit:cover;}

/* ---- Justified gallery: one shared height, rows filled edge-to-edge ---- */
.amx-fw-gallery{display:flex;flex-wrap:wrap;gap:var(--amx-gap,6px);line-height:0;}
.amx-fw-gallery__img{
	height:var(--amx-h,260px);
	width:auto;
	min-width:0;
	object-fit:cover;
	display:block;
	/* flex-grow + flex-basis are set inline, proportional to each image's aspect ratio */
}

/* ---- Slider: one image at a time, cross-fade, autoplay ---- */
.amx-fw-slider{position:relative;height:var(--amx-h,480px);overflow:hidden;background:#0b1e60;}
.amx-fw-slider__slide{position:absolute;inset:0;opacity:0;transition:opacity .8s ease;}
.amx-fw-slider__slide.is-active{opacity:1;}
.amx-fw-slider__slide img{width:100%;height:100%;object-fit:cover;display:block;}
@media (prefers-reduced-motion:reduce){
	.amx-fw-slider__slide{transition:none;}
}

/* ---- Editor: keep the blocks inside the editor canvas (no 100vw breakout) ---- */
.editor-styles-wrapper .amx-fw,
.block-editor-block-list__layout .amx-fw{
	width:100% !important;max-width:100% !important;margin-left:0 !important;margin-right:0 !important;
}
/* In the editor the slider shows the first frame stacked (absolute) — give it the set height. */
.editor-styles-wrapper .amx-fw-slider{height:var(--amx-h,480px);}
.amx-block-placeholder{padding:26px;}
.amx-block-editwrap{position:relative;}
.amx-block-editbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:8px;}
