/**
 * Atlas Arcadia — Share button and modal (design 2A).
 *
 * Plan: docs/plans/2026-10-06-001-feat-share-menu-plan.md (U1)
 *
 * The dialog is appended to <body>, outside .aa-lp and .aa-tp, so it cannot read
 * their scoped custom properties. It re-declares the site's --aa-* palette with
 * the same literal fallbacks, as .aa-tp-dialog does.
 *
 * Selectors are two classes deep: The7 and Elementor style bare `button`, `a`
 * and `h2` under container classes, and a single class loses to them.
 */

/* --- The yellow SHARE pill over the Location hero (variant hero-pill) ------- */

.aa-lp .aa-share--hero,
.aa-share.aa-share--hero {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	margin: 0;
	padding: 8px 18px;
	border: 0;
	border-radius: 999px;
	background: var( --aa-yellow, #fae905 );
	color: var( --aa-brown, #6a3306 );
	font-family: var( --aa-display, 'Cartridge', ui-sans-serif, system-ui, sans-serif );
	font-size: 14px;
	line-height: 1.2;
	letter-spacing: .04em;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba( 74, 36, 4, .25 );
	cursor: pointer;
}

.aa-lp .aa-share--hero:hover,
.aa-share.aa-share--hero:hover {
	background: #fdf28a;
	color: var( --aa-brown, #6a3306 );
}

.aa-lp .aa-share--hero:focus-visible,
.aa-share.aa-share--hero:focus-visible {
	outline: 3px solid var( --aa-white, #fff );
	outline-offset: 2px;
}

@media ( max-width: 600px ) {
	.aa-lp .aa-share--hero,
	.aa-share.aa-share--hero {
		top: 12px;
		right: 12px;
	}
}

/* --- The dialog ------------------------------------------------------------ */

html.aa-share-open {
	overflow: hidden;
}

.aa-share-dialog {
	--s-orange: var( --aa-orange, #db680b );
	--s-orange-dark: var( --aa-orange-dark, #b8560a );
	--s-brown: var( --aa-brown, #6a3306 );
	--s-muted: var( --aa-muted, #8a7a63 );
	--s-rule: #e8ddc4;
	--s-white: #fff;
	--s-display: var( --aa-display, 'Cartridge', ui-sans-serif, system-ui, sans-serif );
	--s-text: var( --aa-text, 'Poppins', ui-sans-serif, system-ui, sans-serif );

	box-sizing: border-box;
	width: min( 320px, calc( 100vw - 32px ) );
	max-width: none;
	max-height: calc( 100vh - 32px );
	max-height: calc( 100dvh - 32px );
	overflow: auto;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: var( --s-white );
	color: var( --s-brown );
	font-family: var( --s-text );
	box-shadow: 0 14px 36px rgba( 0, 0, 0, .4 );
}

.aa-share-dialog::backdrop {
	background: rgba( 74, 36, 4, .7 );
}

.aa-share-dialog *,
.aa-share-dialog *::before,
.aa-share-dialog *::after {
	box-sizing: border-box;
}

.aa-share-dialog [hidden] {
	display: none !important;
}

.aa-share-dialog .aa-share-dialog__card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
}

.aa-share-dialog .aa-share-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.aa-share-dialog .aa-share-dialog__title {
	margin: 0;
	font-family: var( --s-display );
	font-size: 18px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: uppercase;
	color: var( --s-brown );
}

.aa-share-dialog .aa-share-dialog__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -12px -12px -12px 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var( --s-muted );
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.aa-share-dialog .aa-share-dialog__close:hover {
	background: rgba( 106, 51, 6, .08 );
	color: var( --s-brown );
}

/* Preview card */

.aa-share-dialog .aa-share-dialog__preview {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 8px;
	border: 1px solid var( --s-rule );
	border-radius: 8px;
}

.aa-share-dialog .aa-share-dialog__thumb {
	flex: none;
	display: block;
	width: 84px;
	height: 56px;
	max-width: none;
	object-fit: cover;
	border-radius: 4px;
	background: #f1e7d2;
}

.aa-share-dialog .aa-share-dialog__meta {
	flex: 1;
	min-width: 0;
}

.aa-share-dialog .aa-share-dialog__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-family: var( --s-display );
	font-size: 15px;
	line-height: 1.2;
	color: var( --s-brown );
	text-wrap: pretty;
}

.aa-share-dialog .aa-share-dialog__place {
	margin-top: 2px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 12px;
	line-height: 1.4;
	color: var( --s-muted );
}

/* Pills */

.aa-share-dialog .aa-share-dialog__grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 8px;
}

.aa-share-dialog .aa-share__pill {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	border: 1.5px solid var( --s-brown );
	border-radius: 999px;
	background: transparent;
	color: var( --s-brown );
	font-family: var( --s-text );
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
}

.aa-share-dialog .aa-share__pill i {
	flex: none;
	width: 16px;
	text-align: center;
	font-size: 15px;
	color: var( --s-orange );
}

.aa-share-dialog .aa-share__pill:hover {
	background: #fdf6e8;
	color: var( --s-brown );
	text-decoration: none;
}

.aa-share-dialog .aa-share__pill:focus-visible,
.aa-share-dialog .aa-share-dialog__close:focus-visible {
	outline: 3px solid var( --s-orange );
	outline-offset: 2px;
}

.aa-share-dialog .aa-share__pill--copy {
	border-color: var( --s-orange );
	background: var( --s-orange );
	color: var( --s-white );
}

.aa-share-dialog .aa-share__pill--copy i {
	color: var( --s-white );
}

.aa-share-dialog .aa-share__pill--copy:hover {
	border-color: var( --s-orange-dark );
	background: var( --s-orange-dark );
	color: var( --s-white );
}

.aa-share-dialog .aa-share__pill--wide {
	grid-column: 1 / -1;
	justify-content: center;
}

/* Copy-failed fallback and the live region */

.aa-share-dialog .aa-share-dialog__url {
	width: 100%;
	min-height: 40px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var( --s-rule );
	border-radius: 999px;
	font-family: var( --s-text );
	font-size: 12px;
	color: var( --s-brown );
	background: var( --s-white );
}

.aa-share-dialog .aa-share-dialog__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

.aa-share-dialog .aa-share-dialog__offscreen {
	position: fixed;
	left: -9999px;
	top: 0;
	opacity: 0;
}
