/*
 * Affiliate Playground Pro — Share Module
 *
 * Selectors are deliberately two levels deep (.app-share .app-share__btn) and the
 * button defaults are reset explicitly: themes style bare <button> elements, which
 * would otherwise make the copy button a different size to the <a> buttons next to it.
 */

.app-share {
	margin: 1.6em 0;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	position: relative;
}

.app-share__heading {
	font-size: 13px;
	font-weight: 600;
	color: #444;
}

.app-share__items {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.app-share .app-share__btn,
.app-share .app-share__toggle,
.app-share__menu .app-share__btn {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	font-family: inherit;
	font-style: normal;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	margin: 0;
	text-decoration: none;
}

.app-share .app-share__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 0;
	width: 38px;
	height: 38px;
	border: 1px solid transparent;
	background: none;
	cursor: pointer;
	line-height: 1;
	font-size: 13px;
	font-weight: 500;
	transition: transform .12s ease, opacity .12s ease;
}

.app-share .app-share__btn:hover,
.app-share .app-share__btn:focus {
	transform: translateY(-1px);
	text-decoration: none;
}

.app-share__icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
	flex-shrink: 0;
}

/* ── Shapes ──────────────────────────────────────────────────────────────── */

.app-share--shape-circle .app-share__btn { border-radius: 50%; }
.app-share--shape-rounded .app-share__btn { border-radius: 8px; }
.app-share--shape-square .app-share__btn { border-radius: 0; }

/* ── Colour styles ───────────────────────────────────────────────────────── */

.app-share--style-brand .app-share__btn {
	background: #374151;
	color: #fff;
}

.app-share--style-brand .app-share__btn--facebook  { background: #1877F2; }
.app-share--style-brand .app-share__btn--x         { background: #000000; }
.app-share--style-brand .app-share__btn--whatsapp  { background: #25D366; }
.app-share--style-brand .app-share__btn--pinterest { background: #E60023; }
.app-share--style-brand .app-share__btn--linkedin  { background: #0A66C2; }
.app-share--style-brand .app-share__btn--reddit    { background: #FF4500; }
.app-share--style-brand .app-share__btn--email     { background: #6B7280; }

.app-share--style-outline .app-share__btn {
	background: transparent;
	border-color: #d5d7db;
	color: #444;
}

.app-share--style-outline .app-share__btn:hover {
	border-color: var(--app-share-color, #DE369D);
	color: var(--app-share-color, #DE369D);
}

.app-share--style-mono .app-share__btn {
	background: var(--app-share-color, #DE369D);
	color: #fff;
}

/* ── Menu layout ─────────────────────────────────────────────────────────── */

.app-share .app-share__toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	border: 1px solid #d5d7db;
	border-radius: 8px;
	background: #fff;
	color: #1f2328;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.app-share .app-share__toggle:hover {
	border-color: var(--app-share-color, #DE369D);
}

.app-share .app-share__toggle .app-share__icon {
	width: 15px;
	height: 15px;
}

.app-share__menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	margin-top: 6px;
	min-width: 210px;
	padding: 6px;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.app-share__menu[hidden] { display: none; }

/* While open the menu is moved to the end of <body> and positioned from script.
   A z-index alone cannot win here: it only ranks siblings inside the same stacking
   context, so a theme wrapper further up the tree can still paint over it — and an
   invisible full-card link on a related post would then swallow the clicks. */
.app-share__menu.app-share__menu--floating {
	position: fixed;
	top: 0;
	left: -9999px;
	margin: 0;
	z-index: 2147483000;
}

.app-share__menu .app-share__btn {
	width: 100%;
	height: auto;
	justify-content: flex-start;
	gap: 12px;
	padding: 8px 12px;
	border-radius: 6px;
	border-color: transparent;
	background: none;
	color: #1f2328;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.app-share__menu .app-share__btn:hover {
	background: #f2f3f5;
	transform: none;
}

.app-share__menu .app-share__label {
	font-size: 13px;
	line-height: 1.3;
}

.app-share__menu.app-share--style-brand .app-share__btn .app-share__icon            { color: #374151; }
.app-share__menu.app-share--style-brand .app-share__btn--facebook  .app-share__icon { color: #1877F2; }
.app-share__menu.app-share--style-brand .app-share__btn--x         .app-share__icon { color: #000000; }
.app-share__menu.app-share--style-brand .app-share__btn--whatsapp  .app-share__icon { color: #25D366; }
.app-share__menu.app-share--style-brand .app-share__btn--pinterest .app-share__icon { color: #E60023; }
.app-share__menu.app-share--style-brand .app-share__btn--linkedin  .app-share__icon { color: #0A66C2; }
.app-share__menu.app-share--style-brand .app-share__btn--reddit    .app-share__icon { color: #FF4500; }
.app-share__menu.app-share--style-brand .app-share__btn--email     .app-share__icon { color: #6B7280; }

.app-share__menu.app-share--style-mono .app-share__btn .app-share__icon,
.app-share__menu.app-share--style-outline .app-share__btn .app-share__icon {
	color: var(--app-share-color, #DE369D);
}

/* ── Native share sheet: only shown when the browser supports it ──────────── */

.app-share .app-share__btn--native,
.app-share__menu .app-share__btn--native { display: none; }
.app-share--can-native .app-share__btn--native { display: inline-flex; }
.app-share__menu.app-share--can-native .app-share__btn--native { display: flex; }

/* ── Copied feedback ─────────────────────────────────────────────────────── */

.app-share__toast {
	position: absolute;
	bottom: 100%;
	left: 0;
	margin-bottom: 6px;
	padding: 5px 10px;
	border-radius: 6px;
	background: #1f2328;
	color: #fff;
	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
}
