/**
 * Home page v5 — section styling that theme.json can't express.
 * Loaded only on pages containing an `ab-home-` marker class (see inc/enqueue.php).
 * Colours/spacing come from theme.json tokens + the v5 --wp--custom-- scale.
 */

/* ---- Shared ------------------------------------------------------------- */
.ab-home-eyebrow {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	line-height: 1;
}
/* Light eyebrow on dark bands inherits the band's white text. */
.ab-home-eyebrow--light {
	color: rgba(255, 255, 255, 0.85);
}

/* v5 section headings are Fraunces SemiBold (600), not the theme default 700.
   (Inline weights — e.g. the giving panel's 500 h3 — still win, as intended.) */
.ab-home-why .wp-block-heading,
.ab-home-problem .wp-block-heading,
.ab-home-proof .wp-block-heading,
.ab-home-zakat .wp-block-heading,
.ab-home-take-action .wp-block-heading,
.ab-home-giving .wp-block-heading,
.ab-home-cta .wp-block-heading {
	font-weight: 600;
}

/* Fully-rounded pill buttons (Give Today / Become A Monthly Giver / Donate Now
   / Give Your Zakat) and their ghost/outline variants keep text on one line. */
.ab-pill .wp-block-button__link {
	white-space: nowrap;
	font-weight: 600;
}
.ab-pill--ghost .wp-block-button__link:hover,
.ab-pill--ghost .wp-block-button__link:focus {
	background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   The Problem
   ========================================================================== */
.ab-home-problem__bignum {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(2.75rem, 5vw, 4rem);
	font-weight: 600;
	line-height: 1;
}
.ab-home-problem__box {
	background: rgba(13, 114, 186, 0.04);
}

/* ==========================================================================
   Because Sight Changes Everything (CSS-only tab switcher)
   ========================================================================== */
.ab-home-why__widget {
	max-width: 1200px;
	margin-inline: auto;
}
/* Radios drive the switch but stay invisible (still keyboard-focusable). */
.ab-home-why__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.ab-home-why__stage {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	aspect-ratio: 16 / 8;
	background: var(--wp--custom--neutral--100);
}
/* One panel shows at a time; the checked tab's panel is switched to display:block
   by the per-instance CSS generated in albasar_render_why_tabs(). */
.ab-home-why__panel {
	position: absolute;
	inset: 0;
	margin: 0;
	display: none;
}
.ab-home-why__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ab-home-why__img--empty {
	background: var(--wp--custom--neutral--100);
}
/* Chips sit over the top-left of the stage. */
.ab-home-why__chips {
	position: relative;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	padding: 20px;
	margin-bottom: -74px; /* overlap the stage below */
	pointer-events: none;
}
.ab-home-why__chip {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	padding: 9px 18px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	color: var(--wp--preset--color--ab-navy);
	font: 500 0.875rem/1 var(--wp--preset--font-family--sans);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	backdrop-filter: blur(2px);
	transition: background-color 0.15s ease, color 0.15s ease;
}
.ab-home-why__chip:hover {
	background: #fff;
}
/* Overlay card, bottom-right of the stage. */
.ab-home-why__card {
	position: absolute;
	right: 22px;
	bottom: 22px;
	z-index: 3;
	max-width: 340px;
	padding: 22px 24px;
	background: #fff;
	border-radius: 6px;
	box-shadow: var(--wp--preset--shadow--raised);
}
.ab-home-why__copy {
	margin: 0;
	color: var(--wp--preset--color--ab-ink);
	font-size: 1.0625rem;
	line-height: 1.45;
}
.ab-home-why__link {
	display: inline-block;
	margin-top: 16px;
	padding-bottom: 3px;
	border-bottom: 1.5px solid var(--wp--preset--color--ab-orange);
	color: var(--wp--preset--color--ab-navy);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}
.ab-home-why__link:hover {
	color: var(--wp--preset--color--ab-orange);
}
/* Show the checked tab's panel + activate its chip. Radios precede both. */
/* The checked-tab panel/chip switching rules are generated per-instance in
   albasar_render_why_tabs() (dynamic tab count), so no fixed IDs live here. */

/* ==========================================================================
   Proof + interactive map
   ========================================================================== */
.ab-home-proof {
	border-bottom: 1px solid var(--wp--preset--color--ab-line);
}
.ab-home-proof__stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	max-width: 1000px;
	margin: 0 auto var(--wp--preset--spacing--70);
	text-align: center;
}
.ab-home-proof__num {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(2.5rem, 4.5vw, 3.5rem);
	font-weight: 400;
	line-height: 1;
	color: var(--wp--custom--neutral--700);
}
.ab-home-proof__suffix {
	color: var(--wp--preset--color--ab-orange);
}
.ab-home-proof__stat-label {
	display: block;
	margin-top: 12px;
	font-size: 1rem;
	font-weight: 500;
	color: var(--wp--preset--color--ab-navy);
}
.ab-home-proof__mapwrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	border: 1px solid var(--wp--preset--color--ab-line);
	border-radius: 12px;
}
.ab-home-proof__map {
	position: relative;
	line-height: 0;
}
.ab-home-proof__mapimg {
	width: 100%;
	height: auto;
	display: block;
}
.ab-home-proof__marker {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 15px;
	height: 15px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
	cursor: pointer;
	transition: transform 0.12s ease;
}
.ab-home-proof__marker--reached {
	background: var(--wp--preset--color--ab-orange-600);
}
.ab-home-proof__marker--hospital {
	background: var(--wp--preset--color--ab-blue);
}
.ab-home-proof__marker:hover,
.ab-home-proof__marker:focus-visible {
	transform: translate(-50%, -50%) scale(1.35);
	outline: none;
	z-index: 5;
}
.ab-home-proof__tip {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	padding: 7px 11px;
	border-radius: 6px;
	background: var(--wp--preset--color--ab-navy);
	color: #fff;
	font-size: 0.8125rem;
	line-height: 1;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.12s ease;
}
.ab-home-proof__tip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: var(--wp--preset--color--ab-navy);
}
.ab-home-proof__marker:hover .ab-home-proof__tip,
.ab-home-proof__marker:focus-visible .ab-home-proof__tip {
	opacity: 1;
}
.ab-home-proof__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	max-width: 1200px;
	margin: 20px auto 0;
	padding: 18px 22px;
	border: 1px solid var(--wp--preset--color--ab-line);
	border-radius: 10px;
}
.ab-home-proof__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--ab-ink);
}
.ab-home-proof__swatch {
	width: 15px;
	height: 15px;
	border-radius: 3px;
	flex: 0 0 auto;
}
.ab-home-proof__swatch--reached {
	background: var(--wp--preset--color--ab-orange);
}
.ab-home-proof__swatch--hospital {
	background: var(--wp--preset--color--ab-blue);
}

