/* FEF CMS — minimal front-end styles. Everything is easy to override from a template's own Custom CSS. */
.fef-cms { box-sizing: border-box; }
.fef-cms *, .fef-cms *::before, .fef-cms *::after { box-sizing: inherit; }
.fef-cms-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 28px; max-width: 1200px; margin: 0 auto; padding: 14px 24px; }
.fef-cms-header, .fef-cms-footer { width: 100%; }
/* The wrapper is a <header> element: themes style bare `header` / `.site-header` with margins or padding. Never inherit those. */
header.fef-cms.fef-cms-header { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.fef-cms-body { width: 100%; }

/* ── Page width (template setting "Page width": auto | full | boxed — see FEF_Cms_Render::body_width) ──
   full  : edge to edge. Nothing here limits it; an Elementor design's own Content Width decides how wide its content is.
   boxed : a centred column (plain HTML templates by default). */
.fef-cms.fef-cms-body.fef-cms-w-full  { width: 100%; max-width: none; }
.fef-cms.fef-cms-body.fef-cms-w-boxed { max-width: 1200px; margin-left: auto; margin-right: auto; padding: 24px 16px; }

/* Classic theme, no FEF header: the theme's header.php may have opened a container (.container, #content, .site-main…).
   A full-width template pulls out of it to the viewport edges. The small inline script printed by FEF_Cms_Render sets the
   exact values (it allows for the scrollbar); these rules are the no-script fallback. */
.fef-cms.fef-cms-body.fef-cms-breakout { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: 0; }
html:has(.fef-cms-breakout) { overflow-x: clip; }

/* Block themes: the theme's root padding keeps content off the screen edges. Header / footer / full-width templates are
   direct children of .wp-site-blocks, so they bleed back out by that padding (0 when the theme sets none). */
.wp-site-blocks > .fef-cms-header {
	/* WordPress's block-gap rule (:where(.wp-site-blocks) > * { margin-block-start: 24px }) and the theme's root top padding
	   would leave a ~24px strip above the header. The header sits flush with the top of the page. */
	margin-top: 0;
}
body:has(> .wp-site-blocks > .fef-cms-header:first-child),
body:has(> .fef-cms-header:first-child) { padding-top: 0; }
.wp-site-blocks:has(> .fef-cms-header:first-child) { padding-top: 0; }
.wp-site-blocks > .fef-cms-header,
.wp-site-blocks > .fef-cms-footer,
.wp-site-blocks > .fef-cms-body.fef-cms-w-full {
	margin-left: calc(var(--wp--style--root--padding-left, 0px) * -1);
	margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1);
	width: auto;
	max-width: none;
}
.fef-cms-nav ul { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
.fef-cms-nav a, .fef-cms-bar a { text-decoration: none; }
.fef-cms-nav .sub-menu { display: none; }
.fef-cms-breadcrumbs { font-size: .9em; opacity: .8; }
.fef-cms-loop { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fef-cms-loop.fef-cms-cols-1 { grid-template-columns: minmax(0, 1fr); }
.fef-cms-loop.fef-cms-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fef-cms-loop.fef-cms-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fef-cms-loop.fef-cms-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fef-cms-loop.fef-cms-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fef-cms-card { border: 1px solid rgba(0, 0, 0, .1); border-radius: 8px; overflow: hidden; background: #fff; }
.fef-cms-card-img img { display: block; width: 100%; height: auto; }
.fef-cms-card-body { padding: 14px 16px 18px; }
.fef-cms-card-title { margin: 0 0 8px; font-size: 1.1em; }
.fef-cms-card-title a { text-decoration: none; }
.fef-cms-card-excerpt { margin: 0; opacity: .8; }
.fef-cms-sample { display: inline-block; padding: 2px 8px; border: 1px dashed #b4b9be; background: #f6f7f7; color: #646970; font-size: .9em; }
.fef-cms-image { max-width: 100%; height: auto; }
.fef-cms-preview-frame { min-height: 40px; }
@media (max-width: 900px) {
	.fef-cms-loop, .fef-cms-loop[class*="fef-cms-cols-"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.fef-cms-loop, .fef-cms-loop[class*="fef-cms-cols-"] { grid-template-columns: minmax(0, 1fr); }
	.fef-cms-bar { padding: 12px 16px; }
}
