/*
 * Shared components for every page (Claude Design "Website", Nov 2026):
 * design headings (script lead + tag), pill buttons, underlined links,
 * handwritten notes. Page files in assets/css/pages/ build on these.
 */

:root {
	--mbh-ink: var(--wp--preset--color--main, #3a0f00);
	--mbh-crust: #5a1e0c;
	--mbh-peach-soft: #fbe3cb;
	--mbh-line: rgba(58, 15, 0, 0.12);
	--mbh-disp: var(--wp--preset--font-family--script);
	--mbh-sub: var(--wp--preset--font-family--subtitle);
	--mbh-stamp: var(--wp--preset--font-family--heading);
}

/* ------------------------------------------------ Headings: lead + tag */
.mbh-h2--design .mbh-lead {
	display: table;
	margin: 0 0 0.16em 0.04em;
	font-size: 0.5em;
	white-space: nowrap;
	transform: rotate(-3deg);
	transform-origin: left bottom;
}

.mbh-lead--ink {
	color: var(--mbh-ink);
}

.mbh-lead--jam {
	color: var(--mbh-jam);
}

.mbh-h2--design em {
	white-space: nowrap;
}

.mbh-h2--design .mbh-tag {
	margin-top: 0.12em;
}

.mbh-h2--light .mbh-tag {
	background: var(--mbh-cream);
	color: var(--mbh-jam);
}

.mbh-stamplink {
	margin: 0;
}

.mbh-stamplink a {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-family: var(--mbh-stamp);
	font-size: 15px;
	text-transform: uppercase;
	color: var(--mbh-jam);
	text-decoration: none;
}

.mbh-stamplink a span {
	transition: transform 0.3s cubic-bezier(0.34, 1.7, 0.64, 1);
}

.mbh-stamplink a:hover span {
	transform: translateX(4px);
}

/* ------------------------------------------------ Shared buttons + links */
.mbh-pill-btn,
.mbh-cap-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 50px;
	padding: 0 26px;
	border-radius: 999px;
	background: var(--mbh-peach);
	font-family: var(--wp--preset--font-family--primary);
	font-size: 15px;
	font-weight: 800;
	white-space: nowrap;
	color: var(--mbh-jam);
	text-decoration: none;
	transition: transform 0.35s cubic-bezier(0.34, 1.8, 0.64, 1), box-shadow 0.2s;
}

.mbh-pill-btn:hover,
.mbh-cap-btn:hover,
a:hover > .mbh-pill-btn {
	color: var(--mbh-jam);
	transform: translateY(-3px) rotate(-2deg);
	box-shadow: 0 12px 22px -10px rgba(58, 15, 0, 0.45);
}

.mbh-pill-btn--jam,
.mbh-pill-btn--jam:hover,
a:hover > .mbh-pill-btn--jam {
	background: var(--mbh-jam);
	color: var(--mbh-cream);
}

.mbh-cap-btn__cap {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	margin-right: -16px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--mbh-jam);
}

.mbh-cap-btn__cap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mbh-uline {
	padding-bottom: 2px;
	border-bottom: 2.5px solid var(--mbh-peach);
	font-size: 16px;
	font-weight: 700;
	color: var(--mbh-ink);
	text-decoration: none;
}

.mbh-uline--light,
.mbh-byo .mbh-uline {
	color: var(--mbh-cream);
}

/* Handwritten note with an arrow */
.mbh-note {
	display: inline-flex;
	align-items: flex-end;
	gap: 6px;
	font-family: var(--mbh-disp);
	font-size: clamp(23px, 2.1vw, 30px);
	line-height: 1;
	color: var(--mbh-jam);
	transform: rotate(3deg);
}

.mbh-note--peach {
	color: var(--mbh-peach);
}

.mbh-note svg {
	flex: none;
	width: 46px;
	height: 39px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.1;
	stroke-linecap: round;
	stroke-linejoin: round;
	overflow: visible;
	transform: scale(-1, -1);
}

@media (prefers-reduced-motion: reduce) {
	.mbh-pill-btn:hover,
	.mbh-cap-btn:hover,
	a:hover > .mbh-pill-btn {
		transform: none;
	}
}

