/**
 * Bookstore Theme for OMP 3.5 — site chrome: header, navigation, footer and
 * sidebar blocks. Loaded after bookstore.css (uses its --bs-* tokens).
 *
 * 1.3.2: light header so the press logo and menu stay readable, one-row
 * desktop navigation (no more Register/Login overlapping Search), a calmer
 * footer for custom footer HTML, and banner-style custom blocks.
 */

/* ---------- Header ---------- */
.pkp_structure_head {
	position: relative;
	z-index: 20;
	background: #fff;
	border-top: 3px solid var(--bs-primary);
	border-bottom: 1px solid var(--bs-line);
	box-shadow: 0 10px 30px -24px rgba(20, 24, 22, .35);
}
.pkp_structure_head .pkp_site_name .is_text {
	font-family: var(--bs-font-display);
	font-weight: 700;
	color: var(--bs-ink);
	text-decoration: none;
}
.pkp_structure_head .pkp_navigation_primary > li > a,
.pkp_structure_head .pkp_navigation_search_wrapper a,
.pkp_structure_head .pkp_navigation_user > li > a {
	color: var(--bs-ink-soft);
	text-decoration: none;
	transition:
		color var(--bs-dur-fast) var(--bs-ease-soft),
		background-color var(--bs-dur-fast) var(--bs-ease-soft),
		border-color var(--bs-dur-fast) var(--bs-ease-soft);
}
.pkp_structure_head .pkp_navigation_primary > li > a:hover,
.pkp_structure_head .pkp_navigation_primary > li > a:focus-visible,
.pkp_structure_head .pkp_navigation_search_wrapper a:hover,
.pkp_structure_head .pkp_navigation_user > li > a:hover {
	color: var(--bs-primary);
}
.pkp_structure_head .dropdown-menu {
	padding: .4rem;
	border: 1px solid var(--bs-line);
	border-radius: var(--bs-radius-sm);
	background: #fff;
	box-shadow: var(--bs-shadow-lg);
}
.pkp_structure_head .dropdown-menu a {
	display: block;
	padding: .55rem .8rem;
	border: 0;
	border-radius: 4px;
	color: var(--bs-ink-soft);
	font-size: var(--bs-text-sm);
	text-decoration: none;
}
.pkp_structure_head .dropdown-menu a:hover,
.pkp_structure_head .dropdown-menu a:focus-visible {
	background: var(--bs-primary-tint);
	color: var(--bs-primary);
}

@media (min-width: 992px) {
	.pkp_structure_head .pkp_head_wrapper {
		display: flex;
		align-items: center;
		gap: 0;
		padding-top: .85rem;
		padding-bottom: .85rem;
	}
	.pkp_structure_head .pkp_site_name_wrapper {
		flex: 0 0 auto;
		width: auto;
		height: auto;
		padding: 0;
	}
	.pkp_structure_head .pkp_site_name {
		width: auto;
		margin: 0;
		padding: 0;
	}
	.pkp_structure_head .pkp_site_name .is_img img {
		display: block;
		width: auto;
		max-height: 64px;
	}
	.pkp_structure_head .pkp_site_nav_menu {
		position: static;
		display: flex;
		flex: 1 1 auto;
		align-items: center;
		justify-content: flex-end;
		gap: 1rem;
		min-width: 0;
		width: auto;
		margin: 0 0 0 clamp(1rem, 3vw, 3rem);
		padding: 0;
		background: transparent;
	}
	.pkp_structure_head .pkp_navigation_primary_row {
		flex: 0 0 auto;
		padding: 0;
		background: transparent;
	}
	.pkp_structure_head .pkp_navigation_primary_wrapper {
		display: flex;
		align-items: center;
		gap: .75rem;
		width: auto;
		padding: 0;
	}
	.pkp_structure_head .pkp_navigation_primary {
		display: flex;
		flex-wrap: nowrap;
		width: auto;
		gap: .15rem;
		margin: 0;
	}
	.pkp_structure_head .pkp_navigation_primary > li { flex: 0 0 auto; }
	.pkp_structure_head .pkp_navigation_primary > li > a {
		white-space: nowrap;
		margin: 0;
		padding: .55rem .9rem;
		border: 0;
		border-radius: 999px;
		font-size: var(--bs-text-sm);
		font-weight: 600;
	}
	.pkp_structure_head .pkp_navigation_primary > li > a:hover,
	.pkp_structure_head .pkp_navigation_primary > li > a:focus-visible,
	.pkp_structure_head .pkp_navigation_primary > li > a[aria-expanded="true"] {
		background: var(--bs-primary-tint);
		color: var(--bs-primary);
	}
	.pkp_structure_head .pkp_navigation_search_wrapper {
		float: none;
		margin: 0;
		padding: 0;
	}
	.pkp_structure_head .pkp_navigation_search_wrapper a {
		display: inline-flex;
		align-items: center;
		gap: .45em;
		margin: 0;
		padding: .5rem .95rem;
		border: 1px solid var(--bs-line);
		border-radius: 999px;
		font-size: var(--bs-text-sm);
		font-weight: 600;
	}
	.pkp_structure_head .pkp_navigation_search_wrapper a:hover { border-color: var(--bs-primary); }
	.pkp_structure_head .pkp_navigation_user_wrapper {
		position: static;
		top: auto;
		right: auto;
		left: auto;
		transform: none;
		flex: 0 0 auto;
		display: flex;
		max-width: none;
		align-items: center;
		width: auto;
		margin: 0;
		padding: 0 0 0 1rem;
		border-left: 1px solid var(--bs-line);
	}
	.pkp_structure_head .pkp_navigation_user {
		display: flex;
		align-items: center;
		gap: .35rem;
		width: auto;
		max-width: none;
		margin: 0;
		padding: 0;
	}
	.pkp_structure_head .pkp_navigation_user > li { flex: 0 0 auto; }
	.pkp_structure_head .pkp_navigation_user > li > a {
		display: inline-block;
		padding: .5rem .95rem;
		border: 1px solid transparent;
		border-radius: 999px;
		font-size: var(--bs-text-sm);
		font-weight: 600;
		white-space: nowrap;
	}
	/* Last item (Login, or the user menu) as the primary action */
	.pkp_structure_head .pkp_navigation_user > li:last-child > a {
		background: var(--bs-primary);
		color: #fff;
	}
	.pkp_structure_head .pkp_navigation_user > li:last-child > a:hover {
		background: var(--bs-primary-deep);
		color: #fff;
	}
	.pkp_structure_head .pkp_navigation_user .dropdown-menu {
		right: 0;
		left: auto;
	}
}

