/* The Journal WhatsApp News Share - Frontend button styles */

.tjw-whatsapp-share {
	margin: 20px 0;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
}

.tjw-whatsapp-share.tjw-align-left {
	justify-content: flex-start;
}

.tjw-whatsapp-share.tjw-align-center {
	justify-content: center;
}

.tjw-whatsapp-share.tjw-align-right {
	justify-content: flex-end;
}

/* Shared base for both the WhatsApp Share link and the Copy button, so
   they line up with equal height and consistent spacing/touch target
   size regardless of which HTML element each one is. */
.tjw-whatsapp-share__button,
.tjw-whatsapp-share__copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 600;
	font-family: inherit;
	text-decoration: none;
	border-radius: var( --tjw-btn-radius, 6px );
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
	max-width: 100%;
	word-break: break-word;
	text-align: center;
	min-height: 44px; /* touch-friendly target size */
	box-sizing: border-box;
}

/* WhatsApp Share button: unchanged from the original design (solid or
   outline, using the admin-configured button color). */
.tjw-whatsapp-share__button {
	border: 2px solid var( --tjw-btn-color, #25D366 );
}

.tjw-whatsapp-share.tjw-style-solid .tjw-whatsapp-share__button {
	background-color: var( --tjw-btn-color, #25D366 );
	color: var( --tjw-btn-text-color, #ffffff );
}

.tjw-whatsapp-share.tjw-style-outline .tjw-whatsapp-share__button {
	background-color: transparent;
	color: var( --tjw-btn-color, #25D366 );
}

.tjw-whatsapp-share__button:hover,
.tjw-whatsapp-share__button:focus-visible {
	opacity: 0.9;
	transform: translateY( -1px );
	color: var( --tjw-btn-text-color, #ffffff );
}

.tjw-whatsapp-share.tjw-style-outline .tjw-whatsapp-share__button:hover,
.tjw-whatsapp-share.tjw-style-outline .tjw-whatsapp-share__button:focus-visible {
	color: var( --tjw-btn-color, #25D366 );
}

/* Copy button: a lighter, secondary-styled companion button that sits
   next to the WhatsApp Share button without competing with it visually. */
.tjw-whatsapp-share__copy {
	background-color: #ffffff;
	color: #3c3c3c;
	border: 2px solid #d3d3d3;
	padding: 12px 18px;
}

.tjw-whatsapp-share__copy:hover,
.tjw-whatsapp-share__copy:focus-visible {
	opacity: 0.9;
	transform: translateY( -1px );
	border-color: #b7b7b7;
}

.tjw-whatsapp-share__copy.tjw-is-copied {
	background-color: #e6f7ec;
	border-color: #25D366;
	color: #1a7a3f;
}

.tjw-whatsapp-share__copy.tjw-is-error {
	background-color: #fdecea;
	border-color: #d93025;
	color: #a10e0e;
}

/* Visible keyboard focus state for both buttons (accessibility). */
.tjw-whatsapp-share__button:focus-visible,
.tjw-whatsapp-share__copy:focus-visible {
	outline: 3px solid #1a73e8;
	outline-offset: 2px;
}

@media ( max-width: 480px ) {
	.tjw-whatsapp-share {
		flex-direction: column;
		align-items: stretch;
	}

	.tjw-whatsapp-share__button,
	.tjw-whatsapp-share__copy {
		width: 100%;
		justify-content: center;
		font-size: 15px;
		padding: 12px 16px;
	}
}
