/**
 * Bookstore Theme — optional full-width layout (theme setting "full width").
 *
 * 1.3.2: a fluid page container (up to 1320px instead of the Default
 * theme's fixed 1160px), an edge-to-edge hero on the homepage, and the
 * sidebar blocks shown below the content as a banner gallery.
 */
:root {
	--bs-container: 1320px;
	--bs-gutter: clamp(1rem, .4rem + 2.6vw, 2.5rem);
}

/* Below 992px the Default theme insets content by 10px + 20px; the
   full-bleed hero text lines up with that. */
@media (max-width: 991px) {
	:root { --bs-gutter: 30px; }
}

/* Nothing (eg. the full-bleed hero) may cause a horizontal scrollbar.
   overflow-x: clip keeps position: sticky working, unlike hidden. */
.pkp_structure_page { overflow-x: clip; }

@media (min-width: 992px) {
	.pkp_structure_head .pkp_head_wrapper,
	.pkp_structure_page .pkp_structure_content,
	.pkp_structure_footer_wrapper .pkp_structure_footer {
		box-sizing: border-box;
		width: min(100% - 2 * var(--bs-gutter), var(--bs-container));
		max-width: none;
		margin-left: auto;
		margin-right: auto;
		padding-left: 0;
		padding-right: 0;
	}

	.pkp_page_index .pkp_structure_main,
	.pkp_page_catalog .pkp_structure_main {
		float: none;
		width: auto;
		padding-left: 0;
		padding-right: 0;
		padding-bottom: 0;
	}
	.pkp_page_index .pkp_structure_main::before,
	.pkp_page_index .pkp_structure_main::after,
	.pkp_page_catalog .pkp_structure_main::before,
	.pkp_page_catalog .pkp_structure_main::after {
		display: none;
	}
	.pkp_page_index .pkp_structure_sidebar,
	.pkp_page_catalog .pkp_structure_sidebar {
		float: none;
		width: auto;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
		gap: clamp(1.25rem, 1rem + 1.5vw, 2.5rem);
		margin-top: var(--bs-space-section);
		padding: var(--bs-space-lg) 0 0;
		border-top: 1px solid var(--bs-line, #e6e3dc);
	}
	.pkp_page_index .pkp_structure_sidebar .pkp_block,
	.pkp_page_catalog .pkp_structure_sidebar .pkp_block {
		padding: 0;
	}
}

/* ---------- Homepage hero: edge to edge ---------- */
.pkp_page_index .pkp_structure_content { padding-top: 0; }
.pkp_page_index .pkp_structure_main { padding-top: 0; }
.pkp_page_index .bs-hero {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
}
.pkp_page_index .bs-hero__inner {
	box-sizing: border-box;
	width: min(100% - 2 * var(--bs-gutter), var(--bs-container));
	max-width: none;
	margin-left: auto;
	margin-right: auto;
	padding-left: 0;
	padding-right: 0;
}
.pkp_page_index .bs-hero__title { max-width: 15em; }
.pkp_page_index .bs-hero__covers { right: 0; }

/* ---------- Custom blocks below the content: banner gallery ---------- */
.pkp_page_index .pkp_structure_sidebar .block_custom,
.pkp_page_catalog .pkp_structure_sidebar .block_custom {
	grid-column: 1 / -1;
}
.pkp_page_index .pkp_structure_sidebar .block_custom .content,
.pkp_page_catalog .pkp_structure_sidebar .block_custom .content {
	columns: 3 300px;
	column-gap: clamp(1rem, .8rem + 1vw, 1.75rem);
}
.pkp_page_index .pkp_structure_sidebar .block_custom .content > *,
.pkp_page_catalog .pkp_structure_sidebar .block_custom .content > * {
	margin: 0 0 clamp(1rem, .8rem + 1vw, 1.75rem);
	break-inside: avoid;
}
