/**
 * Floor map (a prototype, docs/sbd-floor-map.md). The bar: the search and
 * the levels as pills. Under it the stage, the plan on the cool surface
 * in a bordered box, with the list or the booth's panel beside it from
 * 1024px and under it below. Without the script only the list shows, in
 * columns.
 *
 * A booth is white with a slate outline; one that is taken carries the
 * light red, the selected one the brand red with its number in white.
 * While a search runs, the booths it did not find fade. The drawing has
 * three groups: plan (shapes with a class for what they are), booths, and
 * marks (labels as text, symbols as icons).
 */

.sba-c-floor-map .sba-c-fm-bar {
	display: grid;
	gap: 12px;
	margin-bottom: 16px;
}

.sba-c-floor-map .sba-c-fm-bar[hidden],
.sba-c-floor-map .sba-c-fm-stage[hidden],
.sba-c-floor-map .sba-c-fm-panel[hidden],
.sba-c-floor-map .sba-c-fm-index[hidden],
.sba-c-floor-map .sba-c-fm-list[hidden] {
	display: none;
}

.sba-c-floor-map .sba-c-fm-levels {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sba-c-floor-map .sba-c-fm-levels button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--sba-input);
	border-radius: 9999px;
	background: var(--sba-surface);
	color: var(--sba-charcoal);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	cursor: pointer;
	transition: background-color var(--sba-duration-hover), border-color var(--sba-duration-hover), color var(--sba-duration-hover);
}

.sba-c-floor-map .sba-c-fm-levels button:hover {
	background: var(--sba-accent);
}

.sba-c-floor-map .sba-c-fm-levels button[aria-pressed="true"] {
	border-color: var(--sba-charcoal);
	background: var(--sba-charcoal);
	color: #fff;
}

.sba-c-floor-map .sba-c-fm-hits {
	min-width: 20px;
	padding: 0 6px;
	border-radius: 9999px;
	background: var(--sba-red);
	color: var(--sba-red-contrast);
	font-size: 12px;
	line-height: 20px;
	text-align: center;
}

.sba-c-floor-map .sba-c-fm-hits[hidden] {
	display: none;
}

.sba-c-floor-map :is(.sba-c-fm-levels button, .sba-c-fm-zoom button, .sba-c-fm-back, .sba-c-fm-list li, summary):focus-visible {
	outline: 2px solid var(--sba-ring);
	outline-offset: 2px;
}

/* The stage. */

.sba-c-floor-map .sba-c-fm-body {
	display: grid;
	gap: 16px;
}

.sba-c-floor-map .sba-c-fm-stage {
	position: relative;
	height: min(62vh, 520px);
	min-height: 340px;
	overflow: hidden;
	border: 1px solid var(--sba-border);
	border-radius: var(--sba-radius);
	background: var(--sba-surface-cool);
}

