/*
 * The Quran pieces (src/Embed/Quran.php, PHASE-QURAN2-DESIGN section 2): the door (banner, card, link), the button and
 * the round-up. One stylesheet for every place they show: an iframe embed (after QuranLooks' :root rules), the script
 * embed's shadow root (:host), Muslim.Blue's own pages and the examples page (.mbq-look--{site}).
 *
 * A partner's look is a few custom properties, set on any ancestor:
 *   --mbq-ink  --mbq-paper  --mbq-accent  --mbq-accent-ink  --mbq-radius  --mbq-font  --mbq-head-weight
 * and, when the defaults are not right, --mbq-head-font, --mbq-link, --mbq-button-radius, --mbq-cover, --mbq-gilt.
 *
 * Each piece sizes itself by its own width (container queries), so the same banner is a band in a page body and a
 * stack in a sidebar. Body text never under 17 px, nothing under 14 px, every target 48 px. Nothing loads anything.
 */
.mbq-p {
	--_ink: var(--mbq-ink, #0f1d33);
	--_paper: var(--mbq-paper, #ffffff);
	--_accent: var(--mbq-accent, #1b4f9c);
	--_on: var(--mbq-accent-ink, #ffffff);
	--_r: var(--mbq-radius, 12px);
	--_br: var(--mbq-button-radius, var(--_r));
	--_font: var(--mbq-font, inherit);
	--_hfont: var(--mbq-head-font, var(--_font));
	--_hw: var(--mbq-head-weight, 600);
	--_link: var(--mbq-link, var(--_accent));
	--_cover: var(--mbq-cover, var(--_accent));
	--_gilt: var(--mbq-gilt, #e9d9a6);
	--_muted: color-mix(in srgb, var(--_ink) 74%, var(--_paper));
	--_line: color-mix(in srgb, var(--_ink) 15%, var(--_paper));
	--_edge: color-mix(in srgb, var(--_ink) 32%, var(--_paper));
	--_tint: color-mix(in srgb, var(--_accent) 8%, var(--_paper));
	--_tint-2: color-mix(in srgb, var(--_link) 12%, var(--_paper));
	--_sill: color-mix(in srgb, var(--_accent) 34%, var(--_paper));
	box-sizing: border-box;
	max-inline-size: 100%;
	margin: 0;
	color: var(--_ink);
	font-family: var(--_font);
	font-size: max(1rem, 17px);
	line-height: 1.55;
	text-align: start;
	overflow-wrap: break-word;
}
@media (min-width: 64rem) {
	.mbq-p {
		font-size: max(1.125rem, 18px);
	}
}
.mbq-p *,
.mbq-p *::before,
.mbq-p *::after {
	box-sizing: inherit;
}
.mbq-p p {
	margin: 0;
}
.mbq-sr {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---- Buttons: one fill, one quiet; the price sits after a small dot, never in a sticker ---- */
.mbq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	min-block-size: 48px;
	padding: 0.65em 1.2em;
	border: 1.5px solid transparent;
	border-radius: var(--_br);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.005em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
/* Prefixed with .mbq-p so a host page's own link rules (".site a { color }") never repaint a button. */
.mbq-p .mbq-btn {
	text-decoration: none;
}
.mbq-p .mbq-btn--fill,
.mbq-p .mbq-btn--fill:visited {
	background: var(--_accent);
	color: var(--_on);
}
.mbq-p .mbq-btn--fill:hover {
	background: color-mix(in srgb, var(--_accent) 86%, var(--_ink));
	color: var(--_on);
}
.mbq-p .mbq-btn--quiet,
.mbq-p .mbq-btn--quiet:visited {
	border-color: var(--_edge);
	background: var(--_paper);
	color: var(--_link);
}
.mbq-p .mbq-btn--quiet:hover {
	border-color: var(--_link);
	background: var(--_tint);
	color: var(--_link);
}
.mbq-btn:focus-visible,
.mbq-a:focus-visible,
.mbq-chip:has(input:focus-visible) {
	outline: 3px solid var(--_link);
	outline-offset: 2px;
}
.mbq-btn__dot {
	flex: none;
	inline-size: 0.28em;
	block-size: 0.28em;
	margin-inline: 0.4em;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.55;
}
.mbq-p .mbq-btn__dot + .mbq-sr + .mbq-btn__price,
.mbq-btn__price {
	white-space: nowrap;
	font-variant-numeric: lining-nums;
}
/* A button's words never break inside themselves; on a narrow button the price moves below them. */
.mbq-btn {
	flex-wrap: wrap;
}
.mbq-btn__words {
	white-space: nowrap;
}
/* The words and the price are one run: the dot carries the space between them (the gap would add to it). */
.mbq-btn:has(.mbq-btn__dot) {
	column-gap: 0;
}
.mbq-btn--request:has(.mbq-btn__dot) .mbq-glyph {
	margin-inline-end: 0.55em;
}
/* The dot and the price travel together; a narrow piece puts the price on its own quiet line, with no dot. */
.mbq-btn__tail {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}
.mbq-nb {
	white-space: nowrap;
}
.mbq-button {
	container-type: inline-size;
}
@container (max-width: 18.75rem) {
	.mbq-btn--request {
		row-gap: 0.1em;
	}
	.mbq-btn--request .mbq-btn__dot {
		display: none;
	}
	.mbq-btn--request .mbq-btn__tail {
		flex-basis: 100%;
		justify-content: center;
		font-weight: 500;
		opacity: 0.88;
	}
}
/* A door in a sidebar: tighter buttons keep "Get a Quran • $14.99" on one line down to 240 px... */
@container (max-width: 20rem) {
	.mbq-door .mbq-btn {
		padding-inline: 0.7em;
		letter-spacing: 0;
	}
	.mbq-door .mbq-btn__dot {
		margin-inline: 0.32em;
	}
	.mbq-door .mbq-door__words {
		padding-inline: 16px;
	}
}
/* ...and below 240 px the price takes its own quiet line, with no dot. */
@container (max-width: 15rem) {
	.mbq-door .mbq-btn {
		row-gap: 0.05em;
	}
	.mbq-door .mbq-btn__dot {
		display: none;
	}
	.mbq-door .mbq-btn__tail {
		flex-basis: 100%;
		justify-content: center;
		font-weight: 500;
		opacity: 0.88;
	}
}
.mbq-glyph {
	flex: none;
	inline-size: 1.15em;
	block-size: 1.15em;
}

/* ---- The pocket Quran: upright on its ledge, in its niche ---- */
.mbq-art {
	display: block;
	inline-size: 100%;
	block-size: auto;
	overflow: visible;
}
.mbq-art__niche { fill: var(--_paper); }
.mbq-art__arch { stroke: var(--_sill); stroke-width: 1.2; }
.mbq-art__shade { fill: var(--_ink); opacity: 0.14; }
.mbq-art__ledge { fill: var(--_sill); }
.mbq-art__pages { fill: color-mix(in srgb, var(--_gilt) 22%, #ffffff); }
.mbq-art__leaf { stroke: color-mix(in srgb, var(--_gilt) 55%, #7a6a4a); stroke-width: 0.6; opacity: 0.7; }
.mbq-art__cover { fill: var(--_cover); stroke: var(--mbq-edge, transparent); stroke-width: 1; }
.mbq-art__spine { fill: color-mix(in srgb, var(--_cover) 72%, #000000); }
.mbq-art__hinge { stroke: var(--_gilt); stroke-width: 0.8; opacity: 0.45; }
.mbq-art__frame { stroke: var(--_gilt); stroke-width: 1.1; }
.mbq-art__frame--in { stroke-width: 0.6; opacity: 0.6; }
.mbq-art__gem { fill: var(--_gilt); }
.mbq-art__ribbon { fill: #c9a45c; }

/* ---- The door ---- */
.mbq-door {
	container-type: inline-size;
	position: relative;
	overflow: hidden;
	background: var(--_paper);
	border: 1px solid var(--_line);
	border-radius: var(--_r);
}
.mbq-door__art {
	display: grid;
	place-items: center;
	padding: 24px;
	background: var(--_tint);
	border-block-end: 1px solid var(--_line);
}
.mbq-door__art .mbq-art {
	inline-size: 96px;
}
.mbq-door__words {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 18px 20px;
	min-inline-size: 0;
}
.mbq-door__title {
	margin: 0;
	color: var(--_ink);
	font-family: var(--_hfont);
	font-size: 1.4em;
	font-weight: var(--_hw);
	line-height: 1.18;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
.mbq-door__pitch {
	max-inline-size: 46ch;
	color: var(--_muted);
	text-wrap: pretty;
}
.mbq-p .mbq-door__acts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-block-start: 6px;
}
.mbq-door__acts .mbq-btn {
	flex: 1 1 auto;
}
.mbq-door__count {
	color: var(--_muted);
	font-size: max(0.85em, 14px);
	line-height: 1.45;
}
.mbq-door__count strong {
	color: var(--_ink);
	font-weight: 700;
}

/* The banner: a band beside its picture once there is room (the piece's own width, not the page's). */
.mbq-door__in {
	display: block;
}
@container (min-width: 32rem) {
	.mbq-door--banner .mbq-door__in {
		display: grid;
		grid-template-columns: minmax(150px, 30%) minmax(0, 1fr);
		align-items: stretch;
	}
	.mbq-door--banner .mbq-door__art {
		padding: 24px;
		border-block-end: 0;
		border-inline-end: 1px solid var(--_line);
	}
	.mbq-door--banner .mbq-door__art .mbq-art {
		inline-size: min(124px, 100%);
	}
	.mbq-door--banner .mbq-door__words {
		justify-content: center;
		gap: 12px;
		padding: 26px 28px 26px;
	}
	.mbq-door--banner .mbq-door__title {
		font-size: 1.65em;
	}
	.mbq-door--banner .mbq-door__acts .mbq-btn {
		flex: 0 1 auto;
	}
}
@container (min-width: 50rem) {
	.mbq-door--banner .mbq-door__in {
		grid-template-columns: 200px minmax(0, 1fr);
	}
	.mbq-door--banner .mbq-door__words {
		padding: 30px 40px;
	}
	.mbq-door--banner .mbq-door__title {
		font-size: 1.85em;
	}
}
/* From 900 px the banner fills its width in three columns: the picture, the words, the actions on the right. */
@container (min-width: 56rem) {
	.mbq-door--banner .mbq-door__words {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "title acts" "pitch acts" "count acts";
		align-content: center;
		column-gap: 40px;
		row-gap: 10px;
	}
	.mbq-door--banner .mbq-door__title { grid-area: title; }
	.mbq-door--banner .mbq-door__pitch { grid-area: pitch; }
	.mbq-door--banner .mbq-door__count { grid-area: count; }
	.mbq-p .mbq-door--banner .mbq-door__acts,
	.mbq-door--banner .mbq-door__acts {
		grid-area: acts;
		flex-direction: column;
		align-self: center;
		margin: 0;
		min-inline-size: 13rem;
	}
	.mbq-door--banner .mbq-door__acts .mbq-btn {
		inline-size: 100%;
	}
}

/* The card: the picture above, the actions stacked, for a sidebar or a resource page. */
.mbq-door--card {
	max-inline-size: 26rem;
}
.mbq-door--card .mbq-door__art .mbq-art {
	inline-size: 104px;
}
.mbq-door--card .mbq-door__acts {
	flex-direction: column;
}
.mbq-door--card .mbq-door__acts .mbq-btn {
	inline-size: 100%;
}

/* ---- The link: one line of text, for a footer or an FAQ answer ---- */
.mbq-link {
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}
.mbq-p .mbq-a,
.mbq-p .mbq-a:visited {
	color: var(--_link);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
.mbq-p .mbq-a:hover {
	color: var(--_link);
	text-decoration-thickness: 2px;
}

/* ---- The button ---- */
.mbq-button {
	display: block;
}
.mbq-btn--request {
	padding-inline: 1.05em 1.25em;
}

/* ---- The round-up: a partner checkout's panel; neither choice is chosen until the shopper taps it ---- */
.mbq-round {
	min-inline-size: 0;
	padding: 16px 18px 18px;
	background: var(--_paper);
	border: 1px solid var(--_line);
	border-radius: var(--_r);
}
.mbq-round__ask {
	float: left;
	display: flex;
	align-items: flex-start;
	gap: 0.55em;
	inline-size: 100%;
	margin: 0 0 12px;
	padding: 0;
	color: var(--_ink);
	font-family: var(--_hfont);
	font-size: 1.12em;
	font-weight: var(--_hw);
	line-height: 1.3;
}
.mbq-round__ask .mbq-glyph {
	margin-block-start: 0.12em;
	color: var(--_link);
}
.mbq-round__opts {
	clear: both;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}
@container (min-width: 20rem) {
	.mbq-round__opts {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
	}
}
.mbq-round {
	container-type: inline-size;
}
.mbq-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	min-block-size: 52px;
	padding: 10px 14px;
	border: 1.5px solid var(--_edge);
	border-radius: var(--_br);
	background: var(--_paper);
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}
.mbq-chip:hover {
	border-color: var(--_link);
}
.mbq-chip:has(input:checked) {
	border-color: var(--_link);
	background: var(--_tint-2);
	box-shadow: inset 0 0 0 1px var(--_link);
}
/* Drawn radios: a ring in the text's color on any ground, light or dark, filled when chosen. */
.mbq-chip input {
	flex: none;
	inline-size: 20px;
	block-size: 20px;
	font: inherit;
	margin: 0;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
}
.mbq-chip input:checked {
	border-color: var(--_link);
	background: radial-gradient(circle, var(--_link) 0 42%, transparent 46%);
}
.mbq-chip input:focus-visible {
	outline: none;
}
.mbq-chip__words {
	font-weight: 700;
	font-variant-numeric: lining-nums;
	line-height: 1.25;
}
.mbq-chip__small {
	color: var(--_muted);
	font-weight: 400;
	white-space: nowrap;
}
/* "Remove": a quiet link that shows only once a choice is tapped, and puts the panel back to none. */
.mbq-p .mbq-round__undo {
	display: none;
	margin-block-start: 10px;
}
.mbq-round:has(.mbq-chip input:checked) .mbq-round__undo {
	display: block;
}
.mbq-round__undo label {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	cursor: pointer;
	font-weight: 600;
}
.mbq-round__none {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	opacity: 0;
	pointer-events: none;
}
.mbq-round__undo:has(.mbq-round__none:focus-visible) label {
	outline: 3px solid var(--_link);
	outline-offset: 2px;
}
.mbq-p .mbq-round__fine {
	max-inline-size: 52ch;
	margin-block-start: 12px;
	color: var(--_muted);
	line-height: 1.5;
	text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
	.mbq-btn,
	.mbq-chip {
		transition: none;
	}
}
@media (forced-colors: active) {
	.mbq-btn,
	.mbq-chip,
	.mbq-door,
	.mbq-round {
		border-color: CanvasText;
	}
}
.mbq-round { position: relative; }