/* ---------- Footer ---------- */
.pkp_structure_footer_wrapper {
	position: relative;
	margin-top: var(--bs-space-section);
	background:
		radial-gradient(800px 300px at 100% 0, rgba(255, 255, 255, .05), transparent 70%),
		var(--bs-footer-bg);
	color: rgba(236, 240, 237, .78);
	border-top: 0;
}
.pkp_structure_footer_wrapper::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: linear-gradient(90deg, var(--bs-primary), var(--bs-accent));
}
.pkp_structure_footer_wrapper .pkp_footer_content {
	padding: clamp(2.5rem, 1.8rem + 3vw, 4.5rem) 0;
	font-size: var(--bs-text-sm);
	line-height: 1.75;
}
.pkp_structure_footer_wrapper a {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, .35);
	text-underline-offset: .2em;
	overflow-wrap: anywhere;
	transition: color var(--bs-dur-fast) var(--bs-ease-soft), text-decoration-color var(--bs-dur-fast) var(--bs-ease-soft);
}
.pkp_structure_footer_wrapper a:hover {
	color: var(--bs-accent);
	text-decoration-color: currentColor;
}
.pkp_structure_footer_wrapper p { margin: 0 0 .6rem; }
.pkp_structure_footer_wrapper p:last-child { margin-bottom: 0; }
.pkp_structure_footer_wrapper strong { color: #fff; }
.pkp_structure_footer_wrapper h2,
.pkp_structure_footer_wrapper h3,
.pkp_structure_footer_wrapper h4 {
	margin: 0 0 .6rem;
	font-family: var(--bs-font-display);
	color: #fff;
}
/* Tables pasted into the footer text (eg. a QR code next to the address) */
.pkp_structure_footer_wrapper table {
	width: auto;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: transparent;
}
.pkp_structure_footer_wrapper tbody { display: block; }
.pkp_structure_footer_wrapper tr {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25rem 2.5rem;
}
.pkp_structure_footer_wrapper td {
	display: block;
	padding: 0;
	border: 0;
	vertical-align: top;
}
.pkp_structure_footer_wrapper .pkp_footer_content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--bs-radius-sm);
	background: #fff;
	padding: 6px;
	box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .6);
}
.pkp_structure_footer_wrapper .pkp_footer_content td > p:first-child > strong:first-child {
	display: block;
	margin-bottom: .2rem;
	font-family: var(--bs-font-display);
	font-size: var(--bs-text-lg);
	letter-spacing: .01em;
}

/* ---------- Sidebar blocks ---------- */
.pkp_structure_sidebar .pkp_block .title {
	font-family: var(--bs-font-display);
	color: var(--bs-ink);
}
.pkp_structure_sidebar .pkp_block .content img {
	max-width: 100%;
	height: auto;
}
/* Banner images in custom blocks (several banners may share one paragraph) */
.pkp_structure_sidebar .block_custom .content a:has(> img) { display: block; }
.pkp_structure_sidebar .block_custom .content a:has(> img) ~ a:has(> img) { margin-top: clamp(1rem, .8rem + 1vw, 1.75rem); }
.pkp_structure_sidebar .block_custom .content a:has(> img) + br { display: none; }
.pkp_structure_sidebar .block_custom .content a > img {
	display: block;
	border-radius: var(--bs-radius-sm);
	box-shadow: var(--bs-shadow-sm);
	transition: transform var(--bs-dur) var(--bs-ease), box-shadow var(--bs-dur) var(--bs-ease);
}
.pkp_structure_sidebar .block_custom .content a:hover > img,
.pkp_structure_sidebar .block_custom .content a:focus-visible > img {
	transform: translateY(-3px);
	box-shadow: var(--bs-shadow);
}

@media (prefers-reduced-motion: reduce) {
	.pkp_structure_sidebar .block_custom .content a > img { transition: none; }
	.pkp_structure_sidebar .block_custom .content a:hover > img { transform: none; }
}
