/* TGCC Members Badge 1.2.1
   Pill matches the Learning Centre / PMPro gate: sky #5ec8ff, uppercase, same lock.
   A dark glass fill is added so the pill stays readable over a featured image.
   Card frame uses the site purple (#8e43f0) at low opacity.
   1.2.0: the same pills sit top-left on the featured image (CSS overlay, images unchanged)
   on Elementor Posts, Loop Grid covers, Astra archive thumbs and the post hero (#FEATURED-IMAGE). */

/* ---------------------------------------------------------------------------------------------------------------
   Card frames
   --------------------------------------------------------------------------------------------------------------- */
.elementor-post.tgcc-members-only,
.e-loop-item.tgcc-members-only,
article.elementor-post.tgcc-members-only,
article.ast-article-post.tgcc-members-only {
	box-shadow: 0 0 0 1px rgba(142, 67, 240, 0.5);
	border-radius: 10px;
	overflow: hidden;
}

.elementor-posts--skin-cards .elementor-post.tgcc-members-only .elementor-post__card {
	box-shadow: 0 0 0 1px rgba(142, 67, 240, 0.5);
	border-radius: 10px;
	overflow: hidden;
}

/* ---------------------------------------------------------------------------------------------------------------
   Positioning context for the overlay. Overflow stays on the image box so the pill
   never sits on the title below.
   --------------------------------------------------------------------------------------------------------------- */
.elementor-post.tgcc-members-only .elementor-post__thumbnail__link,
.elementor-post.tgcc-members-only .elementor-post__thumbnail,
.e-loop-item.tgcc-members-only .elementor-post__thumbnail,
article.tgcc-members-only .elementor-post__thumbnail,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image a,
.e-loop-item.tgcc-members-only .tgcc-card__cover,
article.tgcc-members-only .post-thumb,
article.tgcc-members-only .post-thumb-img-content,
article.tgcc-members-only .ast-blog-featured-section,
body.single-post.tgcc-members-only #FEATURED-IMAGE,
body.single-post.tgcc-members-only #FEATURED-IMAGE .elementor-widget-container,
body.single-post.tgcc-members-only #FEATURED-IMAGE figure,
body.single-post.tgcc-members-only .elementor-widget-theme-post-featured-image,
body.single-post.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container,
.tgcc-mb-thumb {
	position: relative;
	display: block;
}

.elementor-post.tgcc-members-only .elementor-post__thumbnail,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image a,
article.tgcc-members-only .post-thumb-img-content,
article.tgcc-members-only .post-thumb {
	overflow: hidden;
}

/* The wrap used when post_thumbnail_html fires. Fill a ratio-box parent so the image CSS still applies. */
a > .tgcc-mb-thumb,
.elementor-post__thumbnail > .tgcc-mb-thumb,
.elementor-widget-theme-post-featured-image a > .tgcc-mb-thumb,
.post-thumb a > .tgcc-mb-thumb {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* When the parent is not a ratio box (plain img in flow), the wrap stays in flow. */
.elementor-post__thumbnail > .tgcc-mb-thumb:only-child,
figure > .tgcc-mb-thumb,
#FEATURED-IMAGE .tgcc-mb-thumb {
	position: relative;
	inset: auto;
	width: auto;
	height: auto;
}

/* ---------------------------------------------------------------------------------------------------------------
   The pill (HTML, when the thumbnail filter fires).
   Visual styles are global. Absolute placement is ONLY inside a featured-image box,
   so a pill injected into the sidebar Latest list cannot float over the search box.
   --------------------------------------------------------------------------------------------------------------- */
.tgcc-members-only-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid #5ec8ff;
	border-radius: 999px;
	color: #5ec8ff;
	background: rgba(11, 8, 20, 0.78);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	font-family: Montserrat, inherit, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.tgcc-members-only-pill svg {
	display: block;
	width: 12px;
	height: 12px;
	flex: none;
	stroke: currentColor;
}

