/**
 * Page Templates by SG Group — front-end layout styles.
 *
 * Loaded only on requests rendered by this plugin. Every selector is scoped under body classes that
 * the plugin adds only on those requests. No 100vw, no large negative margins, no overflow hiding.
 * Custom properties (set inline on body.page-templates-by-sg-group-active):
 *   --page-templates-by-sg-group-content-width
 *   --page-templates-by-sg-group-padding-x-desktop / -tablet / -mobile
 *   --page-templates-by-sg-group-padding-top / -bottom
 *   --page-templates-by-sg-group-sidebar-width / -gap
 */

/* =========================================================================
 * 1. Classic themes — width layouts (theme template or plugin template).
 *    The main entry of the queried post carries .page-templates-by-sg-group-entry.
 * ====================================================================== */

/* 1.1 Full width / flush / centered: lift the constraint chain around the entry. */
body.page-templates-by-sg-group-width-full *:has(.page-templates-by-sg-group-entry),
body.page-templates-by-sg-group-width-flush *:has(.page-templates-by-sg-group-entry),
body.page-templates-by-sg-group-width-centered *:has(.page-templates-by-sg-group-entry) {
	max-width: none !important;
	width: auto !important;
	float: none !important;
	flex-grow: 1;
	flex-basis: auto;
}

body.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry,
body.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry {
	max-width: none !important;
	width: auto !important;
	float: none !important;
}

/*
 * Column-level ancestors (used by 1.2 and 1.5).
 *
 * Heuristic: an ancestor of the entry belongs to the content column when it does NOT also contain a
 * site-level element, i.e. the site header / footer / navigation or the sidebar column:
 *   header, footer, nav (except WordPress' post / comment / posts navigation "navigation" and page
 *   links "page-links"), #secondary, .sidebar, [role=banner|contentinfo|complementary], #masthead,
 *   #colophon, .site-header, .site-footer
 * counted only outside <main>, outside any <article> (comment articles contain footers) and outside
 * the entry itself. Plain <aside> / .widget-area are not markers: themes also use them inside the
 * column (e.g. Twenty Sixteen's content-bottom widgets). Site containers (#page, .site, .site-inner,
 * a Bootstrap-style .container that also holds the header or the sidebar column, ...) therefore keep
 * their width and gutters; only the column (e.g. #content, #primary, main) is adjusted. When a theme
 * puts such an element inside the column, the column is left as the theme renders it (the rule then
 * has no effect there; nothing breaks). Verified: Twenty Sixteen and Twenty Twenty-One.
 * Full width / flush (1.1, 1.4) intentionally lift every ancestor, as the old plugin did.
 */

