/* Whole-deck share button and share card. */
.tbook-deck-share-open {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 8px;
	border: 1px solid var(--td-line);
	border-radius: 999px;
	background: rgba(255, 253, 247, 0.7);
	color: var(--td-accent-dark);
	font: inherit;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.25;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.tbook-deck-share-open:hover,
.tbook-deck-share-open:focus-visible {
	border-color: var(--td-accent);
	background: var(--td-accent-soft);
	outline: none;
}

.tbook-share-modal {
	--share-ink: #2f3e4e;
	--share-muted: #6b7786;
	--share-line: #dce3ea;
	--share-cream: #f7f1e3;
	--share-green: #567a2b;
	--share-green-dark: #41651f;
	--share-orange: #d88a4a;
	position: fixed;
	inset: 0;
	z-index: 100140;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(22, 31, 41, 0.62);
	backdrop-filter: blur(5px);
}

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

.tbook-share-dialog {
	width: min(900px, 100%);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	display: grid;
	grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
	overflow: hidden;
	border-radius: 20px;
	background: #fffdf7;
	box-shadow: 0 30px 90px rgba(15, 25, 35, 0.34);
}

.tbook-share-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: #eee9dc;
}

.tbook-share-card {
	position: relative;
	width: 100%;
	max-width: 330px;
	aspect-ratio: 4 / 5.05;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	padding: 22px;
	border: 1px solid rgba(47, 62, 78, 0.13);
	border-radius: 17px;
	background: var(--share-cream);
	color: var(--share-ink);
	box-shadow: 0 18px 44px rgba(47, 62, 78, 0.17);
}

.tbook-share-card::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: radial-gradient(rgba(86, 122, 43, 0.12) 0.7px, transparent 0.8px);
	background-size: 7px 7px;
	opacity: 0.65;
}

.tbook-share-card::after {
	content: "";
	position: absolute;
	width: 250px;
	height: 250px;
	right: -120px;
	top: -120px;
	border: 36px solid rgba(216, 138, 74, 0.14);
	border-radius: 50%;
	pointer-events: none;
}

.tbook-share-card > * {
	position: relative;
	z-index: 1;
}

.tbook-share-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--share-green-dark);
	font-size: 8.5px;
	font-weight: 800;
	letter-spacing: 0.17em;
	text-transform: uppercase;
}

.tbook-share-type {
	color: var(--share-muted);
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.12em;
}

.tbook-share-card-main {
	margin-top: 14px;
}

.tbook-share-monogram {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 47px;
	height: 47px;
	margin-bottom: 15px;
	border: 1px solid rgba(86, 122, 43, 0.3);
	border-radius: 50%;
	background: rgba(222, 240, 188, 0.58);
	color: var(--share-green-dark);
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 25px;
	line-height: 1;
}

