/*
 * Boring Memberships: the storefront parts (StorefrontStyle). Restriction messages, the Join to
 * unlock block, the members-only line, the free-views banner, the Member content fallback and
 * the member price. Neutral on purpose: no fonts, no text or link colours, no resets. The text
 * keeps the theme's colour, so its contrast is the theme's own; borders and the faint fill are
 * mixed from that colour, so they work on light and dark themes alike.
 */

.bwm-restriction-message,
p.bwm-restricted,
p.bwm-meter-banner,
.bwm-members-only,
.bwm-member-content-fallback {
	box-sizing: border-box;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 10px;
	background: color-mix(in srgb, currentColor 3%, transparent);
}

/* The message: its line, then the Join to unlock block, stacked. */
.bwm-restriction-message {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0 0 1.5em;
	padding: 20px 24px;
}

.bwm-restriction-message > * {
	margin-top: 0;
	margin-bottom: 0;
}

/* The built-in notice, and the message's own line. */
p.bwm-restricted {
	margin: 0 0 1.5em;
	padding: 16px 20px;
}

p.bwm-restricted .bwm-join {
	margin-left: 0.75em;
	white-space: nowrap;
}

.bwm-restriction-message p.bwm-restricted {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-weight: 600;
}

.bwm-restriction-message p.bwm-restricted::before,
.bwm-join-to-unlock__date::before,
p.bwm-meter-banner::before,
p.bwm-members-only::before {
	content: "";
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.5em;
	vertical-align: -0.2em;
	background: currentColor;
	-webkit-mask: var(--bwm-icon) no-repeat center / contain;
	mask: var(--bwm-icon) no-repeat center / contain;
}

/* Decorative icons, drawn in the text colour: a lock, a clock, an info mark. */
.bwm-restriction-message p.bwm-restricted,
p.bwm-members-only {
	--bwm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
}

