/* ==========================================================================
   MEMBERSHIP — hero · why join · how it works · where you can serve · apply · conduct · FAQ
   Every class is prefixed `membership-`. Inside a tone, only semantic vars (--bg, --fg, --line, --accent …).
   ========================================================================== */

/* ---- 01 Hero ---------------------------------------------------------------
   Mobile: vertical video crop on top, fading into black, copy overlapping its lower half.
   Desktop: video fills the right 7 columns, copy overlays the left 5. */
.membership-hero {
	--hero-min: 92svh;
	align-items: flex-end;
	/* the copy starts below the visible part of the vertical crop and overlaps only its faded lower edge */
	padding-top: calc(var(--header-h) + 36vh);
	padding-top: calc(var(--header-h) + 36svh);
}

.membership-hero__media {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: -3;
	height: 58vh;
	height: 58svh;
	overflow: hidden;
}

/* The fade is applied to the picture, not the frame, so the video pause button (WCAG 2.2.2) is never faded away;
   the button sits top-right under the header, clear of the copy and the skyline. */
.membership-hero__media .media-slot__media,
.membership-hero__media .media-slot__placeholder {
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 100%);
}

.membership-hero__media .media-slot__toggle {
	top: calc(var(--header-h) + 0.75rem);
	right: var(--gutter);
	bottom: auto;
}

.membership-hero__veil {
	position: absolute;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background:
		radial-gradient(70% 40% at 80% 14%, rgba(244, 122, 31, 0.24), transparent 70%),
		linear-gradient(to bottom, rgba(11, 9, 7, 0.5) 0%, rgba(11, 9, 7, 0.05) 20%, rgba(11, 9, 7, 0.6) 46%, var(--sanctum-black) 62%);
}

/* the placeholder label sits above the temple skyline instead of being half hidden by it */
.membership-hero__media .media-slot__art ~ .media-slot__meta {
	bottom: clamp(6.5rem, 18vh, 12rem);
	padding: 0 1rem;
	background: none;
}

.membership-hero__inner {
	position: relative;
	z-index: 2;
	width: min(100% - 2 * var(--gutter), var(--container));
	margin-inline: auto;
}

.membership-hero__copy {
	max-width: 36rem;
}

/* Hindi accent beside the English eyebrow: Devanagari reads small at eyebrow size */
.membership-hero .eyebrow [lang='hi'] {
	font-size: 1.12em;
	font-weight: 600;
}

.membership-hero__title {
	margin: 0 0 1.25rem;
	font-size: clamp(2.75rem, 1.4rem + 4.6vw, 5.25rem);
	line-height: 1.02;
	letter-spacing: var(--tracking-display);
	text-wrap: balance;
}

.membership-hero__lead {
	max-width: 30rem;
	margin: 0;
	color: var(--fg-soft);
	font-size: var(--fs-lg);
	line-height: 1.6;
}

.membership-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1.25rem;
	margin-top: 2rem;
}

@media (max-width: 559px) {
	.membership-hero__actions .btn--lg {
		flex: 1 1 100%;
	}
	.membership-hero__actions .btn--ghost {
		margin-inline: auto;
	}
}

.membership-hero__nodes {
	display: none;
}

/* a decorative object, not a labelled box: only the drawn network shows until the real model / poster arrives */
.membership-hero__nodes .media-slot {
	overflow: visible;
	background: transparent;
}

.membership-hero__nodes .media-slot__placeholder {
	overflow: visible;
	background: none;
	box-shadow: none;
}

.membership-hero__nodes .media-slot__pattern,
.membership-hero__nodes .media-slot__meta {
	display: none;
}

.membership-hero__nodes .media-slot__art {
	inset: 0;
}

