/**
 * OZB Lead Magnet, front end.
 *
 * Editorial rather than shouty: no urgency devices or countdowns, but enough
 * hierarchy and brand character for the offer to feel intentionally designed.
 * The theme's font stack is inherited so the block still belongs inside the
 * article around it.
 */

.ozb-lm {
	--ozb-lm-ink: #23201d;
	--ozb-lm-muted: #6b645d;
	--ozb-lm-line: #ddd7cf;
	--ozb-lm-surface: #fbf7f1;
	--ozb-lm-accent: #ba0000;
	--ozb-lm-accent-hover: #920000;
	--ozb-lm-accent-ink: #ffffff;

	box-sizing: border-box;
	color: var(--ozb-lm-ink);
	font-size: 16px;
	line-height: 1.55;
	/* The theme tracks out and bolds text inside dark hero sections; the
	   card resets to quiet editorial type. The eyebrow re-adds its own
	   deliberate tracking. */
	letter-spacing: normal;
	font-weight: 400;
	text-align: left;
}

.ozb-lm__subhead,
.ozb-lm__fine {
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.ozb-lm *,
.ozb-lm *::before,
.ozb-lm *::after {
	box-sizing: inherit;
}

/* ---------------------------------------------------------- inline variant */

.ozb-lm--inline {
	display: flex;
	gap: 28px;
	align-items: center;
	margin: 2.25em 0;
	padding: 28px 30px;
	background: linear-gradient(135deg, var(--ozb-lm-surface) 0%, #fffdf9 100%);
	border: 1px solid var(--ozb-lm-line);
	border-top: 3px solid var(--ozb-lm-accent);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(35, 32, 29, 0.07);
}

.ozb-lm--inline .ozb-lm__cover {
	position: relative;
	flex: 0 0 112px;
	width: 112px;
	height: 144px;
	overflow: hidden;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 9px 24px rgba(35, 32, 29, 0.14);
}

.ozb-lm--inline .ozb-lm__cover-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

/* The current Braai Time artwork is a square product mock-up with generous
   white space around the book. Crop the canvas, not the book, so the cover has
   the same visual authority as a purpose-made portrait image. */
.ozb-lm--inline .ozb-lm__cover-img--square {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 162%;
	height: auto;
	max-width: none;
	transform: translate(-50%, -50%);
}

.ozb-lm--inline .ozb-lm__body {
	flex: 1 1 auto;
	min-width: 0;
}

.ozb-lm__headline {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: 1.375em;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.015em;
	text-transform: none;
	color: var(--ozb-lm-ink);
}

.ozb-lm__subhead {
	margin: 0 0 16px;
	font-size: 1em;
	line-height: 1.5;
	color: var(--ozb-lm-muted);
}

.ozb-lm__eyebrow {
	display: inline-flex;
	align-items: center;
	margin: 0 0 9px;
	padding: 5px 9px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--ozb-lm-accent);
	background: rgba(186, 0, 0, 0.07);
	border-radius: 999px;
}

/* ------------------------------------------------------------------- form */

.ozb-lm__form {
	margin: 0;
}

/* Visible to screen readers, redundant for sighted users next to a placeholder. */
.ozb-lm__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ozb-lm__row {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.ozb-lm__email {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 14px;
	/* 16px minimum: iOS Safari zooms the whole page on focus below that. */
	font-size: 16px;
	color: var(--ozb-lm-ink);
	background: #fff;
	border: 1px solid #cfc7be;
	border-radius: 6px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ozb-lm__email::placeholder {
	color: #746b64;
	opacity: 1;
}

.ozb-lm__email:focus,
.ozb-lm__button:focus {
	outline: 2px solid var(--ozb-lm-accent);
	outline-offset: 2px;
}

.ozb-lm__email:focus {
	border-color: var(--ozb-lm-accent);
	box-shadow: 0 0 0 3px rgba(186, 0, 0, 0.1);
}

.ozb-lm__email[aria-invalid="true"] {
	border-color: #8a2b20;
	box-shadow: 0 0 0 3px rgba(138, 43, 32, 0.1);
}

.ozb-lm__button {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-width: 214px;
	height: 48px;
	padding: 0 20px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	color: var(--ozb-lm-accent-ink);
	background: var(--ozb-lm-accent);
	border: 1px solid var(--ozb-lm-accent);
	border-radius: 6px;
	box-shadow: 0 4px 10px rgba(60, 25, 15, 0.12);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ozb-lm__button:hover {
	color: var(--ozb-lm-accent-ink);
	background: var(--ozb-lm-accent-hover);
	border-color: var(--ozb-lm-accent-hover);
	box-shadow: 0 5px 13px rgba(60, 25, 15, 0.16);
}

.ozb-lm__button span {
	white-space: nowrap;
}

.ozb-lm__button-icon {
	flex: 0 0 auto;
	transition: transform 0.15s ease;
}

.ozb-lm__button:hover .ozb-lm__button-icon {
	transform: translateX(2px);
}

.ozb-lm__button[disabled] {
	opacity: 0.55;
	box-shadow: none;
	cursor: default;
}

.ozb-lm__fine {
	margin: 12px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--ozb-lm-muted);
}

.ozb-lm__privacy {
	color: var(--ozb-lm-muted);
	text-decoration: underline;
}

/* Success state: the form fields retire, the headline and subhead carry the
   confirmation. The message element stays in the DOM for the screen-reader
   announcement but is visually hidden, otherwise side-by-side layouts like
   the banner would show the same confirmation twice. */
.ozb-lm--done .ozb-lm__row,
.ozb-lm--done .ozb-lm__fine {
	display: none;
}

.ozb-lm--done .ozb-lm__message {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.ozb-lm__message {
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--ozb-lm-muted);
}

.ozb-lm__message:empty {
	display: none;
}

.ozb-lm__message.is-error {
	color: #8a2b20;
}

/* Off-screen rather than display:none, so bots that skip hidden inputs still fill it. */
.ozb-lm__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------- inline style variants */

/*
 * Charcoal: warm dark panel matching the theme's hero and footer sections.
 * Every colour pairs against #26221e at 4.5:1 or better.
 */
.ozb-lm--style-charcoal {
	background: #26221e;
	border-color: #26221e;
}

.ozb-lm--style-charcoal .ozb-lm__headline {
	color: #f7f3ec;
}

.ozb-lm--style-charcoal .ozb-lm__eyebrow {
	color: #f7f3ec;
	background: rgba(255, 255, 255, 0.12);
}

.ozb-lm--style-charcoal .ozb-lm__subhead {
	color: #cfc7bc;
}

.ozb-lm--style-charcoal .ozb-lm__fine,
.ozb-lm--style-charcoal .ozb-lm__message,
.ozb-lm--style-charcoal .ozb-lm__privacy {
	color: #b8afa2;
}

.ozb-lm--style-charcoal .ozb-lm__email {
	border-color: #4a443c;
}

.ozb-lm--style-charcoal .ozb-lm__email:focus,
.ozb-lm--style-charcoal .ozb-lm__button:focus {
	outline-color: #f7f3ec;
}

.ozb-lm--style-charcoal .ozb-lm__button {
	color: #26221e;
	background: #f7f3ec;
	border-color: #f7f3ec;
	box-shadow: none;
}

.ozb-lm--style-charcoal .ozb-lm__button:hover {
	color: #26221e;
	background: #ffffff;
	border-color: #ffffff;
}

.ozb-lm--style-charcoal .ozb-lm__message.is-error {
	color: #f2b8ad;
}

.ozb-lm--style-charcoal.ozb-lm--done .ozb-lm__message {
	color: #f7f3ec;
}

/*
 * Banner: one wide strip, offer left, form right. For full-width homepage
 * sections and above-footer rows.
 */
.ozb-lm--style-banner .ozb-lm__body {
	display: flex;
	align-items: center;
	gap: 28px;
}

.ozb-lm--style-banner .ozb-lm__intro {
	flex: 1 1 45%;
	min-width: 0;
}

.ozb-lm--style-banner .ozb-lm__form {
	flex: 1 1 55%;
	min-width: 0;
}

.ozb-lm--style-banner .ozb-lm__subhead {
	margin-bottom: 0;
}

.ozb-lm--style-banner .ozb-lm__headline {
	margin-bottom: 6px;
}

/*
 * Stack: single column whatever the viewport, for narrow containers such as
 * sidebar and footer widget columns, which viewport media queries cannot see.
 */
.ozb-lm--stack {
	flex-direction: column;
	align-items: stretch;
}

.ozb-lm--stack .ozb-lm__cover {
	flex: 0 0 auto;
	align-self: flex-start;
}

.ozb-lm--stack .ozb-lm__body {
	display: block;
}

.ozb-lm--stack .ozb-lm__row {
	flex-direction: column;
}

.ozb-lm--stack .ozb-lm__button {
	min-width: 0;
	width: 100%;
}

.ozb-lm--stack .ozb-lm__subhead {
	margin-bottom: 14px;
}

/* ------------------------------------------------------------------ modal */

.ozb-lm-modal[hidden] {
	display: none;
}

.ozb-lm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ozb-lm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 17, 14, 0.55);
}

.ozb-lm-modal__panel {
	position: relative;
	width: 100%;
	max-width: 660px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 18px 48px rgba(20, 17, 14, 0.28);
	animation: ozb-lm-rise 0.22s ease-out;
	outline: none;
}

@keyframes ozb-lm-rise {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/*
 * 44px hit target (WCAG 2.5.5) on a constant white plate, so the only escape
 * control stays visible whatever cover artwork sits behind it.
 */
.ozb-lm-modal__close {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #4a443e;
	background: rgba(255, 255, 255, 0.9);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.ozb-lm-modal__close:hover {
	color: #23201d;
	background: #fff;
}

.ozb-lm-modal__close:focus {
	outline: 2px solid #23201d;
	outline-offset: -2px;
}

.ozb-lm--modal {
	display: block;
}

/*
 * Two-column editorial layout: the book fills the left panel edge to edge,
 * the offer sits right with generous air, vertically centred. The cover
 * artwork is a 3D mockup on a white field, so object-fit cover crops only
 * white and the book always survives the crop.
 */
.ozb-lm--modal {
	display: flex;
	align-items: stretch;
	min-height: 440px;
}

.ozb-lm--modal .ozb-lm__cover {
	position: relative;
	flex: 0 0 44%;
	min-height: 100%;
	overflow: hidden;
	border-right: 1px solid var(--ozb-lm-line);
}

.ozb-lm--modal .ozb-lm__cover-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ozb-lm--modal .ozb-lm__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 44px 40px;
}

.ozb-lm--modal .ozb-lm__eyebrow {
	margin-bottom: 14px;
	font-size: 11px;
	letter-spacing: 0.14em;
}

.ozb-lm--modal .ozb-lm__headline {
	margin-bottom: 12px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 27px;
	font-weight: 400;
	line-height: 1.25;
}

.ozb-lm--modal .ozb-lm__subhead {
	margin-bottom: 22px;
	font-size: 15px;
	line-height: 1.65;
}

.ozb-lm--modal .ozb-lm__row {
	flex-direction: column;
	gap: 10px;
}

.ozb-lm--modal .ozb-lm__email,
.ozb-lm--modal .ozb-lm__button {
	height: 48px;
}

.ozb-lm--modal .ozb-lm__button {
	width: 100%;
	font-size: 15px;
}

.ozb-lm--modal .ozb-lm__fine {
	margin-top: 14px;
}

/* Narrow desktop windows: collapse to a single column, keep the offer. */
@media (max-width: 699px) {
	.ozb-lm--modal {
		min-height: 0;
	}

	.ozb-lm--modal .ozb-lm__cover {
		display: none;
	}

	.ozb-lm--modal .ozb-lm__body {
		padding: 30px 28px;
	}
}

/*
 * Scroll lock. position:fixed is the variant iOS Safari actually honours;
 * the JS stores the scroll offset, sets body top to compensate, and restores
 * on close. Overflow alone lets the page scroll behind the sheet on iOS.
 */
body.ozb-lm-locked {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
}

.ozb-lm-modal__backdrop {
	touch-action: none;
}

/* --------------------------------------------------- mobile bottom sheet */

@media (max-width: 849px) {
	.ozb-lm-modal--sheet {
		align-items: flex-end;
		padding: 0;
	}

	.ozb-lm-modal--sheet .ozb-lm-modal__panel {
		max-width: none;
		max-height: 82vh;
		border-radius: 12px 12px 0 0;
		animation: ozb-lm-slide 0.24s ease-out;
	}

	/* The sheet stays compact and single column: the keyboard already
	   competes for space, so the tall cover panel stays desktop-only. */
	.ozb-lm-modal--sheet .ozb-lm--modal {
		min-height: 0;
	}

	.ozb-lm-modal--sheet .ozb-lm--modal .ozb-lm__cover {
		display: none;
	}

	.ozb-lm-modal--sheet .ozb-lm--modal .ozb-lm__body {
		padding: 26px 24px 28px;
	}

	.ozb-lm-modal--sheet .ozb-lm--modal .ozb-lm__headline {
		font-size: 22px;
	}

	@keyframes ozb-lm-slide {
		from {
			transform: translateY(100%);
		}
		to {
			transform: none;
		}
	}

	.ozb-lm--inline {
		flex-direction: column;
		/* stretch, not flex-start: children must fill the card width or the
		   stacked input and button shrink to content and look ragged. */
		align-items: stretch;
		gap: 20px;
		padding: 24px;
	}

	.ozb-lm--inline .ozb-lm__cover {
		align-self: center;
		flex-basis: 124px;
		width: 96px;
		height: 124px;
	}

	.ozb-lm--inline .ozb-lm__intro,
	.ozb-lm--inline .ozb-lm__fine {
		text-align: center;
	}

	.ozb-lm--inline .ozb-lm__headline {
		font-size: 1.3125em;
	}

	.ozb-lm--inline .ozb-lm__row {
		flex-direction: column;
	}

	.ozb-lm--inline .ozb-lm__button {
		min-width: 0;
		width: 100%;
	}

	/* The banner's side-by-side offer and form stack on small screens. */
	.ozb-lm--style-banner .ozb-lm__body {
		display: block;
	}

	.ozb-lm--style-banner .ozb-lm__subhead {
		margin-bottom: 14px;
	}
}

@media (max-width: 479px) {
	.ozb-lm--inline {
		margin: 1.75em 0;
		padding: 22px 20px;
		border-radius: 8px;
	}

	.ozb-lm--inline .ozb-lm__cover {
		flex-basis: 114px;
		width: 88px;
		height: 114px;
	}

	.ozb-lm--inline .ozb-lm__headline {
		font-size: 1.25em;
	}

	.ozb-lm--inline .ozb-lm__subhead {
		font-size: 0.9375em;
	}
}

@media (prefers-reduced-motion: reduce) {
	/* !important so the sheet variant's more specific animation rule cannot
	   win over the reduced-motion preference. */
	.ozb-lm-modal__panel {
		animation: none !important;
	}

	.ozb-lm__button,
	.ozb-lm__button-icon,
	.ozb-lm__email {
		transition: none;
	}
}