.elementor-post__thumbnail .tgcc-members-only-pill,
.elementor-widget-theme-post-featured-image .tgcc-members-only-pill,
.tgcc-mb-thumb .tgcc-members-only-pill,
.post-thumb .tgcc-members-only-pill,
.post-thumb-img-content .tgcc-members-only-pill,
#FEATURED-IMAGE .tgcc-members-only-pill {
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	z-index: 4;
}

/* Sidebar Latest (tgcc-sidebar): 64px thumbs. Keep the lock on the thumb, hide the wording,
   and take the pill out of the 2-column grid so the title stays beside the image. */
.tgcc-sb-row {
	position: relative;
}
.tgcc-sb-row > .tgcc-members-only-pill,
.tgcc-sb-row .tgcc-mb-thumb .tgcc-members-only-pill {
	position: absolute;
	top: 2px;
	left: 2px;
	right: auto;
	z-index: 4;
	padding: 3px;
	gap: 0;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.tgcc-sb-row .tgcc-members-only-pill__text {
	display: none;
}
.tgcc-sb-row .tgcc-members-only-pill svg {
	width: 10px;
	height: 10px;
}
.tgcc-sb-row > .tgcc-mb-thumb {
	position: relative;
	width: 64px;
	height: 42px;
	display: block;
}

/* ---------------------------------------------------------------------------------------------------------------
   CSS fallback when the thumbnail HTML filter did not fire (Elementor Posts, Loop Grid,
   background-image skins, Astra archives, the post hero).
   --------------------------------------------------------------------------------------------------------------- */
.elementor-post.tgcc-members-only .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
.e-loop-item.tgcc-members-only .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image a:not(:has(.tgcc-members-only-pill))::after,
.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(a)):not(:has(.tgcc-members-only-pill))::after,
article.tgcc-members-only .post-thumb-img-content:not(:has(.tgcc-members-only-pill))::after,
body.single-post.tgcc-members-only #FEATURED-IMAGE .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after,
body.single-post.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after {
	content: "Members only";
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	padding: 6px 14px 6px 30px;
	border: 1px solid #5ec8ff;
	border-radius: 999px;
	color: #5ec8ff;
	background-color: rgba(11, 8, 20, 0.78);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235ec8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 12px center;
	background-size: 12px 12px;
	font-family: Montserrat, inherit, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

@media (max-width: 544px) {
	.elementor-post__thumbnail .tgcc-members-only-pill,
	.elementor-widget-theme-post-featured-image .tgcc-members-only-pill,
	.tgcc-mb-thumb .tgcc-members-only-pill,
	.post-thumb .tgcc-members-only-pill,
	.post-thumb-img-content .tgcc-members-only-pill,
	#FEATURED-IMAGE .tgcc-members-only-pill,
	.elementor-post.tgcc-members-only .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-only .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image a:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(a)):not(:has(.tgcc-members-only-pill))::after,
	article.tgcc-members-only .post-thumb-img-content:not(:has(.tgcc-members-only-pill))::after,
	body.single-post.tgcc-members-only #FEATURED-IMAGE .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after,
	body.single-post.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after {
		font-size: 10px;
		letter-spacing: 1.6px;
		padding: 5px 10px;
		top: 8px;
		left: 8px;
		right: auto;
	}
	.elementor-post.tgcc-members-only .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-only .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image a:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(a)):not(:has(.tgcc-members-only-pill))::after,
	article.tgcc-members-only .post-thumb-img-content:not(:has(.tgcc-members-only-pill))::after,
	body.single-post.tgcc-members-only #FEATURED-IMAGE .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after,
	body.single-post.tgcc-members-only .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after {
		padding: 5px 10px 5px 26px;
		background-position: 10px center;
		background-size: 11px 11px;
	}
}

/* ---------------------------------------------------------------------------------------------------------------
   1.1.0 Members preview (members evergreen): same pill shape, GOLD #ffb020 instead of sky, and a gold frame instead of purple.
   Sky + purple = strictly members only. Gold = free opening, members read the rest. Driven by the tag members-preview.
   --------------------------------------------------------------------------------------------------------------- */
