/* iShareBlog - front end */

.isb-share {
	--isb-accent: var(--accent, var(--wp--preset--color--primary, var(--wp--preset--color--accent, currentColor)));
	--isb-radius: 6px;
	--isb-gap: 8px;
	margin: 2em 0;
	clear: both;
}

.isb-shape-pill { --isb-radius: 999px; }
.isb-shape-square { --isb-radius: 0; }

.isb-share .isb-heading {
	margin: 0 0 0.6em;
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.75;
}

.isb-share .isb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: var(--isb-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.isb-share .isb-buttons li {
	margin: 0;
	padding: 0;
}

.isb-share .isb-buttons li::before { content: none; }

.isb-share .isb-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 14px;
	border: 2px solid var(--isb-color);
	border-radius: var(--isb-radius);
	background: var(--isb-color);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.isb-share .isb-btn:hover,
.isb-share .isb-btn:focus-visible {
	color: #fff;
	filter: brightness(1.12);
	transform: translateY(-1px);
	text-decoration: none;
	box-shadow: none;
}

.isb-share .isb-btn:focus-visible {
	outline: 2px solid var(--isb-color);
	outline-offset: 2px;
}

.isb-icon {
	flex: none;
	display: block;
}

/* Outline */
.isb-style-outline .isb-btn {
	background: transparent;
	color: var(--isb-color);
}

.isb-style-outline .isb-btn:hover,
.isb-style-outline .isb-btn:focus-visible {
	background: var(--isb-color);
	color: #fff;
	filter: none;
}

/* Minimal: follows the theme's text color */
.isb-style-minimal .isb-btn {
	border-color: currentColor;
	background: transparent;
	color: inherit;
	opacity: 0.85;
}

.isb-style-minimal .isb-btn:hover,
.isb-style-minimal .isb-btn:focus-visible {
	color: inherit;
	filter: none;
	opacity: 1;
}

/* Theme color: outlined, takes the theme's accent/primary color */
.isb-style-theme .isb-btn {
	border-width: 1px;
	border-color: color-mix(in srgb, var(--isb-accent) 45%, transparent);
	background: transparent;
	color: var(--isb-accent);
}

.isb-style-theme .isb-btn:hover,
.isb-style-theme .isb-btn:focus-visible {
	border-color: var(--isb-accent);
	background: color-mix(in srgb, var(--isb-accent) 14%, transparent);
	color: var(--isb-accent);
	filter: none;
}

.isb-style-theme .isb-btn:focus-visible { outline-color: var(--isb-accent); }

/* Summarize-with-AI buttons */
.isb-share .isb-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--isb-gap);
}

/* Summarize buttons sit at the right end of the row, and wrap under the icons on narrow screens. */
.isb-share .isb-ai-buttons { margin-left: auto; }

/* Icons only */
.isb-icons-only .isb-btn:not(.isb-btn--ai) {
	justify-content: center;
	width: 40px;
	padding: 0;
}

.isb-icons-only .isb-btn:not(.isb-btn--ai) .isb-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.isb-share .isb-count {
	margin: 0.6em 0 0;
	font-size: 0.85em;
	opacity: 0.75;
}

@media (max-width: 480px) {
	.isb-share:not(.isb-icons-only) .isb-btn:not(.isb-btn--ai) {
		justify-content: center;
		width: 40px;
		padding: 0;
	}

	.isb-share:not(.isb-icons-only) .isb-btn:not(.isb-btn--ai) .isb-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

/* Toast shown after copying */
.isb-toast {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	z-index: 10;
	padding: 6px 10px;
	border-radius: 4px;
	background: #1d2327;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	transform: translateX(-50%);
	pointer-events: none;
	animation: isb-fade 1.8s ease forwards;
}

@keyframes isb-fade {
	0%, 80% { opacity: 1; }
	100% { opacity: 0; }
}

/* ---------- Shareable quote ---------- */

.isb-quote {
	position: relative;
	margin: 2em 0;
	padding: 1.5em 1.75em 1.25em;
	border: 0;
	border-left: 4px solid currentColor;
	border-radius: 0 8px 8px 0;
	background: rgba(127, 127, 127, 0.08);
}

.isb-quote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	quotes: none;
}

.isb-quote blockquote::before,
.isb-quote blockquote::after { content: none; }

.isb-quote blockquote p {
	margin: 0;
	font-size: 1.25em;
	font-style: normal;
	font-weight: 600;
	line-height: 1.45;
}

.isb-quote figcaption {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75em;
	margin-top: 1em;
	font-size: 0.9em;
}

.isb-quote cite {
	font-style: normal;
	opacity: 0.75;
}

.isb-quote-actions {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.isb-quote-cta {
	margin-right: 4px;
	font-size: 0.85em;
	font-weight: 600;
	opacity: 0.7;
}

.isb-quote-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0.75;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.isb-quote-btn:hover,
.isb-quote-btn:focus-visible {
	background: rgba(127, 127, 127, 0.18);
	color: inherit;
	opacity: 1;
}

.isb-quote-btn:focus-visible { outline: 2px solid currentColor; }

/* ---------- Highlight-to-share popup ---------- */

.isb-popup {
	position: absolute;
	z-index: 99999;
	display: flex;
	gap: 2px;
	padding: 4px;
	border-radius: 8px;
	background: #1d2327;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.isb-popup[hidden] { display: none; }

.isb-popup::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	border: 6px solid transparent;
	border-top-color: #1d2327;
	transform: translateX(-50%);
}

.isb-popup--below::after {
	top: auto;
	bottom: 100%;
	border-top-color: transparent;
	border-bottom-color: #1d2327;
}

.isb-popup-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.isb-popup-btn:hover,
.isb-popup-btn:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.isb-share .isb-btn,
	.isb-quote-btn { transition: none; }
	.isb-share .isb-btn:hover,
	.isb-share .isb-btn:focus-visible { transform: none; }
}
