/**
 * Hibaat Zakat Calculator — the home page zakat section.
 * ---------------------------------------------------------------------------
 * WHERE THE COLOURS COME FROM
 *   Same arrangement as hz-calculator.css: the Hibaat theme publishes its
 *   palette as CSS variables on :root, this file reads them, and the Hibaat
 *   values are written out as fallbacks. So the section inherits the site's
 *   palette when the theme is active, and still looks like Hibaat anywhere else.
 *
 * SCOPING AND SPECIFICITY
 *   Every rule is written as `.hz-teaser .hz-teaser__x` — two classes, not one.
 *   That is deliberate. When the Hibaat theme is active the markup also carries
 *   the theme's own animation classes (.hb-h2, .hb-fade, .hb-line), and the
 *   theme stylesheet is printed after this one, so a single-class rule here
 *   would lose every tie. Two classes wins, and the section keeps its own type
 *   scale while still animating with the rest of the page.
 *
 * @package Hibaat_Zakat_Calculator
 */

/* =========================================================================
 * TOKENS
 * ====================================================================== */

.hz-teaser {
	--hz-ivory:    var(--ivory, #FBFAF7);
	--hz-espresso: var(--espresso, #241E16);
	--hz-gold:     var(--gold, #B08D57);
	--hz-cream:    var(--cream, #F3ECDF);
	--hz-muted:    var(--muted, #7A6F60);
	--hz-gold-rgb: var(--gold-rgb, 176, 141, 87);

	--hz-serif:    var(--serif, 'Marcellus', 'Times New Roman', serif);
	--hz-ital:     var(--ital, 'Cormorant Garamond', Georgia, serif);
	--hz-sans:     var(--sans, 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);

	--hz-ease:     var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
	--hz-lattice:  var(--lattice-repeat, 46px);

	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	margin: 0;
	padding: clamp(76px, 9vw, 132px) clamp(24px, 6vw, 88px);
	background: var(--hz-cream);
	color: var(--hz-espresso);
	font-family: var(--hz-sans);
	font-weight: 300;
	text-align: center;
}

.hz-teaser *,
.hz-teaser *::before,
.hz-teaser *::after {
	box-sizing: border-box;
}

/* =========================================================================
 * THE LACE IN THE CORNER
 * The theme supplies the diamond geometry through .hb-lattice. Off the Hibaat
 * theme that class is absent, so the same geometry is written out here.
 * ====================================================================== */

.hz-teaser .hz-teaser__lace {
	position: absolute;
	top: 0;
	left: 0;
	width: clamp(180px, 26vw, 340px);
	height: clamp(180px, 26vw, 340px);
	opacity: 0.55;
	pointer-events: none;
	background-image:
		repeating-linear-gradient(45deg,  rgba(var(--hz-gold-rgb), 0.14) 0px, rgba(var(--hz-gold-rgb), 0.14) 1px, transparent 1px, transparent var(--hz-lattice)),
		repeating-linear-gradient(-45deg, rgba(var(--hz-gold-rgb), 0.14) 0px, rgba(var(--hz-gold-rgb), 0.14) 1px, transparent 1px, transparent var(--hz-lattice));
	-webkit-mask-image: linear-gradient(135deg, #000 0%, rgba(0, 0, 0, 0) 72%);
	mask-image: linear-gradient(135deg, #000 0%, rgba(0, 0, 0, 0) 72%);
}

/* The mirror image, bottom right, so the section is framed rather than
   weighted to one corner. */
.hz-teaser::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	width: clamp(180px, 26vw, 340px);
	height: clamp(180px, 26vw, 340px);
	opacity: 0.55;
	pointer-events: none;
	background-image:
		repeating-linear-gradient(45deg,  rgba(var(--hz-gold-rgb), 0.14) 0px, rgba(var(--hz-gold-rgb), 0.14) 1px, transparent 1px, transparent var(--hz-lattice)),
		repeating-linear-gradient(-45deg, rgba(var(--hz-gold-rgb), 0.14) 0px, rgba(var(--hz-gold-rgb), 0.14) 1px, transparent 1px, transparent var(--hz-lattice));
	-webkit-mask-image: linear-gradient(-45deg, #000 0%, rgba(0, 0, 0, 0) 72%);
	mask-image: linear-gradient(-45deg, #000 0%, rgba(0, 0, 0, 0) 72%);
}

/* =========================================================================
 * CONTENT COLUMN
 * ====================================================================== */

.hz-teaser .hz-teaser__inner {
	position: relative;
	z-index: 1;
	max-width: 760px;
	margin: 0 auto;
}

.hz-teaser .hz-teaser__eyebrow {
	margin: 0 0 clamp(20px, 2.4vw, 30px);
	font-family: var(--hz-sans);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--hz-gold);
}

.hz-teaser .hz-teaser__h {
	margin: 0;
	font-family: var(--hz-serif);
	font-weight: 400;
	font-size: clamp(30px, 4.4vw, 54px);
	line-height: 1.14;
	letter-spacing: 0.005em;
	color: var(--hz-espresso);
}

/* Masked line reveal. The theme animates these when it is active; here they
   only need to be block-level so each line sits on its own row. */
.hz-teaser .hz-teaser__mask { display: block; }
.hz-teaser .hz-teaser__line { display: block; }

/* The diamond between the heading and the paragraph. */
.hz-teaser .hz-teaser__mark {
	position: relative;
	display: block;
	width: 11px;
	height: 11px;
	margin: clamp(26px, 3.4vw, 40px) auto clamp(24px, 3vw, 34px);
	border: 1px solid var(--hz-gold);
	transform: rotate(45deg);
}

.hz-teaser .hz-teaser__mark > i {
	position: absolute;
	inset: 3px;
	display: block;
	background: var(--hz-gold);
}

.hz-teaser .hz-teaser__p {
	max-width: 62ch;
	margin: 0 auto 1.1em;
	font-size: clamp(15px, 1.15vw, 16.5px);
	font-weight: 300;
	line-height: 1.78;
	color: var(--hz-muted);
}

.hz-teaser .hz-teaser__p:last-of-type {
	margin-bottom: 0;
}

/* =========================================================================
 * THE BUTTON
 * Rewritten rather than borrowed, so it behaves the same on any theme. The
 * fill wipes in from the left on hover, as the theme's solid button does.
 * ====================================================================== */

.hz-teaser .hz-teaser__btn {
	position: relative;
	z-index: 0;
	display: inline-block;
	overflow: hidden;
	margin-top: clamp(32px, 3.6vw, 46px);
	padding: 18px 40px;
	border: none;
	background: var(--hz-espresso);
	color: var(--hz-cream);
	font-family: var(--hz-sans);
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.24em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.45s var(--hz-ease), letter-spacing 0.45s var(--hz-ease);
}

.hz-teaser .hz-teaser__btn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--hz-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.45s var(--hz-ease);
}

.hz-teaser .hz-teaser__btn:hover,
.hz-teaser .hz-teaser__btn:focus-visible {
	color: var(--hz-espresso);
	letter-spacing: 0.26em;
}

.hz-teaser .hz-teaser__btn:hover::before,
.hz-teaser .hz-teaser__btn:focus-visible::before {
	transform: scaleX(1);
}

.hz-teaser .hz-teaser__btn:focus-visible {
	outline: 2px solid var(--hz-gold);
	outline-offset: 3px;
}

.hz-teaser .hz-teaser__btn-t {
	position: relative;
	z-index: 1;
}

/* =========================================================================
 * THE VERSE
 * ====================================================================== */

.hz-teaser .hz-teaser__verse {
	margin: clamp(46px, 5.4vw, 74px) auto 0;
	max-width: 620px;
}

.hz-teaser .hz-teaser__rule {
	display: block;
	width: 56px;
	height: 1px;
	margin: 0 auto clamp(24px, 2.8vw, 34px);
	background: rgba(var(--hz-gold-rgb), 0.5);
}

.hz-teaser .hz-teaser__quote {
	margin: 0;
	padding: 0;
	border: none;
	font-family: var(--hz-ital);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(17px, 1.6vw, 21px);
	line-height: 1.62;
	color: var(--hz-espresso);
	quotes: none;
}

.hz-teaser .hz-teaser__quote::before,
.hz-teaser .hz-teaser__quote::after {
	content: none;
}

.hz-teaser .hz-teaser__src {
	margin: clamp(14px, 1.6vw, 20px) 0 0;
	font-family: var(--hz-sans);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--hz-gold);
}

/* =========================================================================
 * THE "NO CALCULATOR PAGE YET" NOTICE
 * Shown to logged-in editors only. A visitor never reaches this markup.
 * ====================================================================== */

.hz-teaser .hz-teaser__setup {
	max-width: 62ch;
	margin: clamp(32px, 3.6vw, 46px) auto 0;
	padding: 18px 22px;
	border: 1px dashed rgba(var(--hz-gold-rgb), 0.7);
	background: rgba(255, 255, 255, 0.5);
	font-size: 14px;
	line-height: 1.7;
	text-align: left;
	color: var(--hz-espresso);
}

.hz-teaser .hz-teaser__setup strong {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.hz-teaser .hz-teaser__setup code {
	padding: 2px 6px;
	background: rgba(var(--hz-gold-rgb), 0.14);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.92em;
	white-space: nowrap;
}

/* =========================================================================
 * NARROW SCREENS
 * ====================================================================== */

@media (max-width: 640px) {

	.hz-teaser {
		padding: 68px 22px 72px;
	}

	.hz-teaser .hz-teaser__lace,
	.hz-teaser::after {
		width: 150px;
		height: 150px;
		opacity: 0.4;
	}

	.hz-teaser .hz-teaser__btn {
		display: block;
		width: 100%;
		padding: 18px 20px;
		letter-spacing: 0.18em;
	}

	.hz-teaser .hz-teaser__btn:hover,
	.hz-teaser .hz-teaser__btn:focus-visible {
		letter-spacing: 0.18em;
	}
}

/* =========================================================================
 * REDUCED MOTION
 * The theme has its own handling; this covers the section standing alone.
 * ====================================================================== */

@media (prefers-reduced-motion: reduce) {

	.hz-teaser .hz-teaser__btn,
	.hz-teaser .hz-teaser__btn::before {
		transition: none;
	}
}