/* ==========================================================================
   Ready To Change A Life — slider
   ========================================================================== */
.ab-home-take-action {
	border-bottom: 1px solid var(--wp--preset--color--ab-line);
}
.ab-home-ta {
	max-width: 1500px;
	margin-inline: auto;
}
/* Border-box so the dark card's padding doesn't widen it past its flex-basis
   (otherwise the padded card overflows the row and gets clipped). */
.ab-home-ta,
.ab-home-ta *,
.ab-home-ta *::before,
.ab-home-ta *::after {
	box-sizing: border-box;
}
.ab-home-ta__track {
	display: flex;
	gap: 15px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding-bottom: 4px;
}
.ab-home-ta__track::-webkit-scrollbar {
	display: none;
}
.ab-home-ta__card {
	/* Four cards (363.75px each, 15px gaps) fill the 1500 band on desktop, matching
	   the comp; the row still scroll-snaps, so more cards turn it into a working
	   carousel driven by the arrows. White card with a hairline border + 8px radius. */
	flex: 0 0 calc((100% - 3 * 15px) / 4);
	scroll-snap-align: start;
	border: 0.5px solid var(--wp--preset--color--ab-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	aspect-ratio: 364 / 450;
}
.ab-home-ta__card--photo {
	position: relative;
	display: block;
	text-decoration: none;
}
.ab-home-ta__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ab-home-ta__bar {
	position: absolute;
	left: 42px;
	right: 42px;
	bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 15px;
	border-radius: 4px;
	background: rgba(17, 24, 33, 0.55);
	backdrop-filter: blur(3px);
	color: #fff;
}
.ab-home-ta__label {
	font: 500 1.0625rem/1.1 var(--wp--preset--font-family--sans);
	letter-spacing: 1.4px;
	text-transform: uppercase;
}
.ab-home-ta__card--dark {
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: var(--wp--custom--neutral--900);
	color: #fff;
	padding: 28px;
}
.ab-home-ta__dark-title {
	margin: 0 0 14px;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	color: #fff;
}
.ab-home-ta__dark-body {
	margin: 0 0 22px;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.82);
}
.ab-home-ta__dark-btn {
	align-self: flex-start;
	padding: 12px 22px;
	border-radius: 6px;
	background: var(--wp--preset--color--ab-orange);
	color: #fff;
	font: 600 0.875rem/1 var(--wp--preset--font-family--sans);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}
