/**
 * The gate a locked-out visitor sees on a resource or research item that
 * belongs to an interest group. Markup in templates/interest-groups/content-gate.php,
 * drawn by SIG_Content_Access on the gate page, which ESAC renders in place at
 * the item's URL.
 *
 * Two parts: the item's teaser, faded out the way the news and resource
 * templates fade their guest excerpt, then a sand card carrying the eyebrow, a
 * heading, a paragraph and a row of actions. The join control in that row is
 * Nathan's OTA SIG Membership markup and takes its own styling from
 * ota-sig-membership.css and the `ota-btn` contract in ota-buttons.css; the
 * other pills in the row are the same `ota-btn` markup, so the row reads as one
 * set. Nothing here restyles a button.
 *
 * ALSO THE OLDER GATES' MEASURE. Bryce, 9 Sep 2026, on seeing this gate beside
 * the news and resource templates' guest state: "this looks alot better than
 * the exisitng post gates, can we please update those too for a smilar style?
 * im talking about the size and positiong of the excerpt". So the two classes
 * at the end, `ota-content-gate-band` on a template's guest section and
 * `ota-content-gate__teaser` on its excerpt widget, give that state the same
 * 760 measure and the same teaser type; the Member Gate Card inside it keeps
 * its own paint. News_Single loads this sheet on those singles for that.
 *
 * Colours are theme roles with the frame's value as the fallback, the site's
 * usual contract. The card surface is the one literal: sand on a white page,
 * the same reading the resource cards take on the group page's white band, for
 * the same reason (there is no card role; see ota-post-cards.css).
 *
 * WHICH IS WHY THE BLOCK CARRIES `ota-theme--ash` ITSELF, in the template. A
 * literal surface with theme-role text on it only works while the theme in
 * force happens to suit the surface, and until 30 Sep 2026 it always did,
 * because nothing put a page theme on a route that shows this gate. The group
 * child pages did: on `ota-page-theme--navy` the roles inverted under a card
 * that stayed sand, so the heading and body went sand on sand and read as
 * missing. Pinning the block to the theme the sand belongs to is what keeps the
 * two in step, and `ash` is the configured default, so it is the same paint
 * this card has always had.
 *
 * @package Agend\OTA
 */

.ota-content-gate {
	max-width: 760px;
	margin: 0 auto;
	padding: 48px 24px 96px;

	/*
	 * A themed container is painted by `:where(.ota-theme--ash)`, which would
	 * put the sand on this whole block rather than just the card. Zero
	 * specificity, so one declaration answers it, and the card keeps being the
	 * only thing that reads as a surface.
	 */
	background: transparent;
}

/* --- The teaser ------------------------------------------------------------ */

/*
 * The same fade the News and Resource Single guest states draw on their
 * excerpt, so the three read as one treatment: the content is there, and it
 * trails off where the card takes over.
 */
.ota-content-gate__teaser {
	margin: 0 0 32px;
	color: var( --ota-text, #003038 );
	font-size: var( --e-global-typography-lead-font-size, 1.375rem );
	line-height: 1.5;
	letter-spacing: -0.22px;
	-webkit-mask-image: linear-gradient( 180deg, #000 0%, #000 40%, transparent 98% );
	mask-image: linear-gradient( 180deg, #000 0%, #000 40%, transparent 98% );
}

.ota-content-gate__teaser p {
	margin: 0;
}

/* --- The card -------------------------------------------------------------- */

/*
 * The surface now comes from the block's own theme rather than being written
 * out again here, so the sand and the text on it can never disagree. Same
 * colour either way: `ash`'s background role resolves to #F0E7D8.
 */
.ota-content-gate__card {
	padding: 32px;
	border-radius: 14px;
	background: var( --ota-background, #f0e7d8 );
	color: var( --ota-text, #003038 );
}

.ota-content-gate__eyebrow {
	margin: 0 0 8px;
	color: var( --ota-accent, #f04c3a );
	font-size: var( --e-global-typography-eyebrow-font-size, 1.0625rem );
	font-weight: var( --e-global-typography-eyebrow-font-weight, 700 );
	line-height: var( --e-global-typography-eyebrow-line-height, 1.46em );
	letter-spacing: var( --e-global-typography-eyebrow-letter-spacing, 1px );
}

.ota-content-gate__heading {
	margin: 0 0 12px;
	color: var( --ota-text, #003038 );
	font-size: var( --e-global-typography-h3-font-size, 1.75rem );
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.28px;
}

.ota-content-gate__body {
	margin: 0 0 24px;
	color: var( --ota-text, #003038 );
	font-size: var( --e-global-typography-small-font-size, 15px );
	font-weight: var( --e-global-typography-small-font-weight, 300 );
	line-height: var( --e-global-typography-small-line-height, 1.65 );
}

/* --- The actions row --------------------------------------------------------- */

/*
 * One line: the primary pill first (Nathan's Join, or Member login for a
 * guest), outline pills after it (Join OTA, About the group). Bryce, 9 Sep
 * 2026: "if there are 3 buttons just have them all inline". So no wrapping at
 * desktop width; the About label was shortened to make the three fit the 760
 * card, and the row is allowed to wrap only under 768px, where nothing fits on
 * one line anyway. Nathan's control is one flex item holding its own actions
 * row and its message line, so `align-items: flex-start` keeps the pills level
 * with his Join while the message can appear under it.
 */
.ota-content-gate__actions {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 12px;
}

@media ( max-width: 767px ) {
	.ota-content-gate__actions {
		flex-wrap: wrap;
	}
}

.ota-content-gate__actions .ota-sig-membership {
	margin: 0;
}

.ota-content-gate__actions .ota-sig-membership__actions {
	margin: 0;
}

/* --- The older gates take the same measure ---------------------------------- */

/*
 * On the News Single and Resource Single the guest state is a full-width
 * section: the excerpt widget across 1140, then the Member Gate Card. These two
 * classes, set on that section and on its excerpt widget by
 * tools/ota-content-gate-teasers.php, bring both down to this gate's 760
 * measure. The container rule carries one class more than Elementor's own boxed
 * rule (`.elementor-section.elementor-section-boxed > .elementor-container`), so
 * it wins whatever the load order. The mask that the excerpt widget used to
 * carry as per-widget custom CSS now comes from `.ota-content-gate__teaser`
 * above, which is why the script strips it.
 *
 * The script is content config rather than code: the classes it sets live in
 * the database with the templates, so they do not travel with a deploy. Run it
 * on each environment that has those two templates, and again after a database
 * pull, or the two rules below match nothing.
 */
.elementor-section.elementor-section-boxed.ota-content-gate-band > .elementor-container {
	max-width: 760px;
}

.elementor-widget-theme-post-excerpt.ota-content-gate__teaser {
	margin-bottom: 32px;
}

@media ( max-width: 600px ) {
	.ota-content-gate {
		padding: 32px 18px 64px;
	}

	.ota-content-gate__card {
		padding: 24px;
	}
}
