/*
 * Share buttons (inc/share.php) and the share menu (assets/js/st4t-share.js).
 *
 * The selectors include the element name ("button.") or the dialog class, so
 * they are stronger than the Hello Elementor reset ("[type=button]", pink
 * border and text). Sizes match the Copy and Download buttons in the Toolkit
 * popup: 35px high, 8px corners, DM Sans 15px semibold.
 */

button.st4t-share-btn,
.st4t-share-dialog,
.st4t-share-dialog * {
	box-sizing: border-box;
}

button.st4t-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	height: 35px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--e-global-color-secondary, #c99b2a);
	border-radius: 8px;
	background-color: #fff;
	color: var(--e-global-color-primary, #071545);
	font-family: "DM Sans", sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
}

button.st4t-share-btn:hover,
button.st4t-share-btn:focus {
	border-color: var(--e-global-color-secondary, #c99b2a);
	background-color: rgba(201, 155, 42, 0.1);
	color: var(--e-global-color-primary, #071545);
}

button.st4t-share-btn:focus-visible {
	outline: 2px solid var(--e-global-color-primary, #071545);
	outline-offset: 2px;
}

button.st4t-share-btn svg {
	flex-shrink: 0;
}

button.st4t-share-btn.is-busy {
	cursor: progress;
	opacity: 0.7;
}

/* In the Toolkit popup the button is as wide as Download and Copy, below them. */
button.st4t-share-resource {
	width: 100%;
	margin-top: 8px;
}

/* On the incident card the button is smaller. */
button.st4t-share-incident {
	height: 32px;
	padding: 0 12px;
	gap: 8px;
	font-size: 14px;
}

/* ---- Share box ---- */

.st4t-share-dialog {
	width: min(420px, calc(100vw - 32px));
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 24px;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	background: #fff;
	color: #0a1230;
	font-family: "DM Sans", sans-serif;
	box-shadow: 0 16px 48px rgba(7, 21, 69, 0.2);
}

.st4t-share-dialog::backdrop {
	background: rgba(7, 21, 69, 0.45);
}

/* On a computer: a popover under (or above) the Share button, with an arrow. */
.st4t-share-dialog.is-anchored {
	position: fixed;
	right: auto;
	bottom: auto;
	margin: 0;
	overflow: visible;
	max-height: none;
}

.st4t-share-dialog.is-anchored::backdrop {
	background: transparent;
}

.st4t-share-dialog.is-anchored::before {
	content: "";
	position: absolute;
	top: -8px;
	left: var(--st4t-arrow-x, 50%);
	width: 14px;
	height: 14px;
	margin-left: -7px;
	border-top: 1px solid #e2e8f0;
	border-left: 1px solid #e2e8f0;
	background: #fff;
	transform: rotate(45deg);
}

.st4t-share-dialog.is-anchored.is-above::before {
	top: auto;
	bottom: -8px;
	transform: rotate(225deg);
}

/* No space above or below the button: the box covers it, so no arrow. */
.st4t-share-dialog.is-anchored.no-arrow::before {
	display: none;
}

.st4t-share-dialog .st4t-share-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.st4t-share-dialog .st4t-share-heading {
	margin: 0;
	color: #0a1230;
	font-family: "DM Sans", sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}

.st4t-share-dialog .st4t-share-close,
.st4t-share-dialog .st4t-share-close:hover,
.st4t-share-dialog .st4t-share-close:focus {
	display: inline-flex;
	padding: 4px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #0a1230;
	cursor: pointer;
}

.st4t-share-dialog .st4t-share-close:hover,
.st4t-share-dialog .st4t-share-close:focus-visible {
	background: #f1f5f9;
}

.st4t-share-dialog .st4t-share-item {
	margin: 4px 0 0;
	color: #3a4468;
	font-size: 14px;
	line-height: 1.4;
}

.st4t-share-dialog .st4t-share-hint {
	margin: 12px 0 0;
	color: #5b6472;
	font-size: 13px;
	line-height: 1.4;
}

/* Round social buttons with the name below. */
.st4t-share-dialog .st4t-share-apps {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 16px 8px;
	margin-top: 20px;
}

.st4t-share-dialog .st4t-share-app,
.st4t-share-dialog .st4t-share-app:hover,
.st4t-share-dialog .st4t-share-app:focus {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #0a1230;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.st4t-share-dialog .st4t-share-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.st4t-share-dialog .st4t-share-circle svg {
	display: block;
}

/* Email: a line icon on a light circle. */
.st4t-share-dialog .st4t-share-circle-email {
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	color: #0a1230;
}

.st4t-share-dialog .st4t-share-app:hover .st4t-share-circle,
.st4t-share-dialog .st4t-share-app:focus-visible .st4t-share-circle {
	box-shadow: 0 4px 12px rgba(7, 21, 69, 0.2);
	transform: translateY(-2px);
}

.st4t-share-dialog .st4t-share-app:focus-visible {
	outline: none;
}

.st4t-share-dialog .st4t-share-app:focus-visible .st4t-share-circle {
	outline: 2px solid var(--e-global-color-primary, #071545);
	outline-offset: 2px;
}

.st4t-share-dialog .st4t-share-line {
	height: 0;
	margin: 20px 0;
	border: 0;
	border-top: 1px solid #e2e8f0;
	background: none;
}

/* Link or text field with a Copy button. */
.st4t-share-dialog .st4t-share-field {
	display: flex;
	gap: 8px;
}

.st4t-share-dialog .st4t-share-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	color: #3a4468;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.3;
	text-overflow: ellipsis;
}

.st4t-share-dialog .st4t-share-input:focus {
	border-color: var(--e-global-color-secondary, #c99b2a);
	outline: none;
}

.st4t-share-dialog .st4t-share-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.st4t-share-dialog .st4t-share-actions .st4t-share-action {
	flex: 1 1 auto;
}

.st4t-share-dialog .st4t-share-action,
.st4t-share-dialog .st4t-share-action:hover,
.st4t-share-dialog .st4t-share-action:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fff;
	color: #0a1230;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	cursor: pointer;
}

.st4t-share-dialog .st4t-share-action:hover,
.st4t-share-dialog .st4t-share-action:focus-visible {
	border-color: var(--e-global-color-secondary, #c99b2a);
	background: rgba(201, 155, 42, 0.1);
}

.st4t-share-dialog .st4t-share-action.is-primary,
.st4t-share-dialog .st4t-share-action.is-primary:focus {
	border-color: var(--e-global-color-primary, #071545);
	background: var(--e-global-color-primary, #071545);
	color: #fff;
}

.st4t-share-dialog .st4t-share-action.is-primary:hover,
.st4t-share-dialog .st4t-share-action.is-primary:focus-visible {
	border-color: #1c2b66;
	background: #1c2b66;
	color: #fff;
}

.st4t-share-dialog .st4t-share-action svg {
	flex-shrink: 0;
}

.st4t-share-dialog .st4t-share-action.is-busy {
	cursor: progress;
	opacity: 0.7;
}

/* "Tap to share": the file is ready after a slow download. */
button.st4t-share-btn.is-ready {
	border-color: var(--e-global-color-secondary, #c99b2a);
	background-color: var(--e-global-color-secondary, #c99b2a);
	color: #fff;
}

/* Popup Download while the file downloads. */
.rf-download-btn.is-busy {
	cursor: progress;
	opacity: 0.7;
}

/* Text for screen readers only. */
.st4t-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Card buttons ([resource_card_actions]) ---- */

.st4t-card-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.st4t-card-actions .st4t-card-btn,
.st4t-card-actions button.st4t-share-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: auto;
	min-width: 32px;
	height: 32px;
	margin: 0;
	padding: 0 8px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background-color: #fff;
	color: var(--e-global-color-primary, #071545);
	font-family: "DM Sans", sans-serif;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.st4t-card-actions .st4t-card-btn:hover,
.st4t-card-actions .st4t-card-btn:focus,
.st4t-card-actions button.st4t-share-btn:hover,
.st4t-card-actions button.st4t-share-btn:focus {
	border-color: var(--e-global-color-secondary, #c99b2a);
	background-color: rgba(201, 155, 42, 0.1);
	color: var(--e-global-color-primary, #071545);
	text-decoration: none;
}

.st4t-card-actions .st4t-card-btn:focus-visible,
.st4t-card-actions button.st4t-share-btn:focus-visible {
	outline: 2px solid var(--e-global-color-primary, #071545);
	outline-offset: 2px;
}

.st4t-card-actions .st4t-card-btn.is-busy,
.st4t-card-actions button.st4t-share-btn.is-busy {
	cursor: progress;
	opacity: 0.6;
}

.st4t-card-actions .st4t-card-copy.is-done {
	border-color: var(--e-global-color-secondary, #c99b2a);
	background-color: rgba(201, 155, 42, 0.1);
}

.st4t-card-actions button.st4t-share-btn.is-ready {
	border-color: var(--e-global-color-secondary, #c99b2a);
	background-color: var(--e-global-color-secondary, #c99b2a);
	color: #fff;
}