.ab-home-ta__dark-btn:hover {
	background: var(--wp--preset--color--ab-orange-600);
}
.ab-home-ta__nav {
	display: flex;
	justify-content: center;
	gap: 130px;
	margin-top: 40px;
}
.ab-home-ta__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	padding: 10px;
	border: 0;
	background: transparent;
	color: var(--wp--custom--neutral--700);
	cursor: pointer;
	transition: color 0.15s ease, opacity 0.15s ease;
}
.ab-home-ta__arrow svg {
	width: 48px;
	height: 48px;
}
.ab-home-ta__arrow:hover {
	color: var(--wp--preset--color--ab-navy);
}
.ab-home-ta__arrow[disabled] {
	opacity: 0.3;
	cursor: default;
}

/* ==========================================================================
   Steady Giving — newsletter panel
   ========================================================================== */
.ab-home-giving {
	background: var(--wp--custom--paper);
}
/* Subtle panel: white on the warm paper section reads as a faint card. */
.ab-home-giving__panel {
	box-shadow: 0 1px 2px rgba(12, 46, 78, 0.03);
}
.ab-home-giving__sub {
	margin: 10px 0 20px;
	font-size: 14px;
	line-height: 26px;
	color: var(--wp--custom--neutral--700);
}
.ab-home-giving__form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.ab-home-giving__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.ab-home-giving__field {
	width: 100%;
	padding: 16px 20px;
	border: 1px solid var(--wp--custom--neutral--200);
	border-radius: 8px;
	background: #fff;
	font: 400 1rem/1.2 var(--wp--preset--font-family--sans);
	color: var(--wp--custom--neutral--900);
	box-sizing: border-box;
}
.ab-home-giving__field::placeholder {
	color: var(--wp--custom--neutral--400);
	opacity: 1;
}
.ab-home-giving__field:focus {
	outline: 0;
	border-color: var(--wp--preset--color--ab-blue);
	box-shadow: 0 0 0 2px rgba(13, 114, 186, 0.2);
}
.ab-home-giving__submit {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 0;
	padding: 12px 34px;
	border: 0;
	border-radius: 8px;
	background: var(--wp--preset--color--ab-blue);
	color: #fff;
	font: 500 1rem/1 var(--wp--preset--font-family--sans);
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.ab-home-giving__submit:hover,
.ab-home-giving__submit:focus-visible {
	background: var(--wp--preset--color--ab-navy);
	outline: none;
}
.ab-home-giving__fine {
	margin: 20px 0 0;
	font-size: 0.8125rem;
	font-weight: 300;
	color: var(--wp--custom--neutral--400);
}

/* ==========================================================================
   Before You Go
   ========================================================================== */
.ab-home-cta__trust {
	color: rgba(255, 255, 255, 0.82);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 781px) {
	.ab-home-why__stage {
		aspect-ratio: auto;
		overflow: visible;
	}
	/* Panels flow in-document on phones (image on top, card beneath); the active
	   one is switched to display:block by the generated per-instance CSS. */
	.ab-home-why__panel {
		position: static;
	}
	.ab-home-why__img {
		height: 240px;
		border-radius: 14px;
	}
	.ab-home-why__card {
		position: static;
		max-width: none;
		box-shadow: none;
		border-radius: 0;
		padding: 20px 4px 0;
	}
	.ab-home-why__chips {
		position: static;
		margin-bottom: 16px;
		padding: 0;
		justify-content: center;
	}
	.ab-home-why__chip {
		background: var(--wp--custom--neutral--100);
	}

	.ab-home-proof__stats {
		grid-template-columns: repeat(2, 1fr);
		gap: 32px 16px;
	}

	.ab-home-ta__card {
		flex-basis: 84%;
	}
}

/* Tablet: two cards with a peek so the carousel arrows have somewhere to go. */
@media (min-width: 782px) and (max-width: 1023px) {
	.ab-home-ta__card {
		flex: 0 0 calc((100% - 15px) / 2.2);
	}
}
