/**
 * Budgie Mutation Finder widget styles.
 *
 * Scoped under .bmf-widget — inherits theme typography and colors.
 */

.bmf-widget {
	margin-block: 1.5em;
	padding: 1.25em 1.5em;
	border: 1px solid currentColor;
	border-radius: 0.25em;
}

.bmf-widget__root {
	min-height: 2rem;
}

.bmf-widget__result-subheading,
.bmf-widget__candidate-name {
	margin: 0 0 0.75em;
	font-size: inherit;
	line-height: inherit;
}

.bmf-widget__result-card {
	margin-bottom: 1.25rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.bmf-widget__result-card:last-of-type {
	border-bottom: 0;
}

.bmf-widget__progress-line--secondary {
	opacity: 0.85;
	font-size: 0.95em;
}

.bmf-widget__notice {
	margin-bottom: 1rem;
	padding: 0.75em 1em;
	border: 1px solid currentColor;
	border-radius: 0.35em;
}

.bmf-widget__unresolved-list {
	margin: 0 0 1rem;
	padding-left: 1.25em;
}

.bmf-widget__title,
.bmf-widget__question,
.bmf-widget__result-heading,

.bmf-widget__intro,
.bmf-widget__status,
.bmf-widget__progress-line,
.bmf-widget__result-text,
.bmf-widget__candidate-summary,
.bmf-widget__links-heading {
	margin: 0 0 0.75em;
}

.bmf-widget__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.bmf-widget__progress {
	margin-bottom: 1rem;
}

.bmf-widget__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.65em 1.1em;
	border: 1px solid currentColor;
	border-radius: 0.35em;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
}

.bmf-widget__button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bmf-widget__button--primary {
	font-weight: 600;
}

.bmf-widget__button--secondary,
.bmf-widget__button--text {
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.bmf-widget__answers {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
	gap: 0.85rem;
	margin-bottom: 1rem;
}

.bmf-widget__answer-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.65rem;
	min-height: 3rem;
	padding: 0.85rem;
	border: 1px solid currentColor;
	border-radius: 0.45em;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font: inherit;
	text-align: center;
}

.bmf-widget__answer-card.is-selected {
	box-shadow: inset 0 0 0 2px currentColor;
}

.bmf-widget__answer-card:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.bmf-widget__answer-label {
	display: block;
}

.bmf-widget__image-gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	justify-content: center;
}

.bmf-widget__image-button {
	display: block;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
}

.bmf-widget__image {
	display: block;
	width: 100%;
	object-fit: cover;
	border-radius: 0.35em;
}

.bmf-widget__image--small {
	max-width: 5rem;
	max-height: 4rem;
}

.bmf-widget__image--medium {
	max-width: 9rem;
	max-height: 7rem;
}

.bmf-widget__image--large {
	max-width: 14rem;
	max-height: 11rem;
}

.bmf-widget__image--auto {
	max-width: 100%;
	max-height: none;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bmf-widget__help {
	margin-bottom: 1rem;
}

.bmf-widget__help-summary {
	cursor: pointer;
}

.bmf-widget__continue {
	margin-top: 0.5rem;
}

.bmf-widget__result-card {
	padding: 1rem 0;
	border-top: 1px solid currentColor;
}

.bmf-widget__result-card:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.bmf-widget__links {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.bmf-widget__link {
	display: inline-block;
}

.bmf-widget__lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.72);
}

.bmf-widget__lightbox[hidden] {
	display: none !important;
}

.bmf-widget__lightbox-dialog {
	position: relative;
	max-width: min(96vw, 48rem);
	max-height: 92vh;
}

.bmf-widget__lightbox-image {
	display: block;
	max-width: 100%;
	max-height: 88vh;
	width: auto;
	height: auto;
	object-fit: contain;
}

.bmf-widget__lightbox-close {
	position: absolute;
	top: -0.25rem;
	right: -0.25rem;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.bmf-widget--lightbox-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.bmf-widget {
		padding: 1rem;
	}

	.bmf-widget__answers {
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
	}

	.bmf-widget__image--small {
		max-width: 100%;
		max-height: 3.5rem;
	}

	.bmf-widget__image--medium {
		max-width: 100%;
		max-height: 6rem;
	}

	.bmf-widget__image--large {
		max-width: 100%;
		max-height: 9rem;
	}
}