/* 1.2 No sidebar: only the sidebar column goes away; the theme's content area width is kept. */
body.page-templates-by-sg-group-width-no-sidebar *:has(.page-templates-by-sg-group-entry):not(:has(:is(header, footer, nav:not(.navigation, .page-links), #secondary, .sidebar, [role="banner"], [role="contentinfo"], [role="complementary"], #masthead, #colophon, .site-header, .site-footer):not(main *, article *, .page-templates-by-sg-group-entry *))),
body.page-templates-by-sg-group-width-no-sidebar .page-templates-by-sg-group-entry {
	width: auto !important;
	float: none !important;
	flex-grow: 1;
}

/* 1.3 Centered: readable / wide maximum width. */
body.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry {
	box-sizing: border-box;
	width: auto !important;
	max-width: var(--page-templates-by-sg-group-content-width, 840px) !important;
	float: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* 1.4 Flush: no outer horizontal spacing around the entry (inner block padding is never touched). */
body.page-templates-by-sg-group-width-flush *:has(.page-templates-by-sg-group-entry),
body.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry {
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/*
 * 1.5 Custom horizontal padding: the entry gets the padding, its column-level ancestors none
 * (site containers, the header and the footer keep their own gutters).
 */
body.page-templates-by-sg-group-padding-x-custom:not(.page-templates-by-sg-group-layout-sidebar-left):not(.page-templates-by-sg-group-layout-sidebar-right) *:has(.page-templates-by-sg-group-entry):not(:has(:is(header, footer, nav:not(.navigation, .page-links), #secondary, .sidebar, [role="banner"], [role="contentinfo"], [role="complementary"], #masthead, #colophon, .site-header, .site-footer):not(main *, article *, .page-templates-by-sg-group-entry *))) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.page-templates-by-sg-group-padding-x-custom:not(.page-templates-by-sg-group-layout-sidebar-left):not(.page-templates-by-sg-group-layout-sidebar-right) .page-templates-by-sg-group-entry,
body.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-layout {
	box-sizing: border-box;
	padding-left: var(--page-templates-by-sg-group-padding-x-desktop, 32px) !important;
	padding-right: var(--page-templates-by-sg-group-padding-x-desktop, 32px) !important;
}

@media (max-width: 1024px) {
	body.page-templates-by-sg-group-padding-x-custom:not(.page-templates-by-sg-group-layout-sidebar-left):not(.page-templates-by-sg-group-layout-sidebar-right) .page-templates-by-sg-group-entry,
	body.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-layout {
		padding-left: var(--page-templates-by-sg-group-padding-x-tablet, 24px) !important;
		padding-right: var(--page-templates-by-sg-group-padding-x-tablet, 24px) !important;
	}
}

@media (max-width: 600px) {
	body.page-templates-by-sg-group-padding-x-custom:not(.page-templates-by-sg-group-layout-sidebar-left):not(.page-templates-by-sg-group-layout-sidebar-right) .page-templates-by-sg-group-entry,
	body.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-layout {
		padding-left: var(--page-templates-by-sg-group-padding-x-mobile, 16px) !important;
		padding-right: var(--page-templates-by-sg-group-padding-x-mobile, 16px) !important;
	}
}

/* 1.6 Custom vertical padding. */
body.page-templates-by-sg-group-padding-y-custom:not(.page-templates-by-sg-group-layout-sidebar-left):not(.page-templates-by-sg-group-layout-sidebar-right) .page-templates-by-sg-group-entry,
body.page-templates-by-sg-group-padding-y-custom .page-templates-by-sg-group-layout {
	padding-top: var(--page-templates-by-sg-group-padding-top, 0px) !important;
	padding-bottom: var(--page-templates-by-sg-group-padding-bottom, 0px) !important;
}

/* =========================================================================
 * 2. Sidebar layouts (classic plugin template and block template).
 *    Content first in the document; the column order is set with CSS grid.
 * ====================================================================== */

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left,
body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-right {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--page-templates-by-sg-group-sidebar-width, 300px);
	column-gap: var(--page-templates-by-sg-group-sidebar-gap, 40px);
	row-gap: var(--page-templates-by-sg-group-sidebar-gap, 40px);
	align-items: start;
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left {
	grid-template-columns: var(--page-templates-by-sg-group-sidebar-width, 300px) minmax(0, 1fr);
}

/*
 * Grid items: no minimum content width and no horizontal auto margins. Auto margins (e.g. a theme's
 * "margin: 0 auto" on .widget-area) would size the item to its content instead of the track and let
 * it overflow the column.
 */
body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout > * {
	min-width: 0;
	margin-top: 0;
	margin-bottom: 0;
	margin-left: 0;
	margin-right: 0;
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left > .page-templates-by-sg-group-content {
	grid-column: 2;
	grid-row: 1;
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left > .page-templates-by-sg-group-sidebar {
	grid-column: 1;
	grid-row: 1;
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-right > .page-templates-by-sg-group-content {
	grid-column: 1;
	grid-row: 1;
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-right > .page-templates-by-sg-group-sidebar {
	grid-column: 2;
	grid-row: 1;
}

/* No sidebar output (no widget area, visitors): the content takes the whole row. */
body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout:not(:has(> .page-templates-by-sg-group-sidebar)) {
	grid-template-columns: minmax(0, 1fr);
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout:not(:has(> .page-templates-by-sg-group-sidebar)) > .page-templates-by-sg-group-content {
	grid-column: 1;
}

@media (max-width: 781px) {
	body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left,
	body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-right {
		grid-template-columns: minmax(0, 1fr);
	}

	body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left > .page-templates-by-sg-group-content,
	body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-left > .page-templates-by-sg-group-sidebar,
	body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-right > .page-templates-by-sg-group-content,
	body.page-templates-by-sg-group-active .page-templates-by-sg-group-layout.is-sidebar-right > .page-templates-by-sg-group-sidebar {
		grid-column: 1;
		grid-row: auto;
	}
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-sidebar {
	box-sizing: border-box;
	min-width: 0;
}

/* Notice for users who can manage widgets (never rendered for visitors). */
body.page-templates-by-sg-group-active .page-templates-by-sg-group-admin-notice {
	margin: 0;
	padding: 12px 16px;
	border-left: 4px solid #d63638;
	background: #fff;
	color: #1e1e1e;
	font-size: 14px;
	line-height: 1.6;
}

/*
 * Plugin templates: the entry footer is always in the markup (theme scripts measure it), but when it
 * is empty (visitors: no edit link) it takes no space. It stays rendered (not display: none) so that
 * its position remains the end of the entry.
 */
body.page-templates-by-sg-group-active .page-templates-by-sg-group-entry-footer:empty {
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
	border: 0;
}

/* Plugin templates: an empty title is not rendered as an empty heading. */
body.page-templates-by-sg-group-active .page-templates-by-sg-group-entry .entry-title:empty {
	display: none;
}

/* Meta labels of the plugin templates. */
body.page-templates-by-sg-group-active .page-templates-by-sg-group-entry-meta .page-templates-by-sg-group-meta-label {
	margin-right: 0.25em;
}

body.page-templates-by-sg-group-active .page-templates-by-sg-group-entry-meta > span {
	display: inline-block;
	margin-right: 1em;
}

/* =========================================================================
 * 3. Block themes — width layouts keep the theme's block template; the theme's width variables are
 *    overridden inside the page's main element only.
 * ====================================================================== */

body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-width-full .wp-site-blocks main,
body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-width-flush .wp-site-blocks main {
	--wp--style--global--content-size: 100%;
	--wp--style--global--wide-size: 100%;
}

body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-width-flush .wp-site-blocks main {
	--wp--style--root--padding-left: 0px;
	--wp--style--root--padding-right: 0px;
}

body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-width-centered .wp-site-blocks main {
	--wp--style--global--content-size: var(--page-templates-by-sg-group-content-width, 840px);
	--wp--style--global--wide-size: var(--page-templates-by-sg-group-content-width, 840px);
}

/*
 * No sidebar: the theme's content size (contentSize) is kept on purpose. Block themes without a
 * sidebar column therefore render it like the theme default; nothing is widened.
 */

/* Custom horizontal padding: the root padding variables inside main. */
body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-padding-x-custom .wp-site-blocks main,
body.page-templates-by-sg-group-renderer-block-template.page-templates-by-sg-group-padding-x-custom .wp-site-blocks main {
	--wp--style--root--padding-left: var(--page-templates-by-sg-group-padding-x-desktop, 32px);
	--wp--style--root--padding-right: var(--page-templates-by-sg-group-padding-x-desktop, 32px);
}

@media (max-width: 1024px) {
	body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-padding-x-custom .wp-site-blocks main,
	body.page-templates-by-sg-group-renderer-block-template.page-templates-by-sg-group-padding-x-custom .wp-site-blocks main {
		--wp--style--root--padding-left: var(--page-templates-by-sg-group-padding-x-tablet, 24px);
		--wp--style--root--padding-right: var(--page-templates-by-sg-group-padding-x-tablet, 24px);
	}
}

@media (max-width: 600px) {
	body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-padding-x-custom .wp-site-blocks main,
	body.page-templates-by-sg-group-renderer-block-template.page-templates-by-sg-group-padding-x-custom .wp-site-blocks main {
		--wp--style--root--padding-left: var(--page-templates-by-sg-group-padding-x-mobile, 16px);
		--wp--style--root--padding-right: var(--page-templates-by-sg-group-padding-x-mobile, 16px);
	}
}

/* In block themes the sidebar wrapper is not padded again (root padding already applies). */
body.page-templates-by-sg-group-renderer-block-template.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-layout {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Custom vertical padding on the page's main element. */
body.page-templates-by-sg-group-renderer-block-theme.page-templates-by-sg-group-padding-y-custom .wp-site-blocks main,
body.page-templates-by-sg-group-renderer-block-template.page-templates-by-sg-group-padding-y-custom .wp-site-blocks main {
	padding-top: var(--page-templates-by-sg-group-padding-top, 0px);
	padding-bottom: var(--page-templates-by-sg-group-padding-bottom, 0px);
}

body.page-templates-by-sg-group-renderer-block-template.page-templates-by-sg-group-padding-y-custom .page-templates-by-sg-group-layout {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* =========================================================================
 * 4. Verified theme adapters (see Theme_Adapters). Keyed on the theme body class.
 * ====================================================================== */

/* 4.1 Twenty Sixteen ----------------------------------------------------- */

/* Flush: the outer frame (like the old plugin): .site margin and the fixed body frame bars. */
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .site {
	margin: 0 !important;
}

body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush:not(.custom-background-image)::before,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush:not(.custom-background-image)::after {
	height: 0;
}

/*
 * Flush and custom padding: the entry's own gutters (entry margins of the theme) are removed.
 * The doubled entry class outweighs the theme's single-post column rules
 * (body.no-sidebar:not(.search-results) article:not(.type-page) .entry-content).
 */
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-header,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .post-thumbnail,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-summary,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-content,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-footer,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-header,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .post-thumbnail,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-summary,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-content,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-footer {
	margin-left: 0;
	margin-right: 0;
}

/*
 * Full width and centered: the .no-sidebar entry margins (15%) would shrink the column again (full
 * width would then look like "no sidebar", which keeps these margins on purpose).
 */
@media screen and (min-width: 56.875em) {
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-header,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .post-thumbnail,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-summary,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-content,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-footer,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-header,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .post-thumbnail,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-summary,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-content,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry > .entry-footer {
		margin-left: 0;
		margin-right: 0;
	}
}

/*
 * Single posts (≥985px): the theme floats the content into a 50% / 71% column beside the meta
 * column. For full width, flush, custom padding, centered and the plugin templates (meta in the
 * header) the entry is linearized so that the content really uses the entry width (the meta column
 * then follows the content, as on the theme's narrow screens). "No sidebar" keeps the theme's look.
 */
@media screen and (min-width: 61.5625em) {
	/* Plugin templates: the same gutters as the theme uses for pages (15% without sidebar, 0 with). */
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-renderer-plugin-template .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-content,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-renderer-plugin-template .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-footer {
		float: none;
		width: auto;
		margin-left: 0;
		margin-right: 0;
	}

	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-renderer-plugin-template.no-sidebar .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-content,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-renderer-plugin-template.no-sidebar .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-footer {
		margin-left: 15%;
		margin-right: 15%;
	}

	/* Full width, flush, centered and custom padding: no theme gutters (these come last and win). */
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-content,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-footer,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-content,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-footer,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-content,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-footer,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-content,
	body.page-templates-by-sg-group-active.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) > .entry-footer {
		float: none;
		width: auto;
		margin-left: 0;
		margin-right: 0;
	}

	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) .below-entry-meta,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) .below-entry-meta,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) .below-entry-meta,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-padding-x-custom .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) .below-entry-meta,
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-renderer-plugin-template .page-templates-by-sg-group-entry.page-templates-by-sg-group-entry:not(.type-page) .below-entry-meta {
		margin-left: 0;
		max-width: 100%;
	}
}

/* Blank (plugin template): no .site wrapper, so the theme's dark body frame colour would show. */
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-layout-blank.page-templates-by-sg-group-renderer-plugin-template {
	background: #fff;
}

body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-layout-blank.page-templates-by-sg-group-renderer-plugin-template::before,
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-layout-blank.page-templates-by-sg-group-renderer-plugin-template::after {
	height: 0;
}

/* Blank: the theme's content gutter (.site-content padding on wide screens). */
@media screen and (min-width: 56.875em) {
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-layout-blank.page-templates-by-sg-group-renderer-plugin-template .page-templates-by-sg-group-blank {
		padding: 0 4.5455%;
	}
}

/* Meta toggle: the entry footer (date, author, categories, tags, edit link) of the queried post. */
body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-hide-meta .page-templates-by-sg-group-entry .entry-footer {
	display: none;
}

/* 4.2 Twenty Twenty-One -------------------------------------------------- */

/* The content width comes from --responsive--align*-width (max-width of .entry-content > *). */
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry {
	--responsive--aligndefault-width: calc(100% - var(--responsive--spacing-horizontal, 30px));
	--responsive--alignwide-width: calc(100% - var(--responsive--spacing-horizontal, 30px));
}

@media only screen and (min-width: 482px) {
	body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry {
		--responsive--aligndefault-width: calc(100% - 4 * var(--global--spacing-horizontal, 25px));
		--responsive--alignwide-width: calc(100% - 4 * var(--global--spacing-horizontal, 25px));
	}
}

body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry {
	--responsive--aligndefault-width: 100%;
	--responsive--alignwide-width: 100%;
}

body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry {
	max-width: none !important;
	--responsive--aligndefault-width: min(var(--page-templates-by-sg-group-content-width, 840px), calc(100% - var(--responsive--spacing-horizontal, 30px)));
	--responsive--alignwide-width: min(var(--page-templates-by-sg-group-content-width, 840px), calc(100% - var(--responsive--spacing-horizontal, 30px)));
}

@media only screen and (min-width: 482px) {
	body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry {
		--responsive--aligndefault-width: min(var(--page-templates-by-sg-group-content-width, 840px), calc(100% - 4 * var(--global--spacing-horizontal, 25px)));
		--responsive--alignwide-width: min(var(--page-templates-by-sg-group-content-width, 840px), calc(100% - 4 * var(--global--spacing-horizontal, 25px)));
	}
}

/* Custom padding: the entry padding is the gutter; the content fills the padded box. */
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-padding-x-custom.page-templates-by-sg-group-width-full .page-templates-by-sg-group-entry,
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-padding-x-custom.page-templates-by-sg-group-width-flush .page-templates-by-sg-group-entry {
	--responsive--aligndefault-width: 100%;
	--responsive--alignwide-width: 100%;
}

body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-padding-x-custom.page-templates-by-sg-group-width-centered .page-templates-by-sg-group-entry {
	--responsive--aligndefault-width: min(var(--page-templates-by-sg-group-content-width, 840px), 100%);
	--responsive--alignwide-width: min(var(--page-templates-by-sg-group-content-width, 840px), 100%);
}

/* Meta toggle: the entry footer of the queried post. */
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-hide-meta .page-templates-by-sg-group-entry .entry-footer {
	display: none;
}

/*
 * Plugin templates (sidebars, blank, render mode "plugin"). The theme puts its horizontal gutters on
 * the entry parts through markup classes (entry-header "alignwide", entry-footer "default-max-width")
 * and ".site-main > article" rules, which the plugin's entry markup does not match. The same widths
 * are applied here with the theme's own variables, so the title and meta keep the theme's gutters.
 */
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-renderer-plugin-template .page-templates-by-sg-group-entry > .entry-header {
	max-width: var(--responsive--alignwide-width);
	margin-left: auto;
	margin-right: auto;
}

body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-renderer-plugin-template .page-templates-by-sg-group-entry > .entry-footer {
	max-width: var(--responsive--aligndefault-width);
	margin-left: auto;
	margin-right: auto;
}

/*
 * Sidebar layouts: the content and sidebar grid stays inside the theme's wide width (the same box as
 * the header and footer). The theme's variable is based on 100vw; the same gutters are also expressed
 * against the containing block (same breakpoints as the theme), so that the grid keeps its gutters when
 * the page is zoomed with CSS or a vertical scrollbar takes space. With custom horizontal padding the
 * padding is the gutter instead.
 */
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-renderer-plugin-template:not(.page-templates-by-sg-group-padding-x-custom) .page-templates-by-sg-group-layout {
	box-sizing: border-box;
	max-width: min(var(--responsive--alignwide-width), calc(100% - var(--responsive--spacing-horizontal, 30px)));
	margin-left: auto;
	margin-right: auto;
}

@media only screen and (min-width: 482px) {
	body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-renderer-plugin-template:not(.page-templates-by-sg-group-padding-x-custom) .page-templates-by-sg-group-layout {
		max-width: min(var(--responsive--alignwide-width), calc(100% - 4 * var(--global--spacing-horizontal, 25px)));
	}
}

@media only screen and (min-width: 822px) {
	body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-renderer-plugin-template:not(.page-templates-by-sg-group-padding-x-custom) .page-templates-by-sg-group-layout {
		max-width: min(var(--responsive--alignwide-width), calc(100% - 8 * var(--global--spacing-horizontal, 25px)));
	}
}

/*
 * The sidebar column carries the class "widget-area", which the theme styles as its multi-column
 * footer grid (display: grid, 2–3 columns, max-width, auto margins, a large top margin). In the
 * sidebar column the widgets are simply stacked.
 */
body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-active .page-templates-by-sg-group-layout > .page-templates-by-sg-group-sidebar.widget-area {
	display: block;
	width: auto;
	max-width: none;
	margin: 0;
	padding-top: 0;
	padding-bottom: 0;
}

/*
 * With a sidebar column beside it (≥782px), the content column is the reading width: the entry
 * parts, blocks and comments use the whole column instead of the theme's page-wide measures.
 */
@media (min-width: 782px) {
	body.page-templates-by-sg-group-theme-twentytwentyone.page-templates-by-sg-group-active .page-templates-by-sg-group-layout:has(> .page-templates-by-sg-group-sidebar) > .page-templates-by-sg-group-content {
		--responsive--aligndefault-width: 100%;
		--responsive--alignwide-width: 100%;
		--responsive--alignleft-margin: 0px;
		--responsive--alignright-margin: 0px;
	}
}

/*
 * Twenty Sixteen: the plugin sidebar stacked below the content (<= 781px) keeps the same side
 * gutters as the theme's own .sidebar and entry parts (7.6923%, and 23.0769% on the right from
 * 44.375em), so it never touches the viewport edges.
 */
@media screen and (max-width: 781px) {
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-active .page-templates-by-sg-group-layout > .page-templates-by-sg-group-sidebar {
		padding-left: 7.6923%;
		padding-right: 7.6923%;
	}
}

@media screen and (min-width: 44.375em) and (max-width: 781px) {
	body.page-templates-by-sg-group-theme-twentysixteen.page-templates-by-sg-group-active .page-templates-by-sg-group-layout > .page-templates-by-sg-group-sidebar {
		padding-right: 23.0769%;
	}
}
