/* Envoi Pro: display styles, Share menu, QR dialog. */

.envoi__btn--qr { --envoi-brand: #555; }

/* Names are only shown by the styles that use them. */
.envoi--icons .envoi__text {
	display: none;
}

/* Icons with names */
.envoi.envoi--labels a.envoi__btn,
.envoi.envoi--labels button.envoi__btn {
	gap: 0.45em;
}

.envoi.envoi--labels:not(.envoi--plain) .envoi__btn.envoi__btn {
	padding-inline: calc(var(--envoi-size) * 0.6);
}

.envoi.envoi--labels.envoi--circle .envoi__btn.envoi__btn {
	border-radius: 999px;
}

/* Text links: the theme's typography, separated by a middle dot. */
.envoi.envoi--text {
	gap: 0.6em;
}

.envoi--text .envoi__icon {
	display: none;
}

.envoi.envoi--text .envoi__btn.envoi__btn {
	padding: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.envoi--text .envoi__text {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* Brand mode: text takes the brand colour (shapes don't apply to text links). */
.envoi.envoi--brand.envoi--text .envoi__btn.envoi__btn {
	--envoi-fg: var(--envoi-brand);
}

.envoi--text .envoi__btn + .envoi__btn::before {
	content: "·";
	margin-right: 0.6em;
	opacity: 0.6;
}

/* One Share button. Stays block-level so themes' content layouts align it. */
.envoi.envoi--menu {
	position: relative;
}

.envoi button.envoi__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin: 0;
	padding: 0.45em 0.95em;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: var(--envoi-bg);
	box-shadow: none;
	color: var(--envoi-fg);
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.envoi button.envoi__toggle:hover,
.envoi button.envoi__toggle:focus-visible {
	background: var(--envoi-bg-hover, var(--envoi-bg));
	color: var(--envoi-fg-hover, var(--envoi-fg));
}

.envoi__toggle .envoi__icon {
	width: 1.1em;
	height: 1.1em;
}

.envoi__panel {
	position: absolute;
	top: calc(100% + 0.4rem);
	left: 0;
	z-index: 1000;
	display: grid;
	gap: 2px;
	min-width: 13rem;
	padding: 0.4rem;
	border-radius: 10px;
	background: var(--envoi-panel-bg, #fff);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
	color: var(--envoi-panel-fg, #1e1e1e);
}

.envoi .envoi__panel[hidden] {
	display: none;
}

.envoi.envoi--menu .envoi__panel .envoi__btn.envoi__btn {
	box-sizing: border-box;
	justify-content: flex-start;
	gap: 0.6em;
	width: 100%;
	padding: 0.45rem 0.6rem;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: var(--envoi-panel-fg, #1e1e1e);
	opacity: 1;
}

.envoi.envoi--menu .envoi__panel .envoi__btn.envoi__btn:hover,
.envoi.envoi--menu .envoi__panel .envoi__btn.envoi__btn:focus-visible {
	background: rgba(0, 0, 0, 0.06);
}

.envoi--menu .envoi__panel .envoi__icon {
	width: 1.15rem;
	height: 1.15rem;
}

.envoi--menu.envoi--brand .envoi__panel .envoi__icon {
	color: var(--envoi-brand);
}

/* Other styles: the toggle is hidden and the panel is transparent to layout. */
.envoi:not(.envoi--menu) > .envoi__toggle {
	display: none;
}

.envoi:not(.envoi--menu) > .envoi__panel {
	display: contents;
}

/* QR dialog */
.envoi-qr .envoi-qr__code svg {
	display: block;
	width: min(240px, 70vw);
	height: auto;
	margin: 0 auto;
}

.envoi-qr .envoi-qr__url {
	margin: 0.75rem 0 0;
	color: #555;
	font-size: 0.8em;
	text-align: center;
	word-break: break-all;
}

@media print {
	.envoi__panel {
		display: none;
	}
}
