/*
 * Pilanto Platform Base Theme — Site Shell layout primitives
 *
 * Catalog owns structure.
 * Website Design System owns paint.
 * This theme owns Site Shell / document chrome.
 *
 * --pp-shell-* custom properties are SHELL IMPLEMENTATION DEFAULTS for
 * header/footer chrome layout. They are not a design-token system and must
 * not compete with Website Design System paint. A later WDS slice should
 * override these values (and supply color, typography, and spacing paint)
 * from locally persisted design-system configuration.
 *
 * Do not introduce --pgp-* variables here.
 */

.pp-shell {
	--pp-shell-site-width: 72rem;
	--pp-shell-wide-width: 90rem;
	--pp-shell-gutter: 1.25rem;
	--pp-shell-header-gap: 1rem;
	--pp-shell-footer-gap: 1.5rem;
	--pp-shell-sidebar-gap: 40px;
	--pp-shell-main-track: 77fr;
	--pp-shell-sidebar-track: 23fr;
	--pp-shell-sidebar-min: 12.5rem;
}

.pp-shell-header--inner-site {
	--pp-shell-header-inner-max: var(--pp-shell-site-width);
}

.pp-shell-header--inner-wide {
	--pp-shell-header-inner-max: var(--pp-shell-wide-width);
}

.pp-shell-footer--inner-site {
	--pp-shell-footer-inner-max: var(--pp-shell-site-width);
}

.pp-shell-footer--inner-wide {
	--pp-shell-footer-inner-max: var(--pp-shell-wide-width);
}

/* Full-width shell background: the band spans the viewport. */
.pp-shell-header--outer-full .site-header,
.pp-shell-footer--outer-full .site-footer {
	width: 100%;
}

/* Contained shell: the chrome band itself is boxed to the inner measure. */
.pp-shell-header--outer-contained .site-header {
	width: 100%;
	max-width: var(--pp-shell-header-inner-max);
	margin-inline: auto;
}

.pp-shell-footer--outer-contained .site-footer {
	width: 100%;
	max-width: var(--pp-shell-footer-inner-max);
	margin-inline: auto;
}

/* Inner content measure inside a full or contained band. */
.pp-shell .inside-header {
	width: 100%;
	max-width: var(--pp-shell-header-inner-max);
	margin-inline: auto;
	padding-inline: var(--pp-shell-gutter);
	box-sizing: border-box;
}

.pp-shell .inside-footer-widgets,
.pp-shell .inside-site-info {
	width: 100%;
	max-width: var(--pp-shell-footer-inner-max);
	margin-inline: auto;
	padding-inline: var(--pp-shell-gutter);
	box-sizing: border-box;
}

/* Header row: site identity, native primary navigation, optional CTA. */
.pp-shell .inside-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--pp-shell-header-gap);
}

.pp-shell .inside-header .site-branding,
.pp-shell .inside-header .site-logo {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
}

.pp-shell .main-title,
.pp-shell .main-title a {
	min-width: 0;
	max-width: 100%;
	overflow-wrap: break-word;
	white-space: normal;
}

.pp-shell .inside-header .main-navigation {
	flex: 1 1 auto;
}

.pp-shell-header-cta {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.pp-shell-header-cta__link {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

/*
 * Footer columns. GeneratePress also emits native footer widget areas from
 * the mapped default; this grid is the theme-owned layout primitive so the
 * 2/3/4 configuration is visible even if parent CSS differs.
 *
 * The stacking query is a shell implementation default, not a platform
 * breakpoint authority. Custom properties cannot drive @media; a later
 * WDS/mobile slice may replace this.
 */
.pp-shell .inside-footer-widgets {
	display: grid;
	gap: var(--pp-shell-footer-gap);
}

.pp-shell-footer--columns-2 .inside-footer-widgets {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pp-shell-footer--columns-3 .inside-footer-widgets {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pp-shell-footer--columns-4 .inside-footer-widgets {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 47.99rem) {
	.pp-shell .inside-footer-widgets {
		grid-template-columns: minmax(0, 1fr);
	}
}

/*
 * Content region between header and footer.
 *
 * GeneratePress boxes #page.grid-container to container_width and splits
 * .site-content with percentage widths. A page without a sidebar receives
 * the parent class full-width-content, which removes that box. A page with
 * a sidebar keeps the box. The two tracks are fr shares of the free space
 * left after the column gap. Each column can shrink to that track, so wide
 * content does not stretch the row past the layout width. There is no
 * viewport-width rule.
 *
 * Top-level section wrappers are not styled here. Their outer element stays
 * the width of this region; an inner container owns its own measure.
 * 769px is the parent theme's mobile-menu breakpoint, where columns stack.
 */
@media (min-width: 48.0625rem) {
	.pp-shell.right-sidebar .site-content,
	.pp-shell.left-sidebar .site-content {
		display: grid;
		align-items: start;
		column-gap: var(--pp-shell-sidebar-gap);
	}

	.pp-shell.right-sidebar .site-content {
		grid-template-columns: minmax(0, var(--pp-shell-main-track)) minmax(var(--pp-shell-sidebar-min), var(--pp-shell-sidebar-track));
	}

	.pp-shell.left-sidebar .site-content {
		grid-template-columns: minmax(var(--pp-shell-sidebar-min), var(--pp-shell-sidebar-track)) minmax(0, var(--pp-shell-main-track));
	}

	.pp-shell.right-sidebar .site-content .content-area,
	.pp-shell.left-sidebar .site-content .content-area,
	.pp-shell.right-sidebar .site-content .is-right-sidebar,
	.pp-shell.left-sidebar .site-content .is-left-sidebar {
		width: auto;
		max-width: none;
		min-width: 0;
	}
}

.pp-shell.full-width-content.no-sidebar .entry-content .alignfull {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}
