/* A single native dialog with an internally scrollable full-page screenshot. */
.td-gallery-lightbox-open {
	overflow: hidden;
}
#td-gallery-lightbox {
	width: calc(100% - 32px);
	max-width: none;
	height: calc(100dvh - 32px);
	max-height: none;
	margin: auto;
	padding: 0;
	border: 1px solid var(--td-accent-tint-18, #d5e4ff);
	border-radius: 8px;
	background: #fff;
	color: var(--td-ink);
	overflow: hidden;
}
#td-gallery-lightbox[open] {
	display: flex;
	flex-direction: column;
}
#td-gallery-lightbox::backdrop {
	background: rgb(10 18 35 / 0.8);
}
.td-gallery-lightbox__toolbar {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-block-end: 1px solid var(--td-accent-tint-18, #d5e4ff);
}
#td-gallery-lightbox-title {
	min-width: 0;
	margin: 0;
	font-size: 18px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}
.td-gallery-lightbox__controls {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 8px;
}
.td-gallery-lightbox__controls [data-gallery-counter] {
	margin-inline-end: 4px;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}
#td-gallery-lightbox button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--td-accent-tint-18, #d5e4ff);
	border-radius: 4px;
	background: #fff;
	color: var(--td-blue);
	cursor: pointer;
}
#td-gallery-lightbox button:not(:disabled):hover {
	border-color: var(--td-blue);
	background: var(--td-blue);
	color: #fff;
}
#td-gallery-lightbox button:disabled {
	opacity: 0.4;
	cursor: default;
}
#td-gallery-lightbox :is(button, .td-gallery-lightbox__stage):focus-visible {
	outline: 2px solid var(--td-blue);
	outline-offset: -3px;
}
.td-gallery-lightbox__stage {
	flex: 1;
	min-height: 0;
	padding: 16px;
	background: var(--td-accent-tint-4, #f7faff);
	text-align: center;
	overflow: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}
#td-gallery-lightbox [data-gallery-image] {
	display: block;
	width: 100%;
	max-width: 1100px;
	height: auto;
	margin-inline: auto;
}
#td-gallery-lightbox [hidden] {
	display: none;
}
.td-gallery-lightbox__stage [role="status"] {
	margin: 24px 0;
}
[dir="rtl"] .td-gallery-lightbox__controls :is([data-gallery-next], [data-gallery-previous]) .material-symbols-outlined {
	transform: scaleX(-1);
}
@media (max-width: 575px) {
	#td-gallery-lightbox {
		width: calc(100% - 16px);
		height: calc(100dvh - 16px);
	}
	.td-gallery-lightbox__toolbar {
		flex-wrap: wrap;
		padding: 8px;
	}
	.td-gallery-lightbox__controls {
		margin-inline-start: auto;
	}
	.td-gallery-lightbox__stage {
		padding: 8px;
	}
}
