/* Demo samples page — demo.html */

* { box-sizing: border-box; }

:root {
	--bg: #1a1a1a;
	--panel: rgba(255,255,255,0.94);
	--text: #f5f5f5;
	--muted: #b0b0b0;
	--demo-gutter-x: clamp(0.75rem, 3vw, 64px);
	--demo-gutter-y: clamp(0.875rem, 2vw, 1.5rem);
	--demo-stage-pad: clamp(12px, 2.5vw, 48px);
}

body {
	margin: 0;
	font-family: Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
}

html:has(body.custom-demo-page),
html:has(body.custom-demo-page) body,
body.custom-demo-page,
body.custom-demo-page > .body,
body.custom-demo-page .main,
body.custom-demo-page .main.custom-demo-main,
body.custom-demo-page .main[role="main"],
body.custom-demo-page .page {
	background: var(--bg) !important;
	background-color: var(--bg) !important;
}

body.custom-demo-page {
	font-family: "News Cycle", sans-serif;
	color: var(--text);
}

body.custom-demo-page #header.custom-header-over-hero .header-body {
	background-color: transparent !important;
}

html.sticky-header-active body.custom-demo-page #header.custom-header-over-hero .header-body {
	background-color: var(--bg) !important;
}

.custom-demo-main {
	color: var(--text);
	min-height: calc(100vh - var(--kastri-header-height));
}

.page {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: calc(var(--kastri-header-height) + clamp(1.25rem, 3vw, 2rem)) max(var(--demo-gutter-x), var(--kastri-index4-gutter-x)) clamp(1.25rem, 3vw, 2.5rem);
}

