/*
 * The DivePro demo banner, shared by both themes. Styled on its own so it reads the same on either.
 * Collapsed (data-demo-collapsed on <html>): the bar hides and a small tab with a grab handle
 * hangs from the top center of the page; pressing it expands the bar again.
 */

.demo-banner {
	--demo-bg: #111827;
	--demo-text: #f3f4f6;
	--demo-muted: #9ca3af;
	--demo-tag: #fbbf24;
	--demo-line: rgba(255, 255, 255, 0.16);
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--demo-bg);
	color: var(--demo-text);
	font: 500 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	border-bottom: 1px solid var(--demo-line);
}

.demo-banner__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.demo-banner__tag {
	flex: none;
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--demo-tag);
	color: #111827;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.demo-banner .demo-banner__message {
	flex: 1 1 320px;
	margin: 0;
	padding: 0;
	max-width: none;
	font: inherit;
	letter-spacing: normal;
	color: var(--demo-text);
}

.demo-banner__themes {
	flex: none;
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--demo-line);
	border-radius: 999px;
}

.demo-banner__themes a {
	padding: 4px 12px;
	border-radius: 999px;
	color: var(--demo-muted);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.demo-banner__themes a:hover {
	color: var(--demo-text);
}

.demo-banner__themes a[aria-current="page"] {
	background: var(--demo-text);
	color: var(--demo-bg);
}

.demo-banner__toggle,
.demo-banner__wc {
	flex: none;
	padding: 5px 12px;
	border: 1px solid var(--demo-line);
	border-radius: 999px;
	background: transparent;
	color: var(--demo-text);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.demo-banner__toggle:hover,
.demo-banner__wc:hover {
	border-color: var(--demo-text);
}

.demo-banner a:focus-visible,
.demo-banner button:focus-visible {
	outline: 2px solid var(--demo-tag);
	outline-offset: 2px;
}

/* The collapsed tab: about 150 x 10 px, centered on the top edge of the page. */

.demo-banner__tab {
	display: none;
}

html[data-demo-collapsed] .demo-banner {
	height: 0;
	border-bottom: 0;
}

html[data-demo-collapsed] .demo-banner__inner {
	display: none;
}

html[data-demo-collapsed] .demo-banner__tab {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 150px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 0 0 8px 8px;
	background: var(--demo-bg);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 2px 6px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: height 0.15s ease;
}

html[data-demo-collapsed] .demo-banner__tab span {
	display: block;
	width: 36px;
	height: 3px;
	border-radius: 2px;
	background: var(--demo-muted);
}

html[data-demo-collapsed] .demo-banner__tab:hover,
html[data-demo-collapsed] .demo-banner__tab:focus-visible {
	height: 14px;
}

html[data-demo-collapsed] .demo-banner__tab:hover span,
html[data-demo-collapsed] .demo-banner__tab:focus-visible span {
	background: var(--demo-tag);
}

@media (max-width: 560px) {
	.demo-banner .demo-banner__message {
		flex-basis: calc(100% - 70px);
		font-size: 13px;
	}

	.demo-banner__themes {
		margin-right: auto;
	}
}

.demo-banner__wc[aria-pressed="true"] {
	background: #2563eb;
	border-color: #2563eb;
}

/*
 * "Show web components": outlines every DivePro surface (blue) and every gap (red), and marks each
 * value bound with <rj-text> (green): the site's own design around one field of an app record.
 */
html[data-show-wc] rj-widget {
	outline: 2px dashed #2563eb;
	outline-offset: 3px;
}

html[data-show-wc] .wc-gap {
	outline: 2px dashed #dc2626;
	outline-offset: 3px;
}

rj-record {
	display: contents;
}

rj-text {
	display: inline;
}

html[data-show-wc] rj-text {
	background: rgba(22, 163, 74, 0.16);
	box-shadow: inset 0 -2px 0 #16a34a;
}
