/**
 * Social Share Popup - front-end styles
 * Prefix: ctp-
 */

/* ---------------------------------------------------------------------
 * Share button
 * ------------------------------------------------------------------- */
.ctp-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	padding: 10px 18px;
	border: 1px solid #1e73be;
	border-radius: 4px;
	background-color: #1e73be;
	color: #ffffff;
	transition: background-color .2s ease, border-color .2s ease, transform .15s ease;
}

.ctp-share-btn:hover,
.ctp-share-btn:focus-visible {
	background-color: #175d9c;
	border-color: #175d9c;
}

.ctp-share-btn:active {
	transform: translateY(1px);
}

.ctp-share-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.ctp-share-btn__icon svg {
	width: 1em;
	height: 1em;
}

.ctp-share-btn .dashicons {
	width: auto;
	height: auto;
	font-size: 18px;
	line-height: 1;
}

/* ---------------------------------------------------------------------
 * Modal
 * ------------------------------------------------------------------- */
.ctp-share-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ctp-share-modal[hidden] {
	display: none;
}

.ctp-share-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	animation: ctpFadeIn .18s ease;
}

.ctp-share-modal__dialog {
	position: relative;
	background: #ffffff;
	border-radius: 10px;
	max-width: 420px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
	animation: ctpSlideUp .2s ease;
}

.ctp-share-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #555555;
	cursor: pointer;
}

.ctp-share-modal__close:hover,
.ctp-share-modal__close:focus-visible {
	background: #f0f0f0;
	color: #111111;
}

.ctp-share-modal__title {
	margin: 0 0 18px;
	font-size: 20px;
	font-weight: 600;
	color: #1a1a1a;
	padding-right: 30px;
}

.ctp-share-modal__list {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.ctp-share-modal__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 8px;
	border-radius: 8px;
	text-decoration: none;
	color: #333333;
	background: #f6f7f8;
	transition: background-color .15s ease, transform .15s ease;
	font-size: 12px;
	text-align: center;
}

.ctp-share-modal__link:hover,
.ctp-share-modal__link:focus-visible {
	background: #eaecef;
	transform: translateY(-2px);
}

.ctp-share-modal__icon {
	display: inline-flex;
}

.ctp-share-modal__link--facebook .ctp-share-modal__icon { color: #1877f2; }
.ctp-share-modal__link--x .ctp-share-modal__icon { color: #000000; }
.ctp-share-modal__link--linkedin .ctp-share-modal__icon { color: #0a66c2; }
.ctp-share-modal__link--whatsapp .ctp-share-modal__icon { color: #25d366; }
.ctp-share-modal__link--telegram .ctp-share-modal__icon { color: #229ed9; }
.ctp-share-modal__link--email .ctp-share-modal__icon { color: #666666; }

.ctp-share-modal__copy-row {
	display: flex;
	gap: 8px;
	border-top: 1px solid #eeeeee;
	padding-top: 16px;
}

.ctp-share-modal__copy-input {
	flex: 1;
	min-width: 0;
	padding: 9px 10px;
	border: 1px solid #dddddd;
	border-radius: 6px;
	font-size: 13px;
	color: #444444;
	background: #fafafa;
}

.ctp-share-modal__copy-btn {
	flex-shrink: 0;
	padding: 9px 14px;
	border: 1px solid #1e73be;
	background: #1e73be;
	color: #ffffff;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease;
}

.ctp-share-modal__copy-btn:hover,
.ctp-share-modal__copy-btn:focus-visible {
	background: #175d9c;
	border-color: #175d9c;
}

.ctp-share-modal__copy-btn.is-copied {
	background: #1e9e5b;
	border-color: #1e9e5b;
}

.ctp-share-modal__live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

body.ctp-share-modal-open {
	overflow: hidden;
}

@keyframes ctpFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ctpSlideUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 480px) {
	.ctp-share-modal__list {
		grid-template-columns: repeat(2, 1fr);
	}

	.ctp-share-modal__dialog {
		padding: 22px 18px 18px;
	}

	.ctp-share-modal__copy-row {
		flex-direction: column;
	}
}
