/**
 * Popup genèric per al shortcode [allotjament_enlace_acf].
 */
.er-acf-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(42, 37, 32, 0.72);
}

.er-acf-popup.is-open {
	display: flex;
}

.er-acf-popup__dialog {
	position: relative;
	width: min(1100px, calc(100vw - 40px));
	max-height: calc(100vh - 40px);
	background: #ffffff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.er-acf-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.94);
	color: var(--er-ink);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.er-acf-popup__body {
	width: 100%;
	max-height: calc(100vh - 40px);
	overflow: auto;
	background: #ffffff;
}

.er-acf-popup__image {
	display: block;
	width: 100%;
	height: auto;
}

.er-acf-popup__iframe {
	display: block;
	width: 100%;
	height: min(85vh, 900px);
	border: 0;
	background: #ffffff;
}

/* Botó disparador estilitzat */
.er-enlace-acf {
	width: 100%;
}

/* L'aspecte del botó (color, vora, padding, tipografia, estats) el dóna
   .btn-secundari del sistema de botons del tema (§09). Aquí només el
   layout flex per col·locar pin + etiqueta + icona d'expansió. */
.er-enlace-acf__link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
}

.er-enlace-acf__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
}

/* Icona d'expansio a la dreta: comunica "obre vista ampliada".
   Opacitat reduida perque NO competeixi amb el pin de l'esquerra
   (que és el primary affordance "ubicació"). margin-left: auto la
   empeny a la dreta del flex container, separada del label. */
.er-enlace-acf__expand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	margin-left: auto;
	opacity: 0.45;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.er-enlace-acf__link:hover .er-enlace-acf__expand,
.er-enlace-acf__link:focus-visible .er-enlace-acf__expand {
	opacity: 0.8;
	transform: scale(1.08);
}

/* El label porta el màxim espai possible perquè l'icona d'expansió
   quedi flotant a la dreta sense que el text es desplaci visualment. */
.er-enlace-acf__label {
	display: inline-block;
}

@media (max-width: 767px) {
	.er-acf-popup {
		padding: 12px;
	}

	.er-acf-popup__dialog {
		width: calc(100vw - 24px);
		max-height: calc(100vh - 24px);
		border-radius: 16px;
	}

	.er-acf-popup__iframe {
		height: 78vh;
	}
}
