/*
 * Members-only content: lock icons on links, the lock tooltip, gate screens and the editor notice bar.
 * Plain CSS (not part of the sass build), loaded on every front-end page.
 */

/* ==========================================================================
   Lock icons (added inside links by inc/access/locks.php)
   The colour is --acvs-lock, set by the nearest background: maroon on light
   backgrounds, white on dark ones, the button's text colour inside buttons.
   ========================================================================== */

:root {
	--acvs-lock: #6B1241;
}

/* Dark backgrounds */
.gradient,
.gradient-2,
footer,
.is-dark-bg,
.lock-white,
.bg-w-txt-block,
.stats-banner,
.carousel .slide,
.cust-slide,
.bg-offset-cta .cta,
.img-w-btn .box-btn,
.pop-out-image,
.quote-background,
.cta-lg,
.single-page-tabbed-top .horizontal-nav {
	--acvs-lock: #fff;
}

/* Light cards and panels that sit inside dark sections */
.card-w-label,
.icon-blocks .block,
.resources-grid .block,
.block-latest-posts .post,
.quick-links-cards .card,
.nav-panels,
.panel-bottom,
.lock-maroon {
	--acvs-lock: #6B1241;
}

/* Pill buttons (including the megamenu's): follow the button text, including its hover colours */
.btn,
.menu_btn {
	--acvs-lock: currentColor;
}

.gate-lock {
	display: inline-flex;
	align-items: center;
	flex: none;
	align-self: center;
	line-height: 0;
	vertical-align: -0.12em;
	/* The padding makes a bigger tap target; the negative margins keep it from moving anything. */
	margin: -0.35em -0.35em -0.35em -0.1em;
	padding: 0.35em;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.gate-lock .gate-lock__svg {
	display: block;
	width: 0.76em !important;
	height: 1em !important;
	margin: 0 !important;
	position: static !important;
	transform: none !important;
	fill: var(--acvs-lock) !important;
	transition: fill 0.2s;
}

/* Image-only and whole-card links: lock in the top-right corner. :where() keeps any positioning the link already has. */
:where(a.gate-host) {
	position: relative;
}

:where(a.gate-host:has(> img)) {
	display: inline-block;
}

.gate-lock.gate-lock--chip,
.gate-lock.gate-lock--badge {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	margin: 0;
	font-size: 16px;
}

.gate-lock.gate-lock--chip {
	padding: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
	--acvs-lock: #6B1241;
}

/* Resource library cards (template-parts/facet-resources.php): lock button in the card's corner */
.is-gated-card {
	position: relative;
}

.is-gated-card .resource-category {
	padding-right: 34px;
}

button.gate-lock.gate-lock--card {
	top: 12px;
	right: 12px;
	padding: 6px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: inherit;
	font-size: 18px;
}

button.gate-lock.gate-lock--card:focus-visible {
	outline: 2px solid #6B1241;
	outline-offset: 2px;
}

/* Screen-reader text inside members-only links: "(members only: Diplomate)" */
.gate-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Tooltip shown when a lock is tapped or clicked (js/access.js) */
#gate-tip {
	position: fixed;
	z-index: 2147483647;
	max-width: min(280px, calc(100vw - 16px));
	padding: 8px 12px;
	border-radius: 5px;
	background: #6B1241;
	color: #fff;
	font: 600 14px/1.35 Poppins, sans-serif;
	text-align: left;
	box-shadow: 0 10px 10px rgba(0, 0, 0, 0.16);
	pointer-events: none;
	visibility: hidden;
}

#gate-tip.is-on {
	visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
	.gate-lock .gate-lock__svg {
		transition: none;
	}
}

@media (forced-colors: active) {
	.gate-lock .gate-lock__svg {
		fill: LinkText !important;
	}
}

@media print {
	.gate-lock,
	#gate-tip {
		display: none !important;
	}
}

/* ==========================================================================
   Gate screens
   ========================================================================== */

/* Band */
main.acvs-gate .gradient .plain-content {
	text-align: left;
}

