/**
 * DMF Article Tools
 *
 * Button bar (Print / Preview) + the front-end preview modal.
 * Button colors/typography here are sensible brand defaults; nearly all of it
 * is overridable from the widget's Style tab via Elementor selectors.
 */

/* --- Toolbar --- */

.dmf-article-tools {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* Kept for pages rendered before the responsive direction control existed. */
.dmf-article-tools--stack {
	flex-direction: column;
	align-items: flex-start;
}

/*
 * Direction per breakpoint. The responsive `direction` control puts prefix
 * classes on the widget wrapper: `dmf-article-tools--dir-*` (desktop),
 * `dmf-article-tools-tablet--dir-*`, and `dmf-article-tools-mobile--dir-*`.
 * Breakpoints match Elementor's defaults (tablet <=1024px, mobile <=767px).
 */

.dmf-article-tools--dir-stack .dmf-article-tools {
	flex-direction: column;
	align-items: flex-start;
}

@media (max-width: 1024px) {
	.dmf-article-tools-tablet--dir-row .dmf-article-tools {
		flex-direction: row;
		align-items: center;
	}

	.dmf-article-tools-tablet--dir-stack .dmf-article-tools {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 767px) {
	.dmf-article-tools-mobile--dir-row .dmf-article-tools {
		flex-direction: row;
		align-items: center;
	}

	.dmf-article-tools-mobile--dir-stack .dmf-article-tools {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Icon-only mode: fixed squares that match a vertical social-share rail.
   Labels stay in the markup for screen readers but are hidden visually. */
.dmf-article-tools--icon-only .dmf-article-tools__button {
	position: relative;
	width: 46px;
	height: 46px;
	padding: 0;
	justify-content: center;
}

.dmf-article-tools--icon-only .dmf-article-tools__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --- Buttons --- */

.dmf-article-tools__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: 2px solid transparent;
	border-radius: 6px;
	background-color: #003057;
	color: #ffffff;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dmf-article-tools__button:hover {
	background-color: #1a6e63;
	color: #ffffff;
}

.dmf-article-tools__button--print {
	background-color: #888888;
	border-color: #888888;
	color: #ffffff;
}

.dmf-article-tools__button--print:hover {
	background-color: #757575;
	border-color: #757575;
	color: #ffffff;
}

.dmf-article-tools__button .dmf-article-tools__icon {
	display: inline-flex;
	align-items: center;
	font-size: 1em;
}

.dmf-article-tools__button .dmf-article-tools__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.dmf-article-tools__button--icon-after {
	flex-direction: row-reverse;
}

/* JS hides the device-share button where the Web Share API is unsupported;
   the explicit rule is needed because display:inline-flex beats [hidden]. */
.dmf-article-tools__button[hidden] {
	display: none;
}

/* --- Share buttons --- */

/* Share links inherit the shared button style; this covers link resets. */
a.dmf-article-tools__button {
	text-decoration: none;
}

.dmf-article-tools__share--copied {
	background-color: #1a7f37 !important;
	color: #ffffff !important;
}

/* Official brand colors (opt-in via the widget's Share Buttons section). */
.dmf-article-tools--brand-colors .dmf-article-tools__share--facebook {
	background-color: #1877f2;
	border-color: #1877f2;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--x {
	background-color: #000000;
	border-color: #000000;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--linkedin {
	background-color: #0a66c2;
	border-color: #0a66c2;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--whatsapp {
	background-color: #25d366;
	border-color: #25d366;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--pinterest {
	background-color: #e60023;
	border-color: #e60023;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--reddit {
	background-color: #ff4500;
	border-color: #ff4500;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--email {
	background-color: #556575;
	border-color: #556575;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share--copy {
	background-color: #334155;
	border-color: #334155;
	color: #ffffff;
}

/* No brand to match — same neutral slate as Copy Link. */
.dmf-article-tools--brand-colors .dmf-article-tools__share--device {
	background-color: #334155;
	border-color: #334155;
	color: #ffffff;
}

.dmf-article-tools--brand-colors .dmf-article-tools__share:hover {
	filter: brightness(1.15);
	color: #ffffff;
}

/* --- Size presets (prefix_class dmf-article-tools--size-) --- */

.dmf-article-tools--size-xs .dmf-article-tools__button {
	padding: 6px 12px;
	font-size: 12px;
}

.dmf-article-tools--size-sm .dmf-article-tools__button {
	padding: 9px 18px;
	font-size: 13px;
}

.dmf-article-tools--size-lg .dmf-article-tools__button {
	padding: 15px 30px;
	font-size: 17px;
}

.dmf-article-tools--size-xl .dmf-article-tools__button {
	padding: 18px 36px;
	font-size: 19px;
}

/* --- Preview modal --- */

.dmf-article-tools-modal-open,
.dmf-article-tools-modal-open body {
	overflow: hidden;
}

.dmf-article-tools__modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: rgba(10, 20, 30, 0.8);
}

.dmf-article-tools__modal-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 20px;
	background: #0d1b26;
	color: #ffffff;
}

.dmf-article-tools__modal-title {
	font-size: 14px;
	opacity: 0.85;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dmf-article-tools__modal-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.dmf-article-tools__modal-button {
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 5px;
	background: transparent;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.dmf-article-tools__modal-button:hover {
	background: rgba(255, 255, 255, 0.15);
}

.dmf-article-tools__modal-button--close {
	border: none;
	font-size: 16px;
	padding: 8px 10px;
}

.dmf-article-tools__modal-body {
	flex: 1;
	overflow: auto;
	padding: 32px 16px;
}

@media (max-width: 767px) {
	.dmf-article-tools__modal-body {
		padding: 16px 8px;
	}
}
