/**
 * Observer registration wall.
 *
 * Design source: Observer Arts CTA Figma (frames CTA_Dark,
 * Image_CTA_Light, Text_CTA_Dark, Text_CTA_Light); frames drawn at
 * 1/6 production scale, values derived from proportions.
 *
 * Units are px on purpose: the NYO theme sets html{font-size:10px},
 * making rem unpredictable, and selectors are double-classed to win
 * over theme .entry-content element rules.
 */

.obs-regwall {
	--obs-regwall-bg: #000;
	--obs-regwall-text: #fff;
	--obs-regwall-button-bg: #1d819a;
	--obs-regwall-button-text: #fff;
	--obs-regwall-placeholder: #b0b0b0;

	box-sizing: border-box;
	display: flex;
	align-items: stretch;
	margin: 24px 0 32px;
	background: var(--obs-regwall-bg);
	color: var(--obs-regwall-text);
	font-family: "Libre Franklin", -apple-system, blinkmacsystemfont, "Segoe UI", sans-serif;
}

.obs-regwall *,
.obs-regwall *::before,
.obs-regwall *::after {
	box-sizing: inherit;
}

.obs-regwall--light {
	--obs-regwall-bg: #f3f3f3;
	--obs-regwall-text: #000;
	--obs-regwall-button-bg: #000;
	--obs-regwall-button-text: #fff;
}

.obs-regwall .obs-regwall__media {
	position: relative;
	flex: 0 0 42.7%;
}

/* Absolute cover so the image never drives the wall's height. */
.obs-regwall .obs-regwall__media .obs-regwall__image {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	margin: 0;
}

.obs-regwall .obs-regwall__panel {
	position: relative;
	flex: 1 1 auto;
	/* min-width:0 lets the panel shrink to its flex target instead of
	   flooring at its content's intrinsic width and overflowing the
	   wall (which ate the right padding). */
	min-width: 0;
	padding: 40px 44px;
	align-self: center;
}

.obs-regwall--has-image .obs-regwall__panel {
	min-height: 272px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.obs-regwall:not(.obs-regwall--has-image) .obs-regwall__panel {
	text-align: center;
	padding: 44px 48px;
}

/* Prompt copy is editor WYSIWYG: an H2 headline line plus paragraphs.
   The confirm message uses the same H2/paragraph treatment. */
.obs-regwall .obs-regwall__prompt-copy h2,
.obs-regwall .obs-regwall__confirm h2 {
	margin: 0 0 8px;
	padding: 0;
	font-family: inherit;
	font-size: 34px;
	font-weight: 700;
	line-height: 1.21;
	color: var(--obs-regwall-text);
}

.obs-regwall .obs-regwall__prompt-copy p,
.obs-regwall .obs-regwall__confirm p {
	margin: 0 0 24px;
	font-family: inherit;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--obs-regwall-text);
}

/* Last block in a copy area shouldn't add trailing space before the form. */
.obs-regwall .obs-regwall__prompt-copy > :last-child,
.obs-regwall .obs-regwall__confirm > :last-child {
	margin-bottom: 0;
}

.obs-regwall .obs-regwall__prompt-copy {
	margin: 0 0 24px;
}

.obs-regwall .obs-regwall__form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

.obs-regwall:not(.obs-regwall--has-image) .obs-regwall__form {
	max-width: 640px;
	margin: 0 auto;
}

.obs-regwall .obs-regwall__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* 200px floor keeps the field usable; when it can't sit beside the
   button the form wraps and the button drops to its own line. */
.obs-regwall .obs-regwall__input {
	flex: 1 1 200px;
	min-width: 200px;
	height: 48px;
	padding: 0 16px;
	border: 1px solid #767676;
	border-radius: 0;
	background: #fff;
	color: #000;
	font-family: inherit;
	font-size: 18px;
	line-height: 1.21;
}

.obs-regwall .obs-regwall__input::placeholder {
	color: var(--obs-regwall-placeholder);
}

.obs-regwall .obs-regwall__submit {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	background: var(--obs-regwall-button-bg);
	color: var(--obs-regwall-button-text);
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}

.obs-regwall .obs-regwall__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.obs-regwall .obs-regwall__message {
	margin: 12px 0 0;
	font-size: 16px;
	line-height: 1.4;
	color: var(--obs-regwall-text);
}

.obs-regwall .obs-regwall__message.is-error {
	font-weight: 500;
}

/* Close button: shown only in the success state, top right of the panel. */
.obs-regwall .obs-regwall__close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--obs-regwall-text);
	font-family: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
}

.obs-regwall .obs-regwall__close:hover {
	opacity: 1;
}

/* Success state: swap the prompt for the centered confirmation message. */
.obs-regwall.is-success .obs-regwall__prompt {
	display: none;
}

.obs-regwall .obs-regwall__confirm {
	color: var(--obs-regwall-text);
}

.obs-regwall.is-dismissing {
	opacity: 0;
	transition: opacity 400ms ease;
}

/* Gated article body: blurred strip below the wall, fading out. */
.obs-regwall-body.obs-regwall-gated {
	position: relative;
	max-height: 224px;
	overflow: hidden;
	filter: blur(4px);
	pointer-events: none;
	user-select: none;
}

.obs-regwall-body.obs-regwall-gated::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 112px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 90%);
	pointer-events: none;
}

@media (max-width: 700px) {
	.obs-regwall {
		flex-direction: column;
	}

	.obs-regwall .obs-regwall__media {
		flex-basis: auto;
		height: 192px;
	}

	.obs-regwall--has-image .obs-regwall__panel {
		min-height: 0;
	}

	.obs-regwall .obs-regwall__panel,
	.obs-regwall:not(.obs-regwall--has-image) .obs-regwall__panel {
		padding: 24px 20px 28px;
	}

	.obs-regwall .obs-regwall__prompt-copy h2,
	.obs-regwall .obs-regwall__confirm h2 {
		font-size: 24px;
	}

	.obs-regwall .obs-regwall__prompt-copy p,
	.obs-regwall .obs-regwall__confirm p {
		font-size: 17px;
		margin-bottom: 18px;
	}

	.obs-regwall .obs-regwall__form {
		flex-direction: column;
		gap: 10px;
	}

	/* Stacked: the input goes full width, so drop the desktop 200px
	   row-wrap floor that would otherwise overflow narrow phones. */
	.obs-regwall .obs-regwall__input {
		flex-basis: auto;
		min-width: 0;
	}

	.obs-regwall .obs-regwall__submit {
		width: 100%;
	}
}