.elementor-post.tgcc-members-preview,
.e-loop-item.tgcc-members-preview,
article.elementor-post.tgcc-members-preview,
article.ast-article-post.tgcc-members-preview {
	box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.55);
	border-radius: 10px;
	overflow: hidden;
}
.elementor-posts--skin-cards .elementor-post.tgcc-members-preview .elementor-post__card {
	box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.55);
	border-radius: 10px;
	overflow: hidden;
}
.elementor-post.tgcc-members-preview .elementor-post__thumbnail__link,
.elementor-post.tgcc-members-preview .elementor-post__thumbnail,
.e-loop-item.tgcc-members-preview .elementor-post__thumbnail,
article.tgcc-members-preview .elementor-post__thumbnail,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image a,
.e-loop-item.tgcc-members-preview .tgcc-card__cover,
article.tgcc-members-preview .post-thumb,
article.tgcc-members-preview .post-thumb-img-content,
article.tgcc-members-preview .ast-blog-featured-section,
body.single-post.tgcc-members-preview #FEATURED-IMAGE,
body.single-post.tgcc-members-preview #FEATURED-IMAGE .elementor-widget-container,
body.single-post.tgcc-members-preview #FEATURED-IMAGE figure,
body.single-post.tgcc-members-preview .elementor-widget-theme-post-featured-image,
body.single-post.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container {
	position: relative;
	display: block;
}
.elementor-post.tgcc-members-preview .elementor-post__thumbnail,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image a,
article.tgcc-members-preview .post-thumb-img-content,
article.tgcc-members-preview .post-thumb {
	overflow: hidden;
}
.tgcc-members-only-pill.tgcc-members-preview-pill {
	border-color: #ffb020;
	color: #ffb020;
}
.elementor-post.tgcc-members-preview .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
.e-loop-item.tgcc-members-preview .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image a:not(:has(.tgcc-members-only-pill))::after,
.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(a)):not(:has(.tgcc-members-only-pill))::after,
article.tgcc-members-preview .post-thumb-img-content:not(:has(.tgcc-members-only-pill))::after,
body.single-post.tgcc-members-preview #FEATURED-IMAGE .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after,
body.single-post.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after {
	content: "Members preview";
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	padding: 6px 14px 6px 30px;
	border: 1px solid #ffb020;
	border-radius: 999px;
	color: #ffb020;
	background-color: rgba(11, 8, 20, 0.78);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffb020' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 9.9-1'%3E%3C/path%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 12px center;
	background-size: 12px 12px;
	font-family: Montserrat, inherit, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

@media (max-width: 544px) {
	.elementor-post.tgcc-members-preview .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-preview .elementor-post__thumbnail:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image a:not(:has(.tgcc-members-only-pill))::after,
	.e-loop-item.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(a)):not(:has(.tgcc-members-only-pill))::after,
	article.tgcc-members-preview .post-thumb-img-content:not(:has(.tgcc-members-only-pill))::after,
	body.single-post.tgcc-members-preview #FEATURED-IMAGE .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after,
	body.single-post.tgcc-members-preview .elementor-widget-theme-post-featured-image .elementor-widget-container:not(:has(.tgcc-members-only-pill))::after {
		font-size: 10px;
		letter-spacing: 1.6px;
		padding: 5px 10px 5px 26px;
		top: 8px;
		left: 8px;
		right: auto;
		background-position: 10px center;
		background-size: 11px 11px;
	}
}

/* On the article itself: gold gate card and eyebrow for visitors outside the member levels. */
body.tgcc-members-preview .tgcc-lc-gate .lc-eyebrow {
	color: #ffb020;
	border-color: rgba(255, 176, 32, 0.55);
	background: rgba(255, 176, 32, 0.08);
}
body.tgcc-members-preview .tgcc-lc-gate .lc-gate-card {
	border-color: rgba(255, 176, 32, 0.35);
}


/* ---------------------------------------------------------------------------------------------------------------
   1.2.1: Membership Required box in narrow listing and related-reading cards (~250-300px).
   Scoped to post excerpts / Posts widgets / Loop Grid, so the full-page gate is unchanged.
   Smaller stacked heading, no mid-word breaks ("Members hip").
   --------------------------------------------------------------------------------------------------------------- */