main.acvs-gate .gradient .acvs-gate__heading {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: #fff;
	font-family: Poppins, sans-serif;
	font-size: 36px;
	line-height: 42px;
	font-weight: 700;
}

/* The SVG has ~17% empty space around the lock; the negative margin lines the lock up with the text below. */
main.acvs-gate .acvs-gate__lock {
	flex: none;
	width: 40px;
	height: 40px;
	margin-left: -7px;
}

main.acvs-gate .gradient .acvs-gate__for {
	margin: 8px 0 0;
	color: #fff;
	font-size: 18px;
}

/* Card (the form keeps the theme's login styles; the no-access card copies them) */
main.acvs-gate .acvs-gate__card {
	max-width: 440px;
}

main.acvs-gate div.acvs-gate__card {
	margin: 20px auto;
	padding: 20px 30px;
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 0 2px 1px #666;
	border: 1px solid #666;
}

main.acvs-gate .acvs-gate__card h2 {
	margin: 0 0 10px;
	color: #434343;
	font-family: Poppins, sans-serif;
	font-size: 26px;
	line-height: 1.25;
	font-weight: 700;
}

main.acvs-gate .acvs-gate__card p {
	margin: 0 0 16px;
	font-size: 17px;
	line-height: 1.5;
}

main.acvs-gate div.acvs-gate__card .btn {
	display: inline-block;
	margin: 10px auto 20px;
	width: 90%;
	box-sizing: border-box;
	text-align: center;
}

main.acvs-gate .acvs-gate__card .links {
	display: flex;
	justify-content: center;
	gap: 24px;
	padding-top: 10px;
}

main.acvs-gate .acvs-gate__card .links a {
	display: inline;
	padding-top: 0;
}

/* Resources: the resource's name above the heading, and the way back to the library */
main.acvs-gate .acvs-gate__card .acvs-gate__item {
	margin: 0 0 6px;
	color: #6B1241;
	font-family: Poppins, sans-serif;
	font-size: 15px;
	font-weight: 700;
}

main.acvs-gate .gradient .acvs-gate__back {
	margin: 18px 0 0;
}

/* Error or notice inside the card */
main.acvs-gate .acvs-gate__card .acvs-gate__alert {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-left: 4px solid #6B1241;
	border-radius: 2px;
	background: #f7eef2;
	color: #6B1241;
	font-size: 16px;
	font-weight: 700;
	text-align: left;
}

/* Hidden from sight, still read by screen readers */
.acvs-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Honeypot for bots */
main.acvs-gate .acvs-gate__hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 600px) {
	main.acvs-gate .gradient .acvs-gate__heading {
		font-size: 28px;
		line-height: 34px;
	}

	main.acvs-gate .acvs-gate__lock {
		width: 34px;
		height: 34px;
		margin-left: -6px;
	}

	main.acvs-gate .acvs-gate__card {
		margin-left: 16px;
		margin-right: 16px;
	}
}

/* Notice bar for WordPress editors on members-only pages, pinned to the bottom of the window */
.acvs-gate-bar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483646;
	background: #6B1241;
	color: #fff;
	font-family: Poppins, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, .2);
}

body.acvs-has-gate-bar {
	padding-bottom: 48px;
}

.acvs-gate-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 24px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 8px 16px;
}

.acvs-gate-bar__hide {
	margin-left: auto;
	padding: 2px 12px;
	border: 1px solid #fff;
	border-radius: 30px;
	background: transparent;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.acvs-gate-bar__hide:hover,
.acvs-gate-bar__hide:focus-visible {
	background: #fff;
	color: #6B1241;
}

@media (max-width: 767px) {
	body.acvs-has-gate-bar {
		padding-bottom: 110px;
	}
}

.acvs-gate-bar a {
	color: #fff;
	text-decoration: underline;
}

.acvs-gate-bar a:hover,
.acvs-gate-bar a:focus {
	color: #fff;
	text-decoration: none;
}
