/**
 * Save + Share action row, and the share panel behind it.
 *
 * Everything tunable is a custom property on .jdv-post-actions so the
 * Elementor Style tab can repaint the row without this file knowing about
 * Elementor. The dialog is moved to the browser's top layer and is therefore
 * no longer a descendant of the widget wrapper, so its properties are set on
 * :root-level defaults here and overridden through the wrapper only for the
 * values it can still inherit at render time.
 *
 * No font-family is set anywhere; the row inherits the site's.
 */

.jdv-post-actions {
	--jdv-action-text: #4c423c;
	--jdv-action-muted: #6d6259;
	--jdv-action-border: #ded2c4;
	--jdv-action-bg: transparent;
	--jdv-action-hover-bg: #f3ebe0;
	--jdv-action-active-bg: #eaf9d9;
	--jdv-action-active-text: #3d4a24;
	--jdv-action-radius: 999px;
	--jdv-action-gap: 12px;

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--jdv-action-gap);
	width: 100%;
}

.jdv-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 9px 18px;
	border: 1px solid var(--jdv-action-border);
	border-radius: var(--jdv-action-radius);
	background: var(--jdv-action-bg);
	color: var(--jdv-action-text);
	font: inherit;
	font-size: 15px;
	line-height: 1.2;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.jdv-action:hover,
.jdv-action:focus-visible {
	background: var(--jdv-action-hover-bg);
	color: var(--jdv-action-text);
	text-decoration: none;
}

.jdv-action:focus-visible {
	outline: 2px solid var(--jdv-action-text);
	outline-offset: 2px;
}

.jdv-action__icon {
	display: inline-flex;
	flex: 0 0 auto;
}

.jdv-action__icon svg {
	display: block;
}

/* Saved state: the bookmark fills in and the pill takes the accent. */
.jdv-action--save.is-saved {
	background: var(--jdv-action-active-bg);
	border-color: var(--jdv-action-active-bg);
	color: var(--jdv-action-active-text);
}

.jdv-action--save.is-saved .jdv-action__icon svg {
	fill: currentColor;
}

.jdv-action.is-busy {
	opacity: 0.6;
	cursor: progress;
}

/* Editor-only placeholder when there is no post to act on. */
.jdv-post-actions--empty {
	padding: 16px;
	border: 1px dashed #ded2c4;
	border-radius: 8px;
	color: #6d6259;
	font-size: 14px;
}

.jdv-post-actions--empty p {
	margin: 0;
}

/* ------------------------------ share panel ------------------------------ */

.jdv-share-dialog {
	width: min(420px, calc(100vw - 32px));
	max-width: none;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: transparent;
	color: #4c423c;
	overflow: visible;
}

.jdv-share-dialog::backdrop {
	background: rgba(38, 32, 28, 0.55);
}

.jdv-share-dialog__panel {
	padding: 22px;
	border-radius: 14px;
	background: var(--jdv-share-bg, #fdf8f0);
	box-shadow: 0 18px 48px rgba(38, 32, 28, 0.22);
}

.jdv-share-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.jdv-share-dialog__title {
	margin: 0;
	font-size: 20px;
	font-weight: 500;
	color: inherit;
}

.jdv-share-dialog__close {
	display: inline-flex;
	padding: 6px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	cursor: pointer;
}

.jdv-share-dialog__close:hover {
	background: rgba(38, 32, 28, 0.08);
}

.jdv-share__targets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.jdv-share__target a,
.jdv-share__target button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 12px 4px;
	border: 0;
	border-radius: 10px;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 12px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.jdv-share__target a:hover,
.jdv-share__target button:hover,
.jdv-share__target a:focus-visible,
.jdv-share__target button:focus-visible {
	background: rgba(38, 32, 28, 0.07);
	color: inherit;
	text-decoration: none;
}

.jdv-share__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #efe6d8;
}

.jdv-share__icon {
	fill: currentColor;
}

.jdv-share__name {
	line-height: 1.2;
}

.jdv-share__field {
	margin-top: 14px;
}

.jdv-share__field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	color: #6d6259;
}

.jdv-share__copy {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.jdv-share__copy input,
.jdv-share__copy textarea {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid #ded2c4;
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 14px;
	resize: vertical;
}

.jdv-share__copy-btn {
	flex: 0 0 auto;
	align-self: flex-start;
	padding: 10px 16px;
	border: 1px solid #ded2c4;
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.jdv-share__copy-btn:hover {
	background: #f3ebe0;
}

.jdv-share__copy-btn.is-copied {
	border-color: #eaf9d9;
	background: #eaf9d9;
	color: #3d4a24;
}

/* --------------------------------- toast --------------------------------- */

.jdv-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 2147483647;
	max-width: min(420px, calc(100vw - 32px));
	padding: 12px 18px;
	border-radius: 999px;
	background: #3b332c;
	color: #fdf8f0;
	font-size: 14px;
	text-align: center;
	opacity: 0;
	transform: translate(-50%, 12px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.jdv-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.jdv-toast--error {
	background: #8c3a2e;
}

@media (prefers-reduced-motion: reduce) {
	.jdv-action,
	.jdv-toast {
		transition: none;
	}
}