.elementor-post__excerpt .tgcc-lc-gate,
.elementor-widget-posts .tgcc-lc-gate--compact,
.elementor-widget-posts .elementor-post__excerpt .tgcc-lc-gate,
.e-loop-item .tgcc-lc-gate {
	margin: 12px 0 0 !important;
	max-width: 100%;
	min-height: 0 !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-gate-body,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-body,
.e-loop-item .tgcc-lc-gate .lc-gate-body {
	padding: 0 !important;
	display: block !important;
	background: none !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-gate-card,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-card,
.e-loop-item .tgcc-lc-gate .lc-gate-card {
	padding: 14px 12px 16px !important;
	border-radius: 14px !important;
	max-width: 100% !important;
	width: 100% !important;
	box-sizing: border-box;
	box-shadow: none !important;
}

.elementor-post__excerpt .tgcc-lc-gate,
.elementor-post__excerpt .tgcc-lc-gate *,
.elementor-widget-posts .tgcc-lc-gate--compact,
.elementor-widget-posts .tgcc-lc-gate--compact *,
.e-loop-item .tgcc-lc-gate,
.e-loop-item .tgcc-lc-gate * {
	word-break: normal !important;
	overflow-wrap: normal !important;
	-webkit-hyphens: none !important;
	hyphens: none !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message .pmpro_card_title,
.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message h2,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message .pmpro_card_title,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message h2,
.e-loop-item .tgcc-lc-gate .lc-gate-message .pmpro_card_title,
.e-loop-item .tgcc-lc-gate .lc-gate-message h2 {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	font-size: 15px !important;
	line-height: 1.3 !important;
	letter-spacing: normal !important;
	text-align: center !important;
	margin: 0 0 6px !important;
	max-width: 100%;
	white-space: normal !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message .pmpro_card_title svg,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message .pmpro_card_title svg,
.e-loop-item .tgcc-lc-gate .lc-gate-message .pmpro_card_title svg {
	display: block;
	width: 16px !important;
	height: 16px !important;
	padding: 0 !important;
	margin: 0 auto !important;
	background: none !important;
	border: 0 !important;
	flex: none;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-eyebrow,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-eyebrow,
.e-loop-item .tgcc-lc-gate .lc-eyebrow {
	font-size: 10px !important;
	letter-spacing: 1.2px !important;
	padding: 4px 10px !important;
	max-width: 100%;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message,
.e-loop-item .tgcc-lc-gate .lc-gate-message {
	margin-top: 8px !important;
	font-size: 13px !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message p,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message p,
.e-loop-item .tgcc-lc-gate .lc-gate-message p {
	font-size: 13px !important;
	line-height: 1.4 !important;
	margin: 0 0 6px !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-btns,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-btns,
.e-loop-item .tgcc-lc-gate .lc-btns {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 8px !important;
	margin-top: 10px !important;
}

.elementor-post__excerpt .tgcc-lc-gate .lc-btn,
.elementor-widget-posts .tgcc-lc-gate--compact .lc-btn,
.e-loop-item .tgcc-lc-gate .lc-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	min-height: 40px !important;
	padding: 8px 12px !important;
	font-size: 13px !important;
	box-sizing: border-box;
	text-align: center !important;
	white-space: normal !important;
}

.elementor-post__excerpt .tgcc-lc-gate .pmpro_card_actions,
.elementor-widget-posts .tgcc-lc-gate--compact .pmpro_card_actions,
.e-loop-item .tgcc-lc-gate .pmpro_card_actions {
	display: block !important;
	text-align: center !important;
	font-size: 12px !important;
	margin-top: 6px !important;
	padding-top: 0 !important;
	border-top: 0 !important;
}

@media (max-width: 544px) {
	.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message .pmpro_card_title,
	.elementor-post__excerpt .tgcc-lc-gate .lc-gate-message h2,
	.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message .pmpro_card_title,
	.elementor-widget-posts .tgcc-lc-gate--compact .lc-gate-message h2,
	.e-loop-item .tgcc-lc-gate .lc-gate-message .pmpro_card_title,
	.e-loop-item .tgcc-lc-gate .lc-gate-message h2 {
		font-size: 14px !important;
	}
}
