/* ----------------------------------------------------------------
	One side spacing for the whole site: the logo, every page section and
	the right-hand header button start and end on the same two lines.
	Linked from common/header.php and common/charity-header.php so it loads
	after each page's own stylesheets. Change --site-side to adjust all pages.
-----------------------------------------------------------------*/
:root {
	/* grows with the screen; on very wide screens content stops at 1760px */
	--site-side: max(clamp(16px, 4vw, 80px), calc((100% - 1760px) / 2));
}

/* ---------- Main website ---------- */
body.site-modern #header > .container,
body.site-modern #page-title > .container,
body.site-modern #content .content-wrap > .container,
body.site-modern #content .content-wrap > .containers,
body.site-modern #footer > .footer-widgets-wrap,
body.site-modern #footer > .container,
body.site-modern #footer #copyrights > .container,
body.site-modern .hm-container,
body.site-modern .sp-container,
body.home-modern .sp-partner .sp-container,
body.site-modern.books-page .bk-wrap,
body.site-modern.bd-page #page-title > .container,
body.site-modern.bd-page #content .content-wrap > .container,
body.site-modern.cd-page #page-title.cd-hero > .container,
body.site-modern.cd-page #content .content-wrap > .container {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	padding-left: var(--site-side);
	padding-right: var(--site-side);
}

/* centred text blocks keep a comfortable reading width */
body.site-modern .sp-hero .sp-container { max-width: none; }
body.site-modern .sp-hero .sp-container > h1,
body.site-modern .sp-hero .sp-container > p { max-width: 900px; margin-left: auto; margin-right: auto; }

body.site-modern .hm-bk-grid { max-width: none; }
body.site-modern #header #logo,
body.site-modern .hx-hdr-register { margin-left: 0; }
body.site-modern .hx-hdr-register { margin-left: 16px; margin-right: 0; }
body.site-modern .hx-hdr-extra > :last-child { margin-right: 0; }

/* homepage slider arrows sit inside the side space, clear of the text */
body.site-modern .ix-slider-prev { left: max(4px, calc(var(--site-side) / 2 - 23px)); }
body.site-modern .ix-slider-next { right: max(4px, calc(var(--site-side) / 2 - 23px)); }

/* small laptops: the one-row menu needs the room, so narrow the side space and menu padding */
@media (min-width: 992px) and (max-width: 1099px) {
	:root { --site-side: 16px; }
	body.site-modern #header #logo { padding: 5px 0; }
	body.site-modern #header #logo img { height: 56px; max-height: 56px; }
	body.site-modern #header .navbar-expand-lg .navbar-nav .nav-item .nav-link { padding-left: 4px; padding-right: 4px; letter-spacing: 0; }
	body.site-modern #header .navbar-expand-lg .navbar-nav .nav-item .nav-link.dropdown-toggle { padding-left: 4px; }
}

body.site-modern .ix-slide-tabs { right: var(--site-side); }

/* footer: the last column finishes on the right-hand line */
@media (min-width: 768px) {
	body.site-modern #footer .footer-widgets-wrap .row > div:last-child { margin-left: auto; }
	body.site-modern #footer .footer-widgets-wrap .row > div:last-child .widget > div > :not(.d-flex) { text-align: right !important; }
}

/* ---------- Charity pages ---------- */
.charity .ch-container,
.charity .ch-container.vr-container {
	width: 100%;
	max-width: none;
	padding-left: var(--site-side);
	padding-right: var(--site-side);
}
.charity .ch-cta > .ch-container {
	width: calc(100% - 2 * var(--site-side));
	padding-left: 20px;
	padding-right: 20px;
}
/* narrow phones: let the top-bar contacts wrap so "Main Website" stays on screen */
.charity .ch-topbar__info { min-width: 0; }
.charity .ch-topbar__info > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