@media (min-width: 768px) {
	.membership-hero {
		--hero-min: 80svh;
		align-items: center;
		padding-top: calc(var(--header-h) + clamp(3rem, 9vh, 6.5rem));
	}

	.membership-hero__media {
		inset: 0 0 0 auto;
		width: 66%;
		height: auto;
	}

	.membership-hero__media .media-slot__media,
	.membership-hero__media .media-slot__placeholder {
		-webkit-mask-image: linear-gradient(to right, transparent 0%, #000 34%);
		mask-image: linear-gradient(to right, transparent 0%, #000 34%);
	}

	/* the placeholder label starts inside the part of the frame that is not faded out, and stays clear of the nodes object */
	.membership-hero__media .media-slot__art ~ .media-slot__meta {
		align-items: flex-start;
		padding-left: 40%;
		text-align: left;
	}

	.membership-hero__veil {
		background:
			radial-gradient(60% 70% at 86% 22%, rgba(244, 122, 31, 0.26), transparent 66%),
			linear-gradient(90deg, var(--sanctum-black) 0%, rgba(11, 9, 7, 0.9) 28%, rgba(11, 9, 7, 0.4) 56%, rgba(11, 9, 7, 0.12) 100%),
			linear-gradient(0deg, var(--sanctum-black) 0%, transparent 26%);
	}

	.membership-hero__nodes {
		position: absolute;
		right: 0;
		bottom: clamp(1rem, 4vh, 3rem);
		z-index: 1;
		display: block;
		width: clamp(120px, 17vw, 250px);
	}
}

@media (min-width: 1024px) {
	.membership-hero__copy {
		max-width: min(36rem, 44%);
	}
}

@media (min-width: 1440px) {
	.membership-hero__copy {
		max-width: 36rem;
	}
}

/* browsers without svh units (custom properties cannot carry a fallback declaration, so it is an @supports block) */
@supports not (min-height: 1svh) {
	.membership-hero {
		--hero-min: 92vh;
	}

	@media (min-width: 768px) {
		.membership-hero {
			--hero-min: 80vh;
		}
	}
}

/* ---- 02 Why join --------------------------------------------------------------- */
.membership-why__grid {
	display: grid;
	gap: var(--gap);
	grid-template-columns: minmax(0, 1fr);
}

.membership-why__card .membership-why__media .media-slot:not(.media-slot--auto):not(.media-slot--fill) {
	aspect-ratio: 16 / 11;
}

.membership-why__body {
	gap: 0.85rem;
}

.membership-why__icon {
	position: relative;
	z-index: 3;
	margin-top: -3.4rem;
	margin-bottom: 0.2rem;
	background: radial-gradient(circle at 30% 20%, rgba(244, 122, 31, 0.2), transparent 70%), var(--surface);
	box-shadow: 0 0 0 6px var(--surface), 0 14px 30px -14px rgba(60, 35, 10, 0.5);
}

/* the round icon straddles the portrait's lower edge: keep the placeholder label clear of it */
.membership-why__media .media-slot__art ~ .media-slot__meta {
	padding-bottom: 4.6rem;
}

.membership-why__duty {
	margin: auto 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
	color: var(--fg-soft);
	font-size: 0.9rem;
	line-height: 1.55;
}

.membership-why__label {
	display: block;
	margin-bottom: 0.3rem;
	color: var(--accent);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* tablet: horizontal cards (portrait left, copy right) so three cards never leave an orphan */
@media (min-width: 768px) and (max-width: 1023px) {
	.membership-why__card {
		flex-direction: row;
	}

	.membership-why__media {
		flex: 0 0 38%;
		max-width: 38%;
	}

	.membership-why__card .membership-why__media .media-slot:not(.media-slot--auto):not(.media-slot--fill) {
		height: 100%;
		min-height: 100%;
		aspect-ratio: auto;
	}

	.membership-why__body {
		justify-content: center;
	}

	.membership-why__icon {
		margin-top: 0;
		box-shadow: none;
	}
}

@media (min-width: 1024px) {
	.membership-why__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.membership-why__card .membership-why__media .media-slot:not(.media-slot--auto):not(.media-slot--fill) {
		aspect-ratio: 4 / 5;
	}
}

/* ---- 03 How membership works (charcoal) -------------------------------------------- */
.membership-process__art {
	position: absolute;
	inset: auto 0 0;
	z-index: -1;
	height: 60%;
	opacity: 0.18;
	mix-blend-mode: lighten; /* a dark render's black background drops out; transparent art is unaffected */
	pointer-events: none;
}

.membership-steps {
	margin-top: clamp(0.5rem, 1vw, 1.5rem);
}

/* The progress line runs left→right here: blocks.css pins it to scaleX(0) and effects.css only drives scaleY, so drive scaleX from --progress. */
html.hs-motion:not(.hs-reduced) .membership-steps .steps__line > i[data-progress-line] {
	transform: scaleX(var(--progress, 0));
	transform-origin: 0 50%;
}

/* scripts present but the motion layer never started: show the finished line rather than an empty track */
html.hs-js:not(.hs-motion) .membership-steps .steps__line > i {
	transform: none;
}

/* carved stone numerals: a sunk disc with a light lower lip and a dark upper shadow */
.membership-steps .step__num {
	background: radial-gradient(120% 120% at 30% 18%, var(--charcoal-3), var(--sanctum-black) 78%);
	border-color: rgba(217, 164, 65, 0.7);
	box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.75), inset 0 -2px 3px rgba(255, 214, 150, 0.14), 0 0 0 6px var(--bg),
		0 0 40px -8px rgba(244, 122, 31, 0.55);
	color: var(--gold-soft);
	font-size: 1.85rem;
	text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 224, 170, 0.22);
}

.membership-step__body {
	min-width: 0;
}

.membership-step__icon {
	display: inline-flex;
	margin-bottom: 0.5rem;
	color: var(--accent-2);
}

.membership-step__icon .icon {
	width: 1.6rem;
	height: 1.6rem;
}

.membership-steps .step__title {
	margin-top: 0;
	font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.55rem);
}