.bwm-join-to-unlock__date {
	--bwm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

p.bwm-meter-banner {
	--bwm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

/* Join to unlock: a heading, the offers as rows (name, price, plans, Join), the login line. */
.bwm-join-to-unlock {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bwm-join-to-unlock > * {
	margin-top: 0;
	margin-bottom: 0;
}

.bwm-join-to-unlock__heading {
	font-weight: 600;
}

ul.bwm-join-to-unlock__offers {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid rgba(128, 128, 128, 0.3);
	border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

li.bwm-join-to-unlock__offer {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	align-items: center;
	margin: 0;
	padding: 10px 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.3);
	border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

li.bwm-join-to-unlock__offer::before,
li.bwm-join-to-unlock__offer::marker {
	content: none;
}

.bwm-join-to-unlock__price {
	font-weight: 600;
}

.bwm-join-to-unlock__price del {
	font-weight: 400;
}

.bwm-join-to-unlock__plans {
	font-size: 0.875em;
}

.bwm-join-to-unlock__buy {
	margin-left: auto;
	text-align: center;
	white-space: nowrap;
}

.bwm-join-to-unlock__login {
	font-size: 0.9375em;
}

/* The free-views banner, above the message or the post. */
p.bwm-meter-banner {
	margin: 0 0 1.5em;
	padding: 12px 16px;
	border-radius: 8px;
}

/* The line that stands in for Add to cart. In the shop it is a short line, without its box. */
p.bwm-members-only {
	margin: 0 0 1.5em;
	padding: 12px 16px;
	border-radius: 8px;
	font-weight: 600;
}

.products p.bwm-members-only,
.wc-block-grid p.bwm-members-only,
.wp-block-woocommerce-product-template p.bwm-members-only {
	margin: 0.5em 0;
	padding: 0;
	border: 0;
	background: none;
	font-size: 0.875em;
}

/* The Member content block's fallback text. */
.bwm-member-content-fallback {
	margin: 0 0 1.5em;
	padding: 14px 18px;
	border-radius: 8px;
}

/* The member price: the regular price struck through, the member price plain and bold. */
.bwm-member-price ins {
	text-decoration: none;
	font-weight: 600;
}

.bwm-member-price del {
	margin-right: 0.25em;
}

/* My account, team invite (TeamJoin): the invite card's rows and buttons, the box after joining. */
.bwm-team-invite > p,
.bwm-team-joined > p {
	margin: 0 0 0.75em;
}

.bwm-team-invite .bwm-dl {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25em 1em;
	margin: 0 0 1em;
}

.bwm-team-invite .bwm-dl dt {
	opacity: 0.8;
}

.bwm-team-invite .bwm-dl dd {
	margin: 0;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.bwm-team-invite__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625em;
}

.bwm-team-invite__actions form {
	margin: 0;
}

.bwm-team-joined.bwm-box {
	margin: 0 0 1.5em;
	padding: 1.25em 1.5em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
}

.bwm-team-joined__head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625em;
	align-items: center;
	margin: 0 0 0.75em;
}

.bwm-team-joined__head h2 {
	margin: 0;
}

.bwm-team-joined .bwm-pill {
	display: inline-block;
	padding: 0.2em 0.75em;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 600;
	white-space: nowrap;
}

.bwm-team-joined .bwm-pill.bwm-ok {
	background: #e7f2ee;
	color: #134836;
}

.bwm-team-joined .bwm-pill.bwm-off {
	background: #eef0f3;
	color: #454b57;
}

.bwm-team-joined .bwm-muted {
	font-size: 0.875em;
	opacity: 0.85;
}

.bwm-team-joined > p:last-child {
	margin-bottom: 0;
}

/* My account memberships (list and members area): the Pay now and "access ends on" notices. */
.bwm-account-notice {
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 1.5em;
	padding: 14px 18px;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-left-width: 4px;
	border-radius: 8px;
	background: color-mix(in srgb, currentColor 3%, transparent);
}

.bwm-account-notice--due {
	border-left-color: #b26b00;
}

.bwm-account-notice--ending {
	border-left-color: #2346a8;
}

.bwm-account-notice__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bwm-account-notice .button {
	white-space: nowrap;
}

.bwm-memberships .bwm-seat {
	font-size: 0.875em;
	opacity: 0.8;
}


/* My account › Team (TeamArea): the owner's Team page. Scoped to .bwm-team, neutral like the rest. */
.bwm-team {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin: 0 0 2em;
}

.bwm-team > *,
.bwm-team .bwm-box > * {
	margin-top: 0;
	margin-bottom: 0;
}

.bwm-team__head {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	justify-content: space-between;
	align-items: flex-start;
}

.bwm-team__head h2,
.bwm-team__head p {
	margin: 0 0 6px;
}

.bwm-team__buy {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-end;
}

.bwm-team__buy form {
	margin: 0;
}

.bwm-team .bwm-muted {
	opacity: 0.8;
	font-size: 0.875em;
}

.bwm-team .bwm-box {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px 24px;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 10px;
	background: color-mix(in srgb, currentColor 3%, transparent);
}

.bwm-team .bwm-warnbox {
	border-left: 4px solid #b26a00;
}

.bwm-team .bwm-team-ends h3 {
	font-size: 1.1em;
}

.bwm-team .bwm-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 600;
	white-space: nowrap;
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.bwm-team .bwm-pill.bwm-warn {
	background: color-mix(in srgb, #b26a00 20%, transparent);
}


/* Storefront member labels (storefront-member-labels): the "Gold members" pill on a post, "Gold
 * member price" under a price, "Buying this gives you Gold membership…" under a product's price. */
.bwm-pill {
	display: inline-block;
	padding: 0.15em 0.75em;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 6%, transparent);
	font-size: 0.75em;
	font-weight: 600;
	line-height: 1.6;
	white-space: nowrap;
	vertical-align: middle;
}

.bwm-muted {
	font-size: 0.875em;
	opacity: 0.85;
}

p.bwm-member-label {
	margin: 0 0 1em;
}

.wp-block-post-date .bwm-member-pill {
	margin-left: 0.5em;
}

p.bwm-member-note,
p.bwm-grants {
	margin: 0.25em 0 1em;
}

span.bwm-member-note {
	display: block;
}


/* Block editor previews (block-editor-previews): the line under a sample preview in the editor
 * (Join to unlock, My memberships, the member area sections, Member content's fallback). Editor
 * only: no storefront markup carries this class. */
p.bwm-block-preview__note {
	margin: 8px 0 0;
	font-size: 0.8125em;
	font-style: italic;
	opacity: 0.75;
}

/* Licence pause (BOR-217): the "temporarily unavailable" notice that replaces members-only content
 * for everyone, the My account notice, and the "Temporarily unavailable" note on listed items. */
.bwm-paused {
	box-sizing: border-box;
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0 0 1.5em;
	padding: 20px 24px;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 10px;
}

.bwm-paused svg {
	flex: none;
}

.bwm-paused p {
	margin: 0;
}

.bwm-paused .bwm-paused-t {
	font-weight: 600;
}

.bwm-account-notice--licence {
	border-left-color: #8a6d00;
}

.bwm-lock {
	display: inline-block;
	font-size: 0.8125em;
	font-weight: 600;
	color: #7e1d17;
	background: #fdecea;
	border-radius: 999px;
	padding: 2px 10px;
}

/* UI leftovers (memberships-ui-leftovers): the Team page's seats meter under "N of M seats in use",
 * and the renewal pay page's period line. */
.bwm-team .bwm-meter {
	height: 8px;
	max-width: 320px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(128, 128, 128, 0.2);
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.bwm-team .bwm-meter span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.75;
}

.bwm-renewal-period {
	margin: 0 0 1em;
}
