/* Post Share + AI Summary */

:root {
	--psas-brand-color: #88DD5E;
	--psas-float-size: 32px;
}

/* --- AI Summary box --- */
.psas-summary-box {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-left: 4px solid var(--psas-brand-color);
	border-radius: 6px;
	padding: 1em 1.25em;
	margin: 0 0 1.75em;
	background: rgba(0, 0, 0, 0.03);
	background: color-mix(in srgb, var(--psas-brand-color) 8%, transparent);
}

.psas-summary-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5em;
}

.psas-summary-label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--psas-brand-color);
}

.psas-summary-toggle {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.8rem;
	text-decoration: underline;
	color: inherit;
	opacity: 0.7;
}

.psas-summary-body p {
	margin: 0 0 0.75em;
	line-height: 1.5;
}

/* --- Share bar (shared across all placements) --- */
.psas-share-bar {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.psas-icon {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.35em 0.7em;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	text-decoration: none;
	font-size: 0.8rem;
	border: none;
	cursor: pointer;
	line-height: 1;
}

.psas-icon:hover {
	background: rgba(0, 0, 0, 0.12);
	background: color-mix(in srgb, var(--psas-brand-color) 25%, rgba(0, 0, 0, 0.06));
}

/* --- Icon glyph: real platform logo (img) or generic inline SVG for
   email/copy-link — sized consistently wherever it appears. --- */
.psas-icon-glyph {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	flex: 0 0 auto;
}

.psas-icon-glyph img,
.psas-icon-glyph svg {
	width: 1.15rem;
	height: 1.15rem;
	display: block;
}

.psas-icon-glyph svg {
	color: currentColor;
}

/* Fallback badge (shown by frontend.js if a logo image 404s): a plain
   letter circle so the button never renders empty. */
.psas-icon-glyph.psas-icon-fallback {
	width: 1.15rem;
	height: 1.15rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.15);
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
}

.psas-copy-link.psas-copied::after {
	content: " ✓";
}

.psas-icons-only .psas-icon {
	padding: 0.4em;
	width: 2em;
	height: 2em;
	justify-content: center;
}

/* Style variants */
.psas-style-outline .psas-icon {
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.2);
}

.psas-style-filled .psas-icon {
	background: rgba(0, 0, 0, 0.06);
	background: color-mix(in srgb, var(--psas-brand-color) 14%, rgba(0, 0, 0, 0.04));
}

.psas-style-minimal .psas-icon {
	background: transparent;
	padding: 0.2em 0.4em;
	text-decoration: underline;
}

/* --- End-of-post section --- */
.psas-share-section {
	margin: 2em 0;
	padding-top: 1.5em;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.psas-share-heading {
	font-weight: 700;
	margin-bottom: 0.6em;
}

/* --- Floating share bar ---
   Container and icon size are both driven by --psas-float-size, set
   inline from the "Icon & button size" setting (default 32px, down from
   the old fixed ~42px). Position (left/right) and shape (rounded/pill/
   square) are settings-driven modifier classes. */
.psas-floating-bar {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1000;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	padding: 0.4em;
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.psas-floating-pos-left {
	left: 16px;
	transform: translateY(-50%) translateX(-120%);
}

.psas-floating-pos-right {
	right: 16px;
	transform: translateY(-50%) translateX(120%);
}

.psas-floating-bar.psas-visible.psas-floating-pos-left,
.psas-floating-bar.psas-visible.psas-floating-pos-right {
	transform: translateY(-50%) translateX(0);
	opacity: 1;
}

.psas-floating-style-square {
	border-radius: 4px;
}

.psas-floating-style-pill {
	border-radius: 999px;
}

.psas-floating-bar .psas-share-bar {
	flex-direction: column;
	gap: 0.5em;
}

/* Icon-only buttons inside the floating bar: container scales from
   --psas-float-size, set per-instance via inline style from the
   "Icon & button size" setting. */
.psas-floating-bar .psas-icon {
	width: var(--psas-float-size);
	height: var(--psas-float-size);
	padding: 0;
}

.psas-floating-style-square .psas-icon {
	border-radius: 4px;
}

.psas-floating-style-pill .psas-icon,
.psas-floating-style-rounded .psas-icon {
	border-radius: 50%;
}

.psas-floating-bar .psas-icon-glyph img,
.psas-floating-bar .psas-icon-glyph svg {
	width: calc(var(--psas-float-size) * 0.5);
	height: calc(var(--psas-float-size) * 0.5);
}

/* --- Gutenberg block share --- */
.psas-block-share-wrap {
	position: relative;
}

.psas-block-share-content {
	position: relative;
}

.psas-block-share-trigger {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	background: #fff;
	color: inherit;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
	z-index: 2;
}

.psas-block-share-trigger:hover,
.psas-block-share-trigger:focus-visible {
	background: color-mix(in srgb, var(--psas-brand-color) 16%, #fff);
	outline: none;
}

.psas-block-share-wrap:hover .psas-block-share-trigger,
.psas-block-share-wrap:focus-within .psas-block-share-trigger,
.psas-block-share-trigger[aria-expanded="true"] {
	opacity: 1;
	transform: translateY(0);
}

.psas-block-share-panel {
	display: flex;
	justify-content: flex-end;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	padding-top: 0;
	pointer-events: none;
	transition: max-height 0.2s ease, opacity 0.18s ease, padding-top 0.2s ease;
}

.psas-block-share-wrap:hover .psas-block-share-panel,
.psas-block-share-wrap:focus-within .psas-block-share-panel,
.psas-block-share-wrap.psas-block-share-open .psas-block-share-panel {
	max-height: 80px;
	opacity: 1;
	padding-top: 8px;
	pointer-events: auto;
}

.psas-block-share-bar {
	gap: 6px;
}

.psas-block-share-bar .psas-icon {
	width: 32px;
	height: 32px;
	padding: 0;
	justify-content: center;
	border-radius: 50%;
}

.psas-block-share-bar .psas-icon-glyph img,
.psas-block-share-bar .psas-icon-glyph svg {
	width: 17px;
	height: 17px;
}

@media (max-width: 782px) {
	.psas-floating-pos-left {
		left: 8px;
	}

	.psas-floating-pos-right {
		right: 8px;
	}

	.psas-floating-bar .psas-icon {
		width: var(--psas-float-size-mobile);
		height: var(--psas-float-size-mobile);
	}

	.psas-floating-bar .psas-icon-glyph img,
	.psas-floating-bar .psas-icon-glyph svg {
		width: calc(var(--psas-float-size-mobile) * 0.5);
		height: calc(var(--psas-float-size-mobile) * 0.5);
	}

	/* On touch screens there is no hover, so keep the share trigger usable. */
	.psas-block-share-trigger {
		opacity: 0.85;
		transform: none;
	}
}