.membership-steps .step__text {
	max-width: 30ch;
	font-size: 0.96rem;
	line-height: 1.6;
}

@media (min-width: 900px) {
	.membership-steps .step__text {
		margin-inline: auto;
	}
	.membership-step__icon {
		margin-bottom: 0.65rem;
	}
}

/* vertical connector between the numerals on mobile (the horizontal progress line takes over from 900px) */
@media (max-width: 899px) {
	.membership-steps {
		gap: 2.5rem;
	}

	.membership-steps .step:not(:last-child)::after {
		content: '';
		position: absolute;
		top: 72px;
		bottom: -2.4rem;
		left: 33px;
		width: 2px;
		background: linear-gradient(to bottom, rgba(217, 164, 65, 0.7), rgba(217, 164, 65, 0.12));
	}

	.membership-steps .step__num {
		grid-row: 1 / span 2;
		margin-bottom: 0;
	}
}

/* tablet: two columns of steps (numeral left, copy right) instead of one narrow column; no connectors */
@media (min-width: 640px) and (max-width: 899px) {
	.membership-steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2.75rem 2.5rem;
	}

	.membership-steps .step:not(:last-child)::after {
		display: none;
	}
}

/* ---- 04 Where you can serve ---------------------------------------------------------- */
.membership-serve__top {
	display: grid;
	gap: 2rem;
	align-items: center;
	margin-bottom: clamp(2rem, 1.4rem + 3vw, 3.75rem);
}

.membership-serve__head {
	margin-bottom: 0;
}

.membership-serve__art {
	width: 100%;
	max-width: 27rem;
}

.membership-serve__art .media-slot {
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
}

.membership-serve__grid {
	display: grid;
	gap: 0.85rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.membership-serve__card .card__body {
	gap: 0.55rem;
	padding: 1.1rem 1rem 1.2rem;
}

.membership-serve__icon {
	width: 2.9rem;
	height: 2.9rem;
	border-radius: 14px;
}

.membership-serve__icon .icon {
	width: 1.45rem;
	height: 1.45rem;
}

.membership-serve__card .card__title {
	font-size: 1.08rem;
	line-height: 1.2;
}

.membership-serve__card .card__excerpt {
	font-size: 0.86rem;
	line-height: 1.55;
}

@media (min-width: 768px) {
	.membership-serve__top {
		grid-template-columns: minmax(0, 1fr) minmax(0, 17rem);
		gap: 2rem 2.5rem;
	}

	.membership-serve__art {
		justify-self: end;
	}

	.membership-serve__grid {
		gap: var(--gap);
	}

	.membership-serve__card .card__body {
		gap: 0.7rem;
		padding: clamp(1.25rem, 1rem + 1vw, 1.9rem);
	}

	.membership-serve__icon {
		width: 3.5rem;
		height: 3.5rem;
		border-radius: 16px;
	}

	.membership-serve__icon .icon {
		width: 1.7rem;
		height: 1.7rem;
	}

	.membership-serve__card .card__title {
		font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.55rem);
	}

	.membership-serve__card .card__excerpt {
		font-size: var(--fs-sm);
	}
}

@media (min-width: 1024px) {
	.membership-serve__top {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: 3rem;
	}

	.membership-serve__art {
		justify-self: end;
	}

	.membership-serve__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---- 05 Apply (black section, light form surface) --------------------------------------- */
.membership-apply__frame {
	max-width: 58rem;
	margin-inline: auto;
	padding: clamp(0.85rem, 0.5rem + 2vw, 2rem);
	border-radius: 28px;
	background: var(--ivory-3);
	box-shadow: 0 0 0 1px rgba(217, 164, 65, 0.5), 0 0 0 10px rgba(217, 164, 65, 0.06), 0 50px 110px -45px rgba(0, 0, 0, 0.9);
}

.membership-apply__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	margin-bottom: 1rem;
	padding: 0.25rem 0.25rem 1rem;
	border-bottom: 1px solid var(--line);
}