.demo-page-intro {
	margin-bottom: 1rem;
	padding-bottom: clamp(10px, 1.2vw, 16px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.demo-page-intro h1 {
	margin: 0;
	font-family: "News Cycle", sans-serif;
	font-size: clamp(1.75rem, 3.5vw, 2.25rem);
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1.25;
	color: var(--text);
}

.lead {
	margin: 0 0 1.5rem;
	color: rgba(245, 245, 245, 0.88);
	max-width: 72rem;
	line-height: 1.65;
	font-size: clamp(0.9375rem, 1.35vw, 1.0625rem);
	font-weight: 400;
	white-space: normal;
	overflow: visible;
}

.lead strong {
	font-weight: 700;
}

.showcase {
	display: flex;
	align-items: stretch;
	width: 100%;
	min-height: 0;
	border-radius: clamp(12px, 1.5vw, 24px);
	overflow: hidden;
	background: #e3dedd;
	box-shadow: 0 18px 36px rgba(0,0,0,0.12);
}

.showcase-main {
	position: relative;
	flex: 0 0 80%;
	width: 80%;
	min-width: 0;
	min-height: inherit;
	padding: clamp(12px, 2vw, 24px) clamp(16px, 2.5vw, 32px) clamp(10px, 1.5vw, 16px);
	overflow: hidden;
}

.reset-boards-btn {
	position: absolute;
	top: clamp(12px, 2vw, 24px);
	right: clamp(16px, 2.5vw, 32px);
	z-index: 12;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.92);
	color: #1f1f1f;
	font: inherit;
	font-size: 0.8125rem;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transition: opacity 0.2s ease, visibility 0.2s ease, background 0.15s ease;
}

.reset-boards-btn-icon {
	flex-shrink: 0;
	display: block;
}

.reset-boards-btn:hover {
	background: #fff;
}

.reset-boards-btn.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.showcase-sidebar {
	flex: 0 0 20%;
	width: 20%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: clamp(14px, 1.8vw, 24px);
	border-left: 1px solid rgba(0, 0, 0, 0.08);
	background: #e3dedd;
}

.wall {
	position: absolute;
	inset: 0 0 clamp(60px, 8vh, 90px) 0;
	background: #e3dedd;
	pointer-events: none;
}

.floor {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: clamp(60px, 8vh, 90px);
	background: transparent;
	pointer-events: none;
}

.row-guides {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.row-guide {
	position: absolute;
	left: var(--demo-stage-pad);
	right: var(--demo-stage-pad);
	height: 24px;
	border-radius: 999px;
	background: linear-gradient(180deg, #171717 0%, #313131 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 14px rgba(0, 0, 0, 0.24);
	transform: translateY(-50%);
}

.row-guide::before,
.row-guide::after {
	content: "";
	position: absolute;
	left: 10px;
	right: 10px;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
}

.row-guide::before { top: 4px; }
.row-guide::after { bottom: 4px; }

.stage {
	position: relative;
	z-index: 5;
	width: 100%;
	height: auto;
	min-height: 320px;
	margin-top: clamp(24px, 5vh, 48px);
	overflow: hidden;
}

.board {
	position: absolute;
	width: var(--board-w, 150px);
	height: var(--board-h, 185px);
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.16);
	box-shadow: 0 14px 22px rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.12);
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
	transition: box-shadow 0.18s ease, filter 0.18s ease, outline 0.18s ease;
	transform-origin: top center;
	background: #c9b28e;
}

.board:hover { filter: brightness(1.03); }

.board.dragging {
	cursor: grabbing;
	box-shadow: 0 24px 32px rgba(0,0,0,0.24), 0 10px 16px rgba(0,0,0,0.16);
}

.board.active {
	outline: 3px solid rgba(255,255,255,0.48);
	outline-offset: -3px;
}

.board-zoom-btn {
	position: absolute;
	bottom: 8px;
	right: 8px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1f1f1f;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.18s ease, visibility 0.18s ease, background 0.15s ease, transform 0.15s ease;
}

.board.active .board-zoom-btn {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.board-zoom-btn:hover {
	background: #fff;
	transform: scale(1.06);
}

.board-zoom-btn svg {
	display: block;
}

.board-label {
	position: absolute;
	left: 0;
	top: 18px;
	transform: translateX(-100%);
	background: #4a4a4a;
	color: white;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 8px 10px;
	border-top-left-radius: 6px;
	border-bottom-left-radius: 6px;
	white-space: nowrap;
	z-index: 3;
	pointer-events: none;
}

.board-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

.info-panel {
	position: relative;
	z-index: 6;
	flex: 1;
	width: 100%;
	margin: 0;
	max-width: none;
	background: var(--panel);
	color: #1f1f1f;
	border: 1px solid rgba(0,0,0,0.08);
	border-radius: 14px;
	padding: clamp(14px, 1.5vw, 20px);
	box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.info-panel.is-empty h2,
.info-panel.is-empty .info-panel-preview,
.info-panel.is-empty .meta,
.info-panel.is-empty .hint {
	display: none;
}

.info-panel-preview {
	display: block;
	width: 100%;
	margin: 0 0 12px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 8px;
	overflow: hidden;
	background: #f0ece9;
	cursor: pointer;
	font: inherit;
	text-align: left;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.info-panel-preview:hover {
	border-color: rgba(0, 0, 0, 0.14);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.info-panel-preview.is-hidden {
	display: none;
}

.info-panel-preview img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
}

.info-panel h2 {
	margin: 0 0 10px;
	font-size: clamp(1.1rem, 1.6vw, 1.5rem);
	line-height: 1.25;
	word-break: break-word;
}

.meta {
	margin: 6px 0;
	font-size: clamp(0.75rem, 1.1vw, 0.875rem);
	word-break: break-word;
}

.hint {
	margin-top: 14px;
	color: var(--muted);
	font-size: clamp(0.7rem, 1vw, 0.8125rem);
	line-height: 1.45;
}

.info-panel .hint {
	color: #5a5a5a;
}

.load-error {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #fff3f3;
	color: #8b1e1e;
	font-size: 14px;
	display: none;
}

.load-error.visible { display: block; }

.image-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
	background: rgba(0, 0, 0, 0.86);
}

.image-lightbox.is-hidden {
	display: none;
}

.image-lightbox-close {
	position: absolute;
	top: clamp(12px, 2vw, 20px);
	right: clamp(12px, 2vw, 20px);
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.image-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.22);
}

.image-lightbox-content {
	margin: 0;
	max-width: min(920px, 100%);
	max-height: calc(100vh - 80px);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.image-lightbox-content img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.image-lightbox-content figcaption {
	margin: 0;
	color: #f5f5f5;
	font-size: clamp(0.95rem, 1.4vw, 1.125rem);
	text-align: center;
}

@media (max-width: 900px) {
	.showcase {
		flex-direction: column;
		min-height: 0;
	}

	.showcase-main,
	.showcase-sidebar {
		flex: none;
		width: 100%;
	}

	.showcase-sidebar {
		border-left: none;
		border-top: 1px solid rgba(0, 0, 0, 0.08);
	}
}
