/*
 * Click-to-load consent gates for embeds that iubenda blocks before consent
 * (YouTube videos, Google Maps embeds, the WP Go Maps plugin map).
 *
 * Each gate is a sibling of its target inside a wrapper that hugs the target, so
 * it lines up exactly without sitting inside a box the embed may empty on init.
 * The child-combinator selectors keep specificity above the plugin and theme
 * stylesheets, which load after this file.
 *
 * Brand colour: #2a6baf (accent) / #22578f (hover). Change both to restyle.
 */

.pe-gate-wrap {
	position: relative;
	/* flow-root so the wrapper contains a floated target (the WP Go Maps canvas
	   is float:left) instead of collapsing to zero height. */
	display: flow-root;
}

/* An iframe is inline by default, so the wrapper would gain a few pixels of
   baseline space and the gate would no longer match the frame exactly. */
.pe-gate-wrap > iframe {
	display: block;
}

.pe-gate-wrap > .pe-gate {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #eef1f5;
	opacity: 1;
	transition: opacity 0.4s ease;
}

.pe-gate-wrap > .pe-gate.is-leaving {
	opacity: 0;
	pointer-events: none;
}

/* Stylised, self-contained artwork. No third-party request is made for it. */
.pe-gate__art {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pe-gate__card {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: calc(100% - 3rem);
	max-width: 30rem;
	padding: 2rem;
	border-radius: 0.5rem;
	background: #fff;
	box-shadow: 0 0.5rem 2.5rem rgba(0, 0, 0, 0.14);
	text-align: center;
}

.pe-gate__icon {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0 auto 1rem;
	color: #2a6baf;
}

.pe-gate__title {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
	line-height: 1.3;
}

.pe-gate__text {
	margin: 0 0 1.5rem;
	font-size: 0.9375rem;
	line-height: 1.55;
	opacity: 0.8;
}

.pe-gate__card .pe-gate__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 2.75rem;
	padding: 0.75rem 1.75rem;
	border: 0;
	border-radius: 2rem;
	background: #2a6baf;
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.2s ease;
}

.pe-gate__card .pe-gate__button:hover,
.pe-gate__card .pe-gate__button:focus-visible {
	background: #22578f;
	color: #fff;
}

.pe-gate__card .pe-gate__button[disabled] {
	opacity: 0.75;
	cursor: default;
}

.pe-gate__spinner {
	width: 1rem;
	height: 1rem;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pe-gate-spin 0.7s linear infinite;
}

@keyframes pe-gate-spin {
	to {
		transform: rotate(360deg);
	}
}

.pe-gate__card .pe-gate__link {
	display: block;
	margin: 1rem auto 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: 0.8125rem;
	opacity: 0.7;
	text-decoration: underline;
	cursor: pointer;
}

.pe-gate__card .pe-gate__link:hover,
.pe-gate__card .pe-gate__link:focus-visible {
	opacity: 1;
}

.pe-gate__card .pe-gate__button:focus-visible,
.pe-gate__card .pe-gate__link:focus-visible {
	outline: 2px solid #2a6baf;
	outline-offset: 3px;
}

@media (max-width: 600px) {
	.pe-gate__card {
		width: calc(100% - 2rem);
		padding: 1.5rem 1.25rem;
	}

	.pe-gate__title {
		font-size: 1.125rem;
	}

	.pe-gate__text {
		font-size: 0.875rem;
	}
}

/* Short embeds cannot fit the full card, so drop the decorative parts. */
.pe-gate-wrap.is-compact .pe-gate__card {
	padding: 1.25rem;
}

.pe-gate-wrap.is-compact .pe-gate__icon,
.pe-gate-wrap.is-compact .pe-gate__text {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.pe-gate-wrap > .pe-gate {
		transition: none;
	}

	.pe-gate__spinner {
		animation-duration: 2s;
	}
}