.membership-apply__note {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0;
	color: var(--fg-soft);
	font-size: 0.9rem;
	line-height: 1.5;
}

.membership-apply__note .icon {
	width: 1.1rem;
	height: 1.1rem;
	margin-top: 0.2em;
	color: var(--accent-2);
}

.membership-apply__note--center {
	justify-content: center;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
	text-align: left;
}

.membership-apply__policy {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	text-align: center;
}

.membership-apply__embed {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--white);
}

/* The frame is tall enough that the form never needs its own scrollbar (nested scrolling is poor on phones). */
.membership-apply__embed iframe {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: calc(var(--membership-form-h, 1800px) * 1.35);
	border: 0;
	background: var(--white);
}

@media (min-width: 640px) {
	.membership-apply__embed iframe {
		height: calc(var(--membership-form-h, 1800px) * 1.1);
	}
}

@media (min-width: 900px) {
	.membership-apply__embed iframe {
		height: var(--membership-form-h, 1800px);
	}
}

/* style.css disables iframe pointer events under Lenis; the form must stay clickable */
html.lenis.lenis-smooth .membership-apply__embed iframe {
	pointer-events: auto;
}

.membership-apply__loading {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: grid;
	place-items: start center;
	margin: 0;
	padding: 3rem 1.5rem;
	color: var(--fg-muted);
	font-size: 0.9rem;
	text-align: center;
}

.membership-apply__cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding: clamp(1.5rem, 1rem + 3vw, 3.25rem) clamp(0.25rem, 2vw, 2rem) 0.5rem;
	text-align: center;
}

.membership-apply__cta-title {
	margin: 0.25rem 0 0;
	font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem);
	line-height: 1.1;
}

.membership-apply__cta-text {
	max-width: 36rem;
	margin: 0 0 0.75rem;
	color: var(--fg-soft);
}

@media (max-width: 559px) {
	.membership-apply__cta .btn {
		width: 100%;
		white-space: normal;
	}
}

/* ---- 06 Code of conduct (ivory) ---------------------------------------------------------- */
.membership-conduct__layout {
	gap: 2.5rem 3rem;
}

.membership-conduct__head {
	margin-bottom: 0;
}

@media (min-width: 1024px) {
	body.admin-bar .membership-conduct .sticky-top {
		top: calc(var(--header-h) + 56px);
	}
}

/* ---- 07 FAQ + contact (charcoal) ------------------------------------------------------------ */
.membership-faq__layout {
	align-items: start;
	gap: 3rem 3.5rem;
}

.membership-contact {
	max-width: 34rem;
}

.membership-contact__email {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0.25rem 0 0;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.membership-contact__email .icon {
	flex: none;
	color: var(--accent-2);
}

.membership-contact__actions {
	margin-top: 0.75rem;
}

@media (max-width: 559px) {
	.membership-contact__actions .btn {
		width: 100%;
		white-space: normal;
	}
}

/* ---- Native application form ------------------------------------------------ */
.member-form { max-width: 760px; margin-inline: auto; padding: clamp(1.25rem, 1rem + 2vw, 2.25rem); }
.member-form .form__row { display: grid; gap: var(--gap); }
@media (min-width: 640px) { .member-form .form__row--2 { grid-template-columns: 1fr 1fr; } }
.member-form .field { margin-bottom: 1.1rem; }
.member-form input[type="file"] { width: 100%; padding: 0.7rem; border: 1px dashed var(--line, #c9b8a4); border-radius: 10px; background: transparent; }
.member-form__top { text-align: center; }
.member-form__tick { display: none; }
.member-form.is-sent .member-form__tick { display: block; }
.member-form.is-sent .member-form__top { padding: 1.5rem 0; }
.member-form.is-sent .member-form__body { display: none; }
.member-form__tick { color: var(--accent, #f47a1f); }
.member-form__submit { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 0.5rem; }
.member-form__note { margin: 0; font-size: var(--fs-sm, 0.875rem); color: var(--fg-soft); }
.member-form .form-status:not(:empty) { display: block; margin: 0 0 1rem; font-weight: 600; }
.member-form .form-status.is-error { color: #a02121; }