.sba-c-floor-map .sba-c-fm-canvas {
	position: absolute;
	inset: 0;
	cursor: grab;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

.sba-c-floor-map .is-zoomed .sba-c-fm-canvas {
	touch-action: none;
}

.sba-c-floor-map .sba-c-fm-canvas.is-dragging {
	cursor: grabbing;
}

.sba-c-floor-map .sba-c-fm-canvas svg {
	display: block;
	width: 100%;
	height: 100%;
}

.sba-c-floor-map .sba-c-fm-canvas .plan {
	pointer-events: none;
}

/* The plan. A shape says what it is, the colors are the site's: the floor
 * white on the cool stage, rooms a tone darker, lines in the border color.
 * What stands on the floor (catering, media tables, partnering tables) is
 * in the grays, so that red stays the booths' alone. */
.sba-c-floor-map .sba-c-fm-canvas .marks {
	pointer-events: none;
}

.sba-c-floor-map .sba-c-fm-canvas .plan :is(path, rect, polygon, circle, line) {
	stroke: var(--sba-border);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.sba-c-floor-map .sba-c-fm-canvas .plan :is(.floor, .hall, .fixture) {
	fill: var(--sba-surface);
}

.sba-c-floor-map .sba-c-fm-canvas .plan .room {
	fill: var(--sba-muted);
}

.sba-c-floor-map .sba-c-fm-canvas .plan .line {
	fill: none;
	stroke: var(--sba-slate-light);
}

.sba-c-floor-map .sba-c-fm-canvas .plan .mark {
	fill: var(--sba-slate-light);
	stroke: none;
}

/* A fixture is white without an outline, as drawn: it shows on a room,
 * not on the floor. */
.sba-c-floor-map .sba-c-fm-canvas .plan .fixture {
	stroke: none;
}

.sba-c-floor-map .sba-c-fm-canvas .plan :is(.catering, .media) {
	fill: var(--sba-slate);
	stroke: none;
}

.sba-c-floor-map .sba-c-fm-canvas .plan .table {
	fill: var(--sba-slate-light);
	stroke: none;
}

.sba-c-floor-map .sba-c-fm-canvas .plan .table-b {
	fill: var(--sba-slate);
}

.sba-c-floor-map .sba-c-fm-canvas .plan .table-c {
	fill: var(--sba-charcoal-light);
}

.sba-c-floor-map .sba-c-fm-canvas .plan :is(.way, .arrow *) {
	fill: var(--sba-charcoal-light);
	stroke: var(--sba-charcoal-light);
	stroke-width: 1.5;
}

/* Labels: a room's name in slate, a way to another level in charcoal, the
 * name on a fixture in white. */
.sba-c-floor-map .sba-c-fm-canvas .marks .t {
	fill: var(--sba-slate);
	font-family: var(--sba-font-sans);
	font-weight: 500;
	letter-spacing: 0.02em;
	text-anchor: middle;
	dominant-baseline: central;
}

.sba-c-floor-map .sba-c-fm-canvas .marks .t-way {
	fill: var(--sba-charcoal-light);
}

.sba-c-floor-map .sba-c-fm-canvas .marks .t-on {
	fill: #fff;
	letter-spacing: 0;
}

/* The small ones are noise until they can be read. */
.sba-c-floor-map .sba-c-fm-canvas svg.is-far .marks .t-s {
	display: none;
}

/* Symbols: a charcoal disc with the icon in white. */
.sba-c-floor-map .sba-c-fm-canvas .marks .i > circle {
	fill: var(--sba-charcoal);
}

.sba-c-floor-map .sba-c-fm-canvas .marks .i > g {
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sba-c-floor-map .sba-c-fm-canvas g.b {
	cursor: pointer;
	outline: none;
	transition: opacity var(--sba-duration-hover);
}

.sba-c-floor-map .sba-c-fm-canvas g.b :is(rect, path, polygon, circle) {
	fill: var(--sba-red-light);
	stroke: var(--sba-red);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
	transition: fill var(--sba-duration-hover);
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-empty :is(rect, path, polygon, circle) {
	fill: var(--sba-surface);
	stroke: var(--sba-slate-light);
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-area :is(rect, path, polygon, circle) {
	fill: var(--sba-accent);
	stroke: var(--sba-slate-light);
}

.sba-c-floor-map .sba-c-fm-canvas g.b:is(:hover, :focus-visible) :is(rect, path, polygon, circle) {
	fill: #F9BFC1;
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-area:is(:hover, :focus-visible) :is(rect, path, polygon, circle) {
	fill: var(--sba-slate-light);
}

.sba-c-floor-map .sba-c-fm-canvas g.b:focus-visible :is(rect, path, polygon, circle) {
	stroke: var(--sba-charcoal);
	stroke-width: 2;
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-selected :is(rect, path, polygon, circle) {
	fill: var(--sba-red);
	stroke: var(--sba-red-dark);
	stroke-width: 2;
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-dim {
	opacity: 0.18;
}

.sba-c-floor-map .sba-c-fm-canvas g.b text {
	fill: var(--sba-charcoal);
	font-family: var(--sba-font-sans);
	font-weight: 500;
	text-anchor: middle;
	dominant-baseline: central;
	pointer-events: none;
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-selected text {
	fill: #fff;
}

/* Close up a booth names who stands there: the number small on top, the
 * name under it. */
.sba-c-floor-map .sba-c-fm-canvas g.b text.full {
	display: none;
	font-weight: 400;
}

.sba-c-floor-map .sba-c-fm-canvas g.b text.full .code {
	font-weight: 700;
}

.sba-c-floor-map .sba-c-fm-canvas svg.is-near g.b.has-name text.full {
	display: block;
}

.sba-c-floor-map .sba-c-fm-canvas svg.is-near g.b.has-name text.num {
	display: none;
}

/* The visitor's marks: a bookmarked booth has the dark red outline, a
 * visited one steps back into the grays. */
.sba-c-floor-map .sba-c-fm-canvas g.b.is-visited:not(.is-selected) :is(rect, path, polygon, circle) {
	fill: var(--sba-muted);
	stroke: var(--sba-slate-light);
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-visited:not(.is-selected) text {
	fill: var(--sba-slate);
}

.sba-c-floor-map .sba-c-fm-canvas g.b.is-bookmarked:not(.is-selected) :is(rect, path, polygon, circle) {
	stroke: var(--sba-red-dark);
	stroke-width: 2.5;
}

/* Numbers too small to read are noise; an area's name stays. */
.sba-c-floor-map .sba-c-fm-canvas svg.is-far g.b:not(.is-area) text.num {
	display: none;
}

.sba-c-floor-map .sba-c-fm-zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: grid;
	overflow: hidden;
	border: 1px solid var(--sba-input);
	border-radius: var(--sba-radius-md);
	background: var(--sba-surface);
	box-shadow: 0 1px 2px rgba(29, 33, 43, 0.08);
}

.sba-c-floor-map .sba-c-fm-zoom button {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--sba-charcoal);
	font-family: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.sba-c-floor-map .sba-c-fm-zoom button + button {
	border-top: 1px solid var(--sba-border);
}

.sba-c-floor-map .sba-c-fm-zoom button:hover {
	background: var(--sba-accent);
}

.sba-c-floor-map .sba-c-fm-zoom .sba-i {
	font-size: 16px;
}

/* The list and the booth's panel. */

.sba-c-floor-map .sba-c-fm-status,
.sba-c-floor-map .sba-c-fm-none,
.sba-c-floor-map .sba-c-fm-failed {
	margin: 0;
	color: var(--sba-slate);
	font-size: 14px;
	line-height: 20px;
}

.sba-c-floor-map .sba-c-fm-status strong {
	color: var(--sba-charcoal);
	font-weight: 500;
}

.sba-c-floor-map .sba-c-fm-none[hidden] {
	display: none;
}

.sba-c-floor-map .sba-c-fm-none {
	margin-top: 12px;
}

.sba-c-floor-map .sba-c-fm-failed {
	margin-bottom: 16px;
}

.sba-c-floor-map .sba-c-fm-list {
	margin: 12px 0 0;
	padding: 0;
	border-top: 1px solid var(--sba-border);
	list-style: none;
}

.sba-c-floor-map .sba-c-fm-list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 8px 4px;
	border-bottom: 1px solid var(--sba-border);
	color: var(--sba-charcoal);
	font-size: 14px;
	line-height: 20px;
}

.sba-c-floor-map .sba-c-fm-list li[hidden] {
	display: none;
}

.sba-c-floor-map .is-live .sba-c-fm-list li[data-b] {
	cursor: pointer;
}

.sba-c-floor-map .is-live .sba-c-fm-list li[data-b]:hover {
	background: var(--sba-surface-cool);
}

.sba-c-floor-map .sba-c-fm-code {
	flex: 0 0 auto;
	color: var(--sba-slate);
	font-size: 12px;
	line-height: 16px;
}

/* The list's views, and the marks on its rows. */
.sba-c-floor-map .sba-c-fm-views {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.sba-c-floor-map .sba-c-fm-views[hidden] {
	display: none;
}

.sba-c-floor-map :is(.sba-c-fm-views button, .sba-c-fm-mark) {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--sba-input);
	border-radius: 9999px;
	background: var(--sba-surface);
	color: var(--sba-charcoal);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 16px;
	cursor: pointer;
	transition: background-color var(--sba-duration-hover), border-color var(--sba-duration-hover), color var(--sba-duration-hover);
}

.sba-c-floor-map :is(.sba-c-fm-views button, .sba-c-fm-mark):hover {
	background: var(--sba-accent);
}

.sba-c-floor-map :is(.sba-c-fm-views button, .sba-c-fm-mark):focus-visible {
	outline: 2px solid var(--sba-ring);
	outline-offset: 2px;
}

.sba-c-floor-map .sba-c-fm-views button[aria-pressed="true"] {
	border-color: var(--sba-charcoal);
	background: var(--sba-charcoal);
	color: #fff;
}

.sba-c-floor-map .sba-c-fm-mark[aria-pressed="true"] {
	border-color: var(--sba-red-dark);
	background: var(--sba-red-light);
	color: var(--sba-red-darker);
}

.sba-c-floor-map :is(.sba-c-fm-views, .sba-c-fm-mark) .sba-i {
	font-size: 14px;
}

.sba-c-floor-map .sba-c-fm-views button span {
	color: var(--sba-slate);
	font-weight: 400;
}

.sba-c-floor-map .sba-c-fm-views button[aria-pressed="true"] span {
	color: var(--sba-slate-light);
}

.sba-c-floor-map .sba-c-fm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 4px 12px 8px;
}

.sba-c-floor-map .sba-c-fm-list .sba-c-fm-name {
	flex: 1 1 auto;
	min-width: 0;
}

.sba-c-floor-map .sba-c-fm-flags {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 4px;
	align-self: center;
	color: var(--sba-red-dark);
	font-size: 14px;
	line-height: 14px;
}

.sba-c-floor-map .sba-c-fm-flags .sba-i {
	display: none;
}

.sba-c-floor-map li.is-bookmarked .sba-c-fm-flags .sba-i-bookmark,
.sba-c-floor-map li.is-visited .sba-c-fm-flags .sba-i-check {
	display: inline-block;
}

.sba-c-floor-map li.is-visited .sba-c-fm-flags .sba-i-check {
	color: var(--sba-slate);
}

.sba-c-floor-map .sba-c-fm-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--sba-red-dark);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	cursor: pointer;
}

.sba-c-floor-map .sba-c-fm-back:hover {
	color: var(--sba-red-darker);
}

.sba-c-floor-map .sba-c-fm-back .sba-i {
	font-size: 16px;
}

.sba-c-floor-map .sba-c-fm-kind {
	margin: 0 0 4px;
	color: var(--sba-slate);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.08em;
	line-height: 16px;
	text-transform: uppercase;
}

.sba-c-floor-map .sba-c-fm-title {
	margin: 0;
	color: var(--sba-charcoal);
	font-size: 20px;
	font-weight: var(--sba-heading-weight);
	letter-spacing: var(--sba-heading-tracking);
	line-height: 28px;
}

.sba-c-floor-map .sba-c-fm-number {
	display: inline-block;
	margin-right: 4px;
	padding: 0 8px;
	border-radius: var(--sba-radius-sm);
	background: var(--sba-red);
	color: var(--sba-red-contrast);
	letter-spacing: 0;
}

.sba-c-floor-map .sba-c-fm-count {
	margin: 8px 0 0;
	color: var(--sba-slate);
	font-size: 14px;
	line-height: 20px;
}

.sba-c-floor-map .sba-c-fm-exhibitors {
	margin: 16px 0 0;
	padding: 0;
	border-top: 1px solid var(--sba-border);
	list-style: none;
}

.sba-c-floor-map .sba-c-fm-exhibitors li {
	margin: 0;
	border-bottom: 1px solid var(--sba-border);
}

.sba-c-floor-map .sba-c-fm-exhibitors li.is-current {
	box-shadow: inset 2px 0 0 var(--sba-red);
}

.sba-c-floor-map .sba-c-fm-exhibitors summary {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 4px 10px 8px;
	color: var(--sba-charcoal);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	list-style: none;
	cursor: pointer;
}

.sba-c-floor-map .sba-c-fm-exhibitors summary::-webkit-details-marker {
	display: none;
}

.sba-c-floor-map .sba-c-fm-country {
	flex: 0 0 auto;
	color: var(--sba-slate);
	font-size: 12px;
	font-weight: 400;
	line-height: 16px;
}

.sba-c-floor-map .sba-c-fm-exhibitors details > :is(p, a) {
	margin: 0 4px 8px 8px;
	font-size: 14px;
	line-height: 22px;
}

.sba-c-floor-map .sba-c-fm-text {
	color: var(--sba-charcoal-light);
}

.sba-c-floor-map .sba-c-fm-exhibitors details > .sba-c-fm-categories {
	color: var(--sba-slate);
	font-size: 12px;
	line-height: 16px;
}

.sba-c-floor-map .sba-c-fm-exhibitors details > .sba-c-fm-website {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 12px;
	color: var(--sba-red-dark);
	font-weight: 500;
	text-decoration: none;
}

.sba-c-floor-map .sba-c-fm-website:hover {
	color: var(--sba-red-darker);
}

.sba-c-floor-map .sba-c-fm-website .sba-i {
	font-size: 16px;
}

/* Without the script: the list alone, in columns. */
@media (min-width: 640px) {
	.sba-c-floor-map .sba-c-fm:not(.is-live) .sba-c-fm-list {
		columns: 2;
		column-gap: 32px;
	}

	.sba-c-floor-map .sba-c-fm:not(.is-live) .sba-c-fm-list li {
		break-inside: avoid;
	}
}

@media (min-width: 768px) {
	.sba-c-floor-map .sba-c-fm-bar {
		grid-template-columns: minmax(0, 20rem) minmax(0, 16rem) 1fr;
		align-items: center;
	}

	.sba-c-floor-map .sba-c-fm-levels {
		justify-content: flex-end;
	}
}

@media (min-width: 1024px) {
	.sba-c-floor-map .sba-c-fm:not(.is-live) .sba-c-fm-list {
		columns: 3;
	}

	.sba-c-floor-map .is-live .sba-c-fm-body {
		grid-template-columns: minmax(0, 1fr) 22rem;
		gap: 24px;
	}

	.sba-c-floor-map .sba-c-fm-stage {
		height: 640px;
	}

	.sba-c-floor-map .is-live .sba-c-fm-side {
		position: relative;
		height: 640px;
	}

	.sba-c-floor-map .is-live :is(.sba-c-fm-panel, .sba-c-fm-index) {
		position: absolute;
		inset: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-right: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sba-c-floor-map .sba-c-fm-canvas g.b,
	.sba-c-floor-map .sba-c-fm-canvas g.b :is(rect, path, polygon, circle) {
		transition: none;
	}
}
