/* Building mode: a single screen. */
html:has(.madina-building) { scroll-behavior: auto; }
.madina-building { background: var(--deep); }
.bm { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }

/* Prayer strip (same role as the site's header bar) */
.bm-pray { background: #083A34; color: #fff; font-size: 14px; }
.bm-pray__in { display: flex; align-items: center; justify-content: space-between; gap: 10px 28px; flex-wrap: wrap; min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.bm-pray__next { display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.bm-pray__next .icon { width: 16px; height: 16px; color: var(--gold); }
.bm-pray__next strong { color: var(--gold); }
.bm-pray__next em { font-style: normal; color: var(--on-deep); }
.bm-pray__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.bm-pray__list li { display: inline-flex; align-items: baseline; gap: 7px; padding: 5px 12px; border-radius: 999px; color: var(--on-deep); }
.bm-pray__list li span { font-size: 13px; }
.bm-pray__list li b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.bm-pray__list li small { font-size: 12px; color: var(--mint); }
.bm-pray__list li small::before { content: "· "; opacity: .6; }
.bm-pray__list li.is-next { background: var(--gold); color: var(--ink); }
.bm-pray__list li.is-next b, .bm-pray__list li.is-next small { color: var(--ink); }
.bm-pray__list .bm-pray__jummah { border: 1px solid rgba(255,208,40,.45); }
.bm-pray__list .bm-pray__jummah b { color: var(--gold); }

/* Header: the real logo on white */
.bm-head { background: #fff; border-bottom: 1px solid var(--line); }
.bm-head__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.bm-head .custom-logo { max-height: 52px; width: auto; }
.bm-head .btn { min-height: 46px; padding: 10px 22px; }

/* Main stage */
.bm-main {
	flex: 1; display: flex; align-items: center; position: relative; overflow: hidden; color: #fff; padding: 40px 0;
	background-color: var(--deep);
	background-image: radial-gradient(70% 90% at 78% 55%, #0F5E55 0%, rgba(15,94,85,0) 70%);
}
.bm-main__in { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 64px; align-items: center; }
.bm-copy { display: flex; flex-direction: column; align-items: flex-start; }
/* Same brush label and brush underline as the homepage hero */
.bm-brush > span { display: inline-flex; align-items: baseline; gap: 10px; font-size: 22px; }
.bm-brush b { font-family: var(--arabic); font-style: normal; font-weight: 700; font-size: 24px; color: var(--deep); }
.bm-copy h1 { font-size: clamp(40px, 5.2vw, 72px); line-height: 1.04; letter-spacing: -2px; font-weight: 800; margin: 26px 0 20px; color: #fff; }
.bm-copy h1 .underline { white-space: nowrap; }
.bm-copy h1 .underline svg { bottom: -.02em; height: .3em; }
.bm-copy h1 .accent { color: var(--cream) !important; }
.bm-lead { font-size: 19px; line-height: 1.6; color: var(--on-deep); max-width: 520px; margin: 0 0 30px; }
.bm-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn--line { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--line:hover { border-color: #fff; color: #fff; }

/* Card stack: arched cards in a layered deck */
.bm-stack { position: relative; padding-right: 40px; }
.bm-stack__deck { position: relative; height: 480px; touch-action: pan-y; user-select: none; }
.bm-card {
	position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
	border-radius: 999px 999px 28px 28px; box-shadow: 0 30px 70px rgba(0,0,0,.28);
	transform-origin: 50% 100%; transition: transform .65s cubic-bezier(.2,.8,.2,1), opacity .65s ease, filter .65s ease;
	will-change: transform;
}
/* hairline frame inside the arch, like an illuminated page's ruled border */
.bm-card::after { content: ""; position: absolute; inset: 12px; border-radius: 999px 999px 18px 18px; border: 1px solid currentColor; opacity: .28; pointer-events: none; }
.bm-card[data-pos="0"] { transform: none; z-index: 4; }
.bm-card[data-pos="1"] { transform: translate(34px, -18px) scale(.94) rotate(5deg); z-index: 3; opacity: .92; filter: brightness(.92); }
.bm-card[data-pos="2"] { transform: translate(64px, -30px) scale(.88) rotate(10deg); z-index: 2; opacity: .7; filter: brightness(.85); }
.bm-card[data-pos="3"], .bm-card[data-pos="hidden"] { transform: translateY(-60px) scale(.8); z-index: 1; opacity: 0; }
.bm-card.is-leaving { transform: translateX(115%) rotate(10deg) !important; opacity: 0 !important; z-index: 5 !important; }
.bm-card__body { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; padding: 70px 40px 40px; }
/* Photo cards: the photo fills the arch, a dark scrim keeps text readable */
.bm-card { container-type: size; }
.bm-card__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bm-card.has-photo { background: #062F2A; color: #fff; }
.bm-card.has-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4,32,28,.94) 0%, rgba(4,32,28,.78) 34%, rgba(4,32,28,.25) 66%, rgba(4,32,28,.1) 100%); }
.bm-card.has-photo::after { color: #fff; opacity: .35; }
.bm-card.has-photo .bm-card__body { justify-content: flex-end; padding: 40px 34px 40px; gap: 8px; }
.bm-card.has-photo .bm-card__big { color: #fff; }
.bm-card.has-photo .bm-card__line { color: var(--gold); }
.bm-card.has-photo .bm-card__source { color: #fff; opacity: .85; }
.bm-card__ar { margin: 0; font-family: var(--arabic); font-size: clamp(22px, 2.3vw, 30px); line-height: 1.75; max-width: 100%; }
.bm-card__quote { margin: 0; font-size: 20px; line-height: 1.45; font-weight: 600; max-width: 360px; }
.bm-card__big { margin: 0; font-size: min(24cqw, 18cqh); line-height: .95; font-weight: 800; letter-spacing: -.03em; max-width: 100%; }
.bm-card--goal .bm-card__big { font-size: min(13cqw, 11cqh); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bm-card.has-photo .bm-card__big { font-size: min(17cqw, 13cqh); }
.bm-card__line { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(18px, 6cqw, 25px); line-height: 1.25; }
.bm-card__source { margin: 0; font-size: clamp(13px, 3.6cqw, 15px); max-width: 320px; opacity: .78; }
.bm-card__quote { font-size: clamp(16px, 5cqw, 20px); }
.bm-card__ar { font-size: clamp(20px, 7cqw, 30px); }
.bm-card__bar { width: 100%; max-width: 300px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.bm-card__bar span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

.bm-card--deep { background: #0E5850; color: #fff; }
.bm-card--deep .bm-card__ar, .bm-card--deep .bm-card__line { color: var(--gold); }
.bm-card--teal { background: var(--teal); color: #fff; }
.bm-card--teal .bm-card__line { color: var(--cream); }
.bm-card--gold { background: var(--gold); color: var(--ink); }
.bm-card--gold .bm-card__line { color: var(--deep); }
.bm-card--sand { background: linear-gradient(170deg, #FFFFFF, #E4F2EE); color: var(--ink); }
.bm-card--sand .bm-card__ar { color: var(--teal-text); }
.bm-card--cream { background: linear-gradient(170deg, #12675D, #0B4A43); color: #fff; }
.bm-card--cream .bm-card__line { color: var(--gold) !important; }
.bm-card--cream .bm-card__line { color: var(--teal-text); }

.bm-stack__nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }
.bm-stack__btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.bm-stack__btn:hover { background: rgba(255,255,255,.1); }
.bm-stack__dots { display: flex; gap: 6px; }
.bm-stack__dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.3); transition: width .3s, background .3s; }
.bm-stack__dots i.is-on { width: 20px; background: var(--gold); }

/* Footer line */
.bm-foot { background: #083A34; color: var(--on-deep); font-size: 13px; padding: 12px 0; }
.bm-foot .wrap { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bm-foot a { color: var(--on-deep); text-decoration: none; }
.bm-foot a:hover { color: #fff; }

/* Pop-ups */
.bm-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); border: 0; border-radius: 28px; padding: 34px 32px 28px; box-shadow: 0 40px 100px rgba(0,0,0,.35); color: var(--ink); }
.bm-dialog::backdrop { background: rgba(8,58,52,.72); backdrop-filter: blur(4px); }
.bm-dialog__x { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--mist); font-size: 24px; line-height: 1; cursor: pointer; color: var(--deep); }
.bm-dialog__head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; padding-right: 30px; }
.bm-dialog__head h2 { margin: 0; font-size: 28px; letter-spacing: -.6px; color: var(--deep); line-height: 1.15; }
.bm-dialog__head p { margin: 0; font-size: 15px; color: var(--body); }
.bm-dialog__ar { font-family: var(--arabic); font-size: 26px; color: var(--gold-ink) !important; line-height: 1.2; text-align: left; }
.bm-dialog__progress { background: var(--deep); color: #fff; border-radius: 16px; padding: 14px 16px; font-size: 14px; }
.bm-dialog__progress strong { font-size: 20px; }
.bm-dialog__progress .bar { margin: 10px 0 2px; height: 10px; }
.bm-dialog__note { font-style: italic; }

@media (max-width: 960px) {
	.bm-pray__in { justify-content: center; }
	.bm-pray__list { justify-content: center; }
	.bm-main { padding: 32px 0 28px; align-items: flex-start; }
	.bm-main__in { grid-template-columns: minmax(0, 1fr); gap: 34px; }
	.bm-copy { text-align: center; align-items: center; }
	.bm-actions { justify-content: center; }
	.bm-lead { margin-left: auto; margin-right: auto; }
	.bm-stack { max-width: 420px; width: 100%; margin: 0 auto; }
	.bm-stack__deck { height: 400px; }
}
@media (max-width: 520px) {
	.bm-pray { font-size: 13px; }
	.bm-pray__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; gap: 2px; }
	.bm-pray__list li { flex-direction: column; align-items: center; gap: 0; padding: 4px 2px; border-radius: 12px; }
	.bm-pray__list li span { font-size: 11px; }
	.bm-pray__list li small { display: none; }
	.bm-pray__list .bm-pray__jummah { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 8px; border: 0; }
	.bm-head__in { min-height: 64px; }
	.bm-head .custom-logo { max-height: 42px; }
	.bm-copy h1 { font-size: 36px; letter-spacing: -1.2px; margin: 16px 0 20px; }
	.bm-brush { padding: 8px 22px 11px 18px; }
	.bm-brush > span { font-size: 18px; gap: 8px; }
	.bm-brush b { font-size: 20px; }
	.bm-main { padding: 22px 0 22px; }
	.bm-main__in { gap: 26px; }
	.bm-lead { display: none; }
	.bm-actions { flex-wrap: nowrap; gap: 10px; }
	.bm-actions .btn { flex: 1; min-height: 50px; padding: 12px 10px; font-size: 15px; }
	.bm-stack { padding-right: 26px; }
	.bm-card[data-pos="1"] { transform: translate(18px, -12px) scale(.95) rotate(4deg); }
	.bm-card[data-pos="2"] { transform: translate(34px, -20px) scale(.9) rotate(8deg); }
	.bm-stack__deck { height: 340px; }
	.bm-stack__nav { margin-top: 14px; }
	.bm-card__body { padding: 56px 26px 28px; }
	.bm-dialog { padding: 28px 18px 20px; border-radius: 22px; }
}
/* Short laptop screens: keep everything on one screen */
@media (min-width: 961px) and (max-height: 820px) {
	.bm-main { padding: 20px 0; }
	.bm-copy h1 { font-size: clamp(40px, 7.2vh, 64px); margin: 18px 0 14px; }
	.bm-lead { font-size: 17px; margin-bottom: 22px; }
	.bm-stack__deck { height: min(480px, calc(100vh - 330px)); }
	.bm-stack { width: 100%; max-width: 400px; justify-self: center; }
	.bm-head__in { min-height: 64px; }
}
@media (max-width: 520px) and (max-height: 760px) {
	.bm-stack__deck { height: 290px; }
	.bm-copy h1 { font-size: 32px; }
}
@media (max-width: 520px) {
	.bm-stack__deck { height: min(340px, calc(100svh - 540px)); min-height: 260px; }
}
.bm-dialog .mc-amounts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) {
	.bm-dialog .mc-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Light option: white stage, exactly like the homepage hero */
.bm-light .bm-head { border-bottom-color: transparent; }
.bm-light .bm-main { background: #fff; color: var(--ink); }
.bm-light .bm-copy h1 { color: var(--deep); }
.bm-light .bm-copy h1 .accent { color: var(--teal) !important; }
.bm-light .bm-lead { color: var(--body); }
.bm-light .btn--line { color: var(--deep); border-color: var(--deep); }
.bm-light .btn--line:hover { background: var(--deep); color: #fff; }
.bm-light .bm-stack__btn { color: var(--deep); border-color: rgba(11,74,67,.35); }
.bm-light .bm-stack__btn:hover { background: var(--mist); }
.bm-light .bm-stack__dots i { background: rgba(11,74,67,.2); }
.bm-light .bm-stack__dots i.is-on { background: var(--deep); }
.bm-light .bm-card { box-shadow: 0 30px 60px rgba(11,74,67,.22); }
@media (prefers-reduced-motion: reduce) {
	.bm-card { transition: none; }
}
.bm-card__photo { z-index: 0; }
.bm-card.has-photo::before { z-index: 1; }
.bm-card__body { z-index: 2; }
.bm-copy h1 .underline svg { bottom: -.08em; }
@media (max-width: 960px) { .bm-actions { width: 100%; max-width: 460px; } }