.tbook-share-kicker {
	margin: 0 0 6px;
	color: var(--share-muted);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.tbook-share-card h2 {
	margin: 0 0 9px;
	color: var(--share-ink);
	font-family: Georgia, 'Times New Roman', serif;
	font-size: clamp(25px, 4.4vw, 35px);
	font-weight: 500;
	line-height: 1.04;
	letter-spacing: -0.035em;
	overflow-wrap: anywhere;
}

.tbook-share-tagline {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: #556272;
	font-size: 12px;
	line-height: 1.5;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.tbook-share-card-bottom {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
	margin-top: 18px;
}

.tbook-share-qr {
	flex: 0 0 auto;
	width: 116px;
	height: 116px;
	padding: 7px;
	border: 1px solid rgba(47, 62, 78, 0.13);
	border-radius: 9px;
	background: #fff;
}

.tbook-share-qr canvas,
.tbook-share-qr img {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

.tbook-share-scan {
	margin-left: auto;
	padding-bottom: 2px;
	text-align: right;
}

.tbook-share-scan span {
	display: block;
	color: var(--share-muted);
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
}

.tbook-share-scan strong {
	display: block;
	max-width: 120px;
	margin-top: 4px;
	overflow: hidden;
	color: var(--share-green-dark);
	font-size: 10px;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tbook-share-panel {
	position: relative;
	overflow-y: auto;
	padding: 30px 30px 26px;
}

.tbook-share-close {
	position: absolute;
	top: 17px;
	right: 18px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--share-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.tbook-share-eyebrow {
	margin: 0 0 5px;
	color: var(--share-green);
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.tbook-share-panel h3 {
	margin: 0 0 7px;
	color: var(--share-ink);
	font-family: Georgia, 'Times New Roman', serif;
	font-size: 27px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.025em;
}

.tbook-share-lead {
	margin: 0 0 19px;
	color: var(--share-muted);
	font-size: 12.5px;
	line-height: 1.55;
}

.tbook-share-primary,
.tbook-share-native {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 11px 14px;
	border-radius: 9px;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.tbook-share-primary {
	border: 1px solid var(--share-green);
	background: var(--share-green);
	color: #fff;
}

.tbook-share-primary:hover,
.tbook-share-primary:focus-visible {
	border-color: var(--share-green-dark);
	background: var(--share-green-dark);
	outline: none;
}

.tbook-share-native {
	margin-top: 8px;
	border: 1px solid var(--share-line);
	background: #fff;
	color: var(--share-ink);
}

.tbook-share-native:hover,
.tbook-share-native:focus-visible {
	border-color: var(--share-green);
	outline: none;
}

.tbook-share-native[hidden] {
	display: none;
}

.tbook-share-options {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-top: 12px;
}

.tbook-share-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 63px;
	padding: 8px 5px;
	border: 1px solid var(--share-line);
	border-radius: 9px;
	background: #fff;
	color: var(--share-ink);
	font: inherit;
	font-size: 10px;
	font-weight: 700;
	cursor: pointer;
}

.tbook-share-option:hover,
.tbook-share-option:focus-visible {
	border-color: var(--share-green);
	background: #f8fbf4;
	outline: none;
}

.tbook-share-option svg {
	color: var(--share-green-dark);
}

.tbook-share-download {
	width: 100%;
	margin-top: 16px;
	padding: 8px 10px;
	border: 1px dashed var(--share-line);
	border-radius: 8px;
	background: #fbfaf5;
	color: var(--share-muted);
	font: inherit;
	font-size: 10.5px;
	font-weight: 700;
	cursor: pointer;
}

.tbook-share-download:hover,
.tbook-share-download:focus-visible {
	border-color: var(--share-green);
	color: var(--share-green-dark);
	outline: none;
}

.tbook-share-status {
	min-height: 17px;
	margin: 10px 0 0;
	color: var(--share-green-dark);
	font-size: 11px;
	line-height: 1.4;
}

@media (max-width: 760px) {
	.tbook-share-modal {
		align-items: flex-start;
		padding: 10px;
		overflow-y: auto;
	}
	.tbook-share-dialog {
		grid-template-columns: 1fr;
		max-height: none;
		border-radius: 16px;
	}
	.tbook-share-preview {
		padding: 17px;
	}
	.tbook-share-card {
		max-width: 310px;
		padding: 19px;
	}
	.tbook-share-card h2 {
		font-size: 28px;
	}
	.tbook-share-panel {
		padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px));
	}
	.tbook-share-close {
		top: 12px;
		right: 13px;
	}
	.tbook-share-panel h3 {
		font-size: 24px;
		padding-right: 24px;
	}
}

@media (max-width: 420px) {
	.tbook-deck-share-open span {
		display: none;
	}
	.tbook-deck-share-open {
		padding: 4px 7px;
	}
	.tbook-share-card {
		max-width: 280px;
		aspect-ratio: 4 / 5.15;
	}
	.tbook-share-card h2 {
		font-size: 25px;
	}
	.tbook-share-qr {
		width: 102px;
		height: 102px;
	}
}

/* Share control stays legible on the dark deck themes. */
.tbook-deck-theme-noir .tbook-deck-share-open {
	border-color: rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.08);
	color: #f2e9db;
}

.tbook-deck-theme-noir .tbook-deck-share-open:hover,
.tbook-deck-theme-noir .tbook-deck-share-open:focus-visible {
	border-color: rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.16);
}