/* Penster Bross has no "+" glyph; set it in the body font. */
.mbh-plus {
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 800;
}


/* Products without a photo: the brand mark on peach (the design's .ph-fb) instead of the plugin's generic image icon. */
.wb-product-card :has(> .wb-product-card__placeholder) {
	background: #fbe3cb url(/wp-content/uploads/2026/04/MBH-Logos-33-300x292.png) center / 30% no-repeat;
}

.wb-product-card .wb-product-card__placeholder {
	opacity: 0;
}

/*
 * The Grenhill draws "(" and ")" like "<" and ">", which garbles product
 * names such as "Party Pies (Large - 40pc)". "MBH Brackets" holds only those
 * two characters (from the body font) and goes first in the stack wherever
 * product names are set in The Grenhill.
 */
@font-face {
	font-family: "MBH Brackets";
	src: url(../fonts/hanken-grotesk/HankenGrotesk-Variable.woff2) format("woff2");
	font-weight: 100 900;
	font-display: swap;
	unicode-range: U+0028-0029;
}

body .wb-product-card .wb-product-card__title,
body .mbh-mm .mbh-mm__tile .wb-nav-feature-card__title {
	font-family: "MBH Brackets", var(--wp--preset--font-family--subtitle);
}

/*
 * The design's muted brown (#8A6A58) is 4.45:1 on cream, just under WCAG AA
 * for body text. #7E6050 keeps the look and passes on cream, paper and peach.
 * Set on body so it overrides the :root value in the global styles.
 */
body {
	--mbh-mute: #7e6050;
}

/* ------------------------------------------------ Phones: top of the screen
 * The page canvas (iOS status bar / Dynamic Island area, overscroll) is the
 * header's colour rather than the page cream. */
html {
	background-color: var(--mbh-jam-deep, #6e1029);
}

/* Up to 600px wide the admin bar scrolls away with the page, so sticky
 * elements must not keep its 46px offset: it left a see-through band above
 * the header, under the iPhone status bar. */
@media (max-width: 600px) {
	.admin-bar .wp-block-template-part:has(> .mbh-header),
	.admin-bar header:has(> .is-position-sticky) {
		top: 0;
	}

	.admin-bar .wp-block-group.is-position-sticky {
		top: var(--mbh-header-h) !important;
	}

	.admin-bar .mbh-fbar {
		top: var(--mbh-header-h, 98px);
	}

	body.admin-bar {
		--mbh-oa-top: var(--mbh-header-h, 102px);
	}
}

/* Ask Betsy pill: the hero search restyled to the design's button, on the home
   hero and on Betsy's results page (moved from pages/home.css). */
:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__form {
	position: relative;
	padding: 8px 8px 8px 60px;
	border: 0;
	border-radius: 999px;
	background: var(--mbh-paper);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__field {
	border: 0;
	background: transparent;
	box-shadow: none;
}

/* The overlay hides the input's native placeholder while it animates, so it keeps a fill. */
:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__placeholder-overlay {
	background: var(--mbh-paper);
}

:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__form::before {
	content: "✦";
	position: absolute;
	top: 50%;
	left: 8px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--mbh-jam);
	font-size: 16px;
	color: var(--mbh-cream);
	transform: translateY(-50%);
}

:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__icon {
	display: none;
}

:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__input,
:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__placeholder {
	font-size: 16px;
	color: var(--mbh-ink);
}

:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__placeholder {
	color: var(--mbh-mute);
}

:is(.mbh-hero__ask, .wb-ai-results__search-bar) .wb-hero-search__button {
	min-height: 40px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--mbh-peach);
	font-size: 14px;
	font-weight: 800;
	font-family: "Hanken Grotesk", -apple-system, system-ui, sans-serif;
	letter-spacing: normal;
	text-transform: none;
	color: var(--mbh-jam);
}

/* On the light results page the pill needs an edge to stand off the cream. */
.wb-ai-results__search-bar .wb-hero-search__form {
	border: 1px solid rgba(43, 18, 21, 0.14);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}


/* Footer social icons in brand jam on the peach circle. ".mbh-footer a" (cream)
   comes later in the global styles with the same specificity and was winning. */
.mbh-footer .mbh-footer__social a {
	color: var(--mbh-jam);
}
